diff --git a/conformance/src/main/java/build/buf/protovalidate/conformance/FileDescriptorUtil.java b/conformance/src/main/java/build/buf/protovalidate/conformance/FileDescriptorUtil.java index a310c262..b6a0d881 100644 --- a/conformance/src/main/java/build/buf/protovalidate/conformance/FileDescriptorUtil.java +++ b/conformance/src/main/java/build/buf/protovalidate/conformance/FileDescriptorUtil.java @@ -16,6 +16,9 @@ import com.google.protobuf.DescriptorProtos; import com.google.protobuf.Descriptors; +import com.google.protobuf.DynamicMessage; +import com.google.protobuf.ExtensionRegistry; +import com.google.protobuf.TypeRegistry; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -70,4 +73,50 @@ static Map parseFileDescriptors( } return fileDescriptorMap; } + + static TypeRegistry createTypeRegistry( + Iterable fileDescriptors) { + TypeRegistry.Builder registryBuilder = TypeRegistry.newBuilder(); + for (Descriptors.FileDescriptor fileDescriptor : fileDescriptors) { + registryBuilder.add(fileDescriptor.getMessageTypes()); + } + return registryBuilder.build(); + } + + static ExtensionRegistry createExtensionRegistry( + Iterable fileDescriptors) { + ExtensionRegistry registry = ExtensionRegistry.newInstance(); + for (Descriptors.FileDescriptor fileDescriptor : fileDescriptors) { + registerFileExtensions(registry, fileDescriptor); + } + return registry; + } + + private static void registerFileExtensions( + ExtensionRegistry registry, Descriptors.FileDescriptor fileDescriptor) { + registerExtensions(registry, fileDescriptor.getExtensions()); + for (Descriptors.Descriptor descriptor : fileDescriptor.getMessageTypes()) { + registerMessageExtensions(registry, descriptor); + } + } + + private static void registerMessageExtensions( + ExtensionRegistry registry, Descriptors.Descriptor descriptor) { + registerExtensions(registry, descriptor.getExtensions()); + for (Descriptors.Descriptor nestedDescriptor : descriptor.getNestedTypes()) { + registerMessageExtensions(registry, nestedDescriptor); + } + } + + private static void registerExtensions( + ExtensionRegistry registry, List extensions) { + for (Descriptors.FieldDescriptor fieldDescriptor : extensions) { + if (fieldDescriptor.getJavaType() == Descriptors.FieldDescriptor.JavaType.MESSAGE) { + registry.add( + fieldDescriptor, DynamicMessage.getDefaultInstance(fieldDescriptor.getMessageType())); + } else { + registry.add(fieldDescriptor); + } + } + } } diff --git a/conformance/src/main/java/build/buf/protovalidate/conformance/Main.java b/conformance/src/main/java/build/buf/protovalidate/conformance/Main.java index cc06ebe6..474a701a 100644 --- a/conformance/src/main/java/build/buf/protovalidate/conformance/Main.java +++ b/conformance/src/main/java/build/buf/protovalidate/conformance/Main.java @@ -33,6 +33,7 @@ import com.google.protobuf.DynamicMessage; import com.google.protobuf.ExtensionRegistry; import com.google.protobuf.InvalidProtocolBufferException; +import com.google.protobuf.TypeRegistry; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -57,7 +58,17 @@ static TestConformanceResponse testConformance(TestConformanceRequest request) { try { Map descriptorMap = FileDescriptorUtil.parse(request.getFdset()); - Validator validator = new Validator(Config.newBuilder().build()); + Map fileDescriptorMap = + FileDescriptorUtil.parseFileDescriptors(request.getFdset()); + TypeRegistry typeRegistry = FileDescriptorUtil.createTypeRegistry(fileDescriptorMap.values()); + ExtensionRegistry extensionRegistry = + FileDescriptorUtil.createExtensionRegistry(fileDescriptorMap.values()); + Validator validator = + new Validator( + Config.newBuilder() + .setTypeRegistry(typeRegistry) + .setExtensionRegistry(extensionRegistry) + .build()); TestConformanceResponse.Builder responseBuilder = TestConformanceResponse.newBuilder(); Map resultsMap = new HashMap<>(); for (Map.Entry entry : request.getCasesMap().entrySet()) { diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/BoolExample.java b/conformance/src/main/java/build/buf/validate/conformance/cases/BoolExample.java new file mode 100644 index 00000000..12fd3d2a --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/BoolExample.java @@ -0,0 +1,432 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/bool.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.BoolExample} + */ +public final class BoolExample extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.BoolExample) + BoolExampleOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 1, + /* suffix= */ "", + BoolExample.class.getName()); + } + // Use BoolExample.newBuilder() to construct. + private BoolExample(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private BoolExample() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.BoolProto.internal_static_buf_validate_conformance_cases_BoolExample_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.BoolProto.internal_static_buf_validate_conformance_cases_BoolExample_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.BoolExample.class, build.buf.validate.conformance.cases.BoolExample.Builder.class); + } + + public static final int VAL_FIELD_NUMBER = 1; + private boolean val_ = false; + /** + * bool val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public boolean getVal() { + return val_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (val_ != false) { + output.writeBool(1, val_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (val_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(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.BoolExample)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.BoolExample other = (build.buf.validate.conformance.cases.BoolExample) obj; + + if (getVal() + != other.getVal()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + VAL_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getVal()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.BoolExample parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.BoolExample 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.BoolExample parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.BoolExample 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.BoolExample parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.BoolExample 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.BoolExample parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.BoolExample 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.BoolExample parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.BoolExample 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.BoolExample 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.BoolExample 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.BoolExample 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.BoolExample} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.BoolExample) + build.buf.validate.conformance.cases.BoolExampleOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.BoolProto.internal_static_buf_validate_conformance_cases_BoolExample_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.BoolProto.internal_static_buf_validate_conformance_cases_BoolExample_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.BoolExample.class, build.buf.validate.conformance.cases.BoolExample.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.BoolExample.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + val_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.BoolProto.internal_static_buf_validate_conformance_cases_BoolExample_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.BoolExample getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.BoolExample.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.BoolExample build() { + build.buf.validate.conformance.cases.BoolExample result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.BoolExample buildPartial() { + build.buf.validate.conformance.cases.BoolExample result = new build.buf.validate.conformance.cases.BoolExample(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.BoolExample 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.BoolExample) { + return mergeFrom((build.buf.validate.conformance.cases.BoolExample)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.BoolExample other) { + if (other == build.buf.validate.conformance.cases.BoolExample.getDefaultInstance()) return this; + if (other.getVal() != false) { + setVal(other.getVal()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + val_ = input.readBool(); + bitField0_ |= 0x00000001; + break; + } // case 8 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private boolean val_ ; + /** + * bool val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public boolean getVal() { + return val_; + } + /** + * bool val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param value The val to set. + * @return This builder for chaining. + */ + public Builder setVal(boolean value) { + + val_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * bool val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return This builder for chaining. + */ + public Builder clearVal() { + bitField0_ = (bitField0_ & ~0x00000001); + val_ = false; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.BoolExample) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.BoolExample) + private static final build.buf.validate.conformance.cases.BoolExample DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.BoolExample(); + } + + public static build.buf.validate.conformance.cases.BoolExample getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BoolExample 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.BoolExample getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/BoolExampleOrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/BoolExampleOrBuilder.java new file mode 100644 index 00000000..699d2790 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/BoolExampleOrBuilder.java @@ -0,0 +1,17 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/bool.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +public interface BoolExampleOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.BoolExample) + com.google.protobuf.MessageOrBuilder { + + /** + * bool val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + boolean getVal(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/BoolProto.java b/conformance/src/main/java/build/buf/validate/conformance/cases/BoolProto.java index 1b884a90..60351320 100644 --- a/conformance/src/main/java/build/buf/validate/conformance/cases/BoolProto.java +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/BoolProto.java @@ -40,6 +40,11 @@ public static void registerAllExtensions( static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_buf_validate_conformance_cases_BoolConstFalse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_BoolExample_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_conformance_cases_BoolExample_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { @@ -54,12 +59,14 @@ public static void registerAllExtensions( "/validate/validate.proto\"\034\n\010BoolNone\022\020\n\003" + "val\030\001 \001(\010R\003val\"*\n\rBoolConstTrue\022\031\n\003val\030\001" + " \001(\010B\007\272H\004j\002\010\001R\003val\"+\n\016BoolConstFalse\022\031\n\003" + - "val\030\001 \001(\010B\007\272H\004j\002\010\000R\003valB\315\001\n$build.buf.va" + - "lidate.conformance.casesB\tBoolProtoP\001\242\002\004" + - "BVCC\252\002\036Buf.Validate.Conformance.Cases\312\002\036" + - "Buf\\Validate\\Conformance\\Cases\342\002*Buf\\Val" + - "idate\\Conformance\\Cases\\GPBMetadata\352\002!Bu" + - "f::Validate::Conformance::Casesb\006proto3" + "val\030\001 \001(\010B\007\272H\004j\002\010\000R\003val\"(\n\013BoolExample\022\031" + + "\n\003val\030\001 \001(\010B\007\272H\004j\002\020\001R\003valB\315\001\n$build.buf." + + "validate.conformance.casesB\tBoolProtoP\001\242" + + "\002\004BVCC\252\002\036Buf.Validate.Conformance.Cases\312" + + "\002\036Buf\\Validate\\Conformance\\Cases\342\002*Buf\\V" + + "alidate\\Conformance\\Cases\\GPBMetadata\352\002!" + + "Buf::Validate::Conformance::Casesb\006proto" + + "3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor .internalBuildGeneratedFileFrom(descriptorData, @@ -84,6 +91,12 @@ public static void registerAllExtensions( com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_BoolConstFalse_descriptor, new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_BoolExample_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_buf_validate_conformance_cases_BoolExample_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_BoolExample_descriptor, + new java.lang.String[] { "Val", }); descriptor.resolveAllFeaturesImmutable(); build.buf.validate.ValidateProto.getDescriptor(); com.google.protobuf.ExtensionRegistry registry = diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/BytesExample.java b/conformance/src/main/java/build/buf/validate/conformance/cases/BytesExample.java new file mode 100644 index 00000000..bd6b9a61 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/BytesExample.java @@ -0,0 +1,432 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/bytes.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.BytesExample} + */ +public final class BytesExample extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.BytesExample) + BytesExampleOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 1, + /* suffix= */ "", + BytesExample.class.getName()); + } + // Use BytesExample.newBuilder() to construct. + private BytesExample(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private BytesExample() { + val_ = com.google.protobuf.ByteString.EMPTY; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.BytesProto.internal_static_buf_validate_conformance_cases_BytesExample_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.BytesProto.internal_static_buf_validate_conformance_cases_BytesExample_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.BytesExample.class, build.buf.validate.conformance.cases.BytesExample.Builder.class); + } + + public static final int VAL_FIELD_NUMBER = 1; + private com.google.protobuf.ByteString val_ = com.google.protobuf.ByteString.EMPTY; + /** + * bytes val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public com.google.protobuf.ByteString getVal() { + return val_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!val_.isEmpty()) { + output.writeBytes(1, val_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!val_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(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.BytesExample)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.BytesExample other = (build.buf.validate.conformance.cases.BytesExample) 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.BytesExample parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.BytesExample 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.BytesExample parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.BytesExample 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.BytesExample parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.BytesExample 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.BytesExample parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.BytesExample 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.BytesExample parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.BytesExample 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.BytesExample 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.BytesExample 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.BytesExample 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.BytesExample} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.BytesExample) + build.buf.validate.conformance.cases.BytesExampleOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.BytesProto.internal_static_buf_validate_conformance_cases_BytesExample_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.BytesProto.internal_static_buf_validate_conformance_cases_BytesExample_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.BytesExample.class, build.buf.validate.conformance.cases.BytesExample.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.BytesExample.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.ByteString.EMPTY; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.BytesProto.internal_static_buf_validate_conformance_cases_BytesExample_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.BytesExample getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.BytesExample.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.BytesExample build() { + build.buf.validate.conformance.cases.BytesExample result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.BytesExample buildPartial() { + build.buf.validate.conformance.cases.BytesExample result = new build.buf.validate.conformance.cases.BytesExample(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.BytesExample 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.BytesExample) { + return mergeFrom((build.buf.validate.conformance.cases.BytesExample)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.BytesExample other) { + if (other == build.buf.validate.conformance.cases.BytesExample.getDefaultInstance()) return this; + if (other.getVal() != com.google.protobuf.ByteString.EMPTY) { + setVal(other.getVal()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 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 com.google.protobuf.ByteString val_ = com.google.protobuf.ByteString.EMPTY; + /** + * bytes val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public com.google.protobuf.ByteString getVal() { + return val_; + } + /** + * bytes val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param value The val to set. + * @return This builder for chaining. + */ + public Builder setVal(com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + val_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * bytes val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return This builder for chaining. + */ + public Builder clearVal() { + bitField0_ = (bitField0_ & ~0x00000001); + val_ = getDefaultInstance().getVal(); + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.BytesExample) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.BytesExample) + private static final build.buf.validate.conformance.cases.BytesExample DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.BytesExample(); + } + + public static build.buf.validate.conformance.cases.BytesExample getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BytesExample 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.BytesExample getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/BytesExampleOrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/BytesExampleOrBuilder.java new file mode 100644 index 00000000..c8e965b7 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/BytesExampleOrBuilder.java @@ -0,0 +1,17 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/bytes.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +public interface BytesExampleOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.BytesExample) + com.google.protobuf.MessageOrBuilder { + + /** + * bytes val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + com.google.protobuf.ByteString getVal(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/BytesNotIP.java b/conformance/src/main/java/build/buf/validate/conformance/cases/BytesNotIP.java new file mode 100644 index 00000000..56762d0f --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/BytesNotIP.java @@ -0,0 +1,432 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/bytes.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.BytesNotIP} + */ +public final class BytesNotIP extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.BytesNotIP) + BytesNotIPOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 1, + /* suffix= */ "", + BytesNotIP.class.getName()); + } + // Use BytesNotIP.newBuilder() to construct. + private BytesNotIP(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private BytesNotIP() { + val_ = com.google.protobuf.ByteString.EMPTY; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.BytesProto.internal_static_buf_validate_conformance_cases_BytesNotIP_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.BytesProto.internal_static_buf_validate_conformance_cases_BytesNotIP_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.BytesNotIP.class, build.buf.validate.conformance.cases.BytesNotIP.Builder.class); + } + + public static final int VAL_FIELD_NUMBER = 1; + private com.google.protobuf.ByteString val_ = com.google.protobuf.ByteString.EMPTY; + /** + * bytes val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public com.google.protobuf.ByteString getVal() { + return val_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!val_.isEmpty()) { + output.writeBytes(1, val_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!val_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(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.BytesNotIP)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.BytesNotIP other = (build.buf.validate.conformance.cases.BytesNotIP) 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.BytesNotIP parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.BytesNotIP 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.BytesNotIP parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.BytesNotIP 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.BytesNotIP parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.BytesNotIP 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.BytesNotIP parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.BytesNotIP 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.BytesNotIP parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.BytesNotIP 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.BytesNotIP 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.BytesNotIP 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.BytesNotIP 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.BytesNotIP} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.BytesNotIP) + build.buf.validate.conformance.cases.BytesNotIPOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.BytesProto.internal_static_buf_validate_conformance_cases_BytesNotIP_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.BytesProto.internal_static_buf_validate_conformance_cases_BytesNotIP_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.BytesNotIP.class, build.buf.validate.conformance.cases.BytesNotIP.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.BytesNotIP.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.ByteString.EMPTY; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.BytesProto.internal_static_buf_validate_conformance_cases_BytesNotIP_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.BytesNotIP getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.BytesNotIP.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.BytesNotIP build() { + build.buf.validate.conformance.cases.BytesNotIP result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.BytesNotIP buildPartial() { + build.buf.validate.conformance.cases.BytesNotIP result = new build.buf.validate.conformance.cases.BytesNotIP(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.BytesNotIP 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.BytesNotIP) { + return mergeFrom((build.buf.validate.conformance.cases.BytesNotIP)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.BytesNotIP other) { + if (other == build.buf.validate.conformance.cases.BytesNotIP.getDefaultInstance()) return this; + if (other.getVal() != com.google.protobuf.ByteString.EMPTY) { + setVal(other.getVal()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 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 com.google.protobuf.ByteString val_ = com.google.protobuf.ByteString.EMPTY; + /** + * bytes val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public com.google.protobuf.ByteString getVal() { + return val_; + } + /** + * bytes val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param value The val to set. + * @return This builder for chaining. + */ + public Builder setVal(com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + val_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * bytes val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return This builder for chaining. + */ + public Builder clearVal() { + bitField0_ = (bitField0_ & ~0x00000001); + val_ = getDefaultInstance().getVal(); + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.BytesNotIP) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.BytesNotIP) + private static final build.buf.validate.conformance.cases.BytesNotIP DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.BytesNotIP(); + } + + public static build.buf.validate.conformance.cases.BytesNotIP getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BytesNotIP 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.BytesNotIP getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/BytesNotIPOrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/BytesNotIPOrBuilder.java new file mode 100644 index 00000000..603381ec --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/BytesNotIPOrBuilder.java @@ -0,0 +1,17 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/bytes.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +public interface BytesNotIPOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.BytesNotIP) + com.google.protobuf.MessageOrBuilder { + + /** + * bytes val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + com.google.protobuf.ByteString getVal(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/BytesNotIPv4.java b/conformance/src/main/java/build/buf/validate/conformance/cases/BytesNotIPv4.java new file mode 100644 index 00000000..03b5ab13 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/BytesNotIPv4.java @@ -0,0 +1,432 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/bytes.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.BytesNotIPv4} + */ +public final class BytesNotIPv4 extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.BytesNotIPv4) + BytesNotIPv4OrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 1, + /* suffix= */ "", + BytesNotIPv4.class.getName()); + } + // Use BytesNotIPv4.newBuilder() to construct. + private BytesNotIPv4(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private BytesNotIPv4() { + val_ = com.google.protobuf.ByteString.EMPTY; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.BytesProto.internal_static_buf_validate_conformance_cases_BytesNotIPv4_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.BytesProto.internal_static_buf_validate_conformance_cases_BytesNotIPv4_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.BytesNotIPv4.class, build.buf.validate.conformance.cases.BytesNotIPv4.Builder.class); + } + + public static final int VAL_FIELD_NUMBER = 1; + private com.google.protobuf.ByteString val_ = com.google.protobuf.ByteString.EMPTY; + /** + * bytes val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public com.google.protobuf.ByteString getVal() { + return val_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!val_.isEmpty()) { + output.writeBytes(1, val_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!val_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(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.BytesNotIPv4)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.BytesNotIPv4 other = (build.buf.validate.conformance.cases.BytesNotIPv4) 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.BytesNotIPv4 parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.BytesNotIPv4 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.BytesNotIPv4 parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.BytesNotIPv4 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.BytesNotIPv4 parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.BytesNotIPv4 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.BytesNotIPv4 parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.BytesNotIPv4 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.BytesNotIPv4 parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.BytesNotIPv4 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.BytesNotIPv4 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.BytesNotIPv4 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.BytesNotIPv4 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.BytesNotIPv4} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.BytesNotIPv4) + build.buf.validate.conformance.cases.BytesNotIPv4OrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.BytesProto.internal_static_buf_validate_conformance_cases_BytesNotIPv4_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.BytesProto.internal_static_buf_validate_conformance_cases_BytesNotIPv4_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.BytesNotIPv4.class, build.buf.validate.conformance.cases.BytesNotIPv4.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.BytesNotIPv4.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.ByteString.EMPTY; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.BytesProto.internal_static_buf_validate_conformance_cases_BytesNotIPv4_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.BytesNotIPv4 getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.BytesNotIPv4.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.BytesNotIPv4 build() { + build.buf.validate.conformance.cases.BytesNotIPv4 result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.BytesNotIPv4 buildPartial() { + build.buf.validate.conformance.cases.BytesNotIPv4 result = new build.buf.validate.conformance.cases.BytesNotIPv4(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.BytesNotIPv4 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.BytesNotIPv4) { + return mergeFrom((build.buf.validate.conformance.cases.BytesNotIPv4)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.BytesNotIPv4 other) { + if (other == build.buf.validate.conformance.cases.BytesNotIPv4.getDefaultInstance()) return this; + if (other.getVal() != com.google.protobuf.ByteString.EMPTY) { + setVal(other.getVal()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 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 com.google.protobuf.ByteString val_ = com.google.protobuf.ByteString.EMPTY; + /** + * bytes val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public com.google.protobuf.ByteString getVal() { + return val_; + } + /** + * bytes val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param value The val to set. + * @return This builder for chaining. + */ + public Builder setVal(com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + val_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * bytes val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return This builder for chaining. + */ + public Builder clearVal() { + bitField0_ = (bitField0_ & ~0x00000001); + val_ = getDefaultInstance().getVal(); + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.BytesNotIPv4) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.BytesNotIPv4) + private static final build.buf.validate.conformance.cases.BytesNotIPv4 DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.BytesNotIPv4(); + } + + public static build.buf.validate.conformance.cases.BytesNotIPv4 getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BytesNotIPv4 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.BytesNotIPv4 getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/BytesNotIPv4OrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/BytesNotIPv4OrBuilder.java new file mode 100644 index 00000000..c92f43c4 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/BytesNotIPv4OrBuilder.java @@ -0,0 +1,17 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/bytes.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +public interface BytesNotIPv4OrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.BytesNotIPv4) + com.google.protobuf.MessageOrBuilder { + + /** + * bytes val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + com.google.protobuf.ByteString getVal(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/BytesNotIPv6.java b/conformance/src/main/java/build/buf/validate/conformance/cases/BytesNotIPv6.java new file mode 100644 index 00000000..6213be5f --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/BytesNotIPv6.java @@ -0,0 +1,432 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/bytes.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.BytesNotIPv6} + */ +public final class BytesNotIPv6 extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.BytesNotIPv6) + BytesNotIPv6OrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 1, + /* suffix= */ "", + BytesNotIPv6.class.getName()); + } + // Use BytesNotIPv6.newBuilder() to construct. + private BytesNotIPv6(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private BytesNotIPv6() { + val_ = com.google.protobuf.ByteString.EMPTY; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.BytesProto.internal_static_buf_validate_conformance_cases_BytesNotIPv6_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.BytesProto.internal_static_buf_validate_conformance_cases_BytesNotIPv6_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.BytesNotIPv6.class, build.buf.validate.conformance.cases.BytesNotIPv6.Builder.class); + } + + public static final int VAL_FIELD_NUMBER = 1; + private com.google.protobuf.ByteString val_ = com.google.protobuf.ByteString.EMPTY; + /** + * bytes val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public com.google.protobuf.ByteString getVal() { + return val_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!val_.isEmpty()) { + output.writeBytes(1, val_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!val_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(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.BytesNotIPv6)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.BytesNotIPv6 other = (build.buf.validate.conformance.cases.BytesNotIPv6) 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.BytesNotIPv6 parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.BytesNotIPv6 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.BytesNotIPv6 parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.BytesNotIPv6 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.BytesNotIPv6 parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.BytesNotIPv6 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.BytesNotIPv6 parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.BytesNotIPv6 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.BytesNotIPv6 parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.BytesNotIPv6 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.BytesNotIPv6 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.BytesNotIPv6 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.BytesNotIPv6 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.BytesNotIPv6} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.BytesNotIPv6) + build.buf.validate.conformance.cases.BytesNotIPv6OrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.BytesProto.internal_static_buf_validate_conformance_cases_BytesNotIPv6_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.BytesProto.internal_static_buf_validate_conformance_cases_BytesNotIPv6_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.BytesNotIPv6.class, build.buf.validate.conformance.cases.BytesNotIPv6.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.BytesNotIPv6.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.ByteString.EMPTY; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.BytesProto.internal_static_buf_validate_conformance_cases_BytesNotIPv6_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.BytesNotIPv6 getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.BytesNotIPv6.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.BytesNotIPv6 build() { + build.buf.validate.conformance.cases.BytesNotIPv6 result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.BytesNotIPv6 buildPartial() { + build.buf.validate.conformance.cases.BytesNotIPv6 result = new build.buf.validate.conformance.cases.BytesNotIPv6(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.BytesNotIPv6 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.BytesNotIPv6) { + return mergeFrom((build.buf.validate.conformance.cases.BytesNotIPv6)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.BytesNotIPv6 other) { + if (other == build.buf.validate.conformance.cases.BytesNotIPv6.getDefaultInstance()) return this; + if (other.getVal() != com.google.protobuf.ByteString.EMPTY) { + setVal(other.getVal()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 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 com.google.protobuf.ByteString val_ = com.google.protobuf.ByteString.EMPTY; + /** + * bytes val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public com.google.protobuf.ByteString getVal() { + return val_; + } + /** + * bytes val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param value The val to set. + * @return This builder for chaining. + */ + public Builder setVal(com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + val_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * bytes val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return This builder for chaining. + */ + public Builder clearVal() { + bitField0_ = (bitField0_ & ~0x00000001); + val_ = getDefaultInstance().getVal(); + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.BytesNotIPv6) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.BytesNotIPv6) + private static final build.buf.validate.conformance.cases.BytesNotIPv6 DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.BytesNotIPv6(); + } + + public static build.buf.validate.conformance.cases.BytesNotIPv6 getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BytesNotIPv6 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.BytesNotIPv6 getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/BytesNotIPv6OrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/BytesNotIPv6OrBuilder.java new file mode 100644 index 00000000..11ed5f97 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/BytesNotIPv6OrBuilder.java @@ -0,0 +1,17 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/bytes.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +public interface BytesNotIPv6OrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.BytesNotIPv6) + com.google.protobuf.MessageOrBuilder { + + /** + * bytes val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + com.google.protobuf.ByteString getVal(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/BytesProto.java b/conformance/src/main/java/build/buf/validate/conformance/cases/BytesProto.java index 3e29e24d..55415a1d 100644 --- a/conformance/src/main/java/build/buf/validate/conformance/cases/BytesProto.java +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/BytesProto.java @@ -95,21 +95,41 @@ public static void registerAllExtensions( static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_buf_validate_conformance_cases_BytesIP_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_BytesNotIP_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_conformance_cases_BytesNotIP_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_buf_validate_conformance_cases_BytesIPv4_descriptor; static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_buf_validate_conformance_cases_BytesIPv4_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_BytesNotIPv4_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_conformance_cases_BytesNotIPv4_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_buf_validate_conformance_cases_BytesIPv6_descriptor; static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_buf_validate_conformance_cases_BytesIPv6_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_BytesNotIPv6_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_conformance_cases_BytesNotIPv6_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_buf_validate_conformance_cases_BytesIPv6Ignore_descriptor; static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_buf_validate_conformance_cases_BytesIPv6Ignore_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_BytesExample_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_conformance_cases_BytesExample_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { @@ -137,15 +157,20 @@ public static void registerAllExtensions( "-\n\rBytesContains\022\034\n\003val\030\001 \001(\014B\n\272H\007z\005:\003ba" + "rR\003val\",\n\013BytesSuffix\022\035\n\003val\030\001 \001(\014B\013\272H\010z" + "\0062\004buzzR\003val\"$\n\007BytesIP\022\031\n\003val\030\001 \001(\014B\007\272H" + - "\004z\002P\001R\003val\"&\n\tBytesIPv4\022\031\n\003val\030\001 \001(\014B\007\272H" + - "\004z\002X\001R\003val\"&\n\tBytesIPv6\022\031\n\003val\030\001 \001(\014B\007\272H" + - "\004z\002`\001R\003val\"/\n\017BytesIPv6Ignore\022\034\n\003val\030\001 \001" + - "(\014B\n\272H\007z\002`\001\320\001\001R\003valB\316\001\n$build.buf.valida" + - "te.conformance.casesB\nBytesProtoP\001\242\002\004BVC" + - "C\252\002\036Buf.Validate.Conformance.Cases\312\002\036Buf" + - "\\Validate\\Conformance\\Cases\342\002*Buf\\Valida" + - "te\\Conformance\\Cases\\GPBMetadata\352\002!Buf::" + - "Validate::Conformance::Casesb\006proto3" + "\004z\002P\001R\003val\"\'\n\nBytesNotIP\022\031\n\003val\030\001 \001(\014B\007\272" + + "H\004z\002P\000R\003val\"&\n\tBytesIPv4\022\031\n\003val\030\001 \001(\014B\007\272" + + "H\004z\002X\001R\003val\")\n\014BytesNotIPv4\022\031\n\003val\030\001 \001(\014" + + "B\007\272H\004z\002X\000R\003val\"&\n\tBytesIPv6\022\031\n\003val\030\001 \001(\014" + + "B\007\272H\004z\002`\001R\003val\")\n\014BytesNotIPv6\022\031\n\003val\030\001 " + + "\001(\014B\007\272H\004z\002`\000R\003val\"/\n\017BytesIPv6Ignore\022\034\n\003" + + "val\030\001 \001(\014B\n\272H\007z\002`\001\320\001\001R\003val\"*\n\014BytesExamp" + + "le\022\032\n\003val\030\001 \001(\014B\010\272H\005z\003r\001\231R\003valB\316\001\n$build" + + ".buf.validate.conformance.casesB\nBytesPr" + + "otoP\001\242\002\004BVCC\252\002\036Buf.Validate.Conformance." + + "Cases\312\002\036Buf\\Validate\\Conformance\\Cases\342\002" + + "*Buf\\Validate\\Conformance\\Cases\\GPBMetad" + + "ata\352\002!Buf::Validate::Conformance::Casesb" + + "\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor .internalBuildGeneratedFileFrom(descriptorData, @@ -236,24 +261,48 @@ public static void registerAllExtensions( com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_BytesIP_descriptor, new java.lang.String[] { "Val", }); - internal_static_buf_validate_conformance_cases_BytesIPv4_descriptor = + internal_static_buf_validate_conformance_cases_BytesNotIP_descriptor = getDescriptor().getMessageTypes().get(14); + internal_static_buf_validate_conformance_cases_BytesNotIP_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_BytesNotIP_descriptor, + new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_BytesIPv4_descriptor = + getDescriptor().getMessageTypes().get(15); internal_static_buf_validate_conformance_cases_BytesIPv4_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_BytesIPv4_descriptor, new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_BytesNotIPv4_descriptor = + getDescriptor().getMessageTypes().get(16); + internal_static_buf_validate_conformance_cases_BytesNotIPv4_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_BytesNotIPv4_descriptor, + new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_BytesIPv6_descriptor = - getDescriptor().getMessageTypes().get(15); + getDescriptor().getMessageTypes().get(17); internal_static_buf_validate_conformance_cases_BytesIPv6_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_BytesIPv6_descriptor, new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_BytesNotIPv6_descriptor = + getDescriptor().getMessageTypes().get(18); + internal_static_buf_validate_conformance_cases_BytesNotIPv6_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_BytesNotIPv6_descriptor, + new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_BytesIPv6Ignore_descriptor = - getDescriptor().getMessageTypes().get(16); + getDescriptor().getMessageTypes().get(19); internal_static_buf_validate_conformance_cases_BytesIPv6Ignore_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_BytesIPv6Ignore_descriptor, new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_BytesExample_descriptor = + getDescriptor().getMessageTypes().get(20); + internal_static_buf_validate_conformance_cases_BytesExample_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_BytesExample_descriptor, + new java.lang.String[] { "Val", }); descriptor.resolveAllFeaturesImmutable(); build.buf.validate.ValidateProto.getDescriptor(); com.google.protobuf.ExtensionRegistry registry = diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/DoubleExample.java b/conformance/src/main/java/build/buf/validate/conformance/cases/DoubleExample.java new file mode 100644 index 00000000..028868c8 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/DoubleExample.java @@ -0,0 +1,433 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/numbers.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.DoubleExample} + */ +public final class DoubleExample extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.DoubleExample) + DoubleExampleOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 1, + /* suffix= */ "", + DoubleExample.class.getName()); + } + // Use DoubleExample.newBuilder() to construct. + private DoubleExample(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private DoubleExample() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.NumbersProto.internal_static_buf_validate_conformance_cases_DoubleExample_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.NumbersProto.internal_static_buf_validate_conformance_cases_DoubleExample_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.DoubleExample.class, build.buf.validate.conformance.cases.DoubleExample.Builder.class); + } + + public static final int VAL_FIELD_NUMBER = 1; + private double val_ = 0D; + /** + * double val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public double getVal() { + return val_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (java.lang.Double.doubleToRawLongBits(val_) != 0) { + output.writeDouble(1, val_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (java.lang.Double.doubleToRawLongBits(val_) != 0) { + size += com.google.protobuf.CodedOutputStream + .computeDoubleSize(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.DoubleExample)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.DoubleExample other = (build.buf.validate.conformance.cases.DoubleExample) obj; + + if (java.lang.Double.doubleToLongBits(getVal()) + != java.lang.Double.doubleToLongBits( + 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) + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getVal())); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.DoubleExample parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.DoubleExample 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.DoubleExample parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.DoubleExample 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.DoubleExample parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.DoubleExample 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.DoubleExample parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.DoubleExample 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.DoubleExample parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.DoubleExample 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.DoubleExample 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.DoubleExample 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.DoubleExample 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.DoubleExample} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.DoubleExample) + build.buf.validate.conformance.cases.DoubleExampleOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.NumbersProto.internal_static_buf_validate_conformance_cases_DoubleExample_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.NumbersProto.internal_static_buf_validate_conformance_cases_DoubleExample_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.DoubleExample.class, build.buf.validate.conformance.cases.DoubleExample.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.DoubleExample.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + val_ = 0D; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.NumbersProto.internal_static_buf_validate_conformance_cases_DoubleExample_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.DoubleExample getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.DoubleExample.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.DoubleExample build() { + build.buf.validate.conformance.cases.DoubleExample result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.DoubleExample buildPartial() { + build.buf.validate.conformance.cases.DoubleExample result = new build.buf.validate.conformance.cases.DoubleExample(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.DoubleExample 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.DoubleExample) { + return mergeFrom((build.buf.validate.conformance.cases.DoubleExample)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.DoubleExample other) { + if (other == build.buf.validate.conformance.cases.DoubleExample.getDefaultInstance()) return this; + if (other.getVal() != 0D) { + setVal(other.getVal()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 9: { + val_ = input.readDouble(); + bitField0_ |= 0x00000001; + break; + } // case 9 + 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 double val_ ; + /** + * double val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public double getVal() { + return val_; + } + /** + * double val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param value The val to set. + * @return This builder for chaining. + */ + public Builder setVal(double value) { + + val_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * double val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return This builder for chaining. + */ + public Builder clearVal() { + bitField0_ = (bitField0_ & ~0x00000001); + val_ = 0D; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.DoubleExample) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.DoubleExample) + private static final build.buf.validate.conformance.cases.DoubleExample DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.DoubleExample(); + } + + public static build.buf.validate.conformance.cases.DoubleExample getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DoubleExample 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.DoubleExample getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/DoubleExampleOrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/DoubleExampleOrBuilder.java new file mode 100644 index 00000000..d2714681 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/DoubleExampleOrBuilder.java @@ -0,0 +1,17 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/numbers.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +public interface DoubleExampleOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.DoubleExample) + com.google.protobuf.MessageOrBuilder { + + /** + * double val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + double getVal(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/DoubleNotFinite.java b/conformance/src/main/java/build/buf/validate/conformance/cases/DoubleNotFinite.java new file mode 100644 index 00000000..4eba99a0 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/DoubleNotFinite.java @@ -0,0 +1,433 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/numbers.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.DoubleNotFinite} + */ +public final class DoubleNotFinite extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.DoubleNotFinite) + DoubleNotFiniteOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 1, + /* suffix= */ "", + DoubleNotFinite.class.getName()); + } + // Use DoubleNotFinite.newBuilder() to construct. + private DoubleNotFinite(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private DoubleNotFinite() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.NumbersProto.internal_static_buf_validate_conformance_cases_DoubleNotFinite_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.NumbersProto.internal_static_buf_validate_conformance_cases_DoubleNotFinite_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.DoubleNotFinite.class, build.buf.validate.conformance.cases.DoubleNotFinite.Builder.class); + } + + public static final int VAL_FIELD_NUMBER = 1; + private double val_ = 0D; + /** + * double val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public double getVal() { + return val_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (java.lang.Double.doubleToRawLongBits(val_) != 0) { + output.writeDouble(1, val_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (java.lang.Double.doubleToRawLongBits(val_) != 0) { + size += com.google.protobuf.CodedOutputStream + .computeDoubleSize(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.DoubleNotFinite)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.DoubleNotFinite other = (build.buf.validate.conformance.cases.DoubleNotFinite) obj; + + if (java.lang.Double.doubleToLongBits(getVal()) + != java.lang.Double.doubleToLongBits( + 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) + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getVal())); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.DoubleNotFinite parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.DoubleNotFinite 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.DoubleNotFinite parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.DoubleNotFinite 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.DoubleNotFinite parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.DoubleNotFinite 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.DoubleNotFinite parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.DoubleNotFinite 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.DoubleNotFinite parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.DoubleNotFinite 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.DoubleNotFinite 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.DoubleNotFinite 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.DoubleNotFinite 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.DoubleNotFinite} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.DoubleNotFinite) + build.buf.validate.conformance.cases.DoubleNotFiniteOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.NumbersProto.internal_static_buf_validate_conformance_cases_DoubleNotFinite_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.NumbersProto.internal_static_buf_validate_conformance_cases_DoubleNotFinite_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.DoubleNotFinite.class, build.buf.validate.conformance.cases.DoubleNotFinite.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.DoubleNotFinite.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + val_ = 0D; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.NumbersProto.internal_static_buf_validate_conformance_cases_DoubleNotFinite_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.DoubleNotFinite getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.DoubleNotFinite.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.DoubleNotFinite build() { + build.buf.validate.conformance.cases.DoubleNotFinite result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.DoubleNotFinite buildPartial() { + build.buf.validate.conformance.cases.DoubleNotFinite result = new build.buf.validate.conformance.cases.DoubleNotFinite(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.DoubleNotFinite 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.DoubleNotFinite) { + return mergeFrom((build.buf.validate.conformance.cases.DoubleNotFinite)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.DoubleNotFinite other) { + if (other == build.buf.validate.conformance.cases.DoubleNotFinite.getDefaultInstance()) return this; + if (other.getVal() != 0D) { + setVal(other.getVal()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 9: { + val_ = input.readDouble(); + bitField0_ |= 0x00000001; + break; + } // case 9 + 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 double val_ ; + /** + * double val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public double getVal() { + return val_; + } + /** + * double val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param value The val to set. + * @return This builder for chaining. + */ + public Builder setVal(double value) { + + val_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * double val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return This builder for chaining. + */ + public Builder clearVal() { + bitField0_ = (bitField0_ & ~0x00000001); + val_ = 0D; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.DoubleNotFinite) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.DoubleNotFinite) + private static final build.buf.validate.conformance.cases.DoubleNotFinite DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.DoubleNotFinite(); + } + + public static build.buf.validate.conformance.cases.DoubleNotFinite getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DoubleNotFinite 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.DoubleNotFinite getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/DoubleNotFiniteOrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/DoubleNotFiniteOrBuilder.java new file mode 100644 index 00000000..cbe164d5 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/DoubleNotFiniteOrBuilder.java @@ -0,0 +1,17 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/numbers.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +public interface DoubleNotFiniteOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.DoubleNotFinite) + com.google.protobuf.MessageOrBuilder { + + /** + * double val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + double getVal(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/DurationExample.java b/conformance/src/main/java/build/buf/validate/conformance/cases/DurationExample.java new file mode 100644 index 00000000..c41e2e89 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/DurationExample.java @@ -0,0 +1,558 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/wkt_duration.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.DurationExample} + */ +public final class DurationExample extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.DurationExample) + DurationExampleOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 1, + /* suffix= */ "", + DurationExample.class.getName()); + } + // Use DurationExample.newBuilder() to construct. + private DurationExample(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private DurationExample() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.WktDurationProto.internal_static_buf_validate_conformance_cases_DurationExample_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.WktDurationProto.internal_static_buf_validate_conformance_cases_DurationExample_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.DurationExample.class, build.buf.validate.conformance.cases.DurationExample.Builder.class); + } + + private int bitField0_; + public static final int VAL_FIELD_NUMBER = 1; + private com.google.protobuf.Duration val_; + /** + * .google.protobuf.Duration 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); + } + /** + * .google.protobuf.Duration val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public com.google.protobuf.Duration getVal() { + return val_ == null ? com.google.protobuf.Duration.getDefaultInstance() : val_; + } + /** + * .google.protobuf.Duration val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getValOrBuilder() { + return val_ == null ? com.google.protobuf.Duration.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.DurationExample)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.DurationExample other = (build.buf.validate.conformance.cases.DurationExample) 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.DurationExample parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.DurationExample 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.DurationExample parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.DurationExample 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.DurationExample parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.DurationExample 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.DurationExample parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.DurationExample 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.DurationExample parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.DurationExample 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.DurationExample 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.DurationExample 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.DurationExample 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.DurationExample} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.DurationExample) + build.buf.validate.conformance.cases.DurationExampleOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.WktDurationProto.internal_static_buf_validate_conformance_cases_DurationExample_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.WktDurationProto.internal_static_buf_validate_conformance_cases_DurationExample_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.DurationExample.class, build.buf.validate.conformance.cases.DurationExample.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.DurationExample.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage + .alwaysUseFieldBuilders) { + getValFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + val_ = null; + if (valBuilder_ != null) { + valBuilder_.dispose(); + valBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.WktDurationProto.internal_static_buf_validate_conformance_cases_DurationExample_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.DurationExample getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.DurationExample.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.DurationExample build() { + build.buf.validate.conformance.cases.DurationExample result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.DurationExample buildPartial() { + build.buf.validate.conformance.cases.DurationExample result = new build.buf.validate.conformance.cases.DurationExample(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.DurationExample 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.DurationExample) { + return mergeFrom((build.buf.validate.conformance.cases.DurationExample)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.DurationExample other) { + if (other == build.buf.validate.conformance.cases.DurationExample.getDefaultInstance()) return this; + if (other.hasVal()) { + mergeVal(other.getVal()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + input.readMessage( + getValFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private com.google.protobuf.Duration val_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> valBuilder_; + /** + * .google.protobuf.Duration val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + public boolean hasVal() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * .google.protobuf.Duration val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + public com.google.protobuf.Duration getVal() { + if (valBuilder_ == null) { + return val_ == null ? com.google.protobuf.Duration.getDefaultInstance() : val_; + } else { + return valBuilder_.getMessage(); + } + } + /** + * .google.protobuf.Duration val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder setVal(com.google.protobuf.Duration value) { + if (valBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + val_ = value; + } else { + valBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * .google.protobuf.Duration val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder setVal( + com.google.protobuf.Duration.Builder builderForValue) { + if (valBuilder_ == null) { + val_ = builderForValue.build(); + } else { + valBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * .google.protobuf.Duration val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder mergeVal(com.google.protobuf.Duration value) { + if (valBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) && + val_ != null && + val_ != com.google.protobuf.Duration.getDefaultInstance()) { + getValBuilder().mergeFrom(value); + } else { + val_ = value; + } + } else { + valBuilder_.mergeFrom(value); + } + if (val_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + /** + * .google.protobuf.Duration 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; + } + /** + * .google.protobuf.Duration val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public com.google.protobuf.Duration.Builder getValBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getValFieldBuilder().getBuilder(); + } + /** + * .google.protobuf.Duration val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public com.google.protobuf.DurationOrBuilder getValOrBuilder() { + if (valBuilder_ != null) { + return valBuilder_.getMessageOrBuilder(); + } else { + return val_ == null ? + com.google.protobuf.Duration.getDefaultInstance() : val_; + } + } + /** + * .google.protobuf.Duration val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> + getValFieldBuilder() { + if (valBuilder_ == null) { + valBuilder_ = new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder>( + getVal(), + getParentForChildren(), + isClean()); + val_ = null; + } + return valBuilder_; + } + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.DurationExample) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.DurationExample) + private static final build.buf.validate.conformance.cases.DurationExample DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.DurationExample(); + } + + public static build.buf.validate.conformance.cases.DurationExample getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DurationExample 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.DurationExample getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/DurationExampleOrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/DurationExampleOrBuilder.java new file mode 100644 index 00000000..856ae1fb --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/DurationExampleOrBuilder.java @@ -0,0 +1,26 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/wkt_duration.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +public interface DurationExampleOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.DurationExample) + com.google.protobuf.MessageOrBuilder { + + /** + * .google.protobuf.Duration val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + boolean hasVal(); + /** + * .google.protobuf.Duration val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + com.google.protobuf.Duration getVal(); + /** + * .google.protobuf.Duration val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + com.google.protobuf.DurationOrBuilder getValOrBuilder(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/EnumExample.java b/conformance/src/main/java/build/buf/validate/conformance/cases/EnumExample.java new file mode 100644 index 00000000..3b6ec6fb --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/EnumExample.java @@ -0,0 +1,459 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/enums.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.EnumExample} + */ +public final class EnumExample extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.EnumExample) + EnumExampleOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 1, + /* suffix= */ "", + EnumExample.class.getName()); + } + // Use EnumExample.newBuilder() to construct. + private EnumExample(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private EnumExample() { + val_ = 0; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.EnumsProto.internal_static_buf_validate_conformance_cases_EnumExample_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.EnumsProto.internal_static_buf_validate_conformance_cases_EnumExample_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.EnumExample.class, build.buf.validate.conformance.cases.EnumExample.Builder.class); + } + + public static final int VAL_FIELD_NUMBER = 1; + private int val_ = 0; + /** + * .buf.validate.conformance.cases.TestEnum val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The enum numeric value on the wire for val. + */ + @java.lang.Override public int getValValue() { + return val_; + } + /** + * .buf.validate.conformance.cases.TestEnum val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override public build.buf.validate.conformance.cases.TestEnum getVal() { + build.buf.validate.conformance.cases.TestEnum result = build.buf.validate.conformance.cases.TestEnum.forNumber(val_); + return result == null ? build.buf.validate.conformance.cases.TestEnum.UNRECOGNIZED : result; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (val_ != build.buf.validate.conformance.cases.TestEnum.TEST_ENUM_UNSPECIFIED.getNumber()) { + output.writeEnum(1, val_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (val_ != build.buf.validate.conformance.cases.TestEnum.TEST_ENUM_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(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.EnumExample)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.EnumExample other = (build.buf.validate.conformance.cases.EnumExample) obj; + + if (val_ != other.val_) 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) + val_; + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.EnumExample parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.EnumExample 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.EnumExample parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.EnumExample 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.EnumExample parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.EnumExample 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.EnumExample parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.EnumExample 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.EnumExample parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.EnumExample 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.EnumExample 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.EnumExample 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.EnumExample 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.EnumExample} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.EnumExample) + build.buf.validate.conformance.cases.EnumExampleOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.EnumsProto.internal_static_buf_validate_conformance_cases_EnumExample_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.EnumsProto.internal_static_buf_validate_conformance_cases_EnumExample_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.EnumExample.class, build.buf.validate.conformance.cases.EnumExample.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.EnumExample.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + val_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.EnumsProto.internal_static_buf_validate_conformance_cases_EnumExample_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.EnumExample getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.EnumExample.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.EnumExample build() { + build.buf.validate.conformance.cases.EnumExample result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.EnumExample buildPartial() { + build.buf.validate.conformance.cases.EnumExample result = new build.buf.validate.conformance.cases.EnumExample(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.EnumExample 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.EnumExample) { + return mergeFrom((build.buf.validate.conformance.cases.EnumExample)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.EnumExample other) { + if (other == build.buf.validate.conformance.cases.EnumExample.getDefaultInstance()) return this; + if (other.val_ != 0) { + setValValue(other.getValValue()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + val_ = input.readEnum(); + bitField0_ |= 0x00000001; + break; + } // case 8 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private int val_ = 0; + /** + * .buf.validate.conformance.cases.TestEnum val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The enum numeric value on the wire for val. + */ + @java.lang.Override public int getValValue() { + return val_; + } + /** + * .buf.validate.conformance.cases.TestEnum val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param value The enum numeric value on the wire for val to set. + * @return This builder for chaining. + */ + public Builder setValValue(int value) { + val_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * .buf.validate.conformance.cases.TestEnum val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public build.buf.validate.conformance.cases.TestEnum getVal() { + build.buf.validate.conformance.cases.TestEnum result = build.buf.validate.conformance.cases.TestEnum.forNumber(val_); + return result == null ? build.buf.validate.conformance.cases.TestEnum.UNRECOGNIZED : result; + } + /** + * .buf.validate.conformance.cases.TestEnum val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param value The val to set. + * @return This builder for chaining. + */ + public Builder setVal(build.buf.validate.conformance.cases.TestEnum value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + val_ = value.getNumber(); + onChanged(); + return this; + } + /** + * .buf.validate.conformance.cases.TestEnum val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return This builder for chaining. + */ + public Builder clearVal() { + bitField0_ = (bitField0_ & ~0x00000001); + val_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.EnumExample) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.EnumExample) + private static final build.buf.validate.conformance.cases.EnumExample DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.EnumExample(); + } + + public static build.buf.validate.conformance.cases.EnumExample getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public EnumExample 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.EnumExample getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/EnumExampleOrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/EnumExampleOrBuilder.java new file mode 100644 index 00000000..aa2e4e8e --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/EnumExampleOrBuilder.java @@ -0,0 +1,22 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/enums.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +public interface EnumExampleOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.EnumExample) + com.google.protobuf.MessageOrBuilder { + + /** + * .buf.validate.conformance.cases.TestEnum val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The enum numeric value on the wire for val. + */ + int getValValue(); + /** + * .buf.validate.conformance.cases.TestEnum val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + build.buf.validate.conformance.cases.TestEnum getVal(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/EnumsProto.java b/conformance/src/main/java/build/buf/validate/conformance/cases/EnumsProto.java index 20d61fb4..3121868e 100644 --- a/conformance/src/main/java/build/buf/validate/conformance/cases/EnumsProto.java +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/EnumsProto.java @@ -120,6 +120,11 @@ public static void registerAllExtensions( static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_buf_validate_conformance_cases_EnumInsideOneof_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_EnumExample_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_conformance_cases_EnumExample_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { @@ -147,57 +152,59 @@ public static void registerAllExtensions( ".validate.conformance.cases.TestEnumAlia" + "sB\010\272H\005\202\001\002\020\001R\003val\"P\n\006EnumIn\022F\n\003val\030\001 \001(\0162" + "(.buf.validate.conformance.cases.TestEnu" + - "mB\n\272H\007\202\001\004\032\002\000\002R\003val\"Z\n\013EnumAliasIn\022K\n\003val" + + "mB\n\272H\007\202\001\004\030\000\030\002R\003val\"Z\n\013EnumAliasIn\022K\n\003val" + "\030\001 \001(\0162-.buf.validate.conformance.cases." + - "TestEnumAliasB\n\272H\007\202\001\004\032\002\000\002R\003val\"R\n\tEnumNo" + - "tIn\022E\n\003val\030\001 \001(\0162(.buf.validate.conforma" + - "nce.cases.TestEnumB\t\272H\006\202\001\003\"\001\001R\003val\"\\\n\016En" + - "umAliasNotIn\022J\n\003val\030\001 \001(\0162-.buf.validate" + - ".conformance.cases.TestEnumAliasB\t\272H\006\202\001\003" + - "\"\001\001R\003val\"j\n\014EnumExternal\022Z\n\003val\030\001 \001(\0162>." + - "buf.validate.conformance.cases.other_pac" + - "kage.Embed.EnumeratedB\010\272H\005\202\001\002\020\001R\003val\"}\n\r" + - "EnumExternal2\022l\n\003val\030\001 \001(\0162P.buf.validat" + - "e.conformance.cases.other_package.Embed." + - "DoubleEmbed.DoubleEnumeratedB\010\272H\005\202\001\002\020\001R\003" + - "val\"`\n\023RepeatedEnumDefined\022I\n\003val\030\001 \003(\0162" + - "(.buf.validate.conformance.cases.TestEnu" + - "mB\r\272H\n\222\001\007\"\005\202\001\002\020\001R\003val\"~\n\033RepeatedExterna" + - "lEnumDefined\022_\n\003val\030\001 \003(\0162>.buf.validate" + - ".conformance.cases.other_package.Embed.E" + - "numeratedB\r\272H\n\222\001\007\"\005\202\001\002\020\001R\003val\"\216\001\n%Repeat" + - "edYetAnotherExternalEnumDefined\022e\n\003val\030\001" + - " \003(\0162D.buf.validate.conformance.cases.ye" + - "t_another_package.Embed.EnumeratedB\r\272H\n\222" + - "\001\007\"\005\202\001\002\020\001R\003val\"\314\001\n\016MapEnumDefined\022X\n\003val" + - "\030\001 \003(\01327.buf.validate.conformance.cases." + - "MapEnumDefined.ValEntryB\r\272H\n\232\001\007*\005\202\001\002\020\001R\003" + - "val\032`\n\010ValEntry\022\020\n\003key\030\001 \001(\tR\003key\022>\n\005val" + - "ue\030\002 \001(\0162(.buf.validate.conformance.case" + - "s.TestEnumR\005value:\0028\001\"\362\001\n\026MapExternalEnu" + - "mDefined\022`\n\003val\030\001 \003(\0132?.buf.validate.con" + - "formance.cases.MapExternalEnumDefined.Va" + - "lEntryB\r\272H\n\232\001\007*\005\202\001\002\020\001R\003val\032v\n\010ValEntry\022\020" + - "\n\003key\030\001 \001(\tR\003key\022T\n\005value\030\002 \001(\0162>.buf.va" + - "lidate.conformance.cases.other_package.E" + - "mbed.EnumeratedR\005value:\0028\001\"\264\001\n\017EnumInsid" + - "eOneof\022F\n\003val\030\001 \001(\0162(.buf.validate.confo" + - "rmance.cases.TestEnumB\010\272H\005\202\001\002\020\001H\000R\003val\022K" + - "\n\004val2\030\002 \001(\0162(.buf.validate.conformance." + - "cases.TestEnumB\013\272H\010\202\001\005\020\001\"\001\000H\001R\004val2B\005\n\003f" + - "ooB\005\n\003bar*K\n\010TestEnum\022\031\n\025TEST_ENUM_UNSPE" + - "CIFIED\020\000\022\021\n\rTEST_ENUM_ONE\020\001\022\021\n\rTEST_ENUM" + - "_TWO\020\002*\311\001\n\rTestEnumAlias\022\037\n\033TEST_ENUM_AL" + - "IAS_UNSPECIFIED\020\000\022\025\n\021TEST_ENUM_ALIAS_A\020\001" + - "\022\025\n\021TEST_ENUM_ALIAS_B\020\002\022\025\n\021TEST_ENUM_ALI" + - "AS_C\020\003\022\031\n\025TEST_ENUM_ALIAS_ALPHA\020\001\022\030\n\024TES" + - "T_ENUM_ALIAS_BETA\020\002\022\031\n\025TEST_ENUM_ALIAS_G" + - "AMMA\020\003\032\002\020\001B\316\001\n$build.buf.validate.confor" + - "mance.casesB\nEnumsProtoP\001\242\002\004BVCC\252\002\036Buf.V" + - "alidate.Conformance.Cases\312\002\036Buf\\Validate" + - "\\Conformance\\Cases\342\002*Buf\\Validate\\Confor" + - "mance\\Cases\\GPBMetadata\352\002!Buf::Validate:" + - ":Conformance::Casesb\006proto3" + "TestEnumAliasB\n\272H\007\202\001\004\030\000\030\002R\003val\"Q\n\tEnumNo" + + "tIn\022D\n\003val\030\001 \001(\0162(.buf.validate.conforma" + + "nce.cases.TestEnumB\010\272H\005\202\001\002 \001R\003val\"[\n\016Enu" + + "mAliasNotIn\022I\n\003val\030\001 \001(\0162-.buf.validate." + + "conformance.cases.TestEnumAliasB\010\272H\005\202\001\002 " + + "\001R\003val\"j\n\014EnumExternal\022Z\n\003val\030\001 \001(\0162>.bu" + + "f.validate.conformance.cases.other_packa" + + "ge.Embed.EnumeratedB\010\272H\005\202\001\002\020\001R\003val\"}\n\rEn" + + "umExternal2\022l\n\003val\030\001 \001(\0162P.buf.validate." + + "conformance.cases.other_package.Embed.Do" + + "ubleEmbed.DoubleEnumeratedB\010\272H\005\202\001\002\020\001R\003va" + + "l\"`\n\023RepeatedEnumDefined\022I\n\003val\030\001 \003(\0162(." + + "buf.validate.conformance.cases.TestEnumB" + + "\r\272H\n\222\001\007\"\005\202\001\002\020\001R\003val\"~\n\033RepeatedExternalE" + + "numDefined\022_\n\003val\030\001 \003(\0162>.buf.validate.c" + + "onformance.cases.other_package.Embed.Enu" + + "meratedB\r\272H\n\222\001\007\"\005\202\001\002\020\001R\003val\"\216\001\n%Repeated" + + "YetAnotherExternalEnumDefined\022e\n\003val\030\001 \003" + + "(\0162D.buf.validate.conformance.cases.yet_" + + "another_package.Embed.EnumeratedB\r\272H\n\222\001\007" + + "\"\005\202\001\002\020\001R\003val\"\314\001\n\016MapEnumDefined\022X\n\003val\030\001" + + " \003(\01327.buf.validate.conformance.cases.Ma" + + "pEnumDefined.ValEntryB\r\272H\n\232\001\007*\005\202\001\002\020\001R\003va" + + "l\032`\n\010ValEntry\022\020\n\003key\030\001 \001(\tR\003key\022>\n\005value" + + "\030\002 \001(\0162(.buf.validate.conformance.cases." + + "TestEnumR\005value:\0028\001\"\362\001\n\026MapExternalEnumD" + + "efined\022`\n\003val\030\001 \003(\0132?.buf.validate.confo" + + "rmance.cases.MapExternalEnumDefined.ValE" + + "ntryB\r\272H\n\232\001\007*\005\202\001\002\020\001R\003val\032v\n\010ValEntry\022\020\n\003" + + "key\030\001 \001(\tR\003key\022T\n\005value\030\002 \001(\0162>.buf.vali" + + "date.conformance.cases.other_package.Emb" + + "ed.EnumeratedR\005value:\0028\001\"\263\001\n\017EnumInsideO" + + "neof\022F\n\003val\030\001 \001(\0162(.buf.validate.conform" + + "ance.cases.TestEnumB\010\272H\005\202\001\002\020\001H\000R\003val\022J\n\004" + + "val2\030\002 \001(\0162(.buf.validate.conformance.ca" + + "ses.TestEnumB\n\272H\007\202\001\004\020\001 \000H\001R\004val2B\005\n\003fooB" + + "\005\n\003bar\"S\n\013EnumExample\022D\n\003val\030\001 \001(\0162(.buf" + + ".validate.conformance.cases.TestEnumB\010\272H" + + "\005\202\001\002(\002R\003val*K\n\010TestEnum\022\031\n\025TEST_ENUM_UNS" + + "PECIFIED\020\000\022\021\n\rTEST_ENUM_ONE\020\001\022\021\n\rTEST_EN" + + "UM_TWO\020\002*\311\001\n\rTestEnumAlias\022\037\n\033TEST_ENUM_" + + "ALIAS_UNSPECIFIED\020\000\022\025\n\021TEST_ENUM_ALIAS_A" + + "\020\001\022\025\n\021TEST_ENUM_ALIAS_B\020\002\022\025\n\021TEST_ENUM_A" + + "LIAS_C\020\003\022\031\n\025TEST_ENUM_ALIAS_ALPHA\020\001\022\030\n\024T" + + "EST_ENUM_ALIAS_BETA\020\002\022\031\n\025TEST_ENUM_ALIAS" + + "_GAMMA\020\003\032\002\020\001B\316\001\n$build.buf.validate.conf" + + "ormance.casesB\nEnumsProtoP\001\242\002\004BVCC\252\002\036Buf" + + ".Validate.Conformance.Cases\312\002\036Buf\\Valida" + + "te\\Conformance\\Cases\342\002*Buf\\Validate\\Conf" + + "ormance\\Cases\\GPBMetadata\352\002!Buf::Validat" + + "e::Conformance::Casesb\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor .internalBuildGeneratedFileFrom(descriptorData, @@ -320,6 +327,12 @@ public static void registerAllExtensions( com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_EnumInsideOneof_descriptor, new java.lang.String[] { "Val", "Val2", "Foo", "Bar", }); + internal_static_buf_validate_conformance_cases_EnumExample_descriptor = + getDescriptor().getMessageTypes().get(17); + internal_static_buf_validate_conformance_cases_EnumExample_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_EnumExample_descriptor, + new java.lang.String[] { "Val", }); descriptor.resolveAllFeaturesImmutable(); build.buf.validate.conformance.cases.other_package.EmbedProto.getDescriptor(); build.buf.validate.conformance.cases.yet_another_package.Embed2Proto.getDescriptor(); diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Fixed32Example.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Fixed32Example.java new file mode 100644 index 00000000..6171313e --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Fixed32Example.java @@ -0,0 +1,431 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/numbers.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.Fixed32Example} + */ +public final class Fixed32Example extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.Fixed32Example) + Fixed32ExampleOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 1, + /* suffix= */ "", + Fixed32Example.class.getName()); + } + // Use Fixed32Example.newBuilder() to construct. + private Fixed32Example(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private Fixed32Example() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.NumbersProto.internal_static_buf_validate_conformance_cases_Fixed32Example_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.NumbersProto.internal_static_buf_validate_conformance_cases_Fixed32Example_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Fixed32Example.class, build.buf.validate.conformance.cases.Fixed32Example.Builder.class); + } + + public static final int VAL_FIELD_NUMBER = 1; + private int val_ = 0; + /** + * fixed32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public int getVal() { + return val_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (val_ != 0) { + output.writeFixed32(1, val_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (val_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeFixed32Size(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.Fixed32Example)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.Fixed32Example other = (build.buf.validate.conformance.cases.Fixed32Example) obj; + + if (getVal() + != other.getVal()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + VAL_FIELD_NUMBER; + hash = (53 * hash) + getVal(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.Fixed32Example parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Fixed32Example 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.Fixed32Example parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Fixed32Example 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.Fixed32Example parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Fixed32Example 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.Fixed32Example parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Fixed32Example 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.Fixed32Example parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.Fixed32Example 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.Fixed32Example 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.Fixed32Example 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.Fixed32Example 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.Fixed32Example} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.Fixed32Example) + build.buf.validate.conformance.cases.Fixed32ExampleOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.NumbersProto.internal_static_buf_validate_conformance_cases_Fixed32Example_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.NumbersProto.internal_static_buf_validate_conformance_cases_Fixed32Example_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Fixed32Example.class, build.buf.validate.conformance.cases.Fixed32Example.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.Fixed32Example.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + val_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.NumbersProto.internal_static_buf_validate_conformance_cases_Fixed32Example_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Fixed32Example getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.Fixed32Example.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Fixed32Example build() { + build.buf.validate.conformance.cases.Fixed32Example result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Fixed32Example buildPartial() { + build.buf.validate.conformance.cases.Fixed32Example result = new build.buf.validate.conformance.cases.Fixed32Example(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.Fixed32Example 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.Fixed32Example) { + return mergeFrom((build.buf.validate.conformance.cases.Fixed32Example)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.Fixed32Example other) { + if (other == build.buf.validate.conformance.cases.Fixed32Example.getDefaultInstance()) return this; + if (other.getVal() != 0) { + setVal(other.getVal()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 13: { + val_ = input.readFixed32(); + bitField0_ |= 0x00000001; + break; + } // case 13 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private int val_ ; + /** + * fixed32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public int getVal() { + return val_; + } + /** + * fixed32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param value The val to set. + * @return This builder for chaining. + */ + public Builder setVal(int value) { + + val_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * fixed32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return This builder for chaining. + */ + public Builder clearVal() { + bitField0_ = (bitField0_ & ~0x00000001); + val_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.Fixed32Example) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.Fixed32Example) + private static final build.buf.validate.conformance.cases.Fixed32Example DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.Fixed32Example(); + } + + public static build.buf.validate.conformance.cases.Fixed32Example getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Fixed32Example 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.Fixed32Example getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Fixed32ExampleOrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Fixed32ExampleOrBuilder.java new file mode 100644 index 00000000..b75ed2ef --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Fixed32ExampleOrBuilder.java @@ -0,0 +1,17 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/numbers.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +public interface Fixed32ExampleOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.Fixed32Example) + com.google.protobuf.MessageOrBuilder { + + /** + * fixed32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + int getVal(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Fixed64Example.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Fixed64Example.java new file mode 100644 index 00000000..25d28ba9 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Fixed64Example.java @@ -0,0 +1,432 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/numbers.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.Fixed64Example} + */ +public final class Fixed64Example extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.Fixed64Example) + Fixed64ExampleOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 1, + /* suffix= */ "", + Fixed64Example.class.getName()); + } + // Use Fixed64Example.newBuilder() to construct. + private Fixed64Example(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private Fixed64Example() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.NumbersProto.internal_static_buf_validate_conformance_cases_Fixed64Example_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.NumbersProto.internal_static_buf_validate_conformance_cases_Fixed64Example_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Fixed64Example.class, build.buf.validate.conformance.cases.Fixed64Example.Builder.class); + } + + public static final int VAL_FIELD_NUMBER = 1; + private long val_ = 0L; + /** + * fixed64 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public long getVal() { + return val_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (val_ != 0L) { + output.writeFixed64(1, val_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (val_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeFixed64Size(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.Fixed64Example)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.Fixed64Example other = (build.buf.validate.conformance.cases.Fixed64Example) obj; + + if (getVal() + != other.getVal()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + VAL_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getVal()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.Fixed64Example parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Fixed64Example 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.Fixed64Example parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Fixed64Example 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.Fixed64Example parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Fixed64Example 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.Fixed64Example parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Fixed64Example 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.Fixed64Example parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.Fixed64Example 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.Fixed64Example 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.Fixed64Example 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.Fixed64Example 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.Fixed64Example} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.Fixed64Example) + build.buf.validate.conformance.cases.Fixed64ExampleOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.NumbersProto.internal_static_buf_validate_conformance_cases_Fixed64Example_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.NumbersProto.internal_static_buf_validate_conformance_cases_Fixed64Example_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Fixed64Example.class, build.buf.validate.conformance.cases.Fixed64Example.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.Fixed64Example.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + val_ = 0L; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.NumbersProto.internal_static_buf_validate_conformance_cases_Fixed64Example_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Fixed64Example getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.Fixed64Example.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Fixed64Example build() { + build.buf.validate.conformance.cases.Fixed64Example result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Fixed64Example buildPartial() { + build.buf.validate.conformance.cases.Fixed64Example result = new build.buf.validate.conformance.cases.Fixed64Example(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.Fixed64Example 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.Fixed64Example) { + return mergeFrom((build.buf.validate.conformance.cases.Fixed64Example)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.Fixed64Example other) { + if (other == build.buf.validate.conformance.cases.Fixed64Example.getDefaultInstance()) return this; + if (other.getVal() != 0L) { + setVal(other.getVal()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 9: { + val_ = input.readFixed64(); + bitField0_ |= 0x00000001; + break; + } // case 9 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private long val_ ; + /** + * fixed64 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public long getVal() { + return val_; + } + /** + * fixed64 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param value The val to set. + * @return This builder for chaining. + */ + public Builder setVal(long value) { + + val_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * fixed64 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return This builder for chaining. + */ + public Builder clearVal() { + bitField0_ = (bitField0_ & ~0x00000001); + val_ = 0L; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.Fixed64Example) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.Fixed64Example) + private static final build.buf.validate.conformance.cases.Fixed64Example DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.Fixed64Example(); + } + + public static build.buf.validate.conformance.cases.Fixed64Example getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Fixed64Example 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.Fixed64Example getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Fixed64ExampleOrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Fixed64ExampleOrBuilder.java new file mode 100644 index 00000000..f396b435 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Fixed64ExampleOrBuilder.java @@ -0,0 +1,17 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/numbers.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +public interface Fixed64ExampleOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.Fixed64Example) + com.google.protobuf.MessageOrBuilder { + + /** + * fixed64 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + long getVal(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/FloatExample.java b/conformance/src/main/java/build/buf/validate/conformance/cases/FloatExample.java new file mode 100644 index 00000000..f84e2888 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/FloatExample.java @@ -0,0 +1,433 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/numbers.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.FloatExample} + */ +public final class FloatExample extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.FloatExample) + FloatExampleOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 1, + /* suffix= */ "", + FloatExample.class.getName()); + } + // Use FloatExample.newBuilder() to construct. + private FloatExample(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private FloatExample() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.NumbersProto.internal_static_buf_validate_conformance_cases_FloatExample_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.NumbersProto.internal_static_buf_validate_conformance_cases_FloatExample_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.FloatExample.class, build.buf.validate.conformance.cases.FloatExample.Builder.class); + } + + public static final int VAL_FIELD_NUMBER = 1; + private float val_ = 0F; + /** + * float val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public float getVal() { + return val_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (java.lang.Float.floatToRawIntBits(val_) != 0) { + output.writeFloat(1, val_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (java.lang.Float.floatToRawIntBits(val_) != 0) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(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.FloatExample)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.FloatExample other = (build.buf.validate.conformance.cases.FloatExample) obj; + + if (java.lang.Float.floatToIntBits(getVal()) + != java.lang.Float.floatToIntBits( + 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) + java.lang.Float.floatToIntBits( + getVal()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.FloatExample parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.FloatExample 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.FloatExample parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.FloatExample 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.FloatExample parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.FloatExample 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.FloatExample parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.FloatExample 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.FloatExample parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.FloatExample 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.FloatExample 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.FloatExample 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.FloatExample 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.FloatExample} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.FloatExample) + build.buf.validate.conformance.cases.FloatExampleOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.NumbersProto.internal_static_buf_validate_conformance_cases_FloatExample_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.NumbersProto.internal_static_buf_validate_conformance_cases_FloatExample_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.FloatExample.class, build.buf.validate.conformance.cases.FloatExample.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.FloatExample.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + val_ = 0F; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.NumbersProto.internal_static_buf_validate_conformance_cases_FloatExample_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.FloatExample getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.FloatExample.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.FloatExample build() { + build.buf.validate.conformance.cases.FloatExample result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.FloatExample buildPartial() { + build.buf.validate.conformance.cases.FloatExample result = new build.buf.validate.conformance.cases.FloatExample(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.FloatExample 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.FloatExample) { + return mergeFrom((build.buf.validate.conformance.cases.FloatExample)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.FloatExample other) { + if (other == build.buf.validate.conformance.cases.FloatExample.getDefaultInstance()) return this; + if (other.getVal() != 0F) { + setVal(other.getVal()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 13: { + val_ = input.readFloat(); + bitField0_ |= 0x00000001; + break; + } // case 13 + 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 float val_ ; + /** + * float val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public float getVal() { + return val_; + } + /** + * float val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param value The val to set. + * @return This builder for chaining. + */ + public Builder setVal(float value) { + + val_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * float val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return This builder for chaining. + */ + public Builder clearVal() { + bitField0_ = (bitField0_ & ~0x00000001); + val_ = 0F; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.FloatExample) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.FloatExample) + private static final build.buf.validate.conformance.cases.FloatExample DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.FloatExample(); + } + + public static build.buf.validate.conformance.cases.FloatExample getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public FloatExample 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.FloatExample getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/FloatExampleOrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/FloatExampleOrBuilder.java new file mode 100644 index 00000000..a04d6dcc --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/FloatExampleOrBuilder.java @@ -0,0 +1,17 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/numbers.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +public interface FloatExampleOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.FloatExample) + com.google.protobuf.MessageOrBuilder { + + /** + * float val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + float getVal(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/FloatNotFinite.java b/conformance/src/main/java/build/buf/validate/conformance/cases/FloatNotFinite.java new file mode 100644 index 00000000..f00bbcae --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/FloatNotFinite.java @@ -0,0 +1,433 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/numbers.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.FloatNotFinite} + */ +public final class FloatNotFinite extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.FloatNotFinite) + FloatNotFiniteOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 1, + /* suffix= */ "", + FloatNotFinite.class.getName()); + } + // Use FloatNotFinite.newBuilder() to construct. + private FloatNotFinite(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private FloatNotFinite() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.NumbersProto.internal_static_buf_validate_conformance_cases_FloatNotFinite_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.NumbersProto.internal_static_buf_validate_conformance_cases_FloatNotFinite_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.FloatNotFinite.class, build.buf.validate.conformance.cases.FloatNotFinite.Builder.class); + } + + public static final int VAL_FIELD_NUMBER = 1; + private float val_ = 0F; + /** + * float val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public float getVal() { + return val_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (java.lang.Float.floatToRawIntBits(val_) != 0) { + output.writeFloat(1, val_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (java.lang.Float.floatToRawIntBits(val_) != 0) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(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.FloatNotFinite)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.FloatNotFinite other = (build.buf.validate.conformance.cases.FloatNotFinite) obj; + + if (java.lang.Float.floatToIntBits(getVal()) + != java.lang.Float.floatToIntBits( + 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) + java.lang.Float.floatToIntBits( + getVal()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.FloatNotFinite parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.FloatNotFinite 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.FloatNotFinite parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.FloatNotFinite 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.FloatNotFinite parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.FloatNotFinite 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.FloatNotFinite parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.FloatNotFinite 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.FloatNotFinite parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.FloatNotFinite 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.FloatNotFinite 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.FloatNotFinite 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.FloatNotFinite 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.FloatNotFinite} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.FloatNotFinite) + build.buf.validate.conformance.cases.FloatNotFiniteOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.NumbersProto.internal_static_buf_validate_conformance_cases_FloatNotFinite_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.NumbersProto.internal_static_buf_validate_conformance_cases_FloatNotFinite_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.FloatNotFinite.class, build.buf.validate.conformance.cases.FloatNotFinite.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.FloatNotFinite.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + val_ = 0F; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.NumbersProto.internal_static_buf_validate_conformance_cases_FloatNotFinite_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.FloatNotFinite getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.FloatNotFinite.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.FloatNotFinite build() { + build.buf.validate.conformance.cases.FloatNotFinite result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.FloatNotFinite buildPartial() { + build.buf.validate.conformance.cases.FloatNotFinite result = new build.buf.validate.conformance.cases.FloatNotFinite(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.FloatNotFinite 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.FloatNotFinite) { + return mergeFrom((build.buf.validate.conformance.cases.FloatNotFinite)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.FloatNotFinite other) { + if (other == build.buf.validate.conformance.cases.FloatNotFinite.getDefaultInstance()) return this; + if (other.getVal() != 0F) { + setVal(other.getVal()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 13: { + val_ = input.readFloat(); + bitField0_ |= 0x00000001; + break; + } // case 13 + 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 float val_ ; + /** + * float val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public float getVal() { + return val_; + } + /** + * float val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param value The val to set. + * @return This builder for chaining. + */ + public Builder setVal(float value) { + + val_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * float val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return This builder for chaining. + */ + public Builder clearVal() { + bitField0_ = (bitField0_ & ~0x00000001); + val_ = 0F; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.FloatNotFinite) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.FloatNotFinite) + private static final build.buf.validate.conformance.cases.FloatNotFinite DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.FloatNotFinite(); + } + + public static build.buf.validate.conformance.cases.FloatNotFinite getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public FloatNotFinite 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.FloatNotFinite getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/FloatNotFiniteOrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/FloatNotFiniteOrBuilder.java new file mode 100644 index 00000000..79fb002d --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/FloatNotFiniteOrBuilder.java @@ -0,0 +1,17 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/numbers.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +public interface FloatNotFiniteOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.FloatNotFinite) + com.google.protobuf.MessageOrBuilder { + + /** + * float val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + float getVal(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Int32Example.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Int32Example.java new file mode 100644 index 00000000..d24488b4 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Int32Example.java @@ -0,0 +1,431 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/numbers.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.Int32Example} + */ +public final class Int32Example extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.Int32Example) + Int32ExampleOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 1, + /* suffix= */ "", + Int32Example.class.getName()); + } + // Use Int32Example.newBuilder() to construct. + private Int32Example(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private Int32Example() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.NumbersProto.internal_static_buf_validate_conformance_cases_Int32Example_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.NumbersProto.internal_static_buf_validate_conformance_cases_Int32Example_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Int32Example.class, build.buf.validate.conformance.cases.Int32Example.Builder.class); + } + + public static final int VAL_FIELD_NUMBER = 1; + private int val_ = 0; + /** + * int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public int getVal() { + return val_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (val_ != 0) { + output.writeInt32(1, val_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (val_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(1, val_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof build.buf.validate.conformance.cases.Int32Example)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.Int32Example other = (build.buf.validate.conformance.cases.Int32Example) obj; + + if (getVal() + != other.getVal()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + VAL_FIELD_NUMBER; + hash = (53 * hash) + getVal(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.Int32Example parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Int32Example 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.Int32Example parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Int32Example 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.Int32Example parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Int32Example 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.Int32Example parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Int32Example 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.Int32Example parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.Int32Example 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.Int32Example 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.Int32Example 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.Int32Example 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.Int32Example} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.Int32Example) + build.buf.validate.conformance.cases.Int32ExampleOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.NumbersProto.internal_static_buf_validate_conformance_cases_Int32Example_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.NumbersProto.internal_static_buf_validate_conformance_cases_Int32Example_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Int32Example.class, build.buf.validate.conformance.cases.Int32Example.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.Int32Example.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + val_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.NumbersProto.internal_static_buf_validate_conformance_cases_Int32Example_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Int32Example getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.Int32Example.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Int32Example build() { + build.buf.validate.conformance.cases.Int32Example result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Int32Example buildPartial() { + build.buf.validate.conformance.cases.Int32Example result = new build.buf.validate.conformance.cases.Int32Example(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.Int32Example 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.Int32Example) { + return mergeFrom((build.buf.validate.conformance.cases.Int32Example)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.Int32Example other) { + if (other == build.buf.validate.conformance.cases.Int32Example.getDefaultInstance()) return this; + if (other.getVal() != 0) { + setVal(other.getVal()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + val_ = input.readInt32(); + bitField0_ |= 0x00000001; + break; + } // case 8 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private int val_ ; + /** + * int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public int getVal() { + return val_; + } + /** + * int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param value The val to set. + * @return This builder for chaining. + */ + public Builder setVal(int value) { + + val_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return This builder for chaining. + */ + public Builder clearVal() { + bitField0_ = (bitField0_ & ~0x00000001); + val_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.Int32Example) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.Int32Example) + private static final build.buf.validate.conformance.cases.Int32Example DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.Int32Example(); + } + + public static build.buf.validate.conformance.cases.Int32Example getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Int32Example 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.Int32Example getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Int32ExampleOrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Int32ExampleOrBuilder.java new file mode 100644 index 00000000..623bcead --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Int32ExampleOrBuilder.java @@ -0,0 +1,17 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/numbers.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +public interface Int32ExampleOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.Int32Example) + com.google.protobuf.MessageOrBuilder { + + /** + * int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + int getVal(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Int64Example.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Int64Example.java new file mode 100644 index 00000000..b1472fca --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Int64Example.java @@ -0,0 +1,432 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/numbers.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.Int64Example} + */ +public final class Int64Example extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.Int64Example) + Int64ExampleOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 1, + /* suffix= */ "", + Int64Example.class.getName()); + } + // Use Int64Example.newBuilder() to construct. + private Int64Example(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private Int64Example() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.NumbersProto.internal_static_buf_validate_conformance_cases_Int64Example_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.NumbersProto.internal_static_buf_validate_conformance_cases_Int64Example_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Int64Example.class, build.buf.validate.conformance.cases.Int64Example.Builder.class); + } + + public static final int VAL_FIELD_NUMBER = 1; + private long val_ = 0L; + /** + * int64 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public long getVal() { + return val_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (val_ != 0L) { + output.writeInt64(1, val_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (val_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(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.Int64Example)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.Int64Example other = (build.buf.validate.conformance.cases.Int64Example) obj; + + if (getVal() + != other.getVal()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + VAL_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getVal()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.Int64Example parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Int64Example 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.Int64Example parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Int64Example 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.Int64Example parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Int64Example 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.Int64Example parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Int64Example 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.Int64Example parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.Int64Example 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.Int64Example 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.Int64Example 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.Int64Example 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.Int64Example} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.Int64Example) + build.buf.validate.conformance.cases.Int64ExampleOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.NumbersProto.internal_static_buf_validate_conformance_cases_Int64Example_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.NumbersProto.internal_static_buf_validate_conformance_cases_Int64Example_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Int64Example.class, build.buf.validate.conformance.cases.Int64Example.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.Int64Example.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + val_ = 0L; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.NumbersProto.internal_static_buf_validate_conformance_cases_Int64Example_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Int64Example getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.Int64Example.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Int64Example build() { + build.buf.validate.conformance.cases.Int64Example result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Int64Example buildPartial() { + build.buf.validate.conformance.cases.Int64Example result = new build.buf.validate.conformance.cases.Int64Example(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.Int64Example 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.Int64Example) { + return mergeFrom((build.buf.validate.conformance.cases.Int64Example)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.Int64Example other) { + if (other == build.buf.validate.conformance.cases.Int64Example.getDefaultInstance()) return this; + if (other.getVal() != 0L) { + setVal(other.getVal()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + val_ = input.readInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private long val_ ; + /** + * int64 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public long getVal() { + return val_; + } + /** + * int64 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param value The val to set. + * @return This builder for chaining. + */ + public Builder setVal(long value) { + + val_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * int64 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return This builder for chaining. + */ + public Builder clearVal() { + bitField0_ = (bitField0_ & ~0x00000001); + val_ = 0L; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.Int64Example) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.Int64Example) + private static final build.buf.validate.conformance.cases.Int64Example DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.Int64Example(); + } + + public static build.buf.validate.conformance.cases.Int64Example getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Int64Example 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.Int64Example getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Int64ExampleOrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Int64ExampleOrBuilder.java new file mode 100644 index 00000000..d778921c --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Int64ExampleOrBuilder.java @@ -0,0 +1,17 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/numbers.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +public interface Int64ExampleOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.Int64Example) + com.google.protobuf.MessageOrBuilder { + + /** + * int64 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + long getVal(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/KitchenSinkProto.java b/conformance/src/main/java/build/buf/validate/conformance/cases/KitchenSinkProto.java index a54b22e1..71e0dbc9 100644 --- a/conformance/src/main/java/build/buf/validate/conformance/cases/KitchenSinkProto.java +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/KitchenSinkProto.java @@ -68,7 +68,7 @@ public static void registerAllExtensions( "\022H\n\007another\030\010 \001(\0132..buf.validate.conform" + "ance.cases.ComplexTestMsgR\007another\022+\n\013fl" + "oat_const\030\t \001(\002B\n\272H\007\n\005\025\000\000\000AR\nfloatConst\022" + - "4\n\tdouble_in\030\n \001(\001B\027\272H\024\022\0222\020\264\310v\276\237\214|@\000\000\000\000\000" + + "4\n\tdouble_in\030\n \001(\001B\027\272H\024\022\0221\264\310v\276\237\214|@1\000\000\000\000\000" + "\300^@R\010doubleIn\022X\n\nenum_const\030\013 \001(\0162/.buf." + "validate.conformance.cases.ComplexTestEn" + "umB\010\272H\005\202\001\002\010\002R\tenumConst\022c\n\007any_val\030\014 \001(\013" + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/NumbersProto.java b/conformance/src/main/java/build/buf/validate/conformance/cases/NumbersProto.java index 4e5eba5a..23e8dc9a 100644 --- a/conformance/src/main/java/build/buf/validate/conformance/cases/NumbersProto.java +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/NumbersProto.java @@ -90,6 +90,11 @@ public static void registerAllExtensions( static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_buf_validate_conformance_cases_FloatFinite_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_FloatNotFinite_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_conformance_cases_FloatNotFinite_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_buf_validate_conformance_cases_FloatIgnore_descriptor; static final @@ -100,6 +105,11 @@ public static void registerAllExtensions( static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_buf_validate_conformance_cases_FloatIncorrectType_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_FloatExample_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_conformance_cases_FloatExample_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_buf_validate_conformance_cases_DoubleNone_descriptor; static final @@ -165,6 +175,11 @@ public static void registerAllExtensions( static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_buf_validate_conformance_cases_DoubleFinite_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_DoubleNotFinite_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_conformance_cases_DoubleNotFinite_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_buf_validate_conformance_cases_DoubleIgnore_descriptor; static final @@ -175,6 +190,11 @@ public static void registerAllExtensions( static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_buf_validate_conformance_cases_DoubleIncorrectType_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_DoubleExample_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_conformance_cases_DoubleExample_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_buf_validate_conformance_cases_Int32None_descriptor; static final @@ -245,6 +265,11 @@ public static void registerAllExtensions( static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_buf_validate_conformance_cases_Int32IncorrectType_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_Int32Example_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_conformance_cases_Int32Example_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_buf_validate_conformance_cases_Int64None_descriptor; static final @@ -320,6 +345,11 @@ public static void registerAllExtensions( static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_buf_validate_conformance_cases_Int64IncorrectType_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_Int64Example_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_conformance_cases_Int64Example_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_buf_validate_conformance_cases_UInt32None_descriptor; static final @@ -390,6 +420,11 @@ public static void registerAllExtensions( static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_buf_validate_conformance_cases_UInt32IncorrectType_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_UInt32Example_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_conformance_cases_UInt32Example_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_buf_validate_conformance_cases_UInt64None_descriptor; static final @@ -460,6 +495,11 @@ public static void registerAllExtensions( static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_buf_validate_conformance_cases_UInt64IncorrectType_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_UInt64Example_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_conformance_cases_UInt64Example_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_buf_validate_conformance_cases_SInt32None_descriptor; static final @@ -530,6 +570,11 @@ public static void registerAllExtensions( static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_buf_validate_conformance_cases_SInt32IncorrectType_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_SInt32Example_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_conformance_cases_SInt32Example_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_buf_validate_conformance_cases_SInt64None_descriptor; static final @@ -600,6 +645,11 @@ public static void registerAllExtensions( static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_buf_validate_conformance_cases_SInt64IncorrectType_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_SInt64Example_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_conformance_cases_SInt64Example_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_buf_validate_conformance_cases_Fixed32None_descriptor; static final @@ -670,6 +720,11 @@ public static void registerAllExtensions( static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_buf_validate_conformance_cases_Fixed32IncorrectType_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_Fixed32Example_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_conformance_cases_Fixed32Example_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_buf_validate_conformance_cases_Fixed64None_descriptor; static final @@ -740,6 +795,11 @@ public static void registerAllExtensions( static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_buf_validate_conformance_cases_Fixed64IncorrectType_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_Fixed64Example_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_conformance_cases_Fixed64Example_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_buf_validate_conformance_cases_SFixed32None_descriptor; static final @@ -810,6 +870,11 @@ public static void registerAllExtensions( static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_buf_validate_conformance_cases_SFixed32IncorrectType_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_SFixed32Example_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_conformance_cases_SFixed32Example_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_buf_validate_conformance_cases_SFixed64None_descriptor; static final @@ -880,6 +945,11 @@ public static void registerAllExtensions( static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_buf_validate_conformance_cases_SFixed64IncorrectType_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_SFixed64Example_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_conformance_cases_SFixed64Example_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_buf_validate_conformance_cases_Int64LTEOptional_descriptor; static final @@ -899,221 +969,237 @@ public static void registerAllExtensions( "buf/validate/validate.proto\"\035\n\tFloatNone" + "\022\020\n\003val\030\001 \001(\002R\003val\"*\n\nFloatConst\022\034\n\003val\030" + "\001 \001(\002B\n\272H\007\n\005\r\244p\235?R\003val\",\n\007FloatIn\022!\n\003val" + - "\030\001 \001(\002B\017\272H\014\n\n2\010\205\353\221@\341z\374@R\003val\"+\n\nFloatNot" + - "In\022\035\n\003val\030\001 \001(\002B\013\272H\010\n\006:\004\000\000\000\000R\003val\"\'\n\007Flo" + - "atLT\022\034\n\003val\030\001 \001(\002B\n\272H\007\n\005\025\000\000\000\000R\003val\"(\n\010Fl" + - "oatLTE\022\034\n\003val\030\001 \001(\002B\n\272H\007\n\005\035\000\000\200BR\003val\"\'\n\007" + - "FloatGT\022\034\n\003val\030\001 \001(\002B\n\272H\007\n\005%\000\000\200AR\003val\"(\n" + - "\010FloatGTE\022\034\n\003val\030\001 \001(\002B\n\272H\007\n\005-\000\000\000AR\003val\"" + - ".\n\tFloatGTLT\022!\n\003val\030\001 \001(\002B\017\272H\014\n\n\025\000\000 A%\000\000" + - "\000\000R\003val\"0\n\013FloatExLTGT\022!\n\003val\030\001 \001(\002B\017\272H\014" + - "\n\n\025\000\000\000\000%\000\000 AR\003val\"0\n\013FloatGTELTE\022!\n\003val\030" + - "\001 \001(\002B\017\272H\014\n\n\035\000\000\200C-\000\000\000CR\003val\"2\n\rFloatExGT" + - "ELTE\022!\n\003val\030\001 \001(\002B\017\272H\014\n\n\035\000\000\000C-\000\000\200CR\003val\"" + - "(\n\013FloatFinite\022\031\n\003val\030\001 \001(\002B\007\272H\004\n\002@\001R\003va" + - "l\"3\n\013FloatIgnore\022$\n\003val\030\001 \001(\002B\022\272H\017\n\n\035\000\000\200" + - "C-\000\000\000C\320\001\001R\003val\"6\n\022FloatIncorrectType\022 \n\003" + - "val\030\001 \001(\002B\016\272H\013\022\t!\000\000\000\000\000\000\000\000R\003val\"\036\n\nDouble" + - "None\022\020\n\003val\030\001 \001(\001R\003val\"/\n\013DoubleConst\022 \n" + - "\003val\030\001 \001(\001B\016\272H\013\022\t\t\256G\341z\024\256\363?R\003val\"5\n\010Doubl" + - "eIn\022)\n\003val\030\001 \001(\001B\027\272H\024\022\0222\020=\n\327\243p=\022@\217\302\365(\\\217\037" + - "@R\003val\"0\n\013DoubleNotIn\022!\n\003val\030\001 \001(\001B\017\272H\014\022" + - "\n:\010\000\000\000\000\000\000\000\000R\003val\",\n\010DoubleLT\022 \n\003val\030\001 \001(" + - "\001B\016\272H\013\022\t\021\000\000\000\000\000\000\000\000R\003val\"-\n\tDoubleLTE\022 \n\003v" + - "al\030\001 \001(\001B\016\272H\013\022\t\031\000\000\000\000\000\000P@R\003val\",\n\010DoubleG" + - "T\022 \n\003val\030\001 \001(\001B\016\272H\013\022\t!\000\000\000\000\000\0000@R\003val\"-\n\tD" + - "oubleGTE\022 \n\003val\030\001 \001(\001B\016\272H\013\022\t)\000\000\000\000\000\000 @R\003v" + - "al\"7\n\nDoubleGTLT\022)\n\003val\030\001 \001(\001B\027\272H\024\022\022\021\000\000\000" + - "\000\000\000$@!\000\000\000\000\000\000\000\000R\003val\"9\n\014DoubleExLTGT\022)\n\003v" + - "al\030\001 \001(\001B\027\272H\024\022\022\021\000\000\000\000\000\000\000\000!\000\000\000\000\000\000$@R\003val\"9" + - "\n\014DoubleGTELTE\022)\n\003val\030\001 \001(\001B\027\272H\024\022\022\031\000\000\000\000\000" + - "\000p@)\000\000\000\000\000\000`@R\003val\";\n\016DoubleExGTELTE\022)\n\003v" + - "al\030\001 \001(\001B\027\272H\024\022\022\031\000\000\000\000\000\000`@)\000\000\000\000\000\000p@R\003val\")" + - "\n\014DoubleFinite\022\031\n\003val\030\001 \001(\001B\007\272H\004\022\002@\001R\003va" + - "l\"<\n\014DoubleIgnore\022,\n\003val\030\001 \001(\001B\032\272H\027\022\022\031\000\000" + - "\000\000\000\000p@)\000\000\000\000\000\000`@\320\001\001R\003val\"3\n\023DoubleIncorre" + - "ctType\022\034\n\003val\030\001 \001(\001B\n\272H\007\n\005%\000\000\000\000R\003val\"\035\n\t" + - "Int32None\022\020\n\003val\030\001 \001(\005R\003val\"\'\n\nInt32Cons" + - "t\022\031\n\003val\030\001 \001(\005B\007\272H\004\032\002\010\001R\003val\"&\n\007Int32In\022" + - "\033\n\003val\030\001 \001(\005B\t\272H\006\032\0042\002\002\003R\003val\"(\n\nInt32Not" + - "In\022\032\n\003val\030\001 \001(\005B\010\272H\005\032\003:\001\000R\003val\"$\n\007Int32L" + - "T\022\031\n\003val\030\001 \001(\005B\007\272H\004\032\002\020\000R\003val\"%\n\010Int32LTE" + - "\022\031\n\003val\030\001 \001(\005B\007\272H\004\032\002\030@R\003val\"$\n\007Int32GT\022\031" + - "\n\003val\030\001 \001(\005B\007\272H\004\032\002 \020R\003val\"%\n\010Int32GTE\022\031\n" + - "\003val\030\001 \001(\005B\007\272H\004\032\002(\010R\003val\"(\n\tInt32GTLT\022\033\n" + - "\003val\030\001 \001(\005B\t\272H\006\032\004\020\n \000R\003val\"*\n\013Int32ExLTG" + - "T\022\033\n\003val\030\001 \001(\005B\t\272H\006\032\004\020\000 \nR\003val\",\n\013Int32G" + - "TELTE\022\035\n\003val\030\001 \001(\005B\013\272H\010\032\006\030\200\002(\200\001R\003val\".\n\r" + - "Int32ExGTELTE\022\035\n\003val\030\001 \001(\005B\013\272H\010\032\006\030\200\001(\200\002R" + - "\003val\"/\n\013Int32Ignore\022 \n\003val\030\001 \001(\005B\016\272H\013\032\006\030" + - "\200\002(\200\001\320\001\001R\003val\"2\n\022Int32IncorrectType\022\034\n\003v" + - "al\030\001 \001(\005B\n\272H\007\n\005%\000\000\000\000R\003val\"\035\n\tInt64None\022\020" + - "\n\003val\030\001 \001(\003R\003val\"\'\n\nInt64Const\022\031\n\003val\030\001 " + - "\001(\003B\007\272H\004\"\002\010\001R\003val\"&\n\007Int64In\022\033\n\003val\030\001 \001(" + - "\003B\t\272H\006\"\0042\002\002\003R\003val\"(\n\nInt64NotIn\022\032\n\003val\030\001" + - " \001(\003B\010\272H\005\"\003:\001\000R\003val\"$\n\007Int64LT\022\031\n\003val\030\001 " + - "\001(\003B\007\272H\004\"\002\020\000R\003val\"%\n\010Int64LTE\022\031\n\003val\030\001 \001" + - "(\003B\007\272H\004\"\002\030@R\003val\"$\n\007Int64GT\022\031\n\003val\030\001 \001(\003" + - "B\007\272H\004\"\002 \020R\003val\"%\n\010Int64GTE\022\031\n\003val\030\001 \001(\003B" + - "\007\272H\004\"\002(\010R\003val\"(\n\tInt64GTLT\022\033\n\003val\030\001 \001(\003B" + - "\t\272H\006\"\004\020\n \000R\003val\"*\n\013Int64ExLTGT\022\033\n\003val\030\001 " + - "\001(\003B\t\272H\006\"\004\020\000 \nR\003val\",\n\013Int64GTELTE\022\035\n\003va" + - "l\030\001 \001(\003B\013\272H\010\"\006\030\200\002(\200\001R\003val\".\n\rInt64ExGTEL" + - "TE\022\035\n\003val\030\001 \001(\003B\013\272H\010\"\006\030\200\001(\200\002R\003val\"/\n\013Int" + - "64Ignore\022 \n\003val\030\001 \001(\003B\016\272H\013\"\006\030\200\002(\200\001\320\001\001R\003v" + - "al\"\214\004\n\023Int64BigConstraints\022\"\n\006lt_pos\030\001 \001" + - "(\003B\013\272H\010\"\006\020\246\335\207\244\024R\005ltPos\022\'\n\006lt_neg\030\002 \001(\003B\020" + - "\272H\r\"\013\020\332\242\370\333\353\377\377\377\377\001R\005ltNeg\022\"\n\006gt_pos\030\003 \001(\003B" + - "\013\272H\010\"\006 \246\335\207\244\024R\005gtPos\022\'\n\006gt_neg\030\004 \001(\003B\020\272H\r" + - "\"\013 \332\242\370\333\353\377\377\377\377\001R\005gtNeg\022$\n\007lte_pos\030\005 \001(\003B\013\272" + - "H\010\"\006\030\246\335\207\244\024R\006ltePos\022)\n\007lte_neg\030\006 \001(\003B\020\272H\r" + - "\"\013\030\332\242\370\333\353\377\377\377\377\001R\006lteNeg\022$\n\007gte_pos\030\007 \001(\003B\013" + - "\272H\010\"\006(\246\335\207\244\024R\006gtePos\022)\n\007gte_neg\030\010 \001(\003B\020\272H" + - "\r\"\013(\332\242\370\333\353\377\377\377\377\001R\006gteNeg\022.\n\014constant_pos\030\t" + - " \001(\003B\013\272H\010\"\006\010\246\335\207\244\024R\013constantPos\0223\n\014consta" + - "nt_neg\030\n \001(\003B\020\272H\r\"\013\010\332\242\370\333\353\377\377\377\377\001R\013constant" + - "Neg\022&\n\002in\030\013 \001(\003B\026\272H\023\"\0212\017\246\335\207\244\024\332\242\370\333\353\377\377\377\377\001R" + - "\002in\022,\n\005notin\030\014 \001(\003B\026\272H\023\"\021:\017\246\335\207\244\024\332\242\370\333\353\377\377\377" + - "\377\001R\005notin\"2\n\022Int64IncorrectType\022\034\n\003val\030\001" + - " \001(\003B\n\272H\007\n\005%\000\000\000\000R\003val\"\036\n\nUInt32None\022\020\n\003v" + - "al\030\001 \001(\rR\003val\"(\n\013UInt32Const\022\031\n\003val\030\001 \001(" + - "\rB\007\272H\004*\002\010\001R\003val\"\'\n\010UInt32In\022\033\n\003val\030\001 \001(\r" + - "B\t\272H\006*\0042\002\002\003R\003val\")\n\013UInt32NotIn\022\032\n\003val\030\001" + - " \001(\rB\010\272H\005*\003:\001\000R\003val\"%\n\010UInt32LT\022\031\n\003val\030\001" + - " \001(\rB\007\272H\004*\002\020\005R\003val\"&\n\tUInt32LTE\022\031\n\003val\030\001" + - " \001(\rB\007\272H\004*\002\030@R\003val\"%\n\010UInt32GT\022\031\n\003val\030\001 " + - "\001(\rB\007\272H\004*\002 \020R\003val\"&\n\tUInt32GTE\022\031\n\003val\030\001 " + - "\001(\rB\007\272H\004*\002(\010R\003val\")\n\nUInt32GTLT\022\033\n\003val\030\001" + - " \001(\rB\t\272H\006*\004\020\n \005R\003val\"+\n\014UInt32ExLTGT\022\033\n\003" + - "val\030\001 \001(\rB\t\272H\006*\004\020\005 \nR\003val\"-\n\014UInt32GTELT" + - "E\022\035\n\003val\030\001 \001(\rB\013\272H\010*\006\030\200\002(\200\001R\003val\"/\n\016UInt" + - "32ExGTELTE\022\035\n\003val\030\001 \001(\rB\013\272H\010*\006\030\200\001(\200\002R\003va" + - "l\"0\n\014UInt32Ignore\022 \n\003val\030\001 \001(\rB\016\272H\013*\006\030\200\002" + - "(\200\001\320\001\001R\003val\"3\n\023UInt32IncorrectType\022\034\n\003va" + - "l\030\001 \001(\rB\n\272H\007\n\005%\000\000\000\000R\003val\"\036\n\nUInt64None\022\020" + - "\n\003val\030\001 \001(\004R\003val\"(\n\013UInt64Const\022\031\n\003val\030\001" + - " \001(\004B\007\272H\0042\002\010\001R\003val\"\'\n\010UInt64In\022\033\n\003val\030\001 " + - "\001(\004B\t\272H\0062\0042\002\002\003R\003val\")\n\013UInt64NotIn\022\032\n\003va" + - "l\030\001 \001(\004B\010\272H\0052\003:\001\000R\003val\"%\n\010UInt64LT\022\031\n\003va" + - "l\030\001 \001(\004B\007\272H\0042\002\020\005R\003val\"&\n\tUInt64LTE\022\031\n\003va" + - "l\030\001 \001(\004B\007\272H\0042\002\030@R\003val\"%\n\010UInt64GT\022\031\n\003val" + - "\030\001 \001(\004B\007\272H\0042\002 \020R\003val\"&\n\tUInt64GTE\022\031\n\003val" + - "\030\001 \001(\004B\007\272H\0042\002(\010R\003val\")\n\nUInt64GTLT\022\033\n\003va" + - "l\030\001 \001(\004B\t\272H\0062\004\020\n \005R\003val\"+\n\014UInt64ExLTGT\022" + - "\033\n\003val\030\001 \001(\004B\t\272H\0062\004\020\005 \nR\003val\"-\n\014UInt64GT" + - "ELTE\022\035\n\003val\030\001 \001(\004B\013\272H\0102\006\030\200\002(\200\001R\003val\"/\n\016U" + - "Int64ExGTELTE\022\035\n\003val\030\001 \001(\004B\013\272H\0102\006\030\200\001(\200\002R" + - "\003val\"0\n\014UInt64Ignore\022 \n\003val\030\001 \001(\004B\016\272H\0132\006" + - "\030\200\002(\200\001\320\001\001R\003val\"3\n\023UInt64IncorrectType\022\034\n" + - "\003val\030\001 \001(\004B\n\272H\007\n\005%\000\000\000\000R\003val\"\036\n\nSInt32Non" + - "e\022\020\n\003val\030\001 \001(\021R\003val\"(\n\013SInt32Const\022\031\n\003va" + - "l\030\001 \001(\021B\007\272H\004:\002\010\002R\003val\"\'\n\010SInt32In\022\033\n\003val" + - "\030\001 \001(\021B\t\272H\006:\0042\002\004\006R\003val\")\n\013SInt32NotIn\022\032\n" + - "\003val\030\001 \001(\021B\010\272H\005:\003:\001\000R\003val\"%\n\010SInt32LT\022\031\n" + - "\003val\030\001 \001(\021B\007\272H\004:\002\020\000R\003val\"\'\n\tSInt32LTE\022\032\n" + - "\003val\030\001 \001(\021B\010\272H\005:\003\030\200\001R\003val\"%\n\010SInt32GT\022\031\n" + - "\003val\030\001 \001(\021B\007\272H\004:\002 R\003val\"&\n\tSInt32GTE\022\031\n" + - "\003val\030\001 \001(\021B\007\272H\004:\002(\020R\003val\")\n\nSInt32GTLT\022\033" + - "\n\003val\030\001 \001(\021B\t\272H\006:\004\020\024 \000R\003val\"+\n\014SInt32ExL" + - "TGT\022\033\n\003val\030\001 \001(\021B\t\272H\006:\004\020\000 \024R\003val\"-\n\014SInt" + - "32GTELTE\022\035\n\003val\030\001 \001(\021B\013\272H\010:\006\030\200\004(\200\002R\003val\"" + - "/\n\016SInt32ExGTELTE\022\035\n\003val\030\001 \001(\021B\013\272H\010:\006\030\200\002" + - "(\200\004R\003val\"0\n\014SInt32Ignore\022 \n\003val\030\001 \001(\021B\016\272" + - "H\013:\006\030\200\004(\200\002\320\001\001R\003val\"3\n\023SInt32IncorrectTyp" + - "e\022\034\n\003val\030\001 \001(\021B\n\272H\007\n\005%\000\000\000\000R\003val\"\036\n\nSInt6" + - "4None\022\020\n\003val\030\001 \001(\022R\003val\"(\n\013SInt64Const\022\031" + - "\n\003val\030\001 \001(\022B\007\272H\004B\002\010\002R\003val\"\'\n\010SInt64In\022\033\n" + - "\003val\030\001 \001(\022B\t\272H\006B\0042\002\004\006R\003val\")\n\013SInt64NotI" + - "n\022\032\n\003val\030\001 \001(\022B\010\272H\005B\003:\001\000R\003val\"%\n\010SInt64L" + - "T\022\031\n\003val\030\001 \001(\022B\007\272H\004B\002\020\000R\003val\"\'\n\tSInt64LT" + - "E\022\032\n\003val\030\001 \001(\022B\010\272H\005B\003\030\200\001R\003val\"%\n\010SInt64G" + - "T\022\031\n\003val\030\001 \001(\022B\007\272H\004B\002 R\003val\"&\n\tSInt64GT" + - "E\022\031\n\003val\030\001 \001(\022B\007\272H\004B\002(\020R\003val\")\n\nSInt64GT" + - "LT\022\033\n\003val\030\001 \001(\022B\t\272H\006B\004\020\024 \000R\003val\"+\n\014SInt6" + - "4ExLTGT\022\033\n\003val\030\001 \001(\022B\t\272H\006B\004\020\000 \024R\003val\"-\n\014" + - "SInt64GTELTE\022\035\n\003val\030\001 \001(\022B\013\272H\010B\006\030\200\004(\200\002R\003" + - "val\"/\n\016SInt64ExGTELTE\022\035\n\003val\030\001 \001(\022B\013\272H\010B" + - "\006\030\200\002(\200\004R\003val\"0\n\014SInt64Ignore\022 \n\003val\030\001 \001(" + - "\022B\016\272H\013B\006\030\200\004(\200\002\320\001\001R\003val\"3\n\023SInt64Incorrec" + - "tType\022\034\n\003val\030\001 \001(\022B\n\272H\007\n\005%\000\000\000\000R\003val\"\037\n\013F" + - "ixed32None\022\020\n\003val\030\001 \001(\007R\003val\",\n\014Fixed32C" + - "onst\022\034\n\003val\030\001 \001(\007B\n\272H\007J\005\r\001\000\000\000R\003val\".\n\tFi" + - "xed32In\022!\n\003val\030\001 \001(\007B\017\272H\014J\n2\010\002\000\000\000\003\000\000\000R\003v" + - "al\"-\n\014Fixed32NotIn\022\035\n\003val\030\001 \001(\007B\013\272H\010J\006:\004" + - "\000\000\000\000R\003val\")\n\tFixed32LT\022\034\n\003val\030\001 \001(\007B\n\272H\007" + - "J\005\025\005\000\000\000R\003val\"*\n\nFixed32LTE\022\034\n\003val\030\001 \001(\007B" + - "\n\272H\007J\005\035@\000\000\000R\003val\")\n\tFixed32GT\022\034\n\003val\030\001 \001" + - "(\007B\n\272H\007J\005%\020\000\000\000R\003val\"*\n\nFixed32GTE\022\034\n\003val" + - "\030\001 \001(\007B\n\272H\007J\005-\010\000\000\000R\003val\"0\n\013Fixed32GTLT\022!" + - "\n\003val\030\001 \001(\007B\017\272H\014J\n\025\n\000\000\000%\005\000\000\000R\003val\"2\n\rFix" + - "ed32ExLTGT\022!\n\003val\030\001 \001(\007B\017\272H\014J\n\025\005\000\000\000%\n\000\000\000" + - "R\003val\"2\n\rFixed32GTELTE\022!\n\003val\030\001 \001(\007B\017\272H\014" + - "J\n\035\000\001\000\000-\200\000\000\000R\003val\"4\n\017Fixed32ExGTELTE\022!\n\003" + - "val\030\001 \001(\007B\017\272H\014J\n\035\200\000\000\000-\000\001\000\000R\003val\"5\n\rFixed" + - "32Ignore\022$\n\003val\030\001 \001(\007B\022\272H\017J\n\035\000\001\000\000-\200\000\000\000\320\001" + - "\001R\003val\"4\n\024Fixed32IncorrectType\022\034\n\003val\030\001 " + - "\001(\007B\n\272H\007\n\005%\000\000\000\000R\003val\"\037\n\013Fixed64None\022\020\n\003v" + - "al\030\001 \001(\006R\003val\"0\n\014Fixed64Const\022 \n\003val\030\001 \001" + - "(\006B\016\272H\013R\t\t\001\000\000\000\000\000\000\000R\003val\"6\n\tFixed64In\022)\n\003" + - "val\030\001 \001(\006B\027\272H\024R\0222\020\002\000\000\000\000\000\000\000\003\000\000\000\000\000\000\000R\003val\"" + - "1\n\014Fixed64NotIn\022!\n\003val\030\001 \001(\006B\017\272H\014R\n:\010\000\000\000" + - "\000\000\000\000\000R\003val\"-\n\tFixed64LT\022 \n\003val\030\001 \001(\006B\016\272H" + - "\013R\t\021\005\000\000\000\000\000\000\000R\003val\".\n\nFixed64LTE\022 \n\003val\030\001" + - " \001(\006B\016\272H\013R\t\031@\000\000\000\000\000\000\000R\003val\"-\n\tFixed64GT\022 " + - "\n\003val\030\001 \001(\006B\016\272H\013R\t!\020\000\000\000\000\000\000\000R\003val\".\n\nFixe" + - "d64GTE\022 \n\003val\030\001 \001(\006B\016\272H\013R\t)\010\000\000\000\000\000\000\000R\003val" + - "\"8\n\013Fixed64GTLT\022)\n\003val\030\001 \001(\006B\027\272H\024R\022\021\n\000\000\000" + - "\000\000\000\000!\005\000\000\000\000\000\000\000R\003val\":\n\rFixed64ExLTGT\022)\n\003v" + - "al\030\001 \001(\006B\027\272H\024R\022\021\005\000\000\000\000\000\000\000!\n\000\000\000\000\000\000\000R\003val\":" + - "\n\rFixed64GTELTE\022)\n\003val\030\001 \001(\006B\027\272H\024R\022\031\000\001\000\000" + - "\000\000\000\000)\200\000\000\000\000\000\000\000R\003val\"<\n\017Fixed64ExGTELTE\022)\n" + - "\003val\030\001 \001(\006B\027\272H\024R\022\031\200\000\000\000\000\000\000\000)\000\001\000\000\000\000\000\000R\003val" + - "\"=\n\rFixed64Ignore\022,\n\003val\030\001 \001(\006B\032\272H\027R\022\031\000\001" + - "\000\000\000\000\000\000)\200\000\000\000\000\000\000\000\320\001\001R\003val\"4\n\024Fixed64Incorr" + - "ectType\022\034\n\003val\030\001 \001(\006B\n\272H\007\n\005%\000\000\000\000R\003val\" \n" + - "\014SFixed32None\022\020\n\003val\030\001 \001(\017R\003val\"-\n\rSFixe" + - "d32Const\022\034\n\003val\030\001 \001(\017B\n\272H\007Z\005\r\001\000\000\000R\003val\"/" + - "\n\nSFixed32In\022!\n\003val\030\001 \001(\017B\017\272H\014Z\n2\010\002\000\000\000\003\000" + - "\000\000R\003val\".\n\rSFixed32NotIn\022\035\n\003val\030\001 \001(\017B\013\272" + - "H\010Z\006:\004\000\000\000\000R\003val\"*\n\nSFixed32LT\022\034\n\003val\030\001 \001" + - "(\017B\n\272H\007Z\005\025\000\000\000\000R\003val\"+\n\013SFixed32LTE\022\034\n\003va" + - "l\030\001 \001(\017B\n\272H\007Z\005\035@\000\000\000R\003val\"*\n\nSFixed32GT\022\034" + - "\n\003val\030\001 \001(\017B\n\272H\007Z\005%\020\000\000\000R\003val\"+\n\013SFixed32" + - "GTE\022\034\n\003val\030\001 \001(\017B\n\272H\007Z\005-\010\000\000\000R\003val\"1\n\014SFi" + - "xed32GTLT\022!\n\003val\030\001 \001(\017B\017\272H\014Z\n\025\n\000\000\000%\000\000\000\000R" + - "\003val\"3\n\016SFixed32ExLTGT\022!\n\003val\030\001 \001(\017B\017\272H\014" + - "Z\n\025\000\000\000\000%\n\000\000\000R\003val\"3\n\016SFixed32GTELTE\022!\n\003v" + - "al\030\001 \001(\017B\017\272H\014Z\n\035\000\001\000\000-\200\000\000\000R\003val\"5\n\020SFixed" + - "32ExGTELTE\022!\n\003val\030\001 \001(\017B\017\272H\014Z\n\035\200\000\000\000-\000\001\000\000" + - "R\003val\"6\n\016SFixed32Ignore\022$\n\003val\030\001 \001(\017B\022\272H" + - "\017Z\n\035\000\001\000\000-\200\000\000\000\320\001\001R\003val\"5\n\025SFixed32Incorre" + - "ctType\022\034\n\003val\030\001 \001(\017B\n\272H\007\n\005%\000\000\000\000R\003val\" \n\014" + - "SFixed64None\022\020\n\003val\030\001 \001(\020R\003val\"1\n\rSFixed" + - "64Const\022 \n\003val\030\001 \001(\020B\016\272H\013b\t\t\001\000\000\000\000\000\000\000R\003va" + - "l\"7\n\nSFixed64In\022)\n\003val\030\001 \001(\020B\027\272H\024b\0222\020\002\000\000" + - "\000\000\000\000\000\003\000\000\000\000\000\000\000R\003val\"2\n\rSFixed64NotIn\022!\n\003v" + - "al\030\001 \001(\020B\017\272H\014b\n:\010\000\000\000\000\000\000\000\000R\003val\".\n\nSFixed" + - "64LT\022 \n\003val\030\001 \001(\020B\016\272H\013b\t\021\000\000\000\000\000\000\000\000R\003val\"/" + - "\n\013SFixed64LTE\022 \n\003val\030\001 \001(\020B\016\272H\013b\t\031@\000\000\000\000\000" + - "\000\000R\003val\".\n\nSFixed64GT\022 \n\003val\030\001 \001(\020B\016\272H\013b" + - "\t!\020\000\000\000\000\000\000\000R\003val\"/\n\013SFixed64GTE\022 \n\003val\030\001 " + - "\001(\020B\016\272H\013b\t)\010\000\000\000\000\000\000\000R\003val\"9\n\014SFixed64GTLT" + - "\022)\n\003val\030\001 \001(\020B\027\272H\024b\022\021\n\000\000\000\000\000\000\000!\000\000\000\000\000\000\000\000R\003" + - "val\";\n\016SFixed64ExLTGT\022)\n\003val\030\001 \001(\020B\027\272H\024b" + - "\022\021\000\000\000\000\000\000\000\000!\n\000\000\000\000\000\000\000R\003val\";\n\016SFixed64GTEL" + - "TE\022)\n\003val\030\001 \001(\020B\027\272H\024b\022\031\000\001\000\000\000\000\000\000)\200\000\000\000\000\000\000\000" + - "R\003val\"=\n\020SFixed64ExGTELTE\022)\n\003val\030\001 \001(\020B\027" + - "\272H\024b\022\031\200\000\000\000\000\000\000\000)\000\001\000\000\000\000\000\000R\003val\">\n\016SFixed64" + - "Ignore\022,\n\003val\030\001 \001(\020B\032\272H\027b\022\031\000\001\000\000\000\000\000\000)\200\000\000\000" + - "\000\000\000\000\320\001\001R\003val\"5\n\025SFixed64IncorrectType\022\034\n" + - "\003val\030\001 \001(\020B\n\272H\007\n\005%\000\000\000\000R\003val\":\n\020Int64LTEO" + - "ptional\022\036\n\003val\030\001 \001(\003B\007\272H\004\"\002\030@H\000R\003val\210\001\001B" + - "\006\n\004_valB\320\001\n$build.buf.validate.conforman" + - "ce.casesB\014NumbersProtoP\001\242\002\004BVCC\252\002\036Buf.Va" + - "lidate.Conformance.Cases\312\002\036Buf\\Validate\\" + - "Conformance\\Cases\342\002*Buf\\Validate\\Conform" + - "ance\\Cases\\GPBMetadata\352\002!Buf::Validate::" + - "Conformance::Casesb\006proto3" + "\030\001 \001(\002B\017\272H\014\n\n5\205\353\221@5\341z\374@R\003val\"*\n\nFloatNot" + + "In\022\034\n\003val\030\001 \001(\002B\n\272H\007\n\005=\000\000\000\000R\003val\"\'\n\007Floa" + + "tLT\022\034\n\003val\030\001 \001(\002B\n\272H\007\n\005\025\000\000\000\000R\003val\"(\n\010Flo" + + "atLTE\022\034\n\003val\030\001 \001(\002B\n\272H\007\n\005\035\000\000\200BR\003val\"\'\n\007F" + + "loatGT\022\034\n\003val\030\001 \001(\002B\n\272H\007\n\005%\000\000\200AR\003val\"(\n\010" + + "FloatGTE\022\034\n\003val\030\001 \001(\002B\n\272H\007\n\005-\000\000\000AR\003val\"." + + "\n\tFloatGTLT\022!\n\003val\030\001 \001(\002B\017\272H\014\n\n\025\000\000 A%\000\000\000" + + "\000R\003val\"0\n\013FloatExLTGT\022!\n\003val\030\001 \001(\002B\017\272H\014\n" + + "\n\025\000\000\000\000%\000\000 AR\003val\"0\n\013FloatGTELTE\022!\n\003val\030\001" + + " \001(\002B\017\272H\014\n\n\035\000\000\200C-\000\000\000CR\003val\"2\n\rFloatExGTE" + + "LTE\022!\n\003val\030\001 \001(\002B\017\272H\014\n\n\035\000\000\000C-\000\000\200CR\003val\"(" + + "\n\013FloatFinite\022\031\n\003val\030\001 \001(\002B\007\272H\004\n\002@\001R\003val" + + "\")\n\016FloatNotFinite\022\027\n\003val\030\001 \001(\002B\005\272H\002\n\000R\003" + + "val\"3\n\013FloatIgnore\022$\n\003val\030\001 \001(\002B\022\272H\017\n\n\035\000" + + "\000\200C-\000\000\000C\320\001\001R\003val\"6\n\022FloatIncorrectType\022 " + + "\n\003val\030\001 \001(\002B\016\272H\013\022\t!\000\000\000\000\000\000\000\000R\003val\",\n\014Floa" + + "tExample\022\034\n\003val\030\001 \001(\002B\n\272H\007\n\005M\000\000\000AR\003val\"\036" + + "\n\nDoubleNone\022\020\n\003val\030\001 \001(\001R\003val\"/\n\013Double" + + "Const\022 \n\003val\030\001 \001(\001B\016\272H\013\022\t\t\256G\341z\024\256\363?R\003val\"" + + "5\n\010DoubleIn\022)\n\003val\030\001 \001(\001B\027\272H\024\022\0221=\n\327\243p=\022@" + + "1\217\302\365(\\\217\037@R\003val\"/\n\013DoubleNotIn\022 \n\003val\030\001 \001" + + "(\001B\016\272H\013\022\t9\000\000\000\000\000\000\000\000R\003val\",\n\010DoubleLT\022 \n\003v" + + "al\030\001 \001(\001B\016\272H\013\022\t\021\000\000\000\000\000\000\000\000R\003val\"-\n\tDoubleL" + + "TE\022 \n\003val\030\001 \001(\001B\016\272H\013\022\t\031\000\000\000\000\000\000P@R\003val\",\n\010" + + "DoubleGT\022 \n\003val\030\001 \001(\001B\016\272H\013\022\t!\000\000\000\000\000\0000@R\003v" + + "al\"-\n\tDoubleGTE\022 \n\003val\030\001 \001(\001B\016\272H\013\022\t)\000\000\000\000" + + "\000\000 @R\003val\"7\n\nDoubleGTLT\022)\n\003val\030\001 \001(\001B\027\272H" + + "\024\022\022\021\000\000\000\000\000\000$@!\000\000\000\000\000\000\000\000R\003val\"9\n\014DoubleExLT" + + "GT\022)\n\003val\030\001 \001(\001B\027\272H\024\022\022\021\000\000\000\000\000\000\000\000!\000\000\000\000\000\000$@" + + "R\003val\"9\n\014DoubleGTELTE\022)\n\003val\030\001 \001(\001B\027\272H\024\022" + + "\022\031\000\000\000\000\000\000p@)\000\000\000\000\000\000`@R\003val\";\n\016DoubleExGTEL" + + "TE\022)\n\003val\030\001 \001(\001B\027\272H\024\022\022\031\000\000\000\000\000\000`@)\000\000\000\000\000\000p@" + + "R\003val\")\n\014DoubleFinite\022\031\n\003val\030\001 \001(\001B\007\272H\004\022" + + "\002@\001R\003val\"*\n\017DoubleNotFinite\022\027\n\003val\030\001 \001(\001" + + "B\005\272H\002\022\000R\003val\"<\n\014DoubleIgnore\022,\n\003val\030\001 \001(" + + "\001B\032\272H\027\022\022\031\000\000\000\000\000\000p@)\000\000\000\000\000\000`@\320\001\001R\003val\"3\n\023Do" + + "ubleIncorrectType\022\034\n\003val\030\001 \001(\001B\n\272H\007\n\005%\000\000" + + "\000\000R\003val\"1\n\rDoubleExample\022 \n\003val\030\001 \001(\001B\016\272" + + "H\013\022\tI\000\000\000\000\000\000\000\000R\003val\"\035\n\tInt32None\022\020\n\003val\030\001" + + " \001(\005R\003val\"\'\n\nInt32Const\022\031\n\003val\030\001 \001(\005B\007\272H" + + "\004\032\002\010\001R\003val\"&\n\007Int32In\022\033\n\003val\030\001 \001(\005B\t\272H\006\032" + + "\0040\0020\003R\003val\"\'\n\nInt32NotIn\022\031\n\003val\030\001 \001(\005B\007\272" + + "H\004\032\0028\000R\003val\"$\n\007Int32LT\022\031\n\003val\030\001 \001(\005B\007\272H\004" + + "\032\002\020\000R\003val\"%\n\010Int32LTE\022\031\n\003val\030\001 \001(\005B\007\272H\004\032" + + "\002\030@R\003val\"$\n\007Int32GT\022\031\n\003val\030\001 \001(\005B\007\272H\004\032\002 " + + "\020R\003val\"%\n\010Int32GTE\022\031\n\003val\030\001 \001(\005B\007\272H\004\032\002(\010" + + "R\003val\"(\n\tInt32GTLT\022\033\n\003val\030\001 \001(\005B\t\272H\006\032\004\020\n" + + " \000R\003val\"*\n\013Int32ExLTGT\022\033\n\003val\030\001 \001(\005B\t\272H\006" + + "\032\004\020\000 \nR\003val\",\n\013Int32GTELTE\022\035\n\003val\030\001 \001(\005B" + + "\013\272H\010\032\006\030\200\002(\200\001R\003val\".\n\rInt32ExGTELTE\022\035\n\003va" + + "l\030\001 \001(\005B\013\272H\010\032\006\030\200\001(\200\002R\003val\"/\n\013Int32Ignore" + + "\022 \n\003val\030\001 \001(\005B\016\272H\013\032\006\030\200\002(\200\001\320\001\001R\003val\"2\n\022In" + + "t32IncorrectType\022\034\n\003val\030\001 \001(\005B\n\272H\007\n\005%\000\000\000" + + "\000R\003val\")\n\014Int32Example\022\031\n\003val\030\001 \001(\005B\007\272H\004" + + "\032\002@\nR\003val\"\035\n\tInt64None\022\020\n\003val\030\001 \001(\003R\003val" + + "\"\'\n\nInt64Const\022\031\n\003val\030\001 \001(\003B\007\272H\004\"\002\010\001R\003va" + + "l\"&\n\007Int64In\022\033\n\003val\030\001 \001(\003B\t\272H\006\"\0040\0020\003R\003va" + + "l\"\'\n\nInt64NotIn\022\031\n\003val\030\001 \001(\003B\007\272H\004\"\0028\000R\003v" + + "al\"$\n\007Int64LT\022\031\n\003val\030\001 \001(\003B\007\272H\004\"\002\020\000R\003val" + + "\"%\n\010Int64LTE\022\031\n\003val\030\001 \001(\003B\007\272H\004\"\002\030@R\003val\"" + + "$\n\007Int64GT\022\031\n\003val\030\001 \001(\003B\007\272H\004\"\002 \020R\003val\"%\n" + + "\010Int64GTE\022\031\n\003val\030\001 \001(\003B\007\272H\004\"\002(\010R\003val\"(\n\t" + + "Int64GTLT\022\033\n\003val\030\001 \001(\003B\t\272H\006\"\004\020\n \000R\003val\"*" + + "\n\013Int64ExLTGT\022\033\n\003val\030\001 \001(\003B\t\272H\006\"\004\020\000 \nR\003v" + + "al\",\n\013Int64GTELTE\022\035\n\003val\030\001 \001(\003B\013\272H\010\"\006\030\200\002" + + "(\200\001R\003val\".\n\rInt64ExGTELTE\022\035\n\003val\030\001 \001(\003B\013" + + "\272H\010\"\006\030\200\001(\200\002R\003val\"/\n\013Int64Ignore\022 \n\003val\030\001" + + " \001(\003B\016\272H\013\"\006\030\200\002(\200\001\320\001\001R\003val\"\214\004\n\023Int64BigCo" + + "nstraints\022\"\n\006lt_pos\030\001 \001(\003B\013\272H\010\"\006\020\246\335\207\244\024R\005" + + "ltPos\022\'\n\006lt_neg\030\002 \001(\003B\020\272H\r\"\013\020\332\242\370\333\353\377\377\377\377\001R" + + "\005ltNeg\022\"\n\006gt_pos\030\003 \001(\003B\013\272H\010\"\006 \246\335\207\244\024R\005gtP" + + "os\022\'\n\006gt_neg\030\004 \001(\003B\020\272H\r\"\013 \332\242\370\333\353\377\377\377\377\001R\005gt" + + "Neg\022$\n\007lte_pos\030\005 \001(\003B\013\272H\010\"\006\030\246\335\207\244\024R\006ltePo" + + "s\022)\n\007lte_neg\030\006 \001(\003B\020\272H\r\"\013\030\332\242\370\333\353\377\377\377\377\001R\006lt" + + "eNeg\022$\n\007gte_pos\030\007 \001(\003B\013\272H\010\"\006(\246\335\207\244\024R\006gteP" + + "os\022)\n\007gte_neg\030\010 \001(\003B\020\272H\r\"\013(\332\242\370\333\353\377\377\377\377\001R\006g" + + "teNeg\022.\n\014constant_pos\030\t \001(\003B\013\272H\010\"\006\010\246\335\207\244\024" + + "R\013constantPos\0223\n\014constant_neg\030\n \001(\003B\020\272H\r" + + "\"\013\010\332\242\370\333\353\377\377\377\377\001R\013constantNeg\022&\n\002in\030\013 \001(\003B\026" + + "\272H\023\"\0210\246\335\207\244\0240\332\242\370\333\353\377\377\377\377\001R\002in\022,\n\005notin\030\014 \001(" + + "\003B\026\272H\023\"\0218\246\335\207\244\0248\332\242\370\333\353\377\377\377\377\001R\005notin\"2\n\022Int6" + + "4IncorrectType\022\034\n\003val\030\001 \001(\003B\n\272H\007\n\005%\000\000\000\000R" + + "\003val\")\n\014Int64Example\022\031\n\003val\030\001 \001(\003B\007\272H\004\"\002" + + "H\nR\003val\"\036\n\nUInt32None\022\020\n\003val\030\001 \001(\rR\003val\"" + + "(\n\013UInt32Const\022\031\n\003val\030\001 \001(\rB\007\272H\004*\002\010\001R\003va" + + "l\"\'\n\010UInt32In\022\033\n\003val\030\001 \001(\rB\t\272H\006*\0040\0020\003R\003v" + + "al\"(\n\013UInt32NotIn\022\031\n\003val\030\001 \001(\rB\007\272H\004*\0028\000R" + + "\003val\"%\n\010UInt32LT\022\031\n\003val\030\001 \001(\rB\007\272H\004*\002\020\005R\003" + + "val\"&\n\tUInt32LTE\022\031\n\003val\030\001 \001(\rB\007\272H\004*\002\030@R\003" + + "val\"%\n\010UInt32GT\022\031\n\003val\030\001 \001(\rB\007\272H\004*\002 \020R\003v" + + "al\"&\n\tUInt32GTE\022\031\n\003val\030\001 \001(\rB\007\272H\004*\002(\010R\003v" + + "al\")\n\nUInt32GTLT\022\033\n\003val\030\001 \001(\rB\t\272H\006*\004\020\n \005" + + "R\003val\"+\n\014UInt32ExLTGT\022\033\n\003val\030\001 \001(\rB\t\272H\006*" + + "\004\020\005 \nR\003val\"-\n\014UInt32GTELTE\022\035\n\003val\030\001 \001(\rB" + + "\013\272H\010*\006\030\200\002(\200\001R\003val\"/\n\016UInt32ExGTELTE\022\035\n\003v" + + "al\030\001 \001(\rB\013\272H\010*\006\030\200\001(\200\002R\003val\"0\n\014UInt32Igno" + + "re\022 \n\003val\030\001 \001(\rB\016\272H\013*\006\030\200\002(\200\001\320\001\001R\003val\"3\n\023" + + "UInt32IncorrectType\022\034\n\003val\030\001 \001(\rB\n\272H\007\n\005%" + + "\000\000\000\000R\003val\"*\n\rUInt32Example\022\031\n\003val\030\001 \001(\rB" + + "\007\272H\004*\002@\000R\003val\"\036\n\nUInt64None\022\020\n\003val\030\001 \001(\004" + + "R\003val\"(\n\013UInt64Const\022\031\n\003val\030\001 \001(\004B\007\272H\0042\002" + + "\010\001R\003val\"\'\n\010UInt64In\022\033\n\003val\030\001 \001(\004B\t\272H\0062\0040" + + "\0020\003R\003val\"(\n\013UInt64NotIn\022\031\n\003val\030\001 \001(\004B\007\272H" + + "\0042\0028\000R\003val\"%\n\010UInt64LT\022\031\n\003val\030\001 \001(\004B\007\272H\004" + + "2\002\020\005R\003val\"&\n\tUInt64LTE\022\031\n\003val\030\001 \001(\004B\007\272H\004" + + "2\002\030@R\003val\"%\n\010UInt64GT\022\031\n\003val\030\001 \001(\004B\007\272H\0042" + + "\002 \020R\003val\"&\n\tUInt64GTE\022\031\n\003val\030\001 \001(\004B\007\272H\0042" + + "\002(\010R\003val\")\n\nUInt64GTLT\022\033\n\003val\030\001 \001(\004B\t\272H\006" + + "2\004\020\n \005R\003val\"+\n\014UInt64ExLTGT\022\033\n\003val\030\001 \001(\004" + + "B\t\272H\0062\004\020\005 \nR\003val\"-\n\014UInt64GTELTE\022\035\n\003val\030" + + "\001 \001(\004B\013\272H\0102\006\030\200\002(\200\001R\003val\"/\n\016UInt64ExGTELT" + + "E\022\035\n\003val\030\001 \001(\004B\013\272H\0102\006\030\200\001(\200\002R\003val\"0\n\014UInt" + + "64Ignore\022 \n\003val\030\001 \001(\004B\016\272H\0132\006\030\200\002(\200\001\320\001\001R\003v" + + "al\"3\n\023UInt64IncorrectType\022\034\n\003val\030\001 \001(\004B\n" + + "\272H\007\n\005%\000\000\000\000R\003val\"*\n\rUInt64Example\022\031\n\003val\030" + + "\001 \001(\004B\007\272H\0042\002@\000R\003val\"\036\n\nSInt32None\022\020\n\003val" + + "\030\001 \001(\021R\003val\"(\n\013SInt32Const\022\031\n\003val\030\001 \001(\021B" + + "\007\272H\004:\002\010\002R\003val\"\'\n\010SInt32In\022\033\n\003val\030\001 \001(\021B\t" + + "\272H\006:\0040\0040\006R\003val\"(\n\013SInt32NotIn\022\031\n\003val\030\001 \001" + + "(\021B\007\272H\004:\0028\000R\003val\"%\n\010SInt32LT\022\031\n\003val\030\001 \001(" + + "\021B\007\272H\004:\002\020\000R\003val\"\'\n\tSInt32LTE\022\032\n\003val\030\001 \001(" + + "\021B\010\272H\005:\003\030\200\001R\003val\"%\n\010SInt32GT\022\031\n\003val\030\001 \001(" + + "\021B\007\272H\004:\002 R\003val\"&\n\tSInt32GTE\022\031\n\003val\030\001 \001(" + + "\021B\007\272H\004:\002(\020R\003val\")\n\nSInt32GTLT\022\033\n\003val\030\001 \001" + + "(\021B\t\272H\006:\004\020\024 \000R\003val\"+\n\014SInt32ExLTGT\022\033\n\003va" + + "l\030\001 \001(\021B\t\272H\006:\004\020\000 \024R\003val\"-\n\014SInt32GTELTE\022" + + "\035\n\003val\030\001 \001(\021B\013\272H\010:\006\030\200\004(\200\002R\003val\"/\n\016SInt32" + + "ExGTELTE\022\035\n\003val\030\001 \001(\021B\013\272H\010:\006\030\200\002(\200\004R\003val\"" + + "0\n\014SInt32Ignore\022 \n\003val\030\001 \001(\021B\016\272H\013:\006\030\200\004(\200" + + "\002\320\001\001R\003val\"3\n\023SInt32IncorrectType\022\034\n\003val\030" + + "\001 \001(\021B\n\272H\007\n\005%\000\000\000\000R\003val\"*\n\rSInt32Example\022" + + "\031\n\003val\030\001 \001(\021B\007\272H\004:\002@\000R\003val\"\036\n\nSInt64None" + + "\022\020\n\003val\030\001 \001(\022R\003val\"(\n\013SInt64Const\022\031\n\003val" + + "\030\001 \001(\022B\007\272H\004B\002\010\002R\003val\"\'\n\010SInt64In\022\033\n\003val\030" + + "\001 \001(\022B\t\272H\006B\0040\0040\006R\003val\"(\n\013SInt64NotIn\022\031\n\003" + + "val\030\001 \001(\022B\007\272H\004B\0028\000R\003val\"%\n\010SInt64LT\022\031\n\003v" + + "al\030\001 \001(\022B\007\272H\004B\002\020\000R\003val\"\'\n\tSInt64LTE\022\032\n\003v" + + "al\030\001 \001(\022B\010\272H\005B\003\030\200\001R\003val\"%\n\010SInt64GT\022\031\n\003v" + + "al\030\001 \001(\022B\007\272H\004B\002 R\003val\"&\n\tSInt64GTE\022\031\n\003v" + + "al\030\001 \001(\022B\007\272H\004B\002(\020R\003val\")\n\nSInt64GTLT\022\033\n\003" + + "val\030\001 \001(\022B\t\272H\006B\004\020\024 \000R\003val\"+\n\014SInt64ExLTG" + + "T\022\033\n\003val\030\001 \001(\022B\t\272H\006B\004\020\000 \024R\003val\"-\n\014SInt64" + + "GTELTE\022\035\n\003val\030\001 \001(\022B\013\272H\010B\006\030\200\004(\200\002R\003val\"/\n" + + "\016SInt64ExGTELTE\022\035\n\003val\030\001 \001(\022B\013\272H\010B\006\030\200\002(\200" + + "\004R\003val\"0\n\014SInt64Ignore\022 \n\003val\030\001 \001(\022B\016\272H\013" + + "B\006\030\200\004(\200\002\320\001\001R\003val\"3\n\023SInt64IncorrectType\022" + + "\034\n\003val\030\001 \001(\022B\n\272H\007\n\005%\000\000\000\000R\003val\"*\n\rSInt64E" + + "xample\022\031\n\003val\030\001 \001(\022B\007\272H\004B\002@\000R\003val\"\037\n\013Fix" + + "ed32None\022\020\n\003val\030\001 \001(\007R\003val\",\n\014Fixed32Con" + + "st\022\034\n\003val\030\001 \001(\007B\n\272H\007J\005\r\001\000\000\000R\003val\".\n\tFixe" + + "d32In\022!\n\003val\030\001 \001(\007B\017\272H\014J\n5\002\000\000\0005\003\000\000\000R\003val" + + "\",\n\014Fixed32NotIn\022\034\n\003val\030\001 \001(\007B\n\272H\007J\005=\000\000\000" + + "\000R\003val\")\n\tFixed32LT\022\034\n\003val\030\001 \001(\007B\n\272H\007J\005\025" + + "\005\000\000\000R\003val\"*\n\nFixed32LTE\022\034\n\003val\030\001 \001(\007B\n\272H" + + "\007J\005\035@\000\000\000R\003val\")\n\tFixed32GT\022\034\n\003val\030\001 \001(\007B" + + "\n\272H\007J\005%\020\000\000\000R\003val\"*\n\nFixed32GTE\022\034\n\003val\030\001 " + + "\001(\007B\n\272H\007J\005-\010\000\000\000R\003val\"0\n\013Fixed32GTLT\022!\n\003v" + + "al\030\001 \001(\007B\017\272H\014J\n\025\n\000\000\000%\005\000\000\000R\003val\"2\n\rFixed3" + + "2ExLTGT\022!\n\003val\030\001 \001(\007B\017\272H\014J\n\025\005\000\000\000%\n\000\000\000R\003v" + + "al\"2\n\rFixed32GTELTE\022!\n\003val\030\001 \001(\007B\017\272H\014J\n\035" + + "\000\001\000\000-\200\000\000\000R\003val\"4\n\017Fixed32ExGTELTE\022!\n\003val" + + "\030\001 \001(\007B\017\272H\014J\n\035\200\000\000\000-\000\001\000\000R\003val\"5\n\rFixed32I" + + "gnore\022$\n\003val\030\001 \001(\007B\022\272H\017J\n\035\000\001\000\000-\200\000\000\000\320\001\001R\003" + + "val\"4\n\024Fixed32IncorrectType\022\034\n\003val\030\001 \001(\007" + + "B\n\272H\007\n\005%\000\000\000\000R\003val\".\n\016Fixed32Example\022\034\n\003v" + + "al\030\001 \001(\007B\n\272H\007J\005E\000\000\000\000R\003val\"\037\n\013Fixed64None" + + "\022\020\n\003val\030\001 \001(\006R\003val\"0\n\014Fixed64Const\022 \n\003va" + + "l\030\001 \001(\006B\016\272H\013R\t\t\001\000\000\000\000\000\000\000R\003val\"6\n\tFixed64I" + + "n\022)\n\003val\030\001 \001(\006B\027\272H\024R\0221\002\000\000\000\000\000\000\0001\003\000\000\000\000\000\000\000R" + + "\003val\"0\n\014Fixed64NotIn\022 \n\003val\030\001 \001(\006B\016\272H\013R\t" + + "9\000\000\000\000\000\000\000\000R\003val\"-\n\tFixed64LT\022 \n\003val\030\001 \001(\006" + + "B\016\272H\013R\t\021\005\000\000\000\000\000\000\000R\003val\".\n\nFixed64LTE\022 \n\003v" + + "al\030\001 \001(\006B\016\272H\013R\t\031@\000\000\000\000\000\000\000R\003val\"-\n\tFixed64" + + "GT\022 \n\003val\030\001 \001(\006B\016\272H\013R\t!\020\000\000\000\000\000\000\000R\003val\".\n\n" + + "Fixed64GTE\022 \n\003val\030\001 \001(\006B\016\272H\013R\t)\010\000\000\000\000\000\000\000R" + + "\003val\"8\n\013Fixed64GTLT\022)\n\003val\030\001 \001(\006B\027\272H\024R\022\021" + + "\n\000\000\000\000\000\000\000!\005\000\000\000\000\000\000\000R\003val\":\n\rFixed64ExLTGT\022" + + ")\n\003val\030\001 \001(\006B\027\272H\024R\022\021\005\000\000\000\000\000\000\000!\n\000\000\000\000\000\000\000R\003v" + + "al\":\n\rFixed64GTELTE\022)\n\003val\030\001 \001(\006B\027\272H\024R\022\031" + + "\000\001\000\000\000\000\000\000)\200\000\000\000\000\000\000\000R\003val\"<\n\017Fixed64ExGTELT" + + "E\022)\n\003val\030\001 \001(\006B\027\272H\024R\022\031\200\000\000\000\000\000\000\000)\000\001\000\000\000\000\000\000R" + + "\003val\"=\n\rFixed64Ignore\022,\n\003val\030\001 \001(\006B\032\272H\027R" + + "\022\031\000\001\000\000\000\000\000\000)\200\000\000\000\000\000\000\000\320\001\001R\003val\"4\n\024Fixed64In" + + "correctType\022\034\n\003val\030\001 \001(\006B\n\272H\007\n\005%\000\000\000\000R\003va" + + "l\"2\n\016Fixed64Example\022 \n\003val\030\001 \001(\006B\016\272H\013R\tA" + + "\000\000\000\000\000\000\000\000R\003val\" \n\014SFixed32None\022\020\n\003val\030\001 \001" + + "(\017R\003val\"-\n\rSFixed32Const\022\034\n\003val\030\001 \001(\017B\n\272" + + "H\007Z\005\r\001\000\000\000R\003val\"/\n\nSFixed32In\022!\n\003val\030\001 \001(" + + "\017B\017\272H\014Z\n5\002\000\000\0005\003\000\000\000R\003val\"-\n\rSFixed32NotIn" + + "\022\034\n\003val\030\001 \001(\017B\n\272H\007Z\005=\000\000\000\000R\003val\"*\n\nSFixed" + + "32LT\022\034\n\003val\030\001 \001(\017B\n\272H\007Z\005\025\000\000\000\000R\003val\"+\n\013SF" + + "ixed32LTE\022\034\n\003val\030\001 \001(\017B\n\272H\007Z\005\035@\000\000\000R\003val\"" + + "*\n\nSFixed32GT\022\034\n\003val\030\001 \001(\017B\n\272H\007Z\005%\020\000\000\000R\003" + + "val\"+\n\013SFixed32GTE\022\034\n\003val\030\001 \001(\017B\n\272H\007Z\005-\010" + + "\000\000\000R\003val\"1\n\014SFixed32GTLT\022!\n\003val\030\001 \001(\017B\017\272" + + "H\014Z\n\025\n\000\000\000%\000\000\000\000R\003val\"3\n\016SFixed32ExLTGT\022!\n" + + "\003val\030\001 \001(\017B\017\272H\014Z\n\025\000\000\000\000%\n\000\000\000R\003val\"3\n\016SFix" + + "ed32GTELTE\022!\n\003val\030\001 \001(\017B\017\272H\014Z\n\035\000\001\000\000-\200\000\000\000" + + "R\003val\"5\n\020SFixed32ExGTELTE\022!\n\003val\030\001 \001(\017B\017" + + "\272H\014Z\n\035\200\000\000\000-\000\001\000\000R\003val\"6\n\016SFixed32Ignore\022$" + + "\n\003val\030\001 \001(\017B\022\272H\017Z\n\035\000\001\000\000-\200\000\000\000\320\001\001R\003val\"5\n\025" + + "SFixed32IncorrectType\022\034\n\003val\030\001 \001(\017B\n\272H\007\n" + + "\005%\000\000\000\000R\003val\"/\n\017SFixed32Example\022\034\n\003val\030\001 " + + "\001(\017B\n\272H\007Z\005E\000\000\000\000R\003val\" \n\014SFixed64None\022\020\n\003" + + "val\030\001 \001(\020R\003val\"1\n\rSFixed64Const\022 \n\003val\030\001" + + " \001(\020B\016\272H\013b\t\t\001\000\000\000\000\000\000\000R\003val\"7\n\nSFixed64In\022" + + ")\n\003val\030\001 \001(\020B\027\272H\024b\0221\002\000\000\000\000\000\000\0001\003\000\000\000\000\000\000\000R\003v" + + "al\"1\n\rSFixed64NotIn\022 \n\003val\030\001 \001(\020B\016\272H\013b\t9" + + "\000\000\000\000\000\000\000\000R\003val\".\n\nSFixed64LT\022 \n\003val\030\001 \001(\020" + + "B\016\272H\013b\t\021\000\000\000\000\000\000\000\000R\003val\"/\n\013SFixed64LTE\022 \n\003" + + "val\030\001 \001(\020B\016\272H\013b\t\031@\000\000\000\000\000\000\000R\003val\".\n\nSFixed" + + "64GT\022 \n\003val\030\001 \001(\020B\016\272H\013b\t!\020\000\000\000\000\000\000\000R\003val\"/" + + "\n\013SFixed64GTE\022 \n\003val\030\001 \001(\020B\016\272H\013b\t)\010\000\000\000\000\000" + + "\000\000R\003val\"9\n\014SFixed64GTLT\022)\n\003val\030\001 \001(\020B\027\272H" + + "\024b\022\021\n\000\000\000\000\000\000\000!\000\000\000\000\000\000\000\000R\003val\";\n\016SFixed64Ex" + + "LTGT\022)\n\003val\030\001 \001(\020B\027\272H\024b\022\021\000\000\000\000\000\000\000\000!\n\000\000\000\000\000" + + "\000\000R\003val\";\n\016SFixed64GTELTE\022)\n\003val\030\001 \001(\020B\027" + + "\272H\024b\022\031\000\001\000\000\000\000\000\000)\200\000\000\000\000\000\000\000R\003val\"=\n\020SFixed64" + + "ExGTELTE\022)\n\003val\030\001 \001(\020B\027\272H\024b\022\031\200\000\000\000\000\000\000\000)\000\001" + + "\000\000\000\000\000\000R\003val\">\n\016SFixed64Ignore\022,\n\003val\030\001 \001" + + "(\020B\032\272H\027b\022\031\000\001\000\000\000\000\000\000)\200\000\000\000\000\000\000\000\320\001\001R\003val\"5\n\025S" + + "Fixed64IncorrectType\022\034\n\003val\030\001 \001(\020B\n\272H\007\n\005" + + "%\000\000\000\000R\003val\"3\n\017SFixed64Example\022 \n\003val\030\001 \001" + + "(\020B\016\272H\013b\tA\000\000\000\000\000\000\000\000R\003val\":\n\020Int64LTEOptio" + + "nal\022\036\n\003val\030\001 \001(\003B\007\272H\004\"\002\030@H\000R\003val\210\001\001B\006\n\004_" + + "valB\320\001\n$build.buf.validate.conformance.c" + + "asesB\014NumbersProtoP\001\242\002\004BVCC\252\002\036Buf.Valida" + + "te.Conformance.Cases\312\002\036Buf\\Validate\\Conf" + + "ormance\\Cases\342\002*Buf\\Validate\\Conformance" + + "\\Cases\\GPBMetadata\352\002!Buf::Validate::Conf" + + "ormance::Casesb\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor .internalBuildGeneratedFileFrom(descriptorData, @@ -1198,956 +1284,1040 @@ public static void registerAllExtensions( com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_FloatFinite_descriptor, new java.lang.String[] { "Val", }); - internal_static_buf_validate_conformance_cases_FloatIgnore_descriptor = + internal_static_buf_validate_conformance_cases_FloatNotFinite_descriptor = getDescriptor().getMessageTypes().get(13); + internal_static_buf_validate_conformance_cases_FloatNotFinite_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_FloatNotFinite_descriptor, + new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_FloatIgnore_descriptor = + getDescriptor().getMessageTypes().get(14); internal_static_buf_validate_conformance_cases_FloatIgnore_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_FloatIgnore_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_FloatIncorrectType_descriptor = - getDescriptor().getMessageTypes().get(14); + getDescriptor().getMessageTypes().get(15); internal_static_buf_validate_conformance_cases_FloatIncorrectType_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_FloatIncorrectType_descriptor, new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_FloatExample_descriptor = + getDescriptor().getMessageTypes().get(16); + internal_static_buf_validate_conformance_cases_FloatExample_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_FloatExample_descriptor, + new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_DoubleNone_descriptor = - getDescriptor().getMessageTypes().get(15); + getDescriptor().getMessageTypes().get(17); internal_static_buf_validate_conformance_cases_DoubleNone_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_DoubleNone_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_DoubleConst_descriptor = - getDescriptor().getMessageTypes().get(16); + getDescriptor().getMessageTypes().get(18); internal_static_buf_validate_conformance_cases_DoubleConst_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_DoubleConst_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_DoubleIn_descriptor = - getDescriptor().getMessageTypes().get(17); + getDescriptor().getMessageTypes().get(19); internal_static_buf_validate_conformance_cases_DoubleIn_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_DoubleIn_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_DoubleNotIn_descriptor = - getDescriptor().getMessageTypes().get(18); + getDescriptor().getMessageTypes().get(20); internal_static_buf_validate_conformance_cases_DoubleNotIn_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_DoubleNotIn_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_DoubleLT_descriptor = - getDescriptor().getMessageTypes().get(19); + getDescriptor().getMessageTypes().get(21); internal_static_buf_validate_conformance_cases_DoubleLT_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_DoubleLT_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_DoubleLTE_descriptor = - getDescriptor().getMessageTypes().get(20); + getDescriptor().getMessageTypes().get(22); internal_static_buf_validate_conformance_cases_DoubleLTE_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_DoubleLTE_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_DoubleGT_descriptor = - getDescriptor().getMessageTypes().get(21); + getDescriptor().getMessageTypes().get(23); internal_static_buf_validate_conformance_cases_DoubleGT_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_DoubleGT_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_DoubleGTE_descriptor = - getDescriptor().getMessageTypes().get(22); + getDescriptor().getMessageTypes().get(24); internal_static_buf_validate_conformance_cases_DoubleGTE_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_DoubleGTE_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_DoubleGTLT_descriptor = - getDescriptor().getMessageTypes().get(23); + getDescriptor().getMessageTypes().get(25); internal_static_buf_validate_conformance_cases_DoubleGTLT_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_DoubleGTLT_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_DoubleExLTGT_descriptor = - getDescriptor().getMessageTypes().get(24); + getDescriptor().getMessageTypes().get(26); internal_static_buf_validate_conformance_cases_DoubleExLTGT_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_DoubleExLTGT_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_DoubleGTELTE_descriptor = - getDescriptor().getMessageTypes().get(25); + getDescriptor().getMessageTypes().get(27); internal_static_buf_validate_conformance_cases_DoubleGTELTE_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_DoubleGTELTE_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_DoubleExGTELTE_descriptor = - getDescriptor().getMessageTypes().get(26); + getDescriptor().getMessageTypes().get(28); internal_static_buf_validate_conformance_cases_DoubleExGTELTE_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_DoubleExGTELTE_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_DoubleFinite_descriptor = - getDescriptor().getMessageTypes().get(27); + getDescriptor().getMessageTypes().get(29); internal_static_buf_validate_conformance_cases_DoubleFinite_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_DoubleFinite_descriptor, new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_DoubleNotFinite_descriptor = + getDescriptor().getMessageTypes().get(30); + internal_static_buf_validate_conformance_cases_DoubleNotFinite_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_DoubleNotFinite_descriptor, + new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_DoubleIgnore_descriptor = - getDescriptor().getMessageTypes().get(28); + getDescriptor().getMessageTypes().get(31); internal_static_buf_validate_conformance_cases_DoubleIgnore_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_DoubleIgnore_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_DoubleIncorrectType_descriptor = - getDescriptor().getMessageTypes().get(29); + getDescriptor().getMessageTypes().get(32); internal_static_buf_validate_conformance_cases_DoubleIncorrectType_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_DoubleIncorrectType_descriptor, new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_DoubleExample_descriptor = + getDescriptor().getMessageTypes().get(33); + internal_static_buf_validate_conformance_cases_DoubleExample_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_DoubleExample_descriptor, + new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_Int32None_descriptor = - getDescriptor().getMessageTypes().get(30); + getDescriptor().getMessageTypes().get(34); internal_static_buf_validate_conformance_cases_Int32None_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_Int32None_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_Int32Const_descriptor = - getDescriptor().getMessageTypes().get(31); + getDescriptor().getMessageTypes().get(35); internal_static_buf_validate_conformance_cases_Int32Const_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_Int32Const_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_Int32In_descriptor = - getDescriptor().getMessageTypes().get(32); + getDescriptor().getMessageTypes().get(36); internal_static_buf_validate_conformance_cases_Int32In_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_Int32In_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_Int32NotIn_descriptor = - getDescriptor().getMessageTypes().get(33); + getDescriptor().getMessageTypes().get(37); internal_static_buf_validate_conformance_cases_Int32NotIn_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_Int32NotIn_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_Int32LT_descriptor = - getDescriptor().getMessageTypes().get(34); + getDescriptor().getMessageTypes().get(38); internal_static_buf_validate_conformance_cases_Int32LT_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_Int32LT_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_Int32LTE_descriptor = - getDescriptor().getMessageTypes().get(35); + getDescriptor().getMessageTypes().get(39); internal_static_buf_validate_conformance_cases_Int32LTE_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_Int32LTE_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_Int32GT_descriptor = - getDescriptor().getMessageTypes().get(36); + getDescriptor().getMessageTypes().get(40); internal_static_buf_validate_conformance_cases_Int32GT_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_Int32GT_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_Int32GTE_descriptor = - getDescriptor().getMessageTypes().get(37); + getDescriptor().getMessageTypes().get(41); internal_static_buf_validate_conformance_cases_Int32GTE_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_Int32GTE_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_Int32GTLT_descriptor = - getDescriptor().getMessageTypes().get(38); + getDescriptor().getMessageTypes().get(42); internal_static_buf_validate_conformance_cases_Int32GTLT_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_Int32GTLT_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_Int32ExLTGT_descriptor = - getDescriptor().getMessageTypes().get(39); + getDescriptor().getMessageTypes().get(43); internal_static_buf_validate_conformance_cases_Int32ExLTGT_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_Int32ExLTGT_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_Int32GTELTE_descriptor = - getDescriptor().getMessageTypes().get(40); + getDescriptor().getMessageTypes().get(44); internal_static_buf_validate_conformance_cases_Int32GTELTE_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_Int32GTELTE_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_Int32ExGTELTE_descriptor = - getDescriptor().getMessageTypes().get(41); + getDescriptor().getMessageTypes().get(45); internal_static_buf_validate_conformance_cases_Int32ExGTELTE_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_Int32ExGTELTE_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_Int32Ignore_descriptor = - getDescriptor().getMessageTypes().get(42); + getDescriptor().getMessageTypes().get(46); internal_static_buf_validate_conformance_cases_Int32Ignore_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_Int32Ignore_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_Int32IncorrectType_descriptor = - getDescriptor().getMessageTypes().get(43); + getDescriptor().getMessageTypes().get(47); internal_static_buf_validate_conformance_cases_Int32IncorrectType_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_Int32IncorrectType_descriptor, new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_Int32Example_descriptor = + getDescriptor().getMessageTypes().get(48); + internal_static_buf_validate_conformance_cases_Int32Example_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_Int32Example_descriptor, + new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_Int64None_descriptor = - getDescriptor().getMessageTypes().get(44); + getDescriptor().getMessageTypes().get(49); internal_static_buf_validate_conformance_cases_Int64None_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_Int64None_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_Int64Const_descriptor = - getDescriptor().getMessageTypes().get(45); + getDescriptor().getMessageTypes().get(50); internal_static_buf_validate_conformance_cases_Int64Const_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_Int64Const_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_Int64In_descriptor = - getDescriptor().getMessageTypes().get(46); + getDescriptor().getMessageTypes().get(51); internal_static_buf_validate_conformance_cases_Int64In_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_Int64In_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_Int64NotIn_descriptor = - getDescriptor().getMessageTypes().get(47); + getDescriptor().getMessageTypes().get(52); internal_static_buf_validate_conformance_cases_Int64NotIn_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_Int64NotIn_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_Int64LT_descriptor = - getDescriptor().getMessageTypes().get(48); + getDescriptor().getMessageTypes().get(53); internal_static_buf_validate_conformance_cases_Int64LT_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_Int64LT_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_Int64LTE_descriptor = - getDescriptor().getMessageTypes().get(49); + getDescriptor().getMessageTypes().get(54); internal_static_buf_validate_conformance_cases_Int64LTE_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_Int64LTE_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_Int64GT_descriptor = - getDescriptor().getMessageTypes().get(50); + getDescriptor().getMessageTypes().get(55); internal_static_buf_validate_conformance_cases_Int64GT_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_Int64GT_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_Int64GTE_descriptor = - getDescriptor().getMessageTypes().get(51); + getDescriptor().getMessageTypes().get(56); internal_static_buf_validate_conformance_cases_Int64GTE_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_Int64GTE_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_Int64GTLT_descriptor = - getDescriptor().getMessageTypes().get(52); + getDescriptor().getMessageTypes().get(57); internal_static_buf_validate_conformance_cases_Int64GTLT_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_Int64GTLT_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_Int64ExLTGT_descriptor = - getDescriptor().getMessageTypes().get(53); + getDescriptor().getMessageTypes().get(58); internal_static_buf_validate_conformance_cases_Int64ExLTGT_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_Int64ExLTGT_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_Int64GTELTE_descriptor = - getDescriptor().getMessageTypes().get(54); + getDescriptor().getMessageTypes().get(59); internal_static_buf_validate_conformance_cases_Int64GTELTE_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_Int64GTELTE_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_Int64ExGTELTE_descriptor = - getDescriptor().getMessageTypes().get(55); + getDescriptor().getMessageTypes().get(60); internal_static_buf_validate_conformance_cases_Int64ExGTELTE_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_Int64ExGTELTE_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_Int64Ignore_descriptor = - getDescriptor().getMessageTypes().get(56); + getDescriptor().getMessageTypes().get(61); internal_static_buf_validate_conformance_cases_Int64Ignore_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_Int64Ignore_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_Int64BigConstraints_descriptor = - getDescriptor().getMessageTypes().get(57); + getDescriptor().getMessageTypes().get(62); internal_static_buf_validate_conformance_cases_Int64BigConstraints_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_Int64BigConstraints_descriptor, new java.lang.String[] { "LtPos", "LtNeg", "GtPos", "GtNeg", "LtePos", "LteNeg", "GtePos", "GteNeg", "ConstantPos", "ConstantNeg", "In", "Notin", }); internal_static_buf_validate_conformance_cases_Int64IncorrectType_descriptor = - getDescriptor().getMessageTypes().get(58); + getDescriptor().getMessageTypes().get(63); internal_static_buf_validate_conformance_cases_Int64IncorrectType_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_Int64IncorrectType_descriptor, new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_Int64Example_descriptor = + getDescriptor().getMessageTypes().get(64); + internal_static_buf_validate_conformance_cases_Int64Example_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_Int64Example_descriptor, + new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_UInt32None_descriptor = - getDescriptor().getMessageTypes().get(59); + getDescriptor().getMessageTypes().get(65); internal_static_buf_validate_conformance_cases_UInt32None_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_UInt32None_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_UInt32Const_descriptor = - getDescriptor().getMessageTypes().get(60); + getDescriptor().getMessageTypes().get(66); internal_static_buf_validate_conformance_cases_UInt32Const_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_UInt32Const_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_UInt32In_descriptor = - getDescriptor().getMessageTypes().get(61); + getDescriptor().getMessageTypes().get(67); internal_static_buf_validate_conformance_cases_UInt32In_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_UInt32In_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_UInt32NotIn_descriptor = - getDescriptor().getMessageTypes().get(62); + getDescriptor().getMessageTypes().get(68); internal_static_buf_validate_conformance_cases_UInt32NotIn_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_UInt32NotIn_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_UInt32LT_descriptor = - getDescriptor().getMessageTypes().get(63); + getDescriptor().getMessageTypes().get(69); internal_static_buf_validate_conformance_cases_UInt32LT_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_UInt32LT_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_UInt32LTE_descriptor = - getDescriptor().getMessageTypes().get(64); + getDescriptor().getMessageTypes().get(70); internal_static_buf_validate_conformance_cases_UInt32LTE_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_UInt32LTE_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_UInt32GT_descriptor = - getDescriptor().getMessageTypes().get(65); + getDescriptor().getMessageTypes().get(71); internal_static_buf_validate_conformance_cases_UInt32GT_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_UInt32GT_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_UInt32GTE_descriptor = - getDescriptor().getMessageTypes().get(66); + getDescriptor().getMessageTypes().get(72); internal_static_buf_validate_conformance_cases_UInt32GTE_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_UInt32GTE_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_UInt32GTLT_descriptor = - getDescriptor().getMessageTypes().get(67); + getDescriptor().getMessageTypes().get(73); internal_static_buf_validate_conformance_cases_UInt32GTLT_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_UInt32GTLT_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_UInt32ExLTGT_descriptor = - getDescriptor().getMessageTypes().get(68); + getDescriptor().getMessageTypes().get(74); internal_static_buf_validate_conformance_cases_UInt32ExLTGT_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_UInt32ExLTGT_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_UInt32GTELTE_descriptor = - getDescriptor().getMessageTypes().get(69); + getDescriptor().getMessageTypes().get(75); internal_static_buf_validate_conformance_cases_UInt32GTELTE_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_UInt32GTELTE_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_UInt32ExGTELTE_descriptor = - getDescriptor().getMessageTypes().get(70); + getDescriptor().getMessageTypes().get(76); internal_static_buf_validate_conformance_cases_UInt32ExGTELTE_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_UInt32ExGTELTE_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_UInt32Ignore_descriptor = - getDescriptor().getMessageTypes().get(71); + getDescriptor().getMessageTypes().get(77); internal_static_buf_validate_conformance_cases_UInt32Ignore_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_UInt32Ignore_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_UInt32IncorrectType_descriptor = - getDescriptor().getMessageTypes().get(72); + getDescriptor().getMessageTypes().get(78); internal_static_buf_validate_conformance_cases_UInt32IncorrectType_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_UInt32IncorrectType_descriptor, new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_UInt32Example_descriptor = + getDescriptor().getMessageTypes().get(79); + internal_static_buf_validate_conformance_cases_UInt32Example_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_UInt32Example_descriptor, + new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_UInt64None_descriptor = - getDescriptor().getMessageTypes().get(73); + getDescriptor().getMessageTypes().get(80); internal_static_buf_validate_conformance_cases_UInt64None_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_UInt64None_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_UInt64Const_descriptor = - getDescriptor().getMessageTypes().get(74); + getDescriptor().getMessageTypes().get(81); internal_static_buf_validate_conformance_cases_UInt64Const_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_UInt64Const_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_UInt64In_descriptor = - getDescriptor().getMessageTypes().get(75); + getDescriptor().getMessageTypes().get(82); internal_static_buf_validate_conformance_cases_UInt64In_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_UInt64In_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_UInt64NotIn_descriptor = - getDescriptor().getMessageTypes().get(76); + getDescriptor().getMessageTypes().get(83); internal_static_buf_validate_conformance_cases_UInt64NotIn_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_UInt64NotIn_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_UInt64LT_descriptor = - getDescriptor().getMessageTypes().get(77); + getDescriptor().getMessageTypes().get(84); internal_static_buf_validate_conformance_cases_UInt64LT_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_UInt64LT_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_UInt64LTE_descriptor = - getDescriptor().getMessageTypes().get(78); + getDescriptor().getMessageTypes().get(85); internal_static_buf_validate_conformance_cases_UInt64LTE_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_UInt64LTE_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_UInt64GT_descriptor = - getDescriptor().getMessageTypes().get(79); + getDescriptor().getMessageTypes().get(86); internal_static_buf_validate_conformance_cases_UInt64GT_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_UInt64GT_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_UInt64GTE_descriptor = - getDescriptor().getMessageTypes().get(80); + getDescriptor().getMessageTypes().get(87); internal_static_buf_validate_conformance_cases_UInt64GTE_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_UInt64GTE_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_UInt64GTLT_descriptor = - getDescriptor().getMessageTypes().get(81); + getDescriptor().getMessageTypes().get(88); internal_static_buf_validate_conformance_cases_UInt64GTLT_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_UInt64GTLT_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_UInt64ExLTGT_descriptor = - getDescriptor().getMessageTypes().get(82); + getDescriptor().getMessageTypes().get(89); internal_static_buf_validate_conformance_cases_UInt64ExLTGT_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_UInt64ExLTGT_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_UInt64GTELTE_descriptor = - getDescriptor().getMessageTypes().get(83); + getDescriptor().getMessageTypes().get(90); internal_static_buf_validate_conformance_cases_UInt64GTELTE_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_UInt64GTELTE_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_UInt64ExGTELTE_descriptor = - getDescriptor().getMessageTypes().get(84); + getDescriptor().getMessageTypes().get(91); internal_static_buf_validate_conformance_cases_UInt64ExGTELTE_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_UInt64ExGTELTE_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_UInt64Ignore_descriptor = - getDescriptor().getMessageTypes().get(85); + getDescriptor().getMessageTypes().get(92); internal_static_buf_validate_conformance_cases_UInt64Ignore_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_UInt64Ignore_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_UInt64IncorrectType_descriptor = - getDescriptor().getMessageTypes().get(86); + getDescriptor().getMessageTypes().get(93); internal_static_buf_validate_conformance_cases_UInt64IncorrectType_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_UInt64IncorrectType_descriptor, new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_UInt64Example_descriptor = + getDescriptor().getMessageTypes().get(94); + internal_static_buf_validate_conformance_cases_UInt64Example_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_UInt64Example_descriptor, + new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_SInt32None_descriptor = - getDescriptor().getMessageTypes().get(87); + getDescriptor().getMessageTypes().get(95); internal_static_buf_validate_conformance_cases_SInt32None_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_SInt32None_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_SInt32Const_descriptor = - getDescriptor().getMessageTypes().get(88); + getDescriptor().getMessageTypes().get(96); internal_static_buf_validate_conformance_cases_SInt32Const_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_SInt32Const_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_SInt32In_descriptor = - getDescriptor().getMessageTypes().get(89); + getDescriptor().getMessageTypes().get(97); internal_static_buf_validate_conformance_cases_SInt32In_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_SInt32In_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_SInt32NotIn_descriptor = - getDescriptor().getMessageTypes().get(90); + getDescriptor().getMessageTypes().get(98); internal_static_buf_validate_conformance_cases_SInt32NotIn_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_SInt32NotIn_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_SInt32LT_descriptor = - getDescriptor().getMessageTypes().get(91); + getDescriptor().getMessageTypes().get(99); internal_static_buf_validate_conformance_cases_SInt32LT_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_SInt32LT_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_SInt32LTE_descriptor = - getDescriptor().getMessageTypes().get(92); + getDescriptor().getMessageTypes().get(100); internal_static_buf_validate_conformance_cases_SInt32LTE_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_SInt32LTE_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_SInt32GT_descriptor = - getDescriptor().getMessageTypes().get(93); + getDescriptor().getMessageTypes().get(101); internal_static_buf_validate_conformance_cases_SInt32GT_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_SInt32GT_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_SInt32GTE_descriptor = - getDescriptor().getMessageTypes().get(94); + getDescriptor().getMessageTypes().get(102); internal_static_buf_validate_conformance_cases_SInt32GTE_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_SInt32GTE_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_SInt32GTLT_descriptor = - getDescriptor().getMessageTypes().get(95); + getDescriptor().getMessageTypes().get(103); internal_static_buf_validate_conformance_cases_SInt32GTLT_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_SInt32GTLT_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_SInt32ExLTGT_descriptor = - getDescriptor().getMessageTypes().get(96); + getDescriptor().getMessageTypes().get(104); internal_static_buf_validate_conformance_cases_SInt32ExLTGT_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_SInt32ExLTGT_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_SInt32GTELTE_descriptor = - getDescriptor().getMessageTypes().get(97); + getDescriptor().getMessageTypes().get(105); internal_static_buf_validate_conformance_cases_SInt32GTELTE_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_SInt32GTELTE_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_SInt32ExGTELTE_descriptor = - getDescriptor().getMessageTypes().get(98); + getDescriptor().getMessageTypes().get(106); internal_static_buf_validate_conformance_cases_SInt32ExGTELTE_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_SInt32ExGTELTE_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_SInt32Ignore_descriptor = - getDescriptor().getMessageTypes().get(99); + getDescriptor().getMessageTypes().get(107); internal_static_buf_validate_conformance_cases_SInt32Ignore_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_SInt32Ignore_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_SInt32IncorrectType_descriptor = - getDescriptor().getMessageTypes().get(100); + getDescriptor().getMessageTypes().get(108); internal_static_buf_validate_conformance_cases_SInt32IncorrectType_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_SInt32IncorrectType_descriptor, new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_SInt32Example_descriptor = + getDescriptor().getMessageTypes().get(109); + internal_static_buf_validate_conformance_cases_SInt32Example_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_SInt32Example_descriptor, + new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_SInt64None_descriptor = - getDescriptor().getMessageTypes().get(101); + getDescriptor().getMessageTypes().get(110); internal_static_buf_validate_conformance_cases_SInt64None_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_SInt64None_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_SInt64Const_descriptor = - getDescriptor().getMessageTypes().get(102); + getDescriptor().getMessageTypes().get(111); internal_static_buf_validate_conformance_cases_SInt64Const_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_SInt64Const_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_SInt64In_descriptor = - getDescriptor().getMessageTypes().get(103); + getDescriptor().getMessageTypes().get(112); internal_static_buf_validate_conformance_cases_SInt64In_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_SInt64In_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_SInt64NotIn_descriptor = - getDescriptor().getMessageTypes().get(104); + getDescriptor().getMessageTypes().get(113); internal_static_buf_validate_conformance_cases_SInt64NotIn_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_SInt64NotIn_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_SInt64LT_descriptor = - getDescriptor().getMessageTypes().get(105); + getDescriptor().getMessageTypes().get(114); internal_static_buf_validate_conformance_cases_SInt64LT_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_SInt64LT_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_SInt64LTE_descriptor = - getDescriptor().getMessageTypes().get(106); + getDescriptor().getMessageTypes().get(115); internal_static_buf_validate_conformance_cases_SInt64LTE_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_SInt64LTE_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_SInt64GT_descriptor = - getDescriptor().getMessageTypes().get(107); + getDescriptor().getMessageTypes().get(116); internal_static_buf_validate_conformance_cases_SInt64GT_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_SInt64GT_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_SInt64GTE_descriptor = - getDescriptor().getMessageTypes().get(108); + getDescriptor().getMessageTypes().get(117); internal_static_buf_validate_conformance_cases_SInt64GTE_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_SInt64GTE_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_SInt64GTLT_descriptor = - getDescriptor().getMessageTypes().get(109); + getDescriptor().getMessageTypes().get(118); internal_static_buf_validate_conformance_cases_SInt64GTLT_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_SInt64GTLT_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_SInt64ExLTGT_descriptor = - getDescriptor().getMessageTypes().get(110); + getDescriptor().getMessageTypes().get(119); internal_static_buf_validate_conformance_cases_SInt64ExLTGT_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_SInt64ExLTGT_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_SInt64GTELTE_descriptor = - getDescriptor().getMessageTypes().get(111); + getDescriptor().getMessageTypes().get(120); internal_static_buf_validate_conformance_cases_SInt64GTELTE_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_SInt64GTELTE_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_SInt64ExGTELTE_descriptor = - getDescriptor().getMessageTypes().get(112); + getDescriptor().getMessageTypes().get(121); internal_static_buf_validate_conformance_cases_SInt64ExGTELTE_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_SInt64ExGTELTE_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_SInt64Ignore_descriptor = - getDescriptor().getMessageTypes().get(113); + getDescriptor().getMessageTypes().get(122); internal_static_buf_validate_conformance_cases_SInt64Ignore_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_SInt64Ignore_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_SInt64IncorrectType_descriptor = - getDescriptor().getMessageTypes().get(114); + getDescriptor().getMessageTypes().get(123); internal_static_buf_validate_conformance_cases_SInt64IncorrectType_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_SInt64IncorrectType_descriptor, new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_SInt64Example_descriptor = + getDescriptor().getMessageTypes().get(124); + internal_static_buf_validate_conformance_cases_SInt64Example_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_SInt64Example_descriptor, + new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_Fixed32None_descriptor = - getDescriptor().getMessageTypes().get(115); + getDescriptor().getMessageTypes().get(125); internal_static_buf_validate_conformance_cases_Fixed32None_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_Fixed32None_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_Fixed32Const_descriptor = - getDescriptor().getMessageTypes().get(116); + getDescriptor().getMessageTypes().get(126); internal_static_buf_validate_conformance_cases_Fixed32Const_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_Fixed32Const_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_Fixed32In_descriptor = - getDescriptor().getMessageTypes().get(117); + getDescriptor().getMessageTypes().get(127); internal_static_buf_validate_conformance_cases_Fixed32In_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_Fixed32In_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_Fixed32NotIn_descriptor = - getDescriptor().getMessageTypes().get(118); + getDescriptor().getMessageTypes().get(128); internal_static_buf_validate_conformance_cases_Fixed32NotIn_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_Fixed32NotIn_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_Fixed32LT_descriptor = - getDescriptor().getMessageTypes().get(119); + getDescriptor().getMessageTypes().get(129); internal_static_buf_validate_conformance_cases_Fixed32LT_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_Fixed32LT_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_Fixed32LTE_descriptor = - getDescriptor().getMessageTypes().get(120); + getDescriptor().getMessageTypes().get(130); internal_static_buf_validate_conformance_cases_Fixed32LTE_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_Fixed32LTE_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_Fixed32GT_descriptor = - getDescriptor().getMessageTypes().get(121); + getDescriptor().getMessageTypes().get(131); internal_static_buf_validate_conformance_cases_Fixed32GT_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_Fixed32GT_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_Fixed32GTE_descriptor = - getDescriptor().getMessageTypes().get(122); + getDescriptor().getMessageTypes().get(132); internal_static_buf_validate_conformance_cases_Fixed32GTE_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_Fixed32GTE_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_Fixed32GTLT_descriptor = - getDescriptor().getMessageTypes().get(123); + getDescriptor().getMessageTypes().get(133); internal_static_buf_validate_conformance_cases_Fixed32GTLT_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_Fixed32GTLT_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_Fixed32ExLTGT_descriptor = - getDescriptor().getMessageTypes().get(124); + getDescriptor().getMessageTypes().get(134); internal_static_buf_validate_conformance_cases_Fixed32ExLTGT_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_Fixed32ExLTGT_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_Fixed32GTELTE_descriptor = - getDescriptor().getMessageTypes().get(125); + getDescriptor().getMessageTypes().get(135); internal_static_buf_validate_conformance_cases_Fixed32GTELTE_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_Fixed32GTELTE_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_Fixed32ExGTELTE_descriptor = - getDescriptor().getMessageTypes().get(126); + getDescriptor().getMessageTypes().get(136); internal_static_buf_validate_conformance_cases_Fixed32ExGTELTE_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_Fixed32ExGTELTE_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_Fixed32Ignore_descriptor = - getDescriptor().getMessageTypes().get(127); + getDescriptor().getMessageTypes().get(137); internal_static_buf_validate_conformance_cases_Fixed32Ignore_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_Fixed32Ignore_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_Fixed32IncorrectType_descriptor = - getDescriptor().getMessageTypes().get(128); + getDescriptor().getMessageTypes().get(138); internal_static_buf_validate_conformance_cases_Fixed32IncorrectType_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_Fixed32IncorrectType_descriptor, new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_Fixed32Example_descriptor = + getDescriptor().getMessageTypes().get(139); + internal_static_buf_validate_conformance_cases_Fixed32Example_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_Fixed32Example_descriptor, + new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_Fixed64None_descriptor = - getDescriptor().getMessageTypes().get(129); + getDescriptor().getMessageTypes().get(140); internal_static_buf_validate_conformance_cases_Fixed64None_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_Fixed64None_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_Fixed64Const_descriptor = - getDescriptor().getMessageTypes().get(130); + getDescriptor().getMessageTypes().get(141); internal_static_buf_validate_conformance_cases_Fixed64Const_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_Fixed64Const_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_Fixed64In_descriptor = - getDescriptor().getMessageTypes().get(131); + getDescriptor().getMessageTypes().get(142); internal_static_buf_validate_conformance_cases_Fixed64In_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_Fixed64In_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_Fixed64NotIn_descriptor = - getDescriptor().getMessageTypes().get(132); + getDescriptor().getMessageTypes().get(143); internal_static_buf_validate_conformance_cases_Fixed64NotIn_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_Fixed64NotIn_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_Fixed64LT_descriptor = - getDescriptor().getMessageTypes().get(133); + getDescriptor().getMessageTypes().get(144); internal_static_buf_validate_conformance_cases_Fixed64LT_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_Fixed64LT_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_Fixed64LTE_descriptor = - getDescriptor().getMessageTypes().get(134); + getDescriptor().getMessageTypes().get(145); internal_static_buf_validate_conformance_cases_Fixed64LTE_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_Fixed64LTE_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_Fixed64GT_descriptor = - getDescriptor().getMessageTypes().get(135); + getDescriptor().getMessageTypes().get(146); internal_static_buf_validate_conformance_cases_Fixed64GT_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_Fixed64GT_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_Fixed64GTE_descriptor = - getDescriptor().getMessageTypes().get(136); + getDescriptor().getMessageTypes().get(147); internal_static_buf_validate_conformance_cases_Fixed64GTE_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_Fixed64GTE_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_Fixed64GTLT_descriptor = - getDescriptor().getMessageTypes().get(137); + getDescriptor().getMessageTypes().get(148); internal_static_buf_validate_conformance_cases_Fixed64GTLT_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_Fixed64GTLT_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_Fixed64ExLTGT_descriptor = - getDescriptor().getMessageTypes().get(138); + getDescriptor().getMessageTypes().get(149); internal_static_buf_validate_conformance_cases_Fixed64ExLTGT_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_Fixed64ExLTGT_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_Fixed64GTELTE_descriptor = - getDescriptor().getMessageTypes().get(139); + getDescriptor().getMessageTypes().get(150); internal_static_buf_validate_conformance_cases_Fixed64GTELTE_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_Fixed64GTELTE_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_Fixed64ExGTELTE_descriptor = - getDescriptor().getMessageTypes().get(140); + getDescriptor().getMessageTypes().get(151); internal_static_buf_validate_conformance_cases_Fixed64ExGTELTE_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_Fixed64ExGTELTE_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_Fixed64Ignore_descriptor = - getDescriptor().getMessageTypes().get(141); + getDescriptor().getMessageTypes().get(152); internal_static_buf_validate_conformance_cases_Fixed64Ignore_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_Fixed64Ignore_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_Fixed64IncorrectType_descriptor = - getDescriptor().getMessageTypes().get(142); + getDescriptor().getMessageTypes().get(153); internal_static_buf_validate_conformance_cases_Fixed64IncorrectType_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_Fixed64IncorrectType_descriptor, new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_Fixed64Example_descriptor = + getDescriptor().getMessageTypes().get(154); + internal_static_buf_validate_conformance_cases_Fixed64Example_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_Fixed64Example_descriptor, + new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_SFixed32None_descriptor = - getDescriptor().getMessageTypes().get(143); + getDescriptor().getMessageTypes().get(155); internal_static_buf_validate_conformance_cases_SFixed32None_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_SFixed32None_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_SFixed32Const_descriptor = - getDescriptor().getMessageTypes().get(144); + getDescriptor().getMessageTypes().get(156); internal_static_buf_validate_conformance_cases_SFixed32Const_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_SFixed32Const_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_SFixed32In_descriptor = - getDescriptor().getMessageTypes().get(145); + getDescriptor().getMessageTypes().get(157); internal_static_buf_validate_conformance_cases_SFixed32In_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_SFixed32In_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_SFixed32NotIn_descriptor = - getDescriptor().getMessageTypes().get(146); + getDescriptor().getMessageTypes().get(158); internal_static_buf_validate_conformance_cases_SFixed32NotIn_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_SFixed32NotIn_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_SFixed32LT_descriptor = - getDescriptor().getMessageTypes().get(147); + getDescriptor().getMessageTypes().get(159); internal_static_buf_validate_conformance_cases_SFixed32LT_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_SFixed32LT_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_SFixed32LTE_descriptor = - getDescriptor().getMessageTypes().get(148); + getDescriptor().getMessageTypes().get(160); internal_static_buf_validate_conformance_cases_SFixed32LTE_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_SFixed32LTE_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_SFixed32GT_descriptor = - getDescriptor().getMessageTypes().get(149); + getDescriptor().getMessageTypes().get(161); internal_static_buf_validate_conformance_cases_SFixed32GT_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_SFixed32GT_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_SFixed32GTE_descriptor = - getDescriptor().getMessageTypes().get(150); + getDescriptor().getMessageTypes().get(162); internal_static_buf_validate_conformance_cases_SFixed32GTE_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_SFixed32GTE_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_SFixed32GTLT_descriptor = - getDescriptor().getMessageTypes().get(151); + getDescriptor().getMessageTypes().get(163); internal_static_buf_validate_conformance_cases_SFixed32GTLT_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_SFixed32GTLT_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_SFixed32ExLTGT_descriptor = - getDescriptor().getMessageTypes().get(152); + getDescriptor().getMessageTypes().get(164); internal_static_buf_validate_conformance_cases_SFixed32ExLTGT_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_SFixed32ExLTGT_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_SFixed32GTELTE_descriptor = - getDescriptor().getMessageTypes().get(153); + getDescriptor().getMessageTypes().get(165); internal_static_buf_validate_conformance_cases_SFixed32GTELTE_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_SFixed32GTELTE_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_SFixed32ExGTELTE_descriptor = - getDescriptor().getMessageTypes().get(154); + getDescriptor().getMessageTypes().get(166); internal_static_buf_validate_conformance_cases_SFixed32ExGTELTE_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_SFixed32ExGTELTE_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_SFixed32Ignore_descriptor = - getDescriptor().getMessageTypes().get(155); + getDescriptor().getMessageTypes().get(167); internal_static_buf_validate_conformance_cases_SFixed32Ignore_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_SFixed32Ignore_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_SFixed32IncorrectType_descriptor = - getDescriptor().getMessageTypes().get(156); + getDescriptor().getMessageTypes().get(168); internal_static_buf_validate_conformance_cases_SFixed32IncorrectType_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_SFixed32IncorrectType_descriptor, new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_SFixed32Example_descriptor = + getDescriptor().getMessageTypes().get(169); + internal_static_buf_validate_conformance_cases_SFixed32Example_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_SFixed32Example_descriptor, + new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_SFixed64None_descriptor = - getDescriptor().getMessageTypes().get(157); + getDescriptor().getMessageTypes().get(170); internal_static_buf_validate_conformance_cases_SFixed64None_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_SFixed64None_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_SFixed64Const_descriptor = - getDescriptor().getMessageTypes().get(158); + getDescriptor().getMessageTypes().get(171); internal_static_buf_validate_conformance_cases_SFixed64Const_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_SFixed64Const_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_SFixed64In_descriptor = - getDescriptor().getMessageTypes().get(159); + getDescriptor().getMessageTypes().get(172); internal_static_buf_validate_conformance_cases_SFixed64In_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_SFixed64In_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_SFixed64NotIn_descriptor = - getDescriptor().getMessageTypes().get(160); + getDescriptor().getMessageTypes().get(173); internal_static_buf_validate_conformance_cases_SFixed64NotIn_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_SFixed64NotIn_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_SFixed64LT_descriptor = - getDescriptor().getMessageTypes().get(161); + getDescriptor().getMessageTypes().get(174); internal_static_buf_validate_conformance_cases_SFixed64LT_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_SFixed64LT_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_SFixed64LTE_descriptor = - getDescriptor().getMessageTypes().get(162); + getDescriptor().getMessageTypes().get(175); internal_static_buf_validate_conformance_cases_SFixed64LTE_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_SFixed64LTE_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_SFixed64GT_descriptor = - getDescriptor().getMessageTypes().get(163); + getDescriptor().getMessageTypes().get(176); internal_static_buf_validate_conformance_cases_SFixed64GT_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_SFixed64GT_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_SFixed64GTE_descriptor = - getDescriptor().getMessageTypes().get(164); + getDescriptor().getMessageTypes().get(177); internal_static_buf_validate_conformance_cases_SFixed64GTE_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_SFixed64GTE_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_SFixed64GTLT_descriptor = - getDescriptor().getMessageTypes().get(165); + getDescriptor().getMessageTypes().get(178); internal_static_buf_validate_conformance_cases_SFixed64GTLT_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_SFixed64GTLT_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_SFixed64ExLTGT_descriptor = - getDescriptor().getMessageTypes().get(166); + getDescriptor().getMessageTypes().get(179); internal_static_buf_validate_conformance_cases_SFixed64ExLTGT_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_SFixed64ExLTGT_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_SFixed64GTELTE_descriptor = - getDescriptor().getMessageTypes().get(167); + getDescriptor().getMessageTypes().get(180); internal_static_buf_validate_conformance_cases_SFixed64GTELTE_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_SFixed64GTELTE_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_SFixed64ExGTELTE_descriptor = - getDescriptor().getMessageTypes().get(168); + getDescriptor().getMessageTypes().get(181); internal_static_buf_validate_conformance_cases_SFixed64ExGTELTE_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_SFixed64ExGTELTE_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_SFixed64Ignore_descriptor = - getDescriptor().getMessageTypes().get(169); + getDescriptor().getMessageTypes().get(182); internal_static_buf_validate_conformance_cases_SFixed64Ignore_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_SFixed64Ignore_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_SFixed64IncorrectType_descriptor = - getDescriptor().getMessageTypes().get(170); + getDescriptor().getMessageTypes().get(183); internal_static_buf_validate_conformance_cases_SFixed64IncorrectType_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_SFixed64IncorrectType_descriptor, new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_SFixed64Example_descriptor = + getDescriptor().getMessageTypes().get(184); + internal_static_buf_validate_conformance_cases_SFixed64Example_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_SFixed64Example_descriptor, + new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_Int64LTEOptional_descriptor = - getDescriptor().getMessageTypes().get(171); + getDescriptor().getMessageTypes().get(185); internal_static_buf_validate_conformance_cases_Int64LTEOptional_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_Int64LTEOptional_descriptor, diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedAndCustomRuleEdition2023.java b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedAndCustomRuleEdition2023.java new file mode 100644 index 00000000..5808fcf4 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedAndCustomRuleEdition2023.java @@ -0,0 +1,1110 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/predefined_rules_proto_editions.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.PredefinedAndCustomRuleEdition2023} + */ +public final class PredefinedAndCustomRuleEdition2023 extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.PredefinedAndCustomRuleEdition2023) + PredefinedAndCustomRuleEdition2023OrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 1, + /* suffix= */ "", + PredefinedAndCustomRuleEdition2023.class.getName()); + } + // Use PredefinedAndCustomRuleEdition2023.newBuilder() to construct. + private PredefinedAndCustomRuleEdition2023(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private PredefinedAndCustomRuleEdition2023() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.internal_static_buf_validate_conformance_cases_PredefinedAndCustomRuleEdition2023_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.internal_static_buf_validate_conformance_cases_PredefinedAndCustomRuleEdition2023_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.PredefinedAndCustomRuleEdition2023.class, build.buf.validate.conformance.cases.PredefinedAndCustomRuleEdition2023.Builder.class); + } + + public interface NestedOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.PredefinedAndCustomRuleEdition2023.Nested) + com.google.protobuf.MessageOrBuilder { + + /** + * int32 c = 1 [json_name = "c", (.buf.validate.field) = { ... } + * @return Whether the c field is set. + */ + boolean hasC(); + /** + * int32 c = 1 [json_name = "c", (.buf.validate.field) = { ... } + * @return The c. + */ + int getC(); + } + /** + * Protobuf type {@code buf.validate.conformance.cases.PredefinedAndCustomRuleEdition2023.Nested} + */ + public static final class Nested extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.PredefinedAndCustomRuleEdition2023.Nested) + NestedOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 1, + /* suffix= */ "", + Nested.class.getName()); + } + // Use Nested.newBuilder() to construct. + private Nested(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private Nested() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.internal_static_buf_validate_conformance_cases_PredefinedAndCustomRuleEdition2023_Nested_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.internal_static_buf_validate_conformance_cases_PredefinedAndCustomRuleEdition2023_Nested_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.PredefinedAndCustomRuleEdition2023.Nested.class, build.buf.validate.conformance.cases.PredefinedAndCustomRuleEdition2023.Nested.Builder.class); + } + + private int bitField0_; + public static final int C_FIELD_NUMBER = 1; + private int c_ = 0; + /** + * int32 c = 1 [json_name = "c", (.buf.validate.field) = { ... } + * @return Whether the c field is set. + */ + @java.lang.Override + public boolean hasC() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * int32 c = 1 [json_name = "c", (.buf.validate.field) = { ... } + * @return The c. + */ + @java.lang.Override + public int getC() { + return c_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + output.writeInt32(1, c_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(1, c_); + } + 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.PredefinedAndCustomRuleEdition2023.Nested)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.PredefinedAndCustomRuleEdition2023.Nested other = (build.buf.validate.conformance.cases.PredefinedAndCustomRuleEdition2023.Nested) obj; + + if (hasC() != other.hasC()) return false; + if (hasC()) { + if (getC() + != other.getC()) 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 (hasC()) { + hash = (37 * hash) + C_FIELD_NUMBER; + hash = (53 * hash) + getC(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.PredefinedAndCustomRuleEdition2023.Nested parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedAndCustomRuleEdition2023.Nested 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.PredefinedAndCustomRuleEdition2023.Nested parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedAndCustomRuleEdition2023.Nested 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.PredefinedAndCustomRuleEdition2023.Nested parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedAndCustomRuleEdition2023.Nested 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.PredefinedAndCustomRuleEdition2023.Nested parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.PredefinedAndCustomRuleEdition2023.Nested 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.PredefinedAndCustomRuleEdition2023.Nested parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.PredefinedAndCustomRuleEdition2023.Nested 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.PredefinedAndCustomRuleEdition2023.Nested 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.PredefinedAndCustomRuleEdition2023.Nested 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.PredefinedAndCustomRuleEdition2023.Nested 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.PredefinedAndCustomRuleEdition2023.Nested} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.PredefinedAndCustomRuleEdition2023.Nested) + build.buf.validate.conformance.cases.PredefinedAndCustomRuleEdition2023.NestedOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.internal_static_buf_validate_conformance_cases_PredefinedAndCustomRuleEdition2023_Nested_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.internal_static_buf_validate_conformance_cases_PredefinedAndCustomRuleEdition2023_Nested_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.PredefinedAndCustomRuleEdition2023.Nested.class, build.buf.validate.conformance.cases.PredefinedAndCustomRuleEdition2023.Nested.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.PredefinedAndCustomRuleEdition2023.Nested.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + c_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.internal_static_buf_validate_conformance_cases_PredefinedAndCustomRuleEdition2023_Nested_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedAndCustomRuleEdition2023.Nested getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.PredefinedAndCustomRuleEdition2023.Nested.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedAndCustomRuleEdition2023.Nested build() { + build.buf.validate.conformance.cases.PredefinedAndCustomRuleEdition2023.Nested result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedAndCustomRuleEdition2023.Nested buildPartial() { + build.buf.validate.conformance.cases.PredefinedAndCustomRuleEdition2023.Nested result = new build.buf.validate.conformance.cases.PredefinedAndCustomRuleEdition2023.Nested(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.PredefinedAndCustomRuleEdition2023.Nested result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.c_ = c_; + 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.PredefinedAndCustomRuleEdition2023.Nested) { + return mergeFrom((build.buf.validate.conformance.cases.PredefinedAndCustomRuleEdition2023.Nested)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.PredefinedAndCustomRuleEdition2023.Nested other) { + if (other == build.buf.validate.conformance.cases.PredefinedAndCustomRuleEdition2023.Nested.getDefaultInstance()) return this; + if (other.hasC()) { + setC(other.getC()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + c_ = input.readInt32(); + bitField0_ |= 0x00000001; + break; + } // case 8 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private int c_ ; + /** + * int32 c = 1 [json_name = "c", (.buf.validate.field) = { ... } + * @return Whether the c field is set. + */ + @java.lang.Override + public boolean hasC() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * int32 c = 1 [json_name = "c", (.buf.validate.field) = { ... } + * @return The c. + */ + @java.lang.Override + public int getC() { + return c_; + } + /** + * int32 c = 1 [json_name = "c", (.buf.validate.field) = { ... } + * @param value The c to set. + * @return This builder for chaining. + */ + public Builder setC(int value) { + + c_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * int32 c = 1 [json_name = "c", (.buf.validate.field) = { ... } + * @return This builder for chaining. + */ + public Builder clearC() { + bitField0_ = (bitField0_ & ~0x00000001); + c_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.PredefinedAndCustomRuleEdition2023.Nested) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.PredefinedAndCustomRuleEdition2023.Nested) + private static final build.buf.validate.conformance.cases.PredefinedAndCustomRuleEdition2023.Nested DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.PredefinedAndCustomRuleEdition2023.Nested(); + } + + public static build.buf.validate.conformance.cases.PredefinedAndCustomRuleEdition2023.Nested getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Nested 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.PredefinedAndCustomRuleEdition2023.Nested getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private int bitField0_; + public static final int A_FIELD_NUMBER = 1; + private int a_ = 0; + /** + * int32 a = 1 [json_name = "a", (.buf.validate.field) = { ... } + * @return Whether the a field is set. + */ + @java.lang.Override + public boolean hasA() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * int32 a = 1 [json_name = "a", (.buf.validate.field) = { ... } + * @return The a. + */ + @java.lang.Override + public int getA() { + return a_; + } + + public static final int B_FIELD_NUMBER = 2; + private build.buf.validate.conformance.cases.PredefinedAndCustomRuleEdition2023.Nested b_; + /** + * .buf.validate.conformance.cases.PredefinedAndCustomRuleEdition2023.Nested b = 2 [json_name = "b", (.buf.validate.field) = { ... } + * @return Whether the b field is set. + */ + @java.lang.Override + public boolean hasB() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * .buf.validate.conformance.cases.PredefinedAndCustomRuleEdition2023.Nested b = 2 [json_name = "b", (.buf.validate.field) = { ... } + * @return The b. + */ + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedAndCustomRuleEdition2023.Nested getB() { + return b_ == null ? build.buf.validate.conformance.cases.PredefinedAndCustomRuleEdition2023.Nested.getDefaultInstance() : b_; + } + /** + * .buf.validate.conformance.cases.PredefinedAndCustomRuleEdition2023.Nested b = 2 [json_name = "b", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedAndCustomRuleEdition2023.NestedOrBuilder getBOrBuilder() { + return b_ == null ? build.buf.validate.conformance.cases.PredefinedAndCustomRuleEdition2023.Nested.getDefaultInstance() : b_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + output.writeInt32(1, a_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(2, getB()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(1, a_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getB()); + } + 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.PredefinedAndCustomRuleEdition2023)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.PredefinedAndCustomRuleEdition2023 other = (build.buf.validate.conformance.cases.PredefinedAndCustomRuleEdition2023) obj; + + if (hasA() != other.hasA()) return false; + if (hasA()) { + if (getA() + != other.getA()) return false; + } + if (hasB() != other.hasB()) return false; + if (hasB()) { + if (!getB() + .equals(other.getB())) 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 (hasA()) { + hash = (37 * hash) + A_FIELD_NUMBER; + hash = (53 * hash) + getA(); + } + if (hasB()) { + hash = (37 * hash) + B_FIELD_NUMBER; + hash = (53 * hash) + getB().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.PredefinedAndCustomRuleEdition2023 parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedAndCustomRuleEdition2023 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.PredefinedAndCustomRuleEdition2023 parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedAndCustomRuleEdition2023 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.PredefinedAndCustomRuleEdition2023 parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedAndCustomRuleEdition2023 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.PredefinedAndCustomRuleEdition2023 parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.PredefinedAndCustomRuleEdition2023 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.PredefinedAndCustomRuleEdition2023 parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.PredefinedAndCustomRuleEdition2023 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.PredefinedAndCustomRuleEdition2023 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.PredefinedAndCustomRuleEdition2023 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.PredefinedAndCustomRuleEdition2023 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.PredefinedAndCustomRuleEdition2023} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.PredefinedAndCustomRuleEdition2023) + build.buf.validate.conformance.cases.PredefinedAndCustomRuleEdition2023OrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.internal_static_buf_validate_conformance_cases_PredefinedAndCustomRuleEdition2023_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.internal_static_buf_validate_conformance_cases_PredefinedAndCustomRuleEdition2023_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.PredefinedAndCustomRuleEdition2023.class, build.buf.validate.conformance.cases.PredefinedAndCustomRuleEdition2023.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.PredefinedAndCustomRuleEdition2023.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage + .alwaysUseFieldBuilders) { + getBFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + a_ = 0; + b_ = null; + if (bBuilder_ != null) { + bBuilder_.dispose(); + bBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.internal_static_buf_validate_conformance_cases_PredefinedAndCustomRuleEdition2023_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedAndCustomRuleEdition2023 getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.PredefinedAndCustomRuleEdition2023.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedAndCustomRuleEdition2023 build() { + build.buf.validate.conformance.cases.PredefinedAndCustomRuleEdition2023 result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedAndCustomRuleEdition2023 buildPartial() { + build.buf.validate.conformance.cases.PredefinedAndCustomRuleEdition2023 result = new build.buf.validate.conformance.cases.PredefinedAndCustomRuleEdition2023(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.PredefinedAndCustomRuleEdition2023 result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.a_ = a_; + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.b_ = bBuilder_ == null + ? b_ + : bBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof build.buf.validate.conformance.cases.PredefinedAndCustomRuleEdition2023) { + return mergeFrom((build.buf.validate.conformance.cases.PredefinedAndCustomRuleEdition2023)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.PredefinedAndCustomRuleEdition2023 other) { + if (other == build.buf.validate.conformance.cases.PredefinedAndCustomRuleEdition2023.getDefaultInstance()) return this; + if (other.hasA()) { + setA(other.getA()); + } + if (other.hasB()) { + mergeB(other.getB()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + a_ = input.readInt32(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: { + input.readMessage( + getBFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000002; + 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 bitField0_; + + private int a_ ; + /** + * int32 a = 1 [json_name = "a", (.buf.validate.field) = { ... } + * @return Whether the a field is set. + */ + @java.lang.Override + public boolean hasA() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * int32 a = 1 [json_name = "a", (.buf.validate.field) = { ... } + * @return The a. + */ + @java.lang.Override + public int getA() { + return a_; + } + /** + * int32 a = 1 [json_name = "a", (.buf.validate.field) = { ... } + * @param value The a to set. + * @return This builder for chaining. + */ + public Builder setA(int value) { + + a_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * int32 a = 1 [json_name = "a", (.buf.validate.field) = { ... } + * @return This builder for chaining. + */ + public Builder clearA() { + bitField0_ = (bitField0_ & ~0x00000001); + a_ = 0; + onChanged(); + return this; + } + + private build.buf.validate.conformance.cases.PredefinedAndCustomRuleEdition2023.Nested b_; + private com.google.protobuf.SingleFieldBuilder< + build.buf.validate.conformance.cases.PredefinedAndCustomRuleEdition2023.Nested, build.buf.validate.conformance.cases.PredefinedAndCustomRuleEdition2023.Nested.Builder, build.buf.validate.conformance.cases.PredefinedAndCustomRuleEdition2023.NestedOrBuilder> bBuilder_; + /** + * .buf.validate.conformance.cases.PredefinedAndCustomRuleEdition2023.Nested b = 2 [json_name = "b", (.buf.validate.field) = { ... } + * @return Whether the b field is set. + */ + public boolean hasB() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * .buf.validate.conformance.cases.PredefinedAndCustomRuleEdition2023.Nested b = 2 [json_name = "b", (.buf.validate.field) = { ... } + * @return The b. + */ + public build.buf.validate.conformance.cases.PredefinedAndCustomRuleEdition2023.Nested getB() { + if (bBuilder_ == null) { + return b_ == null ? build.buf.validate.conformance.cases.PredefinedAndCustomRuleEdition2023.Nested.getDefaultInstance() : b_; + } else { + return bBuilder_.getMessage(); + } + } + /** + * .buf.validate.conformance.cases.PredefinedAndCustomRuleEdition2023.Nested b = 2 [json_name = "b", (.buf.validate.field) = { ... } + */ + public Builder setB(build.buf.validate.conformance.cases.PredefinedAndCustomRuleEdition2023.Nested value) { + if (bBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + b_ = value; + } else { + bBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * .buf.validate.conformance.cases.PredefinedAndCustomRuleEdition2023.Nested b = 2 [json_name = "b", (.buf.validate.field) = { ... } + */ + public Builder setB( + build.buf.validate.conformance.cases.PredefinedAndCustomRuleEdition2023.Nested.Builder builderForValue) { + if (bBuilder_ == null) { + b_ = builderForValue.build(); + } else { + bBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * .buf.validate.conformance.cases.PredefinedAndCustomRuleEdition2023.Nested b = 2 [json_name = "b", (.buf.validate.field) = { ... } + */ + public Builder mergeB(build.buf.validate.conformance.cases.PredefinedAndCustomRuleEdition2023.Nested value) { + if (bBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) && + b_ != null && + b_ != build.buf.validate.conformance.cases.PredefinedAndCustomRuleEdition2023.Nested.getDefaultInstance()) { + getBBuilder().mergeFrom(value); + } else { + b_ = value; + } + } else { + bBuilder_.mergeFrom(value); + } + if (b_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + /** + * .buf.validate.conformance.cases.PredefinedAndCustomRuleEdition2023.Nested b = 2 [json_name = "b", (.buf.validate.field) = { ... } + */ + public Builder clearB() { + bitField0_ = (bitField0_ & ~0x00000002); + b_ = null; + if (bBuilder_ != null) { + bBuilder_.dispose(); + bBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .buf.validate.conformance.cases.PredefinedAndCustomRuleEdition2023.Nested b = 2 [json_name = "b", (.buf.validate.field) = { ... } + */ + public build.buf.validate.conformance.cases.PredefinedAndCustomRuleEdition2023.Nested.Builder getBBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getBFieldBuilder().getBuilder(); + } + /** + * .buf.validate.conformance.cases.PredefinedAndCustomRuleEdition2023.Nested b = 2 [json_name = "b", (.buf.validate.field) = { ... } + */ + public build.buf.validate.conformance.cases.PredefinedAndCustomRuleEdition2023.NestedOrBuilder getBOrBuilder() { + if (bBuilder_ != null) { + return bBuilder_.getMessageOrBuilder(); + } else { + return b_ == null ? + build.buf.validate.conformance.cases.PredefinedAndCustomRuleEdition2023.Nested.getDefaultInstance() : b_; + } + } + /** + * .buf.validate.conformance.cases.PredefinedAndCustomRuleEdition2023.Nested b = 2 [json_name = "b", (.buf.validate.field) = { ... } + */ + private com.google.protobuf.SingleFieldBuilder< + build.buf.validate.conformance.cases.PredefinedAndCustomRuleEdition2023.Nested, build.buf.validate.conformance.cases.PredefinedAndCustomRuleEdition2023.Nested.Builder, build.buf.validate.conformance.cases.PredefinedAndCustomRuleEdition2023.NestedOrBuilder> + getBFieldBuilder() { + if (bBuilder_ == null) { + bBuilder_ = new com.google.protobuf.SingleFieldBuilder< + build.buf.validate.conformance.cases.PredefinedAndCustomRuleEdition2023.Nested, build.buf.validate.conformance.cases.PredefinedAndCustomRuleEdition2023.Nested.Builder, build.buf.validate.conformance.cases.PredefinedAndCustomRuleEdition2023.NestedOrBuilder>( + getB(), + getParentForChildren(), + isClean()); + b_ = null; + } + return bBuilder_; + } + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.PredefinedAndCustomRuleEdition2023) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.PredefinedAndCustomRuleEdition2023) + private static final build.buf.validate.conformance.cases.PredefinedAndCustomRuleEdition2023 DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.PredefinedAndCustomRuleEdition2023(); + } + + public static build.buf.validate.conformance.cases.PredefinedAndCustomRuleEdition2023 getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PredefinedAndCustomRuleEdition2023 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.PredefinedAndCustomRuleEdition2023 getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedAndCustomRuleEdition2023OrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedAndCustomRuleEdition2023OrBuilder.java new file mode 100644 index 00000000..d5fb1a7a --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedAndCustomRuleEdition2023OrBuilder.java @@ -0,0 +1,37 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/predefined_rules_proto_editions.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +public interface PredefinedAndCustomRuleEdition2023OrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.PredefinedAndCustomRuleEdition2023) + com.google.protobuf.MessageOrBuilder { + + /** + * int32 a = 1 [json_name = "a", (.buf.validate.field) = { ... } + * @return Whether the a field is set. + */ + boolean hasA(); + /** + * int32 a = 1 [json_name = "a", (.buf.validate.field) = { ... } + * @return The a. + */ + int getA(); + + /** + * .buf.validate.conformance.cases.PredefinedAndCustomRuleEdition2023.Nested b = 2 [json_name = "b", (.buf.validate.field) = { ... } + * @return Whether the b field is set. + */ + boolean hasB(); + /** + * .buf.validate.conformance.cases.PredefinedAndCustomRuleEdition2023.Nested b = 2 [json_name = "b", (.buf.validate.field) = { ... } + * @return The b. + */ + build.buf.validate.conformance.cases.PredefinedAndCustomRuleEdition2023.Nested getB(); + /** + * .buf.validate.conformance.cases.PredefinedAndCustomRuleEdition2023.Nested b = 2 [json_name = "b", (.buf.validate.field) = { ... } + */ + build.buf.validate.conformance.cases.PredefinedAndCustomRuleEdition2023.NestedOrBuilder getBOrBuilder(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedAndCustomRuleProto2.java b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedAndCustomRuleProto2.java new file mode 100644 index 00000000..23f8c512 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedAndCustomRuleProto2.java @@ -0,0 +1,1110 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/predefined_rules_proto2.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.PredefinedAndCustomRuleProto2} + */ +public final class PredefinedAndCustomRuleProto2 extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.PredefinedAndCustomRuleProto2) + PredefinedAndCustomRuleProto2OrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 1, + /* suffix= */ "", + PredefinedAndCustomRuleProto2.class.getName()); + } + // Use PredefinedAndCustomRuleProto2.newBuilder() to construct. + private PredefinedAndCustomRuleProto2(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private PredefinedAndCustomRuleProto2() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.internal_static_buf_validate_conformance_cases_PredefinedAndCustomRuleProto2_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.internal_static_buf_validate_conformance_cases_PredefinedAndCustomRuleProto2_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto2.class, build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto2.Builder.class); + } + + public interface NestedOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.PredefinedAndCustomRuleProto2.Nested) + com.google.protobuf.MessageOrBuilder { + + /** + * optional int32 c = 1 [json_name = "c", (.buf.validate.field) = { ... } + * @return Whether the c field is set. + */ + boolean hasC(); + /** + * optional int32 c = 1 [json_name = "c", (.buf.validate.field) = { ... } + * @return The c. + */ + int getC(); + } + /** + * Protobuf type {@code buf.validate.conformance.cases.PredefinedAndCustomRuleProto2.Nested} + */ + public static final class Nested extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.PredefinedAndCustomRuleProto2.Nested) + NestedOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 1, + /* suffix= */ "", + Nested.class.getName()); + } + // Use Nested.newBuilder() to construct. + private Nested(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private Nested() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.internal_static_buf_validate_conformance_cases_PredefinedAndCustomRuleProto2_Nested_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.internal_static_buf_validate_conformance_cases_PredefinedAndCustomRuleProto2_Nested_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto2.Nested.class, build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto2.Nested.Builder.class); + } + + private int bitField0_; + public static final int C_FIELD_NUMBER = 1; + private int c_ = 0; + /** + * optional int32 c = 1 [json_name = "c", (.buf.validate.field) = { ... } + * @return Whether the c field is set. + */ + @java.lang.Override + public boolean hasC() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * optional int32 c = 1 [json_name = "c", (.buf.validate.field) = { ... } + * @return The c. + */ + @java.lang.Override + public int getC() { + return c_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + output.writeInt32(1, c_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(1, c_); + } + 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.PredefinedAndCustomRuleProto2.Nested)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto2.Nested other = (build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto2.Nested) obj; + + if (hasC() != other.hasC()) return false; + if (hasC()) { + if (getC() + != other.getC()) 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 (hasC()) { + hash = (37 * hash) + C_FIELD_NUMBER; + hash = (53 * hash) + getC(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto2.Nested parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto2.Nested 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.PredefinedAndCustomRuleProto2.Nested parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto2.Nested 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.PredefinedAndCustomRuleProto2.Nested parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto2.Nested 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.PredefinedAndCustomRuleProto2.Nested parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto2.Nested 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.PredefinedAndCustomRuleProto2.Nested parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto2.Nested 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.PredefinedAndCustomRuleProto2.Nested 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.PredefinedAndCustomRuleProto2.Nested 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.PredefinedAndCustomRuleProto2.Nested 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.PredefinedAndCustomRuleProto2.Nested} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.PredefinedAndCustomRuleProto2.Nested) + build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto2.NestedOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.internal_static_buf_validate_conformance_cases_PredefinedAndCustomRuleProto2_Nested_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.internal_static_buf_validate_conformance_cases_PredefinedAndCustomRuleProto2_Nested_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto2.Nested.class, build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto2.Nested.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto2.Nested.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + c_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.internal_static_buf_validate_conformance_cases_PredefinedAndCustomRuleProto2_Nested_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto2.Nested getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto2.Nested.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto2.Nested build() { + build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto2.Nested result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto2.Nested buildPartial() { + build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto2.Nested result = new build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto2.Nested(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto2.Nested result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.c_ = c_; + 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.PredefinedAndCustomRuleProto2.Nested) { + return mergeFrom((build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto2.Nested)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto2.Nested other) { + if (other == build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto2.Nested.getDefaultInstance()) return this; + if (other.hasC()) { + setC(other.getC()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + c_ = input.readInt32(); + bitField0_ |= 0x00000001; + break; + } // case 8 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private int c_ ; + /** + * optional int32 c = 1 [json_name = "c", (.buf.validate.field) = { ... } + * @return Whether the c field is set. + */ + @java.lang.Override + public boolean hasC() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * optional int32 c = 1 [json_name = "c", (.buf.validate.field) = { ... } + * @return The c. + */ + @java.lang.Override + public int getC() { + return c_; + } + /** + * optional int32 c = 1 [json_name = "c", (.buf.validate.field) = { ... } + * @param value The c to set. + * @return This builder for chaining. + */ + public Builder setC(int value) { + + c_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * optional int32 c = 1 [json_name = "c", (.buf.validate.field) = { ... } + * @return This builder for chaining. + */ + public Builder clearC() { + bitField0_ = (bitField0_ & ~0x00000001); + c_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.PredefinedAndCustomRuleProto2.Nested) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.PredefinedAndCustomRuleProto2.Nested) + private static final build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto2.Nested DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto2.Nested(); + } + + public static build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto2.Nested getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Nested 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.PredefinedAndCustomRuleProto2.Nested getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private int bitField0_; + public static final int A_FIELD_NUMBER = 1; + private int a_ = 0; + /** + * optional int32 a = 1 [json_name = "a", (.buf.validate.field) = { ... } + * @return Whether the a field is set. + */ + @java.lang.Override + public boolean hasA() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * optional int32 a = 1 [json_name = "a", (.buf.validate.field) = { ... } + * @return The a. + */ + @java.lang.Override + public int getA() { + return a_; + } + + public static final int B_FIELD_NUMBER = 2; + private build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto2.Nested b_; + /** + * optional .buf.validate.conformance.cases.PredefinedAndCustomRuleProto2.Nested b = 2 [json_name = "b", (.buf.validate.field) = { ... } + * @return Whether the b field is set. + */ + @java.lang.Override + public boolean hasB() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * optional .buf.validate.conformance.cases.PredefinedAndCustomRuleProto2.Nested b = 2 [json_name = "b", (.buf.validate.field) = { ... } + * @return The b. + */ + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto2.Nested getB() { + return b_ == null ? build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto2.Nested.getDefaultInstance() : b_; + } + /** + * optional .buf.validate.conformance.cases.PredefinedAndCustomRuleProto2.Nested b = 2 [json_name = "b", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto2.NestedOrBuilder getBOrBuilder() { + return b_ == null ? build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto2.Nested.getDefaultInstance() : b_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + output.writeInt32(1, a_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(2, getB()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(1, a_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getB()); + } + 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.PredefinedAndCustomRuleProto2)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto2 other = (build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto2) obj; + + if (hasA() != other.hasA()) return false; + if (hasA()) { + if (getA() + != other.getA()) return false; + } + if (hasB() != other.hasB()) return false; + if (hasB()) { + if (!getB() + .equals(other.getB())) 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 (hasA()) { + hash = (37 * hash) + A_FIELD_NUMBER; + hash = (53 * hash) + getA(); + } + if (hasB()) { + hash = (37 * hash) + B_FIELD_NUMBER; + hash = (53 * hash) + getB().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto2 parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto2 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.PredefinedAndCustomRuleProto2 parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto2 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.PredefinedAndCustomRuleProto2 parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto2 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.PredefinedAndCustomRuleProto2 parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto2 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.PredefinedAndCustomRuleProto2 parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto2 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.PredefinedAndCustomRuleProto2 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.PredefinedAndCustomRuleProto2 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.PredefinedAndCustomRuleProto2 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.PredefinedAndCustomRuleProto2} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.PredefinedAndCustomRuleProto2) + build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto2OrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.internal_static_buf_validate_conformance_cases_PredefinedAndCustomRuleProto2_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.internal_static_buf_validate_conformance_cases_PredefinedAndCustomRuleProto2_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto2.class, build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto2.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto2.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage + .alwaysUseFieldBuilders) { + getBFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + a_ = 0; + b_ = null; + if (bBuilder_ != null) { + bBuilder_.dispose(); + bBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.internal_static_buf_validate_conformance_cases_PredefinedAndCustomRuleProto2_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto2 getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto2.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto2 build() { + build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto2 result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto2 buildPartial() { + build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto2 result = new build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto2(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto2 result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.a_ = a_; + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.b_ = bBuilder_ == null + ? b_ + : bBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto2) { + return mergeFrom((build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto2)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto2 other) { + if (other == build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto2.getDefaultInstance()) return this; + if (other.hasA()) { + setA(other.getA()); + } + if (other.hasB()) { + mergeB(other.getB()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + a_ = input.readInt32(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: { + input.readMessage( + getBFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000002; + 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 bitField0_; + + private int a_ ; + /** + * optional int32 a = 1 [json_name = "a", (.buf.validate.field) = { ... } + * @return Whether the a field is set. + */ + @java.lang.Override + public boolean hasA() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * optional int32 a = 1 [json_name = "a", (.buf.validate.field) = { ... } + * @return The a. + */ + @java.lang.Override + public int getA() { + return a_; + } + /** + * optional int32 a = 1 [json_name = "a", (.buf.validate.field) = { ... } + * @param value The a to set. + * @return This builder for chaining. + */ + public Builder setA(int value) { + + a_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * optional int32 a = 1 [json_name = "a", (.buf.validate.field) = { ... } + * @return This builder for chaining. + */ + public Builder clearA() { + bitField0_ = (bitField0_ & ~0x00000001); + a_ = 0; + onChanged(); + return this; + } + + private build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto2.Nested b_; + private com.google.protobuf.SingleFieldBuilder< + build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto2.Nested, build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto2.Nested.Builder, build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto2.NestedOrBuilder> bBuilder_; + /** + * optional .buf.validate.conformance.cases.PredefinedAndCustomRuleProto2.Nested b = 2 [json_name = "b", (.buf.validate.field) = { ... } + * @return Whether the b field is set. + */ + public boolean hasB() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * optional .buf.validate.conformance.cases.PredefinedAndCustomRuleProto2.Nested b = 2 [json_name = "b", (.buf.validate.field) = { ... } + * @return The b. + */ + public build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto2.Nested getB() { + if (bBuilder_ == null) { + return b_ == null ? build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto2.Nested.getDefaultInstance() : b_; + } else { + return bBuilder_.getMessage(); + } + } + /** + * optional .buf.validate.conformance.cases.PredefinedAndCustomRuleProto2.Nested b = 2 [json_name = "b", (.buf.validate.field) = { ... } + */ + public Builder setB(build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto2.Nested value) { + if (bBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + b_ = value; + } else { + bBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * optional .buf.validate.conformance.cases.PredefinedAndCustomRuleProto2.Nested b = 2 [json_name = "b", (.buf.validate.field) = { ... } + */ + public Builder setB( + build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto2.Nested.Builder builderForValue) { + if (bBuilder_ == null) { + b_ = builderForValue.build(); + } else { + bBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * optional .buf.validate.conformance.cases.PredefinedAndCustomRuleProto2.Nested b = 2 [json_name = "b", (.buf.validate.field) = { ... } + */ + public Builder mergeB(build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto2.Nested value) { + if (bBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) && + b_ != null && + b_ != build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto2.Nested.getDefaultInstance()) { + getBBuilder().mergeFrom(value); + } else { + b_ = value; + } + } else { + bBuilder_.mergeFrom(value); + } + if (b_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + /** + * optional .buf.validate.conformance.cases.PredefinedAndCustomRuleProto2.Nested b = 2 [json_name = "b", (.buf.validate.field) = { ... } + */ + public Builder clearB() { + bitField0_ = (bitField0_ & ~0x00000002); + b_ = null; + if (bBuilder_ != null) { + bBuilder_.dispose(); + bBuilder_ = null; + } + onChanged(); + return this; + } + /** + * optional .buf.validate.conformance.cases.PredefinedAndCustomRuleProto2.Nested b = 2 [json_name = "b", (.buf.validate.field) = { ... } + */ + public build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto2.Nested.Builder getBBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getBFieldBuilder().getBuilder(); + } + /** + * optional .buf.validate.conformance.cases.PredefinedAndCustomRuleProto2.Nested b = 2 [json_name = "b", (.buf.validate.field) = { ... } + */ + public build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto2.NestedOrBuilder getBOrBuilder() { + if (bBuilder_ != null) { + return bBuilder_.getMessageOrBuilder(); + } else { + return b_ == null ? + build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto2.Nested.getDefaultInstance() : b_; + } + } + /** + * optional .buf.validate.conformance.cases.PredefinedAndCustomRuleProto2.Nested b = 2 [json_name = "b", (.buf.validate.field) = { ... } + */ + private com.google.protobuf.SingleFieldBuilder< + build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto2.Nested, build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto2.Nested.Builder, build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto2.NestedOrBuilder> + getBFieldBuilder() { + if (bBuilder_ == null) { + bBuilder_ = new com.google.protobuf.SingleFieldBuilder< + build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto2.Nested, build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto2.Nested.Builder, build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto2.NestedOrBuilder>( + getB(), + getParentForChildren(), + isClean()); + b_ = null; + } + return bBuilder_; + } + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.PredefinedAndCustomRuleProto2) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.PredefinedAndCustomRuleProto2) + private static final build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto2 DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto2(); + } + + public static build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto2 getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PredefinedAndCustomRuleProto2 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.PredefinedAndCustomRuleProto2 getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedAndCustomRuleProto2OrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedAndCustomRuleProto2OrBuilder.java new file mode 100644 index 00000000..fb66e488 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedAndCustomRuleProto2OrBuilder.java @@ -0,0 +1,37 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/predefined_rules_proto2.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +public interface PredefinedAndCustomRuleProto2OrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.PredefinedAndCustomRuleProto2) + com.google.protobuf.MessageOrBuilder { + + /** + * optional int32 a = 1 [json_name = "a", (.buf.validate.field) = { ... } + * @return Whether the a field is set. + */ + boolean hasA(); + /** + * optional int32 a = 1 [json_name = "a", (.buf.validate.field) = { ... } + * @return The a. + */ + int getA(); + + /** + * optional .buf.validate.conformance.cases.PredefinedAndCustomRuleProto2.Nested b = 2 [json_name = "b", (.buf.validate.field) = { ... } + * @return Whether the b field is set. + */ + boolean hasB(); + /** + * optional .buf.validate.conformance.cases.PredefinedAndCustomRuleProto2.Nested b = 2 [json_name = "b", (.buf.validate.field) = { ... } + * @return The b. + */ + build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto2.Nested getB(); + /** + * optional .buf.validate.conformance.cases.PredefinedAndCustomRuleProto2.Nested b = 2 [json_name = "b", (.buf.validate.field) = { ... } + */ + build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto2.NestedOrBuilder getBOrBuilder(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedAndCustomRuleProto3.java b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedAndCustomRuleProto3.java new file mode 100644 index 00000000..a64a3178 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedAndCustomRuleProto3.java @@ -0,0 +1,1058 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/predefined_rules_proto3.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.PredefinedAndCustomRuleProto3} + */ +public final class PredefinedAndCustomRuleProto3 extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.PredefinedAndCustomRuleProto3) + PredefinedAndCustomRuleProto3OrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 1, + /* suffix= */ "", + PredefinedAndCustomRuleProto3.class.getName()); + } + // Use PredefinedAndCustomRuleProto3.newBuilder() to construct. + private PredefinedAndCustomRuleProto3(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private PredefinedAndCustomRuleProto3() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.PredefinedRulesProto3Proto.internal_static_buf_validate_conformance_cases_PredefinedAndCustomRuleProto3_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.PredefinedRulesProto3Proto.internal_static_buf_validate_conformance_cases_PredefinedAndCustomRuleProto3_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto3.class, build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto3.Builder.class); + } + + public interface NestedOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.PredefinedAndCustomRuleProto3.Nested) + com.google.protobuf.MessageOrBuilder { + + /** + * int32 c = 1 [json_name = "c", (.buf.validate.field) = { ... } + * @return The c. + */ + int getC(); + } + /** + * Protobuf type {@code buf.validate.conformance.cases.PredefinedAndCustomRuleProto3.Nested} + */ + public static final class Nested extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.PredefinedAndCustomRuleProto3.Nested) + NestedOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 1, + /* suffix= */ "", + Nested.class.getName()); + } + // Use Nested.newBuilder() to construct. + private Nested(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private Nested() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.PredefinedRulesProto3Proto.internal_static_buf_validate_conformance_cases_PredefinedAndCustomRuleProto3_Nested_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.PredefinedRulesProto3Proto.internal_static_buf_validate_conformance_cases_PredefinedAndCustomRuleProto3_Nested_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto3.Nested.class, build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto3.Nested.Builder.class); + } + + public static final int C_FIELD_NUMBER = 1; + private int c_ = 0; + /** + * int32 c = 1 [json_name = "c", (.buf.validate.field) = { ... } + * @return The c. + */ + @java.lang.Override + public int getC() { + return c_; + } + + 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 (c_ != 0) { + output.writeInt32(1, c_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (c_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(1, c_); + } + 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.PredefinedAndCustomRuleProto3.Nested)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto3.Nested other = (build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto3.Nested) obj; + + if (getC() + != other.getC()) 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) + C_FIELD_NUMBER; + hash = (53 * hash) + getC(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto3.Nested parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto3.Nested 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.PredefinedAndCustomRuleProto3.Nested parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto3.Nested 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.PredefinedAndCustomRuleProto3.Nested parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto3.Nested 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.PredefinedAndCustomRuleProto3.Nested parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto3.Nested 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.PredefinedAndCustomRuleProto3.Nested parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto3.Nested 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.PredefinedAndCustomRuleProto3.Nested 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.PredefinedAndCustomRuleProto3.Nested 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.PredefinedAndCustomRuleProto3.Nested 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.PredefinedAndCustomRuleProto3.Nested} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.PredefinedAndCustomRuleProto3.Nested) + build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto3.NestedOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.PredefinedRulesProto3Proto.internal_static_buf_validate_conformance_cases_PredefinedAndCustomRuleProto3_Nested_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.PredefinedRulesProto3Proto.internal_static_buf_validate_conformance_cases_PredefinedAndCustomRuleProto3_Nested_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto3.Nested.class, build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto3.Nested.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto3.Nested.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + c_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.PredefinedRulesProto3Proto.internal_static_buf_validate_conformance_cases_PredefinedAndCustomRuleProto3_Nested_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto3.Nested getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto3.Nested.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto3.Nested build() { + build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto3.Nested result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto3.Nested buildPartial() { + build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto3.Nested result = new build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto3.Nested(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto3.Nested result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.c_ = c_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto3.Nested) { + return mergeFrom((build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto3.Nested)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto3.Nested other) { + if (other == build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto3.Nested.getDefaultInstance()) return this; + if (other.getC() != 0) { + setC(other.getC()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + c_ = input.readInt32(); + bitField0_ |= 0x00000001; + break; + } // case 8 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private int c_ ; + /** + * int32 c = 1 [json_name = "c", (.buf.validate.field) = { ... } + * @return The c. + */ + @java.lang.Override + public int getC() { + return c_; + } + /** + * int32 c = 1 [json_name = "c", (.buf.validate.field) = { ... } + * @param value The c to set. + * @return This builder for chaining. + */ + public Builder setC(int value) { + + c_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * int32 c = 1 [json_name = "c", (.buf.validate.field) = { ... } + * @return This builder for chaining. + */ + public Builder clearC() { + bitField0_ = (bitField0_ & ~0x00000001); + c_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.PredefinedAndCustomRuleProto3.Nested) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.PredefinedAndCustomRuleProto3.Nested) + private static final build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto3.Nested DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto3.Nested(); + } + + public static build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto3.Nested getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Nested 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.PredefinedAndCustomRuleProto3.Nested getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private int bitField0_; + public static final int A_FIELD_NUMBER = 1; + private int a_ = 0; + /** + * int32 a = 1 [json_name = "a", (.buf.validate.field) = { ... } + * @return The a. + */ + @java.lang.Override + public int getA() { + return a_; + } + + public static final int B_FIELD_NUMBER = 2; + private build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto3.Nested b_; + /** + * optional .buf.validate.conformance.cases.PredefinedAndCustomRuleProto3.Nested b = 2 [json_name = "b", (.buf.validate.field) = { ... } + * @return Whether the b field is set. + */ + @java.lang.Override + public boolean hasB() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * optional .buf.validate.conformance.cases.PredefinedAndCustomRuleProto3.Nested b = 2 [json_name = "b", (.buf.validate.field) = { ... } + * @return The b. + */ + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto3.Nested getB() { + return b_ == null ? build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto3.Nested.getDefaultInstance() : b_; + } + /** + * optional .buf.validate.conformance.cases.PredefinedAndCustomRuleProto3.Nested b = 2 [json_name = "b", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto3.NestedOrBuilder getBOrBuilder() { + return b_ == null ? build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto3.Nested.getDefaultInstance() : b_; + } + + 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 (a_ != 0) { + output.writeInt32(1, a_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getB()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (a_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(1, a_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getB()); + } + 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.PredefinedAndCustomRuleProto3)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto3 other = (build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto3) obj; + + if (getA() + != other.getA()) return false; + if (hasB() != other.hasB()) return false; + if (hasB()) { + if (!getB() + .equals(other.getB())) 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) + A_FIELD_NUMBER; + hash = (53 * hash) + getA(); + if (hasB()) { + hash = (37 * hash) + B_FIELD_NUMBER; + hash = (53 * hash) + getB().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto3 parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto3 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.PredefinedAndCustomRuleProto3 parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto3 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.PredefinedAndCustomRuleProto3 parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto3 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.PredefinedAndCustomRuleProto3 parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto3 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.PredefinedAndCustomRuleProto3 parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto3 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.PredefinedAndCustomRuleProto3 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.PredefinedAndCustomRuleProto3 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.PredefinedAndCustomRuleProto3 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.PredefinedAndCustomRuleProto3} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.PredefinedAndCustomRuleProto3) + build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto3OrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.PredefinedRulesProto3Proto.internal_static_buf_validate_conformance_cases_PredefinedAndCustomRuleProto3_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.PredefinedRulesProto3Proto.internal_static_buf_validate_conformance_cases_PredefinedAndCustomRuleProto3_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto3.class, build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto3.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto3.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage + .alwaysUseFieldBuilders) { + getBFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + a_ = 0; + b_ = null; + if (bBuilder_ != null) { + bBuilder_.dispose(); + bBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.PredefinedRulesProto3Proto.internal_static_buf_validate_conformance_cases_PredefinedAndCustomRuleProto3_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto3 getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto3.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto3 build() { + build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto3 result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto3 buildPartial() { + build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto3 result = new build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto3(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto3 result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.a_ = a_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.b_ = bBuilder_ == null + ? b_ + : bBuilder_.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.PredefinedAndCustomRuleProto3) { + return mergeFrom((build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto3)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto3 other) { + if (other == build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto3.getDefaultInstance()) return this; + if (other.getA() != 0) { + setA(other.getA()); + } + if (other.hasB()) { + mergeB(other.getB()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + a_ = input.readInt32(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: { + input.readMessage( + getBFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000002; + 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 bitField0_; + + private int a_ ; + /** + * int32 a = 1 [json_name = "a", (.buf.validate.field) = { ... } + * @return The a. + */ + @java.lang.Override + public int getA() { + return a_; + } + /** + * int32 a = 1 [json_name = "a", (.buf.validate.field) = { ... } + * @param value The a to set. + * @return This builder for chaining. + */ + public Builder setA(int value) { + + a_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * int32 a = 1 [json_name = "a", (.buf.validate.field) = { ... } + * @return This builder for chaining. + */ + public Builder clearA() { + bitField0_ = (bitField0_ & ~0x00000001); + a_ = 0; + onChanged(); + return this; + } + + private build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto3.Nested b_; + private com.google.protobuf.SingleFieldBuilder< + build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto3.Nested, build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto3.Nested.Builder, build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto3.NestedOrBuilder> bBuilder_; + /** + * optional .buf.validate.conformance.cases.PredefinedAndCustomRuleProto3.Nested b = 2 [json_name = "b", (.buf.validate.field) = { ... } + * @return Whether the b field is set. + */ + public boolean hasB() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * optional .buf.validate.conformance.cases.PredefinedAndCustomRuleProto3.Nested b = 2 [json_name = "b", (.buf.validate.field) = { ... } + * @return The b. + */ + public build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto3.Nested getB() { + if (bBuilder_ == null) { + return b_ == null ? build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto3.Nested.getDefaultInstance() : b_; + } else { + return bBuilder_.getMessage(); + } + } + /** + * optional .buf.validate.conformance.cases.PredefinedAndCustomRuleProto3.Nested b = 2 [json_name = "b", (.buf.validate.field) = { ... } + */ + public Builder setB(build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto3.Nested value) { + if (bBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + b_ = value; + } else { + bBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * optional .buf.validate.conformance.cases.PredefinedAndCustomRuleProto3.Nested b = 2 [json_name = "b", (.buf.validate.field) = { ... } + */ + public Builder setB( + build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto3.Nested.Builder builderForValue) { + if (bBuilder_ == null) { + b_ = builderForValue.build(); + } else { + bBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * optional .buf.validate.conformance.cases.PredefinedAndCustomRuleProto3.Nested b = 2 [json_name = "b", (.buf.validate.field) = { ... } + */ + public Builder mergeB(build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto3.Nested value) { + if (bBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) && + b_ != null && + b_ != build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto3.Nested.getDefaultInstance()) { + getBBuilder().mergeFrom(value); + } else { + b_ = value; + } + } else { + bBuilder_.mergeFrom(value); + } + if (b_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + /** + * optional .buf.validate.conformance.cases.PredefinedAndCustomRuleProto3.Nested b = 2 [json_name = "b", (.buf.validate.field) = { ... } + */ + public Builder clearB() { + bitField0_ = (bitField0_ & ~0x00000002); + b_ = null; + if (bBuilder_ != null) { + bBuilder_.dispose(); + bBuilder_ = null; + } + onChanged(); + return this; + } + /** + * optional .buf.validate.conformance.cases.PredefinedAndCustomRuleProto3.Nested b = 2 [json_name = "b", (.buf.validate.field) = { ... } + */ + public build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto3.Nested.Builder getBBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getBFieldBuilder().getBuilder(); + } + /** + * optional .buf.validate.conformance.cases.PredefinedAndCustomRuleProto3.Nested b = 2 [json_name = "b", (.buf.validate.field) = { ... } + */ + public build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto3.NestedOrBuilder getBOrBuilder() { + if (bBuilder_ != null) { + return bBuilder_.getMessageOrBuilder(); + } else { + return b_ == null ? + build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto3.Nested.getDefaultInstance() : b_; + } + } + /** + * optional .buf.validate.conformance.cases.PredefinedAndCustomRuleProto3.Nested b = 2 [json_name = "b", (.buf.validate.field) = { ... } + */ + private com.google.protobuf.SingleFieldBuilder< + build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto3.Nested, build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto3.Nested.Builder, build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto3.NestedOrBuilder> + getBFieldBuilder() { + if (bBuilder_ == null) { + bBuilder_ = new com.google.protobuf.SingleFieldBuilder< + build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto3.Nested, build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto3.Nested.Builder, build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto3.NestedOrBuilder>( + getB(), + getParentForChildren(), + isClean()); + b_ = null; + } + return bBuilder_; + } + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.PredefinedAndCustomRuleProto3) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.PredefinedAndCustomRuleProto3) + private static final build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto3 DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto3(); + } + + public static build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto3 getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PredefinedAndCustomRuleProto3 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.PredefinedAndCustomRuleProto3 getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedAndCustomRuleProto3OrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedAndCustomRuleProto3OrBuilder.java new file mode 100644 index 00000000..55298d92 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedAndCustomRuleProto3OrBuilder.java @@ -0,0 +1,32 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/predefined_rules_proto3.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +public interface PredefinedAndCustomRuleProto3OrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.PredefinedAndCustomRuleProto3) + com.google.protobuf.MessageOrBuilder { + + /** + * int32 a = 1 [json_name = "a", (.buf.validate.field) = { ... } + * @return The a. + */ + int getA(); + + /** + * optional .buf.validate.conformance.cases.PredefinedAndCustomRuleProto3.Nested b = 2 [json_name = "b", (.buf.validate.field) = { ... } + * @return Whether the b field is set. + */ + boolean hasB(); + /** + * optional .buf.validate.conformance.cases.PredefinedAndCustomRuleProto3.Nested b = 2 [json_name = "b", (.buf.validate.field) = { ... } + * @return The b. + */ + build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto3.Nested getB(); + /** + * optional .buf.validate.conformance.cases.PredefinedAndCustomRuleProto3.Nested b = 2 [json_name = "b", (.buf.validate.field) = { ... } + */ + build.buf.validate.conformance.cases.PredefinedAndCustomRuleProto3.NestedOrBuilder getBOrBuilder(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedBoolRuleEdition2023.java b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedBoolRuleEdition2023.java new file mode 100644 index 00000000..2fc2ac3a --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedBoolRuleEdition2023.java @@ -0,0 +1,457 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/predefined_rules_proto_editions.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.PredefinedBoolRuleEdition2023} + */ +public final class PredefinedBoolRuleEdition2023 extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.PredefinedBoolRuleEdition2023) + PredefinedBoolRuleEdition2023OrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 1, + /* suffix= */ "", + PredefinedBoolRuleEdition2023.class.getName()); + } + // Use PredefinedBoolRuleEdition2023.newBuilder() to construct. + private PredefinedBoolRuleEdition2023(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private PredefinedBoolRuleEdition2023() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.internal_static_buf_validate_conformance_cases_PredefinedBoolRuleEdition2023_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.internal_static_buf_validate_conformance_cases_PredefinedBoolRuleEdition2023_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.PredefinedBoolRuleEdition2023.class, build.buf.validate.conformance.cases.PredefinedBoolRuleEdition2023.Builder.class); + } + + private int bitField0_; + public static final int VAL_FIELD_NUMBER = 1; + private boolean val_ = false; + /** + * bool 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); + } + /** + * bool val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public boolean getVal() { + return val_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + output.writeBool(1, val_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(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.PredefinedBoolRuleEdition2023)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.PredefinedBoolRuleEdition2023 other = (build.buf.validate.conformance.cases.PredefinedBoolRuleEdition2023) obj; + + if (hasVal() != other.hasVal()) return false; + if (hasVal()) { + if (getVal() + != other.getVal()) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasVal()) { + hash = (37 * hash) + VAL_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getVal()); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.PredefinedBoolRuleEdition2023 parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedBoolRuleEdition2023 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.PredefinedBoolRuleEdition2023 parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedBoolRuleEdition2023 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.PredefinedBoolRuleEdition2023 parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedBoolRuleEdition2023 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.PredefinedBoolRuleEdition2023 parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.PredefinedBoolRuleEdition2023 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.PredefinedBoolRuleEdition2023 parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.PredefinedBoolRuleEdition2023 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.PredefinedBoolRuleEdition2023 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.PredefinedBoolRuleEdition2023 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.PredefinedBoolRuleEdition2023 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.PredefinedBoolRuleEdition2023} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.PredefinedBoolRuleEdition2023) + build.buf.validate.conformance.cases.PredefinedBoolRuleEdition2023OrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.internal_static_buf_validate_conformance_cases_PredefinedBoolRuleEdition2023_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.internal_static_buf_validate_conformance_cases_PredefinedBoolRuleEdition2023_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.PredefinedBoolRuleEdition2023.class, build.buf.validate.conformance.cases.PredefinedBoolRuleEdition2023.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.PredefinedBoolRuleEdition2023.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + val_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.internal_static_buf_validate_conformance_cases_PredefinedBoolRuleEdition2023_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedBoolRuleEdition2023 getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.PredefinedBoolRuleEdition2023.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedBoolRuleEdition2023 build() { + build.buf.validate.conformance.cases.PredefinedBoolRuleEdition2023 result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedBoolRuleEdition2023 buildPartial() { + build.buf.validate.conformance.cases.PredefinedBoolRuleEdition2023 result = new build.buf.validate.conformance.cases.PredefinedBoolRuleEdition2023(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.PredefinedBoolRuleEdition2023 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.PredefinedBoolRuleEdition2023) { + return mergeFrom((build.buf.validate.conformance.cases.PredefinedBoolRuleEdition2023)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.PredefinedBoolRuleEdition2023 other) { + if (other == build.buf.validate.conformance.cases.PredefinedBoolRuleEdition2023.getDefaultInstance()) return this; + if (other.hasVal()) { + setVal(other.getVal()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + val_ = input.readBool(); + bitField0_ |= 0x00000001; + break; + } // case 8 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private boolean val_ ; + /** + * bool 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); + } + /** + * bool val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public boolean getVal() { + return val_; + } + /** + * bool val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param value The val to set. + * @return This builder for chaining. + */ + public Builder setVal(boolean value) { + + val_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * bool val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return This builder for chaining. + */ + public Builder clearVal() { + bitField0_ = (bitField0_ & ~0x00000001); + val_ = false; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.PredefinedBoolRuleEdition2023) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.PredefinedBoolRuleEdition2023) + private static final build.buf.validate.conformance.cases.PredefinedBoolRuleEdition2023 DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.PredefinedBoolRuleEdition2023(); + } + + public static build.buf.validate.conformance.cases.PredefinedBoolRuleEdition2023 getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PredefinedBoolRuleEdition2023 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.PredefinedBoolRuleEdition2023 getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedBoolRuleEdition2023OrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedBoolRuleEdition2023OrBuilder.java new file mode 100644 index 00000000..cfc857f4 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedBoolRuleEdition2023OrBuilder.java @@ -0,0 +1,22 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/predefined_rules_proto_editions.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +public interface PredefinedBoolRuleEdition2023OrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.PredefinedBoolRuleEdition2023) + com.google.protobuf.MessageOrBuilder { + + /** + * bool val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + boolean hasVal(); + /** + * bool val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + boolean getVal(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedBoolRuleProto2.java b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedBoolRuleProto2.java new file mode 100644 index 00000000..2a9f3553 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedBoolRuleProto2.java @@ -0,0 +1,457 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/predefined_rules_proto2.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.PredefinedBoolRuleProto2} + */ +public final class PredefinedBoolRuleProto2 extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.PredefinedBoolRuleProto2) + PredefinedBoolRuleProto2OrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 1, + /* suffix= */ "", + PredefinedBoolRuleProto2.class.getName()); + } + // Use PredefinedBoolRuleProto2.newBuilder() to construct. + private PredefinedBoolRuleProto2(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private PredefinedBoolRuleProto2() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.internal_static_buf_validate_conformance_cases_PredefinedBoolRuleProto2_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.internal_static_buf_validate_conformance_cases_PredefinedBoolRuleProto2_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.PredefinedBoolRuleProto2.class, build.buf.validate.conformance.cases.PredefinedBoolRuleProto2.Builder.class); + } + + private int bitField0_; + public static final int VAL_FIELD_NUMBER = 1; + private boolean val_ = false; + /** + * optional bool 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 bool val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public boolean getVal() { + return val_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + output.writeBool(1, val_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(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.PredefinedBoolRuleProto2)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.PredefinedBoolRuleProto2 other = (build.buf.validate.conformance.cases.PredefinedBoolRuleProto2) obj; + + if (hasVal() != other.hasVal()) return false; + if (hasVal()) { + if (getVal() + != other.getVal()) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasVal()) { + hash = (37 * hash) + VAL_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getVal()); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.PredefinedBoolRuleProto2 parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedBoolRuleProto2 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.PredefinedBoolRuleProto2 parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedBoolRuleProto2 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.PredefinedBoolRuleProto2 parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedBoolRuleProto2 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.PredefinedBoolRuleProto2 parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.PredefinedBoolRuleProto2 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.PredefinedBoolRuleProto2 parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.PredefinedBoolRuleProto2 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.PredefinedBoolRuleProto2 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.PredefinedBoolRuleProto2 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.PredefinedBoolRuleProto2 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.PredefinedBoolRuleProto2} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.PredefinedBoolRuleProto2) + build.buf.validate.conformance.cases.PredefinedBoolRuleProto2OrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.internal_static_buf_validate_conformance_cases_PredefinedBoolRuleProto2_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.internal_static_buf_validate_conformance_cases_PredefinedBoolRuleProto2_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.PredefinedBoolRuleProto2.class, build.buf.validate.conformance.cases.PredefinedBoolRuleProto2.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.PredefinedBoolRuleProto2.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + val_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.internal_static_buf_validate_conformance_cases_PredefinedBoolRuleProto2_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedBoolRuleProto2 getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.PredefinedBoolRuleProto2.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedBoolRuleProto2 build() { + build.buf.validate.conformance.cases.PredefinedBoolRuleProto2 result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedBoolRuleProto2 buildPartial() { + build.buf.validate.conformance.cases.PredefinedBoolRuleProto2 result = new build.buf.validate.conformance.cases.PredefinedBoolRuleProto2(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.PredefinedBoolRuleProto2 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.PredefinedBoolRuleProto2) { + return mergeFrom((build.buf.validate.conformance.cases.PredefinedBoolRuleProto2)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.PredefinedBoolRuleProto2 other) { + if (other == build.buf.validate.conformance.cases.PredefinedBoolRuleProto2.getDefaultInstance()) return this; + if (other.hasVal()) { + setVal(other.getVal()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + val_ = input.readBool(); + bitField0_ |= 0x00000001; + break; + } // case 8 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private boolean val_ ; + /** + * optional bool 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 bool val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public boolean getVal() { + return val_; + } + /** + * optional bool val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param value The val to set. + * @return This builder for chaining. + */ + public Builder setVal(boolean value) { + + val_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * optional bool val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return This builder for chaining. + */ + public Builder clearVal() { + bitField0_ = (bitField0_ & ~0x00000001); + val_ = false; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.PredefinedBoolRuleProto2) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.PredefinedBoolRuleProto2) + private static final build.buf.validate.conformance.cases.PredefinedBoolRuleProto2 DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.PredefinedBoolRuleProto2(); + } + + public static build.buf.validate.conformance.cases.PredefinedBoolRuleProto2 getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PredefinedBoolRuleProto2 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.PredefinedBoolRuleProto2 getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedBoolRuleProto2OrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedBoolRuleProto2OrBuilder.java new file mode 100644 index 00000000..29c9ef30 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedBoolRuleProto2OrBuilder.java @@ -0,0 +1,22 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/predefined_rules_proto2.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +public interface PredefinedBoolRuleProto2OrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.PredefinedBoolRuleProto2) + com.google.protobuf.MessageOrBuilder { + + /** + * optional bool val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + boolean hasVal(); + /** + * optional bool val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + boolean getVal(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedBoolRuleProto3.java b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedBoolRuleProto3.java new file mode 100644 index 00000000..5882070c --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedBoolRuleProto3.java @@ -0,0 +1,432 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/predefined_rules_proto3.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.PredefinedBoolRuleProto3} + */ +public final class PredefinedBoolRuleProto3 extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.PredefinedBoolRuleProto3) + PredefinedBoolRuleProto3OrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 1, + /* suffix= */ "", + PredefinedBoolRuleProto3.class.getName()); + } + // Use PredefinedBoolRuleProto3.newBuilder() to construct. + private PredefinedBoolRuleProto3(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private PredefinedBoolRuleProto3() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.PredefinedRulesProto3Proto.internal_static_buf_validate_conformance_cases_PredefinedBoolRuleProto3_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.PredefinedRulesProto3Proto.internal_static_buf_validate_conformance_cases_PredefinedBoolRuleProto3_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.PredefinedBoolRuleProto3.class, build.buf.validate.conformance.cases.PredefinedBoolRuleProto3.Builder.class); + } + + public static final int VAL_FIELD_NUMBER = 1; + private boolean val_ = false; + /** + * bool val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public boolean getVal() { + return val_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (val_ != false) { + output.writeBool(1, val_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (val_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(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.PredefinedBoolRuleProto3)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.PredefinedBoolRuleProto3 other = (build.buf.validate.conformance.cases.PredefinedBoolRuleProto3) obj; + + if (getVal() + != other.getVal()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + VAL_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getVal()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.PredefinedBoolRuleProto3 parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedBoolRuleProto3 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.PredefinedBoolRuleProto3 parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedBoolRuleProto3 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.PredefinedBoolRuleProto3 parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedBoolRuleProto3 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.PredefinedBoolRuleProto3 parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.PredefinedBoolRuleProto3 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.PredefinedBoolRuleProto3 parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.PredefinedBoolRuleProto3 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.PredefinedBoolRuleProto3 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.PredefinedBoolRuleProto3 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.PredefinedBoolRuleProto3 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.PredefinedBoolRuleProto3} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.PredefinedBoolRuleProto3) + build.buf.validate.conformance.cases.PredefinedBoolRuleProto3OrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.PredefinedRulesProto3Proto.internal_static_buf_validate_conformance_cases_PredefinedBoolRuleProto3_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.PredefinedRulesProto3Proto.internal_static_buf_validate_conformance_cases_PredefinedBoolRuleProto3_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.PredefinedBoolRuleProto3.class, build.buf.validate.conformance.cases.PredefinedBoolRuleProto3.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.PredefinedBoolRuleProto3.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + val_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.PredefinedRulesProto3Proto.internal_static_buf_validate_conformance_cases_PredefinedBoolRuleProto3_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedBoolRuleProto3 getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.PredefinedBoolRuleProto3.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedBoolRuleProto3 build() { + build.buf.validate.conformance.cases.PredefinedBoolRuleProto3 result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedBoolRuleProto3 buildPartial() { + build.buf.validate.conformance.cases.PredefinedBoolRuleProto3 result = new build.buf.validate.conformance.cases.PredefinedBoolRuleProto3(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.PredefinedBoolRuleProto3 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.PredefinedBoolRuleProto3) { + return mergeFrom((build.buf.validate.conformance.cases.PredefinedBoolRuleProto3)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.PredefinedBoolRuleProto3 other) { + if (other == build.buf.validate.conformance.cases.PredefinedBoolRuleProto3.getDefaultInstance()) return this; + if (other.getVal() != false) { + setVal(other.getVal()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + val_ = input.readBool(); + bitField0_ |= 0x00000001; + break; + } // case 8 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private boolean val_ ; + /** + * bool val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public boolean getVal() { + return val_; + } + /** + * bool val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param value The val to set. + * @return This builder for chaining. + */ + public Builder setVal(boolean value) { + + val_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * bool val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return This builder for chaining. + */ + public Builder clearVal() { + bitField0_ = (bitField0_ & ~0x00000001); + val_ = false; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.PredefinedBoolRuleProto3) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.PredefinedBoolRuleProto3) + private static final build.buf.validate.conformance.cases.PredefinedBoolRuleProto3 DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.PredefinedBoolRuleProto3(); + } + + public static build.buf.validate.conformance.cases.PredefinedBoolRuleProto3 getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PredefinedBoolRuleProto3 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.PredefinedBoolRuleProto3 getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedBoolRuleProto3OrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedBoolRuleProto3OrBuilder.java new file mode 100644 index 00000000..4d3675b5 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedBoolRuleProto3OrBuilder.java @@ -0,0 +1,17 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/predefined_rules_proto3.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +public interface PredefinedBoolRuleProto3OrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.PredefinedBoolRuleProto3) + com.google.protobuf.MessageOrBuilder { + + /** + * bool val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + boolean getVal(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedBytesRuleEdition2023.java b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedBytesRuleEdition2023.java new file mode 100644 index 00000000..4f1a489a --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedBytesRuleEdition2023.java @@ -0,0 +1,457 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/predefined_rules_proto_editions.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.PredefinedBytesRuleEdition2023} + */ +public final class PredefinedBytesRuleEdition2023 extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.PredefinedBytesRuleEdition2023) + PredefinedBytesRuleEdition2023OrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 1, + /* suffix= */ "", + PredefinedBytesRuleEdition2023.class.getName()); + } + // Use PredefinedBytesRuleEdition2023.newBuilder() to construct. + private PredefinedBytesRuleEdition2023(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private PredefinedBytesRuleEdition2023() { + val_ = com.google.protobuf.ByteString.EMPTY; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.internal_static_buf_validate_conformance_cases_PredefinedBytesRuleEdition2023_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.internal_static_buf_validate_conformance_cases_PredefinedBytesRuleEdition2023_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.PredefinedBytesRuleEdition2023.class, build.buf.validate.conformance.cases.PredefinedBytesRuleEdition2023.Builder.class); + } + + private int bitField0_; + public static final int VAL_FIELD_NUMBER = 1; + private com.google.protobuf.ByteString val_ = com.google.protobuf.ByteString.EMPTY; + /** + * bytes 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); + } + /** + * bytes val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public com.google.protobuf.ByteString getVal() { + return val_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + output.writeBytes(1, val_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(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.PredefinedBytesRuleEdition2023)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.PredefinedBytesRuleEdition2023 other = (build.buf.validate.conformance.cases.PredefinedBytesRuleEdition2023) 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.PredefinedBytesRuleEdition2023 parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedBytesRuleEdition2023 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.PredefinedBytesRuleEdition2023 parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedBytesRuleEdition2023 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.PredefinedBytesRuleEdition2023 parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedBytesRuleEdition2023 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.PredefinedBytesRuleEdition2023 parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.PredefinedBytesRuleEdition2023 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.PredefinedBytesRuleEdition2023 parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.PredefinedBytesRuleEdition2023 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.PredefinedBytesRuleEdition2023 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.PredefinedBytesRuleEdition2023 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.PredefinedBytesRuleEdition2023 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.PredefinedBytesRuleEdition2023} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.PredefinedBytesRuleEdition2023) + build.buf.validate.conformance.cases.PredefinedBytesRuleEdition2023OrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.internal_static_buf_validate_conformance_cases_PredefinedBytesRuleEdition2023_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.internal_static_buf_validate_conformance_cases_PredefinedBytesRuleEdition2023_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.PredefinedBytesRuleEdition2023.class, build.buf.validate.conformance.cases.PredefinedBytesRuleEdition2023.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.PredefinedBytesRuleEdition2023.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.ByteString.EMPTY; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.internal_static_buf_validate_conformance_cases_PredefinedBytesRuleEdition2023_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedBytesRuleEdition2023 getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.PredefinedBytesRuleEdition2023.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedBytesRuleEdition2023 build() { + build.buf.validate.conformance.cases.PredefinedBytesRuleEdition2023 result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedBytesRuleEdition2023 buildPartial() { + build.buf.validate.conformance.cases.PredefinedBytesRuleEdition2023 result = new build.buf.validate.conformance.cases.PredefinedBytesRuleEdition2023(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.PredefinedBytesRuleEdition2023 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.PredefinedBytesRuleEdition2023) { + return mergeFrom((build.buf.validate.conformance.cases.PredefinedBytesRuleEdition2023)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.PredefinedBytesRuleEdition2023 other) { + if (other == build.buf.validate.conformance.cases.PredefinedBytesRuleEdition2023.getDefaultInstance()) return this; + if (other.hasVal()) { + setVal(other.getVal()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 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 com.google.protobuf.ByteString val_ = com.google.protobuf.ByteString.EMPTY; + /** + * bytes 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); + } + /** + * bytes val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public com.google.protobuf.ByteString getVal() { + return val_; + } + /** + * bytes val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param value The val to set. + * @return This builder for chaining. + */ + public Builder setVal(com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + val_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * bytes val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return This builder for chaining. + */ + public Builder clearVal() { + bitField0_ = (bitField0_ & ~0x00000001); + val_ = getDefaultInstance().getVal(); + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.PredefinedBytesRuleEdition2023) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.PredefinedBytesRuleEdition2023) + private static final build.buf.validate.conformance.cases.PredefinedBytesRuleEdition2023 DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.PredefinedBytesRuleEdition2023(); + } + + public static build.buf.validate.conformance.cases.PredefinedBytesRuleEdition2023 getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PredefinedBytesRuleEdition2023 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.PredefinedBytesRuleEdition2023 getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedBytesRuleEdition2023OrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedBytesRuleEdition2023OrBuilder.java new file mode 100644 index 00000000..1ddef944 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedBytesRuleEdition2023OrBuilder.java @@ -0,0 +1,22 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/predefined_rules_proto_editions.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +public interface PredefinedBytesRuleEdition2023OrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.PredefinedBytesRuleEdition2023) + com.google.protobuf.MessageOrBuilder { + + /** + * bytes val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + boolean hasVal(); + /** + * bytes val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + com.google.protobuf.ByteString getVal(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedBytesRuleProto2.java b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedBytesRuleProto2.java new file mode 100644 index 00000000..daab5f89 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedBytesRuleProto2.java @@ -0,0 +1,457 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/predefined_rules_proto2.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.PredefinedBytesRuleProto2} + */ +public final class PredefinedBytesRuleProto2 extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.PredefinedBytesRuleProto2) + PredefinedBytesRuleProto2OrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 1, + /* suffix= */ "", + PredefinedBytesRuleProto2.class.getName()); + } + // Use PredefinedBytesRuleProto2.newBuilder() to construct. + private PredefinedBytesRuleProto2(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private PredefinedBytesRuleProto2() { + val_ = com.google.protobuf.ByteString.EMPTY; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.internal_static_buf_validate_conformance_cases_PredefinedBytesRuleProto2_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.internal_static_buf_validate_conformance_cases_PredefinedBytesRuleProto2_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.PredefinedBytesRuleProto2.class, build.buf.validate.conformance.cases.PredefinedBytesRuleProto2.Builder.class); + } + + private int bitField0_; + public static final int VAL_FIELD_NUMBER = 1; + private com.google.protobuf.ByteString val_ = com.google.protobuf.ByteString.EMPTY; + /** + * optional bytes 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 bytes val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public com.google.protobuf.ByteString getVal() { + return val_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + output.writeBytes(1, val_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(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.PredefinedBytesRuleProto2)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.PredefinedBytesRuleProto2 other = (build.buf.validate.conformance.cases.PredefinedBytesRuleProto2) 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.PredefinedBytesRuleProto2 parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedBytesRuleProto2 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.PredefinedBytesRuleProto2 parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedBytesRuleProto2 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.PredefinedBytesRuleProto2 parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedBytesRuleProto2 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.PredefinedBytesRuleProto2 parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.PredefinedBytesRuleProto2 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.PredefinedBytesRuleProto2 parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.PredefinedBytesRuleProto2 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.PredefinedBytesRuleProto2 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.PredefinedBytesRuleProto2 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.PredefinedBytesRuleProto2 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.PredefinedBytesRuleProto2} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.PredefinedBytesRuleProto2) + build.buf.validate.conformance.cases.PredefinedBytesRuleProto2OrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.internal_static_buf_validate_conformance_cases_PredefinedBytesRuleProto2_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.internal_static_buf_validate_conformance_cases_PredefinedBytesRuleProto2_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.PredefinedBytesRuleProto2.class, build.buf.validate.conformance.cases.PredefinedBytesRuleProto2.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.PredefinedBytesRuleProto2.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.ByteString.EMPTY; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.internal_static_buf_validate_conformance_cases_PredefinedBytesRuleProto2_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedBytesRuleProto2 getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.PredefinedBytesRuleProto2.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedBytesRuleProto2 build() { + build.buf.validate.conformance.cases.PredefinedBytesRuleProto2 result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedBytesRuleProto2 buildPartial() { + build.buf.validate.conformance.cases.PredefinedBytesRuleProto2 result = new build.buf.validate.conformance.cases.PredefinedBytesRuleProto2(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.PredefinedBytesRuleProto2 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.PredefinedBytesRuleProto2) { + return mergeFrom((build.buf.validate.conformance.cases.PredefinedBytesRuleProto2)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.PredefinedBytesRuleProto2 other) { + if (other == build.buf.validate.conformance.cases.PredefinedBytesRuleProto2.getDefaultInstance()) return this; + if (other.hasVal()) { + setVal(other.getVal()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 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 com.google.protobuf.ByteString val_ = com.google.protobuf.ByteString.EMPTY; + /** + * optional bytes 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 bytes val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public com.google.protobuf.ByteString getVal() { + return val_; + } + /** + * optional bytes val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param value The val to set. + * @return This builder for chaining. + */ + public Builder setVal(com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + val_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * optional bytes val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return This builder for chaining. + */ + public Builder clearVal() { + bitField0_ = (bitField0_ & ~0x00000001); + val_ = getDefaultInstance().getVal(); + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.PredefinedBytesRuleProto2) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.PredefinedBytesRuleProto2) + private static final build.buf.validate.conformance.cases.PredefinedBytesRuleProto2 DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.PredefinedBytesRuleProto2(); + } + + public static build.buf.validate.conformance.cases.PredefinedBytesRuleProto2 getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PredefinedBytesRuleProto2 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.PredefinedBytesRuleProto2 getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedBytesRuleProto2OrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedBytesRuleProto2OrBuilder.java new file mode 100644 index 00000000..a36316cb --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedBytesRuleProto2OrBuilder.java @@ -0,0 +1,22 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/predefined_rules_proto2.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +public interface PredefinedBytesRuleProto2OrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.PredefinedBytesRuleProto2) + com.google.protobuf.MessageOrBuilder { + + /** + * optional bytes val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + boolean hasVal(); + /** + * optional bytes val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + com.google.protobuf.ByteString getVal(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedBytesRuleProto3.java b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedBytesRuleProto3.java new file mode 100644 index 00000000..ab571631 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedBytesRuleProto3.java @@ -0,0 +1,432 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/predefined_rules_proto3.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.PredefinedBytesRuleProto3} + */ +public final class PredefinedBytesRuleProto3 extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.PredefinedBytesRuleProto3) + PredefinedBytesRuleProto3OrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 1, + /* suffix= */ "", + PredefinedBytesRuleProto3.class.getName()); + } + // Use PredefinedBytesRuleProto3.newBuilder() to construct. + private PredefinedBytesRuleProto3(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private PredefinedBytesRuleProto3() { + val_ = com.google.protobuf.ByteString.EMPTY; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.PredefinedRulesProto3Proto.internal_static_buf_validate_conformance_cases_PredefinedBytesRuleProto3_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.PredefinedRulesProto3Proto.internal_static_buf_validate_conformance_cases_PredefinedBytesRuleProto3_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.PredefinedBytesRuleProto3.class, build.buf.validate.conformance.cases.PredefinedBytesRuleProto3.Builder.class); + } + + public static final int VAL_FIELD_NUMBER = 1; + private com.google.protobuf.ByteString val_ = com.google.protobuf.ByteString.EMPTY; + /** + * bytes val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public com.google.protobuf.ByteString getVal() { + return val_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!val_.isEmpty()) { + output.writeBytes(1, val_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!val_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(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.PredefinedBytesRuleProto3)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.PredefinedBytesRuleProto3 other = (build.buf.validate.conformance.cases.PredefinedBytesRuleProto3) 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.PredefinedBytesRuleProto3 parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedBytesRuleProto3 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.PredefinedBytesRuleProto3 parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedBytesRuleProto3 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.PredefinedBytesRuleProto3 parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedBytesRuleProto3 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.PredefinedBytesRuleProto3 parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.PredefinedBytesRuleProto3 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.PredefinedBytesRuleProto3 parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.PredefinedBytesRuleProto3 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.PredefinedBytesRuleProto3 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.PredefinedBytesRuleProto3 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.PredefinedBytesRuleProto3 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.PredefinedBytesRuleProto3} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.PredefinedBytesRuleProto3) + build.buf.validate.conformance.cases.PredefinedBytesRuleProto3OrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.PredefinedRulesProto3Proto.internal_static_buf_validate_conformance_cases_PredefinedBytesRuleProto3_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.PredefinedRulesProto3Proto.internal_static_buf_validate_conformance_cases_PredefinedBytesRuleProto3_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.PredefinedBytesRuleProto3.class, build.buf.validate.conformance.cases.PredefinedBytesRuleProto3.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.PredefinedBytesRuleProto3.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.ByteString.EMPTY; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.PredefinedRulesProto3Proto.internal_static_buf_validate_conformance_cases_PredefinedBytesRuleProto3_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedBytesRuleProto3 getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.PredefinedBytesRuleProto3.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedBytesRuleProto3 build() { + build.buf.validate.conformance.cases.PredefinedBytesRuleProto3 result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedBytesRuleProto3 buildPartial() { + build.buf.validate.conformance.cases.PredefinedBytesRuleProto3 result = new build.buf.validate.conformance.cases.PredefinedBytesRuleProto3(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.PredefinedBytesRuleProto3 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.PredefinedBytesRuleProto3) { + return mergeFrom((build.buf.validate.conformance.cases.PredefinedBytesRuleProto3)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.PredefinedBytesRuleProto3 other) { + if (other == build.buf.validate.conformance.cases.PredefinedBytesRuleProto3.getDefaultInstance()) return this; + if (other.getVal() != com.google.protobuf.ByteString.EMPTY) { + setVal(other.getVal()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 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 com.google.protobuf.ByteString val_ = com.google.protobuf.ByteString.EMPTY; + /** + * bytes val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public com.google.protobuf.ByteString getVal() { + return val_; + } + /** + * bytes val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param value The val to set. + * @return This builder for chaining. + */ + public Builder setVal(com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + val_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * bytes val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return This builder for chaining. + */ + public Builder clearVal() { + bitField0_ = (bitField0_ & ~0x00000001); + val_ = getDefaultInstance().getVal(); + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.PredefinedBytesRuleProto3) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.PredefinedBytesRuleProto3) + private static final build.buf.validate.conformance.cases.PredefinedBytesRuleProto3 DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.PredefinedBytesRuleProto3(); + } + + public static build.buf.validate.conformance.cases.PredefinedBytesRuleProto3 getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PredefinedBytesRuleProto3 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.PredefinedBytesRuleProto3 getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedBytesRuleProto3OrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedBytesRuleProto3OrBuilder.java new file mode 100644 index 00000000..98527dae --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedBytesRuleProto3OrBuilder.java @@ -0,0 +1,17 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/predefined_rules_proto3.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +public interface PredefinedBytesRuleProto3OrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.PredefinedBytesRuleProto3) + com.google.protobuf.MessageOrBuilder { + + /** + * bytes val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + com.google.protobuf.ByteString getVal(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedDoubleRuleEdition2023.java b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedDoubleRuleEdition2023.java new file mode 100644 index 00000000..4ec349fc --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedDoubleRuleEdition2023.java @@ -0,0 +1,458 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/predefined_rules_proto_editions.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.PredefinedDoubleRuleEdition2023} + */ +public final class PredefinedDoubleRuleEdition2023 extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.PredefinedDoubleRuleEdition2023) + PredefinedDoubleRuleEdition2023OrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 1, + /* suffix= */ "", + PredefinedDoubleRuleEdition2023.class.getName()); + } + // Use PredefinedDoubleRuleEdition2023.newBuilder() to construct. + private PredefinedDoubleRuleEdition2023(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private PredefinedDoubleRuleEdition2023() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.internal_static_buf_validate_conformance_cases_PredefinedDoubleRuleEdition2023_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.internal_static_buf_validate_conformance_cases_PredefinedDoubleRuleEdition2023_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.PredefinedDoubleRuleEdition2023.class, build.buf.validate.conformance.cases.PredefinedDoubleRuleEdition2023.Builder.class); + } + + private int bitField0_; + public static final int VAL_FIELD_NUMBER = 1; + private double val_ = 0D; + /** + * double 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); + } + /** + * double val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public double getVal() { + return val_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + output.writeDouble(1, val_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeDoubleSize(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.PredefinedDoubleRuleEdition2023)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.PredefinedDoubleRuleEdition2023 other = (build.buf.validate.conformance.cases.PredefinedDoubleRuleEdition2023) obj; + + if (hasVal() != other.hasVal()) return false; + if (hasVal()) { + if (java.lang.Double.doubleToLongBits(getVal()) + != java.lang.Double.doubleToLongBits( + 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) + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getVal())); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.PredefinedDoubleRuleEdition2023 parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedDoubleRuleEdition2023 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.PredefinedDoubleRuleEdition2023 parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedDoubleRuleEdition2023 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.PredefinedDoubleRuleEdition2023 parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedDoubleRuleEdition2023 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.PredefinedDoubleRuleEdition2023 parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.PredefinedDoubleRuleEdition2023 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.PredefinedDoubleRuleEdition2023 parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.PredefinedDoubleRuleEdition2023 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.PredefinedDoubleRuleEdition2023 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.PredefinedDoubleRuleEdition2023 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.PredefinedDoubleRuleEdition2023 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.PredefinedDoubleRuleEdition2023} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.PredefinedDoubleRuleEdition2023) + build.buf.validate.conformance.cases.PredefinedDoubleRuleEdition2023OrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.internal_static_buf_validate_conformance_cases_PredefinedDoubleRuleEdition2023_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.internal_static_buf_validate_conformance_cases_PredefinedDoubleRuleEdition2023_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.PredefinedDoubleRuleEdition2023.class, build.buf.validate.conformance.cases.PredefinedDoubleRuleEdition2023.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.PredefinedDoubleRuleEdition2023.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + val_ = 0D; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.internal_static_buf_validate_conformance_cases_PredefinedDoubleRuleEdition2023_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedDoubleRuleEdition2023 getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.PredefinedDoubleRuleEdition2023.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedDoubleRuleEdition2023 build() { + build.buf.validate.conformance.cases.PredefinedDoubleRuleEdition2023 result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedDoubleRuleEdition2023 buildPartial() { + build.buf.validate.conformance.cases.PredefinedDoubleRuleEdition2023 result = new build.buf.validate.conformance.cases.PredefinedDoubleRuleEdition2023(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.PredefinedDoubleRuleEdition2023 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.PredefinedDoubleRuleEdition2023) { + return mergeFrom((build.buf.validate.conformance.cases.PredefinedDoubleRuleEdition2023)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.PredefinedDoubleRuleEdition2023 other) { + if (other == build.buf.validate.conformance.cases.PredefinedDoubleRuleEdition2023.getDefaultInstance()) return this; + if (other.hasVal()) { + setVal(other.getVal()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 9: { + val_ = input.readDouble(); + bitField0_ |= 0x00000001; + break; + } // case 9 + 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 double val_ ; + /** + * double 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); + } + /** + * double val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public double getVal() { + return val_; + } + /** + * double val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param value The val to set. + * @return This builder for chaining. + */ + public Builder setVal(double value) { + + val_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * double val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return This builder for chaining. + */ + public Builder clearVal() { + bitField0_ = (bitField0_ & ~0x00000001); + val_ = 0D; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.PredefinedDoubleRuleEdition2023) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.PredefinedDoubleRuleEdition2023) + private static final build.buf.validate.conformance.cases.PredefinedDoubleRuleEdition2023 DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.PredefinedDoubleRuleEdition2023(); + } + + public static build.buf.validate.conformance.cases.PredefinedDoubleRuleEdition2023 getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PredefinedDoubleRuleEdition2023 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.PredefinedDoubleRuleEdition2023 getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedDoubleRuleEdition2023OrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedDoubleRuleEdition2023OrBuilder.java new file mode 100644 index 00000000..8cac7d38 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedDoubleRuleEdition2023OrBuilder.java @@ -0,0 +1,22 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/predefined_rules_proto_editions.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +public interface PredefinedDoubleRuleEdition2023OrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.PredefinedDoubleRuleEdition2023) + com.google.protobuf.MessageOrBuilder { + + /** + * double val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + boolean hasVal(); + /** + * double val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + double getVal(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedDoubleRuleProto2.java b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedDoubleRuleProto2.java new file mode 100644 index 00000000..8e519e7d --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedDoubleRuleProto2.java @@ -0,0 +1,458 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/predefined_rules_proto2.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.PredefinedDoubleRuleProto2} + */ +public final class PredefinedDoubleRuleProto2 extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.PredefinedDoubleRuleProto2) + PredefinedDoubleRuleProto2OrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 1, + /* suffix= */ "", + PredefinedDoubleRuleProto2.class.getName()); + } + // Use PredefinedDoubleRuleProto2.newBuilder() to construct. + private PredefinedDoubleRuleProto2(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private PredefinedDoubleRuleProto2() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.internal_static_buf_validate_conformance_cases_PredefinedDoubleRuleProto2_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.internal_static_buf_validate_conformance_cases_PredefinedDoubleRuleProto2_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.PredefinedDoubleRuleProto2.class, build.buf.validate.conformance.cases.PredefinedDoubleRuleProto2.Builder.class); + } + + private int bitField0_; + public static final int VAL_FIELD_NUMBER = 1; + private double val_ = 0D; + /** + * optional double 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 double val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public double getVal() { + return val_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + output.writeDouble(1, val_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeDoubleSize(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.PredefinedDoubleRuleProto2)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.PredefinedDoubleRuleProto2 other = (build.buf.validate.conformance.cases.PredefinedDoubleRuleProto2) obj; + + if (hasVal() != other.hasVal()) return false; + if (hasVal()) { + if (java.lang.Double.doubleToLongBits(getVal()) + != java.lang.Double.doubleToLongBits( + 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) + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getVal())); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.PredefinedDoubleRuleProto2 parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedDoubleRuleProto2 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.PredefinedDoubleRuleProto2 parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedDoubleRuleProto2 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.PredefinedDoubleRuleProto2 parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedDoubleRuleProto2 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.PredefinedDoubleRuleProto2 parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.PredefinedDoubleRuleProto2 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.PredefinedDoubleRuleProto2 parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.PredefinedDoubleRuleProto2 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.PredefinedDoubleRuleProto2 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.PredefinedDoubleRuleProto2 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.PredefinedDoubleRuleProto2 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.PredefinedDoubleRuleProto2} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.PredefinedDoubleRuleProto2) + build.buf.validate.conformance.cases.PredefinedDoubleRuleProto2OrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.internal_static_buf_validate_conformance_cases_PredefinedDoubleRuleProto2_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.internal_static_buf_validate_conformance_cases_PredefinedDoubleRuleProto2_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.PredefinedDoubleRuleProto2.class, build.buf.validate.conformance.cases.PredefinedDoubleRuleProto2.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.PredefinedDoubleRuleProto2.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + val_ = 0D; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.internal_static_buf_validate_conformance_cases_PredefinedDoubleRuleProto2_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedDoubleRuleProto2 getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.PredefinedDoubleRuleProto2.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedDoubleRuleProto2 build() { + build.buf.validate.conformance.cases.PredefinedDoubleRuleProto2 result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedDoubleRuleProto2 buildPartial() { + build.buf.validate.conformance.cases.PredefinedDoubleRuleProto2 result = new build.buf.validate.conformance.cases.PredefinedDoubleRuleProto2(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.PredefinedDoubleRuleProto2 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.PredefinedDoubleRuleProto2) { + return mergeFrom((build.buf.validate.conformance.cases.PredefinedDoubleRuleProto2)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.PredefinedDoubleRuleProto2 other) { + if (other == build.buf.validate.conformance.cases.PredefinedDoubleRuleProto2.getDefaultInstance()) return this; + if (other.hasVal()) { + setVal(other.getVal()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 9: { + val_ = input.readDouble(); + bitField0_ |= 0x00000001; + break; + } // case 9 + 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 double val_ ; + /** + * optional double 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 double val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public double getVal() { + return val_; + } + /** + * optional double val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param value The val to set. + * @return This builder for chaining. + */ + public Builder setVal(double value) { + + val_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * optional double val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return This builder for chaining. + */ + public Builder clearVal() { + bitField0_ = (bitField0_ & ~0x00000001); + val_ = 0D; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.PredefinedDoubleRuleProto2) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.PredefinedDoubleRuleProto2) + private static final build.buf.validate.conformance.cases.PredefinedDoubleRuleProto2 DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.PredefinedDoubleRuleProto2(); + } + + public static build.buf.validate.conformance.cases.PredefinedDoubleRuleProto2 getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PredefinedDoubleRuleProto2 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.PredefinedDoubleRuleProto2 getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedDoubleRuleProto2OrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedDoubleRuleProto2OrBuilder.java new file mode 100644 index 00000000..09bd2678 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedDoubleRuleProto2OrBuilder.java @@ -0,0 +1,22 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/predefined_rules_proto2.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +public interface PredefinedDoubleRuleProto2OrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.PredefinedDoubleRuleProto2) + com.google.protobuf.MessageOrBuilder { + + /** + * optional double val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + boolean hasVal(); + /** + * optional double val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + double getVal(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedDoubleRuleProto3.java b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedDoubleRuleProto3.java new file mode 100644 index 00000000..c73d8ddf --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedDoubleRuleProto3.java @@ -0,0 +1,433 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/predefined_rules_proto3.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.PredefinedDoubleRuleProto3} + */ +public final class PredefinedDoubleRuleProto3 extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.PredefinedDoubleRuleProto3) + PredefinedDoubleRuleProto3OrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 1, + /* suffix= */ "", + PredefinedDoubleRuleProto3.class.getName()); + } + // Use PredefinedDoubleRuleProto3.newBuilder() to construct. + private PredefinedDoubleRuleProto3(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private PredefinedDoubleRuleProto3() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.PredefinedRulesProto3Proto.internal_static_buf_validate_conformance_cases_PredefinedDoubleRuleProto3_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.PredefinedRulesProto3Proto.internal_static_buf_validate_conformance_cases_PredefinedDoubleRuleProto3_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.PredefinedDoubleRuleProto3.class, build.buf.validate.conformance.cases.PredefinedDoubleRuleProto3.Builder.class); + } + + public static final int VAL_FIELD_NUMBER = 1; + private double val_ = 0D; + /** + * double val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public double getVal() { + return val_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (java.lang.Double.doubleToRawLongBits(val_) != 0) { + output.writeDouble(1, val_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (java.lang.Double.doubleToRawLongBits(val_) != 0) { + size += com.google.protobuf.CodedOutputStream + .computeDoubleSize(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.PredefinedDoubleRuleProto3)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.PredefinedDoubleRuleProto3 other = (build.buf.validate.conformance.cases.PredefinedDoubleRuleProto3) obj; + + if (java.lang.Double.doubleToLongBits(getVal()) + != java.lang.Double.doubleToLongBits( + 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) + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getVal())); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.PredefinedDoubleRuleProto3 parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedDoubleRuleProto3 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.PredefinedDoubleRuleProto3 parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedDoubleRuleProto3 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.PredefinedDoubleRuleProto3 parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedDoubleRuleProto3 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.PredefinedDoubleRuleProto3 parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.PredefinedDoubleRuleProto3 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.PredefinedDoubleRuleProto3 parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.PredefinedDoubleRuleProto3 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.PredefinedDoubleRuleProto3 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.PredefinedDoubleRuleProto3 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.PredefinedDoubleRuleProto3 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.PredefinedDoubleRuleProto3} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.PredefinedDoubleRuleProto3) + build.buf.validate.conformance.cases.PredefinedDoubleRuleProto3OrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.PredefinedRulesProto3Proto.internal_static_buf_validate_conformance_cases_PredefinedDoubleRuleProto3_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.PredefinedRulesProto3Proto.internal_static_buf_validate_conformance_cases_PredefinedDoubleRuleProto3_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.PredefinedDoubleRuleProto3.class, build.buf.validate.conformance.cases.PredefinedDoubleRuleProto3.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.PredefinedDoubleRuleProto3.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + val_ = 0D; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.PredefinedRulesProto3Proto.internal_static_buf_validate_conformance_cases_PredefinedDoubleRuleProto3_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedDoubleRuleProto3 getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.PredefinedDoubleRuleProto3.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedDoubleRuleProto3 build() { + build.buf.validate.conformance.cases.PredefinedDoubleRuleProto3 result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedDoubleRuleProto3 buildPartial() { + build.buf.validate.conformance.cases.PredefinedDoubleRuleProto3 result = new build.buf.validate.conformance.cases.PredefinedDoubleRuleProto3(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.PredefinedDoubleRuleProto3 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.PredefinedDoubleRuleProto3) { + return mergeFrom((build.buf.validate.conformance.cases.PredefinedDoubleRuleProto3)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.PredefinedDoubleRuleProto3 other) { + if (other == build.buf.validate.conformance.cases.PredefinedDoubleRuleProto3.getDefaultInstance()) return this; + if (other.getVal() != 0D) { + setVal(other.getVal()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 9: { + val_ = input.readDouble(); + bitField0_ |= 0x00000001; + break; + } // case 9 + 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 double val_ ; + /** + * double val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public double getVal() { + return val_; + } + /** + * double val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param value The val to set. + * @return This builder for chaining. + */ + public Builder setVal(double value) { + + val_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * double val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return This builder for chaining. + */ + public Builder clearVal() { + bitField0_ = (bitField0_ & ~0x00000001); + val_ = 0D; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.PredefinedDoubleRuleProto3) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.PredefinedDoubleRuleProto3) + private static final build.buf.validate.conformance.cases.PredefinedDoubleRuleProto3 DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.PredefinedDoubleRuleProto3(); + } + + public static build.buf.validate.conformance.cases.PredefinedDoubleRuleProto3 getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PredefinedDoubleRuleProto3 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.PredefinedDoubleRuleProto3 getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedDoubleRuleProto3OrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedDoubleRuleProto3OrBuilder.java new file mode 100644 index 00000000..6c18eb3f --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedDoubleRuleProto3OrBuilder.java @@ -0,0 +1,17 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/predefined_rules_proto3.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +public interface PredefinedDoubleRuleProto3OrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.PredefinedDoubleRuleProto3) + com.google.protobuf.MessageOrBuilder { + + /** + * double val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + double getVal(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedDurationRuleEdition2023.java b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedDurationRuleEdition2023.java new file mode 100644 index 00000000..5f56ef01 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedDurationRuleEdition2023.java @@ -0,0 +1,558 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/predefined_rules_proto_editions.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.PredefinedDurationRuleEdition2023} + */ +public final class PredefinedDurationRuleEdition2023 extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.PredefinedDurationRuleEdition2023) + PredefinedDurationRuleEdition2023OrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 1, + /* suffix= */ "", + PredefinedDurationRuleEdition2023.class.getName()); + } + // Use PredefinedDurationRuleEdition2023.newBuilder() to construct. + private PredefinedDurationRuleEdition2023(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private PredefinedDurationRuleEdition2023() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.internal_static_buf_validate_conformance_cases_PredefinedDurationRuleEdition2023_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.internal_static_buf_validate_conformance_cases_PredefinedDurationRuleEdition2023_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.PredefinedDurationRuleEdition2023.class, build.buf.validate.conformance.cases.PredefinedDurationRuleEdition2023.Builder.class); + } + + private int bitField0_; + public static final int VAL_FIELD_NUMBER = 1; + private com.google.protobuf.Duration val_; + /** + * .google.protobuf.Duration 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); + } + /** + * .google.protobuf.Duration val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public com.google.protobuf.Duration getVal() { + return val_ == null ? com.google.protobuf.Duration.getDefaultInstance() : val_; + } + /** + * .google.protobuf.Duration val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getValOrBuilder() { + return val_ == null ? com.google.protobuf.Duration.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.PredefinedDurationRuleEdition2023)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.PredefinedDurationRuleEdition2023 other = (build.buf.validate.conformance.cases.PredefinedDurationRuleEdition2023) 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.PredefinedDurationRuleEdition2023 parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedDurationRuleEdition2023 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.PredefinedDurationRuleEdition2023 parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedDurationRuleEdition2023 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.PredefinedDurationRuleEdition2023 parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedDurationRuleEdition2023 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.PredefinedDurationRuleEdition2023 parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.PredefinedDurationRuleEdition2023 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.PredefinedDurationRuleEdition2023 parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.PredefinedDurationRuleEdition2023 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.PredefinedDurationRuleEdition2023 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.PredefinedDurationRuleEdition2023 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.PredefinedDurationRuleEdition2023 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.PredefinedDurationRuleEdition2023} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.PredefinedDurationRuleEdition2023) + build.buf.validate.conformance.cases.PredefinedDurationRuleEdition2023OrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.internal_static_buf_validate_conformance_cases_PredefinedDurationRuleEdition2023_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.internal_static_buf_validate_conformance_cases_PredefinedDurationRuleEdition2023_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.PredefinedDurationRuleEdition2023.class, build.buf.validate.conformance.cases.PredefinedDurationRuleEdition2023.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.PredefinedDurationRuleEdition2023.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage + .alwaysUseFieldBuilders) { + getValFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + val_ = null; + if (valBuilder_ != null) { + valBuilder_.dispose(); + valBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.internal_static_buf_validate_conformance_cases_PredefinedDurationRuleEdition2023_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedDurationRuleEdition2023 getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.PredefinedDurationRuleEdition2023.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedDurationRuleEdition2023 build() { + build.buf.validate.conformance.cases.PredefinedDurationRuleEdition2023 result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedDurationRuleEdition2023 buildPartial() { + build.buf.validate.conformance.cases.PredefinedDurationRuleEdition2023 result = new build.buf.validate.conformance.cases.PredefinedDurationRuleEdition2023(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.PredefinedDurationRuleEdition2023 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.PredefinedDurationRuleEdition2023) { + return mergeFrom((build.buf.validate.conformance.cases.PredefinedDurationRuleEdition2023)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.PredefinedDurationRuleEdition2023 other) { + if (other == build.buf.validate.conformance.cases.PredefinedDurationRuleEdition2023.getDefaultInstance()) return this; + if (other.hasVal()) { + mergeVal(other.getVal()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + input.readMessage( + getValFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private com.google.protobuf.Duration val_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> valBuilder_; + /** + * .google.protobuf.Duration val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + public boolean hasVal() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * .google.protobuf.Duration val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + public com.google.protobuf.Duration getVal() { + if (valBuilder_ == null) { + return val_ == null ? com.google.protobuf.Duration.getDefaultInstance() : val_; + } else { + return valBuilder_.getMessage(); + } + } + /** + * .google.protobuf.Duration val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder setVal(com.google.protobuf.Duration value) { + if (valBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + val_ = value; + } else { + valBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * .google.protobuf.Duration val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder setVal( + com.google.protobuf.Duration.Builder builderForValue) { + if (valBuilder_ == null) { + val_ = builderForValue.build(); + } else { + valBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * .google.protobuf.Duration val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder mergeVal(com.google.protobuf.Duration value) { + if (valBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) && + val_ != null && + val_ != com.google.protobuf.Duration.getDefaultInstance()) { + getValBuilder().mergeFrom(value); + } else { + val_ = value; + } + } else { + valBuilder_.mergeFrom(value); + } + if (val_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + /** + * .google.protobuf.Duration 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; + } + /** + * .google.protobuf.Duration val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public com.google.protobuf.Duration.Builder getValBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getValFieldBuilder().getBuilder(); + } + /** + * .google.protobuf.Duration val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public com.google.protobuf.DurationOrBuilder getValOrBuilder() { + if (valBuilder_ != null) { + return valBuilder_.getMessageOrBuilder(); + } else { + return val_ == null ? + com.google.protobuf.Duration.getDefaultInstance() : val_; + } + } + /** + * .google.protobuf.Duration val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> + getValFieldBuilder() { + if (valBuilder_ == null) { + valBuilder_ = new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder>( + getVal(), + getParentForChildren(), + isClean()); + val_ = null; + } + return valBuilder_; + } + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.PredefinedDurationRuleEdition2023) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.PredefinedDurationRuleEdition2023) + private static final build.buf.validate.conformance.cases.PredefinedDurationRuleEdition2023 DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.PredefinedDurationRuleEdition2023(); + } + + public static build.buf.validate.conformance.cases.PredefinedDurationRuleEdition2023 getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PredefinedDurationRuleEdition2023 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.PredefinedDurationRuleEdition2023 getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedDurationRuleEdition2023OrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedDurationRuleEdition2023OrBuilder.java new file mode 100644 index 00000000..58723344 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedDurationRuleEdition2023OrBuilder.java @@ -0,0 +1,26 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/predefined_rules_proto_editions.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +public interface PredefinedDurationRuleEdition2023OrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.PredefinedDurationRuleEdition2023) + com.google.protobuf.MessageOrBuilder { + + /** + * .google.protobuf.Duration val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + boolean hasVal(); + /** + * .google.protobuf.Duration val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + com.google.protobuf.Duration getVal(); + /** + * .google.protobuf.Duration val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + com.google.protobuf.DurationOrBuilder getValOrBuilder(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedDurationRuleProto2.java b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedDurationRuleProto2.java new file mode 100644 index 00000000..110014d5 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedDurationRuleProto2.java @@ -0,0 +1,558 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/predefined_rules_proto2.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.PredefinedDurationRuleProto2} + */ +public final class PredefinedDurationRuleProto2 extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.PredefinedDurationRuleProto2) + PredefinedDurationRuleProto2OrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 1, + /* suffix= */ "", + PredefinedDurationRuleProto2.class.getName()); + } + // Use PredefinedDurationRuleProto2.newBuilder() to construct. + private PredefinedDurationRuleProto2(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private PredefinedDurationRuleProto2() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.internal_static_buf_validate_conformance_cases_PredefinedDurationRuleProto2_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.internal_static_buf_validate_conformance_cases_PredefinedDurationRuleProto2_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.PredefinedDurationRuleProto2.class, build.buf.validate.conformance.cases.PredefinedDurationRuleProto2.Builder.class); + } + + private int bitField0_; + public static final int VAL_FIELD_NUMBER = 1; + private com.google.protobuf.Duration val_; + /** + * optional .google.protobuf.Duration 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 .google.protobuf.Duration val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public com.google.protobuf.Duration getVal() { + return val_ == null ? com.google.protobuf.Duration.getDefaultInstance() : val_; + } + /** + * optional .google.protobuf.Duration val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getValOrBuilder() { + return val_ == null ? com.google.protobuf.Duration.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.PredefinedDurationRuleProto2)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.PredefinedDurationRuleProto2 other = (build.buf.validate.conformance.cases.PredefinedDurationRuleProto2) 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.PredefinedDurationRuleProto2 parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedDurationRuleProto2 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.PredefinedDurationRuleProto2 parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedDurationRuleProto2 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.PredefinedDurationRuleProto2 parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedDurationRuleProto2 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.PredefinedDurationRuleProto2 parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.PredefinedDurationRuleProto2 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.PredefinedDurationRuleProto2 parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.PredefinedDurationRuleProto2 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.PredefinedDurationRuleProto2 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.PredefinedDurationRuleProto2 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.PredefinedDurationRuleProto2 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.PredefinedDurationRuleProto2} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.PredefinedDurationRuleProto2) + build.buf.validate.conformance.cases.PredefinedDurationRuleProto2OrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.internal_static_buf_validate_conformance_cases_PredefinedDurationRuleProto2_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.internal_static_buf_validate_conformance_cases_PredefinedDurationRuleProto2_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.PredefinedDurationRuleProto2.class, build.buf.validate.conformance.cases.PredefinedDurationRuleProto2.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.PredefinedDurationRuleProto2.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage + .alwaysUseFieldBuilders) { + getValFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + val_ = null; + if (valBuilder_ != null) { + valBuilder_.dispose(); + valBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.internal_static_buf_validate_conformance_cases_PredefinedDurationRuleProto2_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedDurationRuleProto2 getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.PredefinedDurationRuleProto2.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedDurationRuleProto2 build() { + build.buf.validate.conformance.cases.PredefinedDurationRuleProto2 result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedDurationRuleProto2 buildPartial() { + build.buf.validate.conformance.cases.PredefinedDurationRuleProto2 result = new build.buf.validate.conformance.cases.PredefinedDurationRuleProto2(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.PredefinedDurationRuleProto2 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.PredefinedDurationRuleProto2) { + return mergeFrom((build.buf.validate.conformance.cases.PredefinedDurationRuleProto2)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.PredefinedDurationRuleProto2 other) { + if (other == build.buf.validate.conformance.cases.PredefinedDurationRuleProto2.getDefaultInstance()) return this; + if (other.hasVal()) { + mergeVal(other.getVal()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + input.readMessage( + getValFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private com.google.protobuf.Duration val_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> valBuilder_; + /** + * optional .google.protobuf.Duration val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + public boolean hasVal() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * optional .google.protobuf.Duration val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + public com.google.protobuf.Duration getVal() { + if (valBuilder_ == null) { + return val_ == null ? com.google.protobuf.Duration.getDefaultInstance() : val_; + } else { + return valBuilder_.getMessage(); + } + } + /** + * optional .google.protobuf.Duration val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder setVal(com.google.protobuf.Duration value) { + if (valBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + val_ = value; + } else { + valBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * optional .google.protobuf.Duration val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder setVal( + com.google.protobuf.Duration.Builder builderForValue) { + if (valBuilder_ == null) { + val_ = builderForValue.build(); + } else { + valBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * optional .google.protobuf.Duration val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder mergeVal(com.google.protobuf.Duration value) { + if (valBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) && + val_ != null && + val_ != com.google.protobuf.Duration.getDefaultInstance()) { + getValBuilder().mergeFrom(value); + } else { + val_ = value; + } + } else { + valBuilder_.mergeFrom(value); + } + if (val_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + /** + * optional .google.protobuf.Duration 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 .google.protobuf.Duration val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public com.google.protobuf.Duration.Builder getValBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getValFieldBuilder().getBuilder(); + } + /** + * optional .google.protobuf.Duration val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public com.google.protobuf.DurationOrBuilder getValOrBuilder() { + if (valBuilder_ != null) { + return valBuilder_.getMessageOrBuilder(); + } else { + return val_ == null ? + com.google.protobuf.Duration.getDefaultInstance() : val_; + } + } + /** + * optional .google.protobuf.Duration val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> + getValFieldBuilder() { + if (valBuilder_ == null) { + valBuilder_ = new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder>( + getVal(), + getParentForChildren(), + isClean()); + val_ = null; + } + return valBuilder_; + } + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.PredefinedDurationRuleProto2) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.PredefinedDurationRuleProto2) + private static final build.buf.validate.conformance.cases.PredefinedDurationRuleProto2 DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.PredefinedDurationRuleProto2(); + } + + public static build.buf.validate.conformance.cases.PredefinedDurationRuleProto2 getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PredefinedDurationRuleProto2 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.PredefinedDurationRuleProto2 getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedDurationRuleProto2OrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedDurationRuleProto2OrBuilder.java new file mode 100644 index 00000000..0c500803 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedDurationRuleProto2OrBuilder.java @@ -0,0 +1,26 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/predefined_rules_proto2.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +public interface PredefinedDurationRuleProto2OrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.PredefinedDurationRuleProto2) + com.google.protobuf.MessageOrBuilder { + + /** + * optional .google.protobuf.Duration val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + boolean hasVal(); + /** + * optional .google.protobuf.Duration val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + com.google.protobuf.Duration getVal(); + /** + * optional .google.protobuf.Duration val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + com.google.protobuf.DurationOrBuilder getValOrBuilder(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedDurationRuleProto3.java b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedDurationRuleProto3.java new file mode 100644 index 00000000..a08dd170 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedDurationRuleProto3.java @@ -0,0 +1,558 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/predefined_rules_proto3.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.PredefinedDurationRuleProto3} + */ +public final class PredefinedDurationRuleProto3 extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.PredefinedDurationRuleProto3) + PredefinedDurationRuleProto3OrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 1, + /* suffix= */ "", + PredefinedDurationRuleProto3.class.getName()); + } + // Use PredefinedDurationRuleProto3.newBuilder() to construct. + private PredefinedDurationRuleProto3(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private PredefinedDurationRuleProto3() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.PredefinedRulesProto3Proto.internal_static_buf_validate_conformance_cases_PredefinedDurationRuleProto3_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.PredefinedRulesProto3Proto.internal_static_buf_validate_conformance_cases_PredefinedDurationRuleProto3_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.PredefinedDurationRuleProto3.class, build.buf.validate.conformance.cases.PredefinedDurationRuleProto3.Builder.class); + } + + private int bitField0_; + public static final int VAL_FIELD_NUMBER = 1; + private com.google.protobuf.Duration val_; + /** + * .google.protobuf.Duration 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); + } + /** + * .google.protobuf.Duration val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public com.google.protobuf.Duration getVal() { + return val_ == null ? com.google.protobuf.Duration.getDefaultInstance() : val_; + } + /** + * .google.protobuf.Duration val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getValOrBuilder() { + return val_ == null ? com.google.protobuf.Duration.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.PredefinedDurationRuleProto3)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.PredefinedDurationRuleProto3 other = (build.buf.validate.conformance.cases.PredefinedDurationRuleProto3) 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.PredefinedDurationRuleProto3 parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedDurationRuleProto3 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.PredefinedDurationRuleProto3 parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedDurationRuleProto3 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.PredefinedDurationRuleProto3 parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedDurationRuleProto3 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.PredefinedDurationRuleProto3 parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.PredefinedDurationRuleProto3 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.PredefinedDurationRuleProto3 parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.PredefinedDurationRuleProto3 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.PredefinedDurationRuleProto3 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.PredefinedDurationRuleProto3 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.PredefinedDurationRuleProto3 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.PredefinedDurationRuleProto3} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.PredefinedDurationRuleProto3) + build.buf.validate.conformance.cases.PredefinedDurationRuleProto3OrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.PredefinedRulesProto3Proto.internal_static_buf_validate_conformance_cases_PredefinedDurationRuleProto3_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.PredefinedRulesProto3Proto.internal_static_buf_validate_conformance_cases_PredefinedDurationRuleProto3_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.PredefinedDurationRuleProto3.class, build.buf.validate.conformance.cases.PredefinedDurationRuleProto3.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.PredefinedDurationRuleProto3.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage + .alwaysUseFieldBuilders) { + getValFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + val_ = null; + if (valBuilder_ != null) { + valBuilder_.dispose(); + valBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.PredefinedRulesProto3Proto.internal_static_buf_validate_conformance_cases_PredefinedDurationRuleProto3_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedDurationRuleProto3 getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.PredefinedDurationRuleProto3.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedDurationRuleProto3 build() { + build.buf.validate.conformance.cases.PredefinedDurationRuleProto3 result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedDurationRuleProto3 buildPartial() { + build.buf.validate.conformance.cases.PredefinedDurationRuleProto3 result = new build.buf.validate.conformance.cases.PredefinedDurationRuleProto3(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.PredefinedDurationRuleProto3 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.PredefinedDurationRuleProto3) { + return mergeFrom((build.buf.validate.conformance.cases.PredefinedDurationRuleProto3)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.PredefinedDurationRuleProto3 other) { + if (other == build.buf.validate.conformance.cases.PredefinedDurationRuleProto3.getDefaultInstance()) return this; + if (other.hasVal()) { + mergeVal(other.getVal()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + input.readMessage( + getValFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private com.google.protobuf.Duration val_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> valBuilder_; + /** + * .google.protobuf.Duration val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + public boolean hasVal() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * .google.protobuf.Duration val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + public com.google.protobuf.Duration getVal() { + if (valBuilder_ == null) { + return val_ == null ? com.google.protobuf.Duration.getDefaultInstance() : val_; + } else { + return valBuilder_.getMessage(); + } + } + /** + * .google.protobuf.Duration val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder setVal(com.google.protobuf.Duration value) { + if (valBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + val_ = value; + } else { + valBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * .google.protobuf.Duration val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder setVal( + com.google.protobuf.Duration.Builder builderForValue) { + if (valBuilder_ == null) { + val_ = builderForValue.build(); + } else { + valBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * .google.protobuf.Duration val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder mergeVal(com.google.protobuf.Duration value) { + if (valBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) && + val_ != null && + val_ != com.google.protobuf.Duration.getDefaultInstance()) { + getValBuilder().mergeFrom(value); + } else { + val_ = value; + } + } else { + valBuilder_.mergeFrom(value); + } + if (val_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + /** + * .google.protobuf.Duration 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; + } + /** + * .google.protobuf.Duration val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public com.google.protobuf.Duration.Builder getValBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getValFieldBuilder().getBuilder(); + } + /** + * .google.protobuf.Duration val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public com.google.protobuf.DurationOrBuilder getValOrBuilder() { + if (valBuilder_ != null) { + return valBuilder_.getMessageOrBuilder(); + } else { + return val_ == null ? + com.google.protobuf.Duration.getDefaultInstance() : val_; + } + } + /** + * .google.protobuf.Duration val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> + getValFieldBuilder() { + if (valBuilder_ == null) { + valBuilder_ = new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder>( + getVal(), + getParentForChildren(), + isClean()); + val_ = null; + } + return valBuilder_; + } + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.PredefinedDurationRuleProto3) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.PredefinedDurationRuleProto3) + private static final build.buf.validate.conformance.cases.PredefinedDurationRuleProto3 DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.PredefinedDurationRuleProto3(); + } + + public static build.buf.validate.conformance.cases.PredefinedDurationRuleProto3 getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PredefinedDurationRuleProto3 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.PredefinedDurationRuleProto3 getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedDurationRuleProto3OrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedDurationRuleProto3OrBuilder.java new file mode 100644 index 00000000..fb85b55d --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedDurationRuleProto3OrBuilder.java @@ -0,0 +1,26 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/predefined_rules_proto3.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +public interface PredefinedDurationRuleProto3OrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.PredefinedDurationRuleProto3) + com.google.protobuf.MessageOrBuilder { + + /** + * .google.protobuf.Duration val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + boolean hasVal(); + /** + * .google.protobuf.Duration val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + com.google.protobuf.Duration getVal(); + /** + * .google.protobuf.Duration val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + com.google.protobuf.DurationOrBuilder getValOrBuilder(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedEnumRuleEdition2023.java b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedEnumRuleEdition2023.java new file mode 100644 index 00000000..baaa9334 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedEnumRuleEdition2023.java @@ -0,0 +1,599 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/predefined_rules_proto_editions.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.PredefinedEnumRuleEdition2023} + */ +public final class PredefinedEnumRuleEdition2023 extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.PredefinedEnumRuleEdition2023) + PredefinedEnumRuleEdition2023OrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 1, + /* suffix= */ "", + PredefinedEnumRuleEdition2023.class.getName()); + } + // Use PredefinedEnumRuleEdition2023.newBuilder() to construct. + private PredefinedEnumRuleEdition2023(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private PredefinedEnumRuleEdition2023() { + val_ = 0; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.internal_static_buf_validate_conformance_cases_PredefinedEnumRuleEdition2023_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.internal_static_buf_validate_conformance_cases_PredefinedEnumRuleEdition2023_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.PredefinedEnumRuleEdition2023.class, build.buf.validate.conformance.cases.PredefinedEnumRuleEdition2023.Builder.class); + } + + /** + * Protobuf enum {@code buf.validate.conformance.cases.PredefinedEnumRuleEdition2023.EnumEdition2023} + */ + public enum EnumEdition2023 + implements com.google.protobuf.ProtocolMessageEnum { + /** + * ENUM_EDITION2023_ZERO_UNSPECIFIED = 0; + */ + ENUM_EDITION2023_ZERO_UNSPECIFIED(0), + /** + * ENUM_EDITION2023_ONE = 1; + */ + ENUM_EDITION2023_ONE(1), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 1, + /* suffix= */ "", + EnumEdition2023.class.getName()); + } + /** + * ENUM_EDITION2023_ZERO_UNSPECIFIED = 0; + */ + public static final int ENUM_EDITION2023_ZERO_UNSPECIFIED_VALUE = 0; + /** + * ENUM_EDITION2023_ONE = 1; + */ + public static final int ENUM_EDITION2023_ONE_VALUE = 1; + + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static EnumEdition2023 valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static EnumEdition2023 forNumber(int value) { + switch (value) { + case 0: return ENUM_EDITION2023_ZERO_UNSPECIFIED; + case 1: return ENUM_EDITION2023_ONE; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + EnumEdition2023> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public EnumEdition2023 findValueByNumber(int number) { + return EnumEdition2023.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + public final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptorForType() { + return getDescriptor(); + } + public static final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptor() { + return build.buf.validate.conformance.cases.PredefinedEnumRuleEdition2023.getDescriptor().getEnumTypes().get(0); + } + + private static final EnumEdition2023[] VALUES = values(); + + public static EnumEdition2023 valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException( + "EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private EnumEdition2023(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:buf.validate.conformance.cases.PredefinedEnumRuleEdition2023.EnumEdition2023) + } + + private int bitField0_; + public static final int VAL_FIELD_NUMBER = 1; + private int val_ = 0; + /** + * .buf.validate.conformance.cases.PredefinedEnumRuleEdition2023.EnumEdition2023 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.PredefinedEnumRuleEdition2023.EnumEdition2023 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The enum numeric value on the wire for val. + */ + @java.lang.Override public int getValValue() { + return val_; + } + /** + * .buf.validate.conformance.cases.PredefinedEnumRuleEdition2023.EnumEdition2023 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override public build.buf.validate.conformance.cases.PredefinedEnumRuleEdition2023.EnumEdition2023 getVal() { + build.buf.validate.conformance.cases.PredefinedEnumRuleEdition2023.EnumEdition2023 result = build.buf.validate.conformance.cases.PredefinedEnumRuleEdition2023.EnumEdition2023.forNumber(val_); + return result == null ? build.buf.validate.conformance.cases.PredefinedEnumRuleEdition2023.EnumEdition2023.UNRECOGNIZED : result; + } + + 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.writeEnum(1, val_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(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.PredefinedEnumRuleEdition2023)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.PredefinedEnumRuleEdition2023 other = (build.buf.validate.conformance.cases.PredefinedEnumRuleEdition2023) obj; + + if (hasVal() != other.hasVal()) return false; + if (hasVal()) { + if (val_ != other.val_) 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) + val_; + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.PredefinedEnumRuleEdition2023 parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedEnumRuleEdition2023 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.PredefinedEnumRuleEdition2023 parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedEnumRuleEdition2023 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.PredefinedEnumRuleEdition2023 parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedEnumRuleEdition2023 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.PredefinedEnumRuleEdition2023 parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.PredefinedEnumRuleEdition2023 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.PredefinedEnumRuleEdition2023 parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.PredefinedEnumRuleEdition2023 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.PredefinedEnumRuleEdition2023 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.PredefinedEnumRuleEdition2023 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.PredefinedEnumRuleEdition2023 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.PredefinedEnumRuleEdition2023} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.PredefinedEnumRuleEdition2023) + build.buf.validate.conformance.cases.PredefinedEnumRuleEdition2023OrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.internal_static_buf_validate_conformance_cases_PredefinedEnumRuleEdition2023_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.internal_static_buf_validate_conformance_cases_PredefinedEnumRuleEdition2023_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.PredefinedEnumRuleEdition2023.class, build.buf.validate.conformance.cases.PredefinedEnumRuleEdition2023.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.PredefinedEnumRuleEdition2023.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + val_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.internal_static_buf_validate_conformance_cases_PredefinedEnumRuleEdition2023_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedEnumRuleEdition2023 getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.PredefinedEnumRuleEdition2023.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedEnumRuleEdition2023 build() { + build.buf.validate.conformance.cases.PredefinedEnumRuleEdition2023 result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedEnumRuleEdition2023 buildPartial() { + build.buf.validate.conformance.cases.PredefinedEnumRuleEdition2023 result = new build.buf.validate.conformance.cases.PredefinedEnumRuleEdition2023(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.PredefinedEnumRuleEdition2023 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.PredefinedEnumRuleEdition2023) { + return mergeFrom((build.buf.validate.conformance.cases.PredefinedEnumRuleEdition2023)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.PredefinedEnumRuleEdition2023 other) { + if (other == build.buf.validate.conformance.cases.PredefinedEnumRuleEdition2023.getDefaultInstance()) return this; + if (other.hasVal()) { + setVal(other.getVal()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + val_ = input.readEnum(); + bitField0_ |= 0x00000001; + break; + } // case 8 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private int val_ = 0; + /** + * .buf.validate.conformance.cases.PredefinedEnumRuleEdition2023.EnumEdition2023 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.PredefinedEnumRuleEdition2023.EnumEdition2023 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The enum numeric value on the wire for val. + */ + @java.lang.Override public int getValValue() { + return val_; + } + /** + * .buf.validate.conformance.cases.PredefinedEnumRuleEdition2023.EnumEdition2023 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param value The enum numeric value on the wire for val to set. + * @return This builder for chaining. + */ + public Builder setValValue(int value) { + val_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * .buf.validate.conformance.cases.PredefinedEnumRuleEdition2023.EnumEdition2023 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedEnumRuleEdition2023.EnumEdition2023 getVal() { + build.buf.validate.conformance.cases.PredefinedEnumRuleEdition2023.EnumEdition2023 result = build.buf.validate.conformance.cases.PredefinedEnumRuleEdition2023.EnumEdition2023.forNumber(val_); + return result == null ? build.buf.validate.conformance.cases.PredefinedEnumRuleEdition2023.EnumEdition2023.UNRECOGNIZED : result; + } + /** + * .buf.validate.conformance.cases.PredefinedEnumRuleEdition2023.EnumEdition2023 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param value The val to set. + * @return This builder for chaining. + */ + public Builder setVal(build.buf.validate.conformance.cases.PredefinedEnumRuleEdition2023.EnumEdition2023 value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + val_ = value.getNumber(); + onChanged(); + return this; + } + /** + * .buf.validate.conformance.cases.PredefinedEnumRuleEdition2023.EnumEdition2023 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return This builder for chaining. + */ + public Builder clearVal() { + bitField0_ = (bitField0_ & ~0x00000001); + val_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.PredefinedEnumRuleEdition2023) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.PredefinedEnumRuleEdition2023) + private static final build.buf.validate.conformance.cases.PredefinedEnumRuleEdition2023 DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.PredefinedEnumRuleEdition2023(); + } + + public static build.buf.validate.conformance.cases.PredefinedEnumRuleEdition2023 getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PredefinedEnumRuleEdition2023 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.PredefinedEnumRuleEdition2023 getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedEnumRuleEdition2023OrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedEnumRuleEdition2023OrBuilder.java new file mode 100644 index 00000000..0ba0bf9f --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedEnumRuleEdition2023OrBuilder.java @@ -0,0 +1,27 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/predefined_rules_proto_editions.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +public interface PredefinedEnumRuleEdition2023OrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.PredefinedEnumRuleEdition2023) + com.google.protobuf.MessageOrBuilder { + + /** + * .buf.validate.conformance.cases.PredefinedEnumRuleEdition2023.EnumEdition2023 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + boolean hasVal(); + /** + * .buf.validate.conformance.cases.PredefinedEnumRuleEdition2023.EnumEdition2023 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The enum numeric value on the wire for val. + */ + int getValValue(); + /** + * .buf.validate.conformance.cases.PredefinedEnumRuleEdition2023.EnumEdition2023 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + build.buf.validate.conformance.cases.PredefinedEnumRuleEdition2023.EnumEdition2023 getVal(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedEnumRuleProto2.java b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedEnumRuleProto2.java new file mode 100644 index 00000000..9882ecf0 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedEnumRuleProto2.java @@ -0,0 +1,569 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/predefined_rules_proto2.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.PredefinedEnumRuleProto2} + */ +public final class PredefinedEnumRuleProto2 extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.PredefinedEnumRuleProto2) + PredefinedEnumRuleProto2OrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 1, + /* suffix= */ "", + PredefinedEnumRuleProto2.class.getName()); + } + // Use PredefinedEnumRuleProto2.newBuilder() to construct. + private PredefinedEnumRuleProto2(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private PredefinedEnumRuleProto2() { + val_ = 0; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.internal_static_buf_validate_conformance_cases_PredefinedEnumRuleProto2_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.internal_static_buf_validate_conformance_cases_PredefinedEnumRuleProto2_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.PredefinedEnumRuleProto2.class, build.buf.validate.conformance.cases.PredefinedEnumRuleProto2.Builder.class); + } + + /** + * Protobuf enum {@code buf.validate.conformance.cases.PredefinedEnumRuleProto2.EnumProto2} + */ + public enum EnumProto2 + implements com.google.protobuf.ProtocolMessageEnum { + /** + * ENUM_PROTO2_ZERO_UNSPECIFIED = 0; + */ + ENUM_PROTO2_ZERO_UNSPECIFIED(0), + /** + * ENUM_PROTO2_ONE = 1; + */ + ENUM_PROTO2_ONE(1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 1, + /* suffix= */ "", + EnumProto2.class.getName()); + } + /** + * ENUM_PROTO2_ZERO_UNSPECIFIED = 0; + */ + public static final int ENUM_PROTO2_ZERO_UNSPECIFIED_VALUE = 0; + /** + * ENUM_PROTO2_ONE = 1; + */ + public static final int ENUM_PROTO2_ONE_VALUE = 1; + + + public final int getNumber() { + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static EnumProto2 valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static EnumProto2 forNumber(int value) { + switch (value) { + case 0: return ENUM_PROTO2_ZERO_UNSPECIFIED; + case 1: return ENUM_PROTO2_ONE; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + EnumProto2> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public EnumProto2 findValueByNumber(int number) { + return EnumProto2.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + return getDescriptor().getValues().get(ordinal()); + } + public final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptorForType() { + return getDescriptor(); + } + public static final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptor() { + return build.buf.validate.conformance.cases.PredefinedEnumRuleProto2.getDescriptor().getEnumTypes().get(0); + } + + private static final EnumProto2[] VALUES = values(); + + public static EnumProto2 valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException( + "EnumValueDescriptor is not for this type."); + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private EnumProto2(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:buf.validate.conformance.cases.PredefinedEnumRuleProto2.EnumProto2) + } + + private int bitField0_; + public static final int VAL_FIELD_NUMBER = 1; + private int val_ = 0; + /** + * optional .buf.validate.conformance.cases.PredefinedEnumRuleProto2.EnumProto2 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.PredefinedEnumRuleProto2.EnumProto2 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override public build.buf.validate.conformance.cases.PredefinedEnumRuleProto2.EnumProto2 getVal() { + build.buf.validate.conformance.cases.PredefinedEnumRuleProto2.EnumProto2 result = build.buf.validate.conformance.cases.PredefinedEnumRuleProto2.EnumProto2.forNumber(val_); + return result == null ? build.buf.validate.conformance.cases.PredefinedEnumRuleProto2.EnumProto2.ENUM_PROTO2_ZERO_UNSPECIFIED : result; + } + + 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.writeEnum(1, val_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(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.PredefinedEnumRuleProto2)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.PredefinedEnumRuleProto2 other = (build.buf.validate.conformance.cases.PredefinedEnumRuleProto2) obj; + + if (hasVal() != other.hasVal()) return false; + if (hasVal()) { + if (val_ != other.val_) 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) + val_; + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.PredefinedEnumRuleProto2 parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedEnumRuleProto2 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.PredefinedEnumRuleProto2 parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedEnumRuleProto2 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.PredefinedEnumRuleProto2 parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedEnumRuleProto2 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.PredefinedEnumRuleProto2 parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.PredefinedEnumRuleProto2 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.PredefinedEnumRuleProto2 parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.PredefinedEnumRuleProto2 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.PredefinedEnumRuleProto2 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.PredefinedEnumRuleProto2 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.PredefinedEnumRuleProto2 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.PredefinedEnumRuleProto2} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.PredefinedEnumRuleProto2) + build.buf.validate.conformance.cases.PredefinedEnumRuleProto2OrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.internal_static_buf_validate_conformance_cases_PredefinedEnumRuleProto2_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.internal_static_buf_validate_conformance_cases_PredefinedEnumRuleProto2_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.PredefinedEnumRuleProto2.class, build.buf.validate.conformance.cases.PredefinedEnumRuleProto2.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.PredefinedEnumRuleProto2.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + val_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.internal_static_buf_validate_conformance_cases_PredefinedEnumRuleProto2_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedEnumRuleProto2 getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.PredefinedEnumRuleProto2.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedEnumRuleProto2 build() { + build.buf.validate.conformance.cases.PredefinedEnumRuleProto2 result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedEnumRuleProto2 buildPartial() { + build.buf.validate.conformance.cases.PredefinedEnumRuleProto2 result = new build.buf.validate.conformance.cases.PredefinedEnumRuleProto2(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.PredefinedEnumRuleProto2 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.PredefinedEnumRuleProto2) { + return mergeFrom((build.buf.validate.conformance.cases.PredefinedEnumRuleProto2)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.PredefinedEnumRuleProto2 other) { + if (other == build.buf.validate.conformance.cases.PredefinedEnumRuleProto2.getDefaultInstance()) return this; + if (other.hasVal()) { + setVal(other.getVal()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + int tmpRaw = input.readEnum(); + build.buf.validate.conformance.cases.PredefinedEnumRuleProto2.EnumProto2 tmpValue = + build.buf.validate.conformance.cases.PredefinedEnumRuleProto2.EnumProto2.forNumber(tmpRaw); + if (tmpValue == null) { + mergeUnknownVarintField(1, tmpRaw); + } else { + val_ = tmpRaw; + bitField0_ |= 0x00000001; + } + break; + } // case 8 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private int val_ = 0; + /** + * optional .buf.validate.conformance.cases.PredefinedEnumRuleProto2.EnumProto2 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.PredefinedEnumRuleProto2.EnumProto2 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedEnumRuleProto2.EnumProto2 getVal() { + build.buf.validate.conformance.cases.PredefinedEnumRuleProto2.EnumProto2 result = build.buf.validate.conformance.cases.PredefinedEnumRuleProto2.EnumProto2.forNumber(val_); + return result == null ? build.buf.validate.conformance.cases.PredefinedEnumRuleProto2.EnumProto2.ENUM_PROTO2_ZERO_UNSPECIFIED : result; + } + /** + * optional .buf.validate.conformance.cases.PredefinedEnumRuleProto2.EnumProto2 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param value The val to set. + * @return This builder for chaining. + */ + public Builder setVal(build.buf.validate.conformance.cases.PredefinedEnumRuleProto2.EnumProto2 value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + val_ = value.getNumber(); + onChanged(); + return this; + } + /** + * optional .buf.validate.conformance.cases.PredefinedEnumRuleProto2.EnumProto2 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return This builder for chaining. + */ + public Builder clearVal() { + bitField0_ = (bitField0_ & ~0x00000001); + val_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.PredefinedEnumRuleProto2) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.PredefinedEnumRuleProto2) + private static final build.buf.validate.conformance.cases.PredefinedEnumRuleProto2 DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.PredefinedEnumRuleProto2(); + } + + public static build.buf.validate.conformance.cases.PredefinedEnumRuleProto2 getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PredefinedEnumRuleProto2 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.PredefinedEnumRuleProto2 getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedEnumRuleProto2OrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedEnumRuleProto2OrBuilder.java new file mode 100644 index 00000000..8aac65b0 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedEnumRuleProto2OrBuilder.java @@ -0,0 +1,22 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/predefined_rules_proto2.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +public interface PredefinedEnumRuleProto2OrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.PredefinedEnumRuleProto2) + com.google.protobuf.MessageOrBuilder { + + /** + * optional .buf.validate.conformance.cases.PredefinedEnumRuleProto2.EnumProto2 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + boolean hasVal(); + /** + * optional .buf.validate.conformance.cases.PredefinedEnumRuleProto2.EnumProto2 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + build.buf.validate.conformance.cases.PredefinedEnumRuleProto2.EnumProto2 getVal(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedEnumRuleProto3.java b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedEnumRuleProto3.java new file mode 100644 index 00000000..28956e64 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedEnumRuleProto3.java @@ -0,0 +1,576 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/predefined_rules_proto3.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.PredefinedEnumRuleProto3} + */ +public final class PredefinedEnumRuleProto3 extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.PredefinedEnumRuleProto3) + PredefinedEnumRuleProto3OrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 1, + /* suffix= */ "", + PredefinedEnumRuleProto3.class.getName()); + } + // Use PredefinedEnumRuleProto3.newBuilder() to construct. + private PredefinedEnumRuleProto3(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private PredefinedEnumRuleProto3() { + val_ = 0; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.PredefinedRulesProto3Proto.internal_static_buf_validate_conformance_cases_PredefinedEnumRuleProto3_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.PredefinedRulesProto3Proto.internal_static_buf_validate_conformance_cases_PredefinedEnumRuleProto3_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.PredefinedEnumRuleProto3.class, build.buf.validate.conformance.cases.PredefinedEnumRuleProto3.Builder.class); + } + + /** + * Protobuf enum {@code buf.validate.conformance.cases.PredefinedEnumRuleProto3.EnumProto3} + */ + public enum EnumProto3 + implements com.google.protobuf.ProtocolMessageEnum { + /** + * ENUM_PROTO3_ZERO_UNSPECIFIED = 0; + */ + ENUM_PROTO3_ZERO_UNSPECIFIED(0), + /** + * ENUM_PROTO3_ONE = 1; + */ + ENUM_PROTO3_ONE(1), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 1, + /* suffix= */ "", + EnumProto3.class.getName()); + } + /** + * ENUM_PROTO3_ZERO_UNSPECIFIED = 0; + */ + public static final int ENUM_PROTO3_ZERO_UNSPECIFIED_VALUE = 0; + /** + * ENUM_PROTO3_ONE = 1; + */ + public static final int ENUM_PROTO3_ONE_VALUE = 1; + + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static EnumProto3 valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static EnumProto3 forNumber(int value) { + switch (value) { + case 0: return ENUM_PROTO3_ZERO_UNSPECIFIED; + case 1: return ENUM_PROTO3_ONE; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + EnumProto3> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public EnumProto3 findValueByNumber(int number) { + return EnumProto3.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + public final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptorForType() { + return getDescriptor(); + } + public static final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptor() { + return build.buf.validate.conformance.cases.PredefinedEnumRuleProto3.getDescriptor().getEnumTypes().get(0); + } + + private static final EnumProto3[] VALUES = values(); + + public static EnumProto3 valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException( + "EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private EnumProto3(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:buf.validate.conformance.cases.PredefinedEnumRuleProto3.EnumProto3) + } + + public static final int VAL_FIELD_NUMBER = 1; + private int val_ = 0; + /** + * .buf.validate.conformance.cases.PredefinedEnumRuleProto3.EnumProto3 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The enum numeric value on the wire for val. + */ + @java.lang.Override public int getValValue() { + return val_; + } + /** + * .buf.validate.conformance.cases.PredefinedEnumRuleProto3.EnumProto3 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override public build.buf.validate.conformance.cases.PredefinedEnumRuleProto3.EnumProto3 getVal() { + build.buf.validate.conformance.cases.PredefinedEnumRuleProto3.EnumProto3 result = build.buf.validate.conformance.cases.PredefinedEnumRuleProto3.EnumProto3.forNumber(val_); + return result == null ? build.buf.validate.conformance.cases.PredefinedEnumRuleProto3.EnumProto3.UNRECOGNIZED : result; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (val_ != build.buf.validate.conformance.cases.PredefinedEnumRuleProto3.EnumProto3.ENUM_PROTO3_ZERO_UNSPECIFIED.getNumber()) { + output.writeEnum(1, val_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (val_ != build.buf.validate.conformance.cases.PredefinedEnumRuleProto3.EnumProto3.ENUM_PROTO3_ZERO_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(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.PredefinedEnumRuleProto3)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.PredefinedEnumRuleProto3 other = (build.buf.validate.conformance.cases.PredefinedEnumRuleProto3) obj; + + if (val_ != other.val_) 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) + val_; + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.PredefinedEnumRuleProto3 parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedEnumRuleProto3 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.PredefinedEnumRuleProto3 parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedEnumRuleProto3 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.PredefinedEnumRuleProto3 parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedEnumRuleProto3 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.PredefinedEnumRuleProto3 parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.PredefinedEnumRuleProto3 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.PredefinedEnumRuleProto3 parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.PredefinedEnumRuleProto3 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.PredefinedEnumRuleProto3 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.PredefinedEnumRuleProto3 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.PredefinedEnumRuleProto3 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.PredefinedEnumRuleProto3} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.PredefinedEnumRuleProto3) + build.buf.validate.conformance.cases.PredefinedEnumRuleProto3OrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.PredefinedRulesProto3Proto.internal_static_buf_validate_conformance_cases_PredefinedEnumRuleProto3_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.PredefinedRulesProto3Proto.internal_static_buf_validate_conformance_cases_PredefinedEnumRuleProto3_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.PredefinedEnumRuleProto3.class, build.buf.validate.conformance.cases.PredefinedEnumRuleProto3.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.PredefinedEnumRuleProto3.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + val_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.PredefinedRulesProto3Proto.internal_static_buf_validate_conformance_cases_PredefinedEnumRuleProto3_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedEnumRuleProto3 getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.PredefinedEnumRuleProto3.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedEnumRuleProto3 build() { + build.buf.validate.conformance.cases.PredefinedEnumRuleProto3 result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedEnumRuleProto3 buildPartial() { + build.buf.validate.conformance.cases.PredefinedEnumRuleProto3 result = new build.buf.validate.conformance.cases.PredefinedEnumRuleProto3(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.PredefinedEnumRuleProto3 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.PredefinedEnumRuleProto3) { + return mergeFrom((build.buf.validate.conformance.cases.PredefinedEnumRuleProto3)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.PredefinedEnumRuleProto3 other) { + if (other == build.buf.validate.conformance.cases.PredefinedEnumRuleProto3.getDefaultInstance()) return this; + if (other.val_ != 0) { + setValValue(other.getValValue()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + val_ = input.readEnum(); + bitField0_ |= 0x00000001; + break; + } // case 8 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private int val_ = 0; + /** + * .buf.validate.conformance.cases.PredefinedEnumRuleProto3.EnumProto3 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The enum numeric value on the wire for val. + */ + @java.lang.Override public int getValValue() { + return val_; + } + /** + * .buf.validate.conformance.cases.PredefinedEnumRuleProto3.EnumProto3 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param value The enum numeric value on the wire for val to set. + * @return This builder for chaining. + */ + public Builder setValValue(int value) { + val_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * .buf.validate.conformance.cases.PredefinedEnumRuleProto3.EnumProto3 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedEnumRuleProto3.EnumProto3 getVal() { + build.buf.validate.conformance.cases.PredefinedEnumRuleProto3.EnumProto3 result = build.buf.validate.conformance.cases.PredefinedEnumRuleProto3.EnumProto3.forNumber(val_); + return result == null ? build.buf.validate.conformance.cases.PredefinedEnumRuleProto3.EnumProto3.UNRECOGNIZED : result; + } + /** + * .buf.validate.conformance.cases.PredefinedEnumRuleProto3.EnumProto3 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param value The val to set. + * @return This builder for chaining. + */ + public Builder setVal(build.buf.validate.conformance.cases.PredefinedEnumRuleProto3.EnumProto3 value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + val_ = value.getNumber(); + onChanged(); + return this; + } + /** + * .buf.validate.conformance.cases.PredefinedEnumRuleProto3.EnumProto3 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return This builder for chaining. + */ + public Builder clearVal() { + bitField0_ = (bitField0_ & ~0x00000001); + val_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.PredefinedEnumRuleProto3) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.PredefinedEnumRuleProto3) + private static final build.buf.validate.conformance.cases.PredefinedEnumRuleProto3 DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.PredefinedEnumRuleProto3(); + } + + public static build.buf.validate.conformance.cases.PredefinedEnumRuleProto3 getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PredefinedEnumRuleProto3 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.PredefinedEnumRuleProto3 getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedEnumRuleProto3OrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedEnumRuleProto3OrBuilder.java new file mode 100644 index 00000000..fcd73373 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedEnumRuleProto3OrBuilder.java @@ -0,0 +1,22 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/predefined_rules_proto3.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +public interface PredefinedEnumRuleProto3OrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.PredefinedEnumRuleProto3) + com.google.protobuf.MessageOrBuilder { + + /** + * .buf.validate.conformance.cases.PredefinedEnumRuleProto3.EnumProto3 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The enum numeric value on the wire for val. + */ + int getValValue(); + /** + * .buf.validate.conformance.cases.PredefinedEnumRuleProto3.EnumProto3 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + build.buf.validate.conformance.cases.PredefinedEnumRuleProto3.EnumProto3 getVal(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedFixed32RuleEdition2023.java b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedFixed32RuleEdition2023.java new file mode 100644 index 00000000..6c862dbf --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedFixed32RuleEdition2023.java @@ -0,0 +1,456 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/predefined_rules_proto_editions.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.PredefinedFixed32RuleEdition2023} + */ +public final class PredefinedFixed32RuleEdition2023 extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.PredefinedFixed32RuleEdition2023) + PredefinedFixed32RuleEdition2023OrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 1, + /* suffix= */ "", + PredefinedFixed32RuleEdition2023.class.getName()); + } + // Use PredefinedFixed32RuleEdition2023.newBuilder() to construct. + private PredefinedFixed32RuleEdition2023(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private PredefinedFixed32RuleEdition2023() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.internal_static_buf_validate_conformance_cases_PredefinedFixed32RuleEdition2023_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.internal_static_buf_validate_conformance_cases_PredefinedFixed32RuleEdition2023_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.PredefinedFixed32RuleEdition2023.class, build.buf.validate.conformance.cases.PredefinedFixed32RuleEdition2023.Builder.class); + } + + private int bitField0_; + public static final int VAL_FIELD_NUMBER = 1; + private int val_ = 0; + /** + * fixed32 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); + } + /** + * fixed32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public int getVal() { + return val_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + output.writeFixed32(1, val_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeFixed32Size(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.PredefinedFixed32RuleEdition2023)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.PredefinedFixed32RuleEdition2023 other = (build.buf.validate.conformance.cases.PredefinedFixed32RuleEdition2023) obj; + + if (hasVal() != other.hasVal()) return false; + if (hasVal()) { + if (getVal() + != other.getVal()) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasVal()) { + hash = (37 * hash) + VAL_FIELD_NUMBER; + hash = (53 * hash) + getVal(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.PredefinedFixed32RuleEdition2023 parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedFixed32RuleEdition2023 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.PredefinedFixed32RuleEdition2023 parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedFixed32RuleEdition2023 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.PredefinedFixed32RuleEdition2023 parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedFixed32RuleEdition2023 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.PredefinedFixed32RuleEdition2023 parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.PredefinedFixed32RuleEdition2023 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.PredefinedFixed32RuleEdition2023 parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.PredefinedFixed32RuleEdition2023 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.PredefinedFixed32RuleEdition2023 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.PredefinedFixed32RuleEdition2023 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.PredefinedFixed32RuleEdition2023 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.PredefinedFixed32RuleEdition2023} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.PredefinedFixed32RuleEdition2023) + build.buf.validate.conformance.cases.PredefinedFixed32RuleEdition2023OrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.internal_static_buf_validate_conformance_cases_PredefinedFixed32RuleEdition2023_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.internal_static_buf_validate_conformance_cases_PredefinedFixed32RuleEdition2023_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.PredefinedFixed32RuleEdition2023.class, build.buf.validate.conformance.cases.PredefinedFixed32RuleEdition2023.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.PredefinedFixed32RuleEdition2023.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + val_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.internal_static_buf_validate_conformance_cases_PredefinedFixed32RuleEdition2023_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedFixed32RuleEdition2023 getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.PredefinedFixed32RuleEdition2023.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedFixed32RuleEdition2023 build() { + build.buf.validate.conformance.cases.PredefinedFixed32RuleEdition2023 result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedFixed32RuleEdition2023 buildPartial() { + build.buf.validate.conformance.cases.PredefinedFixed32RuleEdition2023 result = new build.buf.validate.conformance.cases.PredefinedFixed32RuleEdition2023(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.PredefinedFixed32RuleEdition2023 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.PredefinedFixed32RuleEdition2023) { + return mergeFrom((build.buf.validate.conformance.cases.PredefinedFixed32RuleEdition2023)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.PredefinedFixed32RuleEdition2023 other) { + if (other == build.buf.validate.conformance.cases.PredefinedFixed32RuleEdition2023.getDefaultInstance()) return this; + if (other.hasVal()) { + setVal(other.getVal()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 13: { + val_ = input.readFixed32(); + bitField0_ |= 0x00000001; + break; + } // case 13 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private int val_ ; + /** + * fixed32 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); + } + /** + * fixed32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public int getVal() { + return val_; + } + /** + * fixed32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param value The val to set. + * @return This builder for chaining. + */ + public Builder setVal(int value) { + + val_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * fixed32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return This builder for chaining. + */ + public Builder clearVal() { + bitField0_ = (bitField0_ & ~0x00000001); + val_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.PredefinedFixed32RuleEdition2023) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.PredefinedFixed32RuleEdition2023) + private static final build.buf.validate.conformance.cases.PredefinedFixed32RuleEdition2023 DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.PredefinedFixed32RuleEdition2023(); + } + + public static build.buf.validate.conformance.cases.PredefinedFixed32RuleEdition2023 getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PredefinedFixed32RuleEdition2023 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.PredefinedFixed32RuleEdition2023 getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedFixed32RuleEdition2023OrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedFixed32RuleEdition2023OrBuilder.java new file mode 100644 index 00000000..177bba43 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedFixed32RuleEdition2023OrBuilder.java @@ -0,0 +1,22 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/predefined_rules_proto_editions.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +public interface PredefinedFixed32RuleEdition2023OrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.PredefinedFixed32RuleEdition2023) + com.google.protobuf.MessageOrBuilder { + + /** + * fixed32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + boolean hasVal(); + /** + * fixed32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + int getVal(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedFixed32RuleProto2.java b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedFixed32RuleProto2.java new file mode 100644 index 00000000..4786eb88 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedFixed32RuleProto2.java @@ -0,0 +1,456 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/predefined_rules_proto2.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.PredefinedFixed32RuleProto2} + */ +public final class PredefinedFixed32RuleProto2 extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.PredefinedFixed32RuleProto2) + PredefinedFixed32RuleProto2OrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 1, + /* suffix= */ "", + PredefinedFixed32RuleProto2.class.getName()); + } + // Use PredefinedFixed32RuleProto2.newBuilder() to construct. + private PredefinedFixed32RuleProto2(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private PredefinedFixed32RuleProto2() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.internal_static_buf_validate_conformance_cases_PredefinedFixed32RuleProto2_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.internal_static_buf_validate_conformance_cases_PredefinedFixed32RuleProto2_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.PredefinedFixed32RuleProto2.class, build.buf.validate.conformance.cases.PredefinedFixed32RuleProto2.Builder.class); + } + + private int bitField0_; + public static final int VAL_FIELD_NUMBER = 1; + private int val_ = 0; + /** + * optional fixed32 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 fixed32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public int getVal() { + return val_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + output.writeFixed32(1, val_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeFixed32Size(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.PredefinedFixed32RuleProto2)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.PredefinedFixed32RuleProto2 other = (build.buf.validate.conformance.cases.PredefinedFixed32RuleProto2) obj; + + if (hasVal() != other.hasVal()) return false; + if (hasVal()) { + if (getVal() + != other.getVal()) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasVal()) { + hash = (37 * hash) + VAL_FIELD_NUMBER; + hash = (53 * hash) + getVal(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.PredefinedFixed32RuleProto2 parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedFixed32RuleProto2 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.PredefinedFixed32RuleProto2 parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedFixed32RuleProto2 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.PredefinedFixed32RuleProto2 parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedFixed32RuleProto2 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.PredefinedFixed32RuleProto2 parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.PredefinedFixed32RuleProto2 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.PredefinedFixed32RuleProto2 parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.PredefinedFixed32RuleProto2 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.PredefinedFixed32RuleProto2 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.PredefinedFixed32RuleProto2 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.PredefinedFixed32RuleProto2 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.PredefinedFixed32RuleProto2} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.PredefinedFixed32RuleProto2) + build.buf.validate.conformance.cases.PredefinedFixed32RuleProto2OrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.internal_static_buf_validate_conformance_cases_PredefinedFixed32RuleProto2_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.internal_static_buf_validate_conformance_cases_PredefinedFixed32RuleProto2_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.PredefinedFixed32RuleProto2.class, build.buf.validate.conformance.cases.PredefinedFixed32RuleProto2.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.PredefinedFixed32RuleProto2.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + val_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.internal_static_buf_validate_conformance_cases_PredefinedFixed32RuleProto2_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedFixed32RuleProto2 getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.PredefinedFixed32RuleProto2.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedFixed32RuleProto2 build() { + build.buf.validate.conformance.cases.PredefinedFixed32RuleProto2 result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedFixed32RuleProto2 buildPartial() { + build.buf.validate.conformance.cases.PredefinedFixed32RuleProto2 result = new build.buf.validate.conformance.cases.PredefinedFixed32RuleProto2(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.PredefinedFixed32RuleProto2 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.PredefinedFixed32RuleProto2) { + return mergeFrom((build.buf.validate.conformance.cases.PredefinedFixed32RuleProto2)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.PredefinedFixed32RuleProto2 other) { + if (other == build.buf.validate.conformance.cases.PredefinedFixed32RuleProto2.getDefaultInstance()) return this; + if (other.hasVal()) { + setVal(other.getVal()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 13: { + val_ = input.readFixed32(); + bitField0_ |= 0x00000001; + break; + } // case 13 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private int val_ ; + /** + * optional fixed32 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 fixed32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public int getVal() { + return val_; + } + /** + * optional fixed32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param value The val to set. + * @return This builder for chaining. + */ + public Builder setVal(int value) { + + val_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * optional fixed32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return This builder for chaining. + */ + public Builder clearVal() { + bitField0_ = (bitField0_ & ~0x00000001); + val_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.PredefinedFixed32RuleProto2) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.PredefinedFixed32RuleProto2) + private static final build.buf.validate.conformance.cases.PredefinedFixed32RuleProto2 DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.PredefinedFixed32RuleProto2(); + } + + public static build.buf.validate.conformance.cases.PredefinedFixed32RuleProto2 getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PredefinedFixed32RuleProto2 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.PredefinedFixed32RuleProto2 getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedFixed32RuleProto2OrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedFixed32RuleProto2OrBuilder.java new file mode 100644 index 00000000..2926bf8c --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedFixed32RuleProto2OrBuilder.java @@ -0,0 +1,22 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/predefined_rules_proto2.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +public interface PredefinedFixed32RuleProto2OrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.PredefinedFixed32RuleProto2) + com.google.protobuf.MessageOrBuilder { + + /** + * optional fixed32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + boolean hasVal(); + /** + * optional fixed32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + int getVal(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedFixed32RuleProto3.java b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedFixed32RuleProto3.java new file mode 100644 index 00000000..3a7406a1 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedFixed32RuleProto3.java @@ -0,0 +1,431 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/predefined_rules_proto3.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.PredefinedFixed32RuleProto3} + */ +public final class PredefinedFixed32RuleProto3 extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.PredefinedFixed32RuleProto3) + PredefinedFixed32RuleProto3OrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 1, + /* suffix= */ "", + PredefinedFixed32RuleProto3.class.getName()); + } + // Use PredefinedFixed32RuleProto3.newBuilder() to construct. + private PredefinedFixed32RuleProto3(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private PredefinedFixed32RuleProto3() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.PredefinedRulesProto3Proto.internal_static_buf_validate_conformance_cases_PredefinedFixed32RuleProto3_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.PredefinedRulesProto3Proto.internal_static_buf_validate_conformance_cases_PredefinedFixed32RuleProto3_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.PredefinedFixed32RuleProto3.class, build.buf.validate.conformance.cases.PredefinedFixed32RuleProto3.Builder.class); + } + + public static final int VAL_FIELD_NUMBER = 1; + private int val_ = 0; + /** + * fixed32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public int getVal() { + return val_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (val_ != 0) { + output.writeFixed32(1, val_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (val_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeFixed32Size(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.PredefinedFixed32RuleProto3)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.PredefinedFixed32RuleProto3 other = (build.buf.validate.conformance.cases.PredefinedFixed32RuleProto3) obj; + + if (getVal() + != other.getVal()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + VAL_FIELD_NUMBER; + hash = (53 * hash) + getVal(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.PredefinedFixed32RuleProto3 parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedFixed32RuleProto3 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.PredefinedFixed32RuleProto3 parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedFixed32RuleProto3 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.PredefinedFixed32RuleProto3 parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedFixed32RuleProto3 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.PredefinedFixed32RuleProto3 parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.PredefinedFixed32RuleProto3 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.PredefinedFixed32RuleProto3 parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.PredefinedFixed32RuleProto3 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.PredefinedFixed32RuleProto3 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.PredefinedFixed32RuleProto3 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.PredefinedFixed32RuleProto3 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.PredefinedFixed32RuleProto3} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.PredefinedFixed32RuleProto3) + build.buf.validate.conformance.cases.PredefinedFixed32RuleProto3OrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.PredefinedRulesProto3Proto.internal_static_buf_validate_conformance_cases_PredefinedFixed32RuleProto3_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.PredefinedRulesProto3Proto.internal_static_buf_validate_conformance_cases_PredefinedFixed32RuleProto3_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.PredefinedFixed32RuleProto3.class, build.buf.validate.conformance.cases.PredefinedFixed32RuleProto3.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.PredefinedFixed32RuleProto3.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + val_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.PredefinedRulesProto3Proto.internal_static_buf_validate_conformance_cases_PredefinedFixed32RuleProto3_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedFixed32RuleProto3 getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.PredefinedFixed32RuleProto3.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedFixed32RuleProto3 build() { + build.buf.validate.conformance.cases.PredefinedFixed32RuleProto3 result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedFixed32RuleProto3 buildPartial() { + build.buf.validate.conformance.cases.PredefinedFixed32RuleProto3 result = new build.buf.validate.conformance.cases.PredefinedFixed32RuleProto3(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.PredefinedFixed32RuleProto3 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.PredefinedFixed32RuleProto3) { + return mergeFrom((build.buf.validate.conformance.cases.PredefinedFixed32RuleProto3)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.PredefinedFixed32RuleProto3 other) { + if (other == build.buf.validate.conformance.cases.PredefinedFixed32RuleProto3.getDefaultInstance()) return this; + if (other.getVal() != 0) { + setVal(other.getVal()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 13: { + val_ = input.readFixed32(); + bitField0_ |= 0x00000001; + break; + } // case 13 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private int val_ ; + /** + * fixed32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public int getVal() { + return val_; + } + /** + * fixed32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param value The val to set. + * @return This builder for chaining. + */ + public Builder setVal(int value) { + + val_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * fixed32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return This builder for chaining. + */ + public Builder clearVal() { + bitField0_ = (bitField0_ & ~0x00000001); + val_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.PredefinedFixed32RuleProto3) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.PredefinedFixed32RuleProto3) + private static final build.buf.validate.conformance.cases.PredefinedFixed32RuleProto3 DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.PredefinedFixed32RuleProto3(); + } + + public static build.buf.validate.conformance.cases.PredefinedFixed32RuleProto3 getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PredefinedFixed32RuleProto3 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.PredefinedFixed32RuleProto3 getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedFixed32RuleProto3OrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedFixed32RuleProto3OrBuilder.java new file mode 100644 index 00000000..8cf5414d --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedFixed32RuleProto3OrBuilder.java @@ -0,0 +1,17 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/predefined_rules_proto3.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +public interface PredefinedFixed32RuleProto3OrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.PredefinedFixed32RuleProto3) + com.google.protobuf.MessageOrBuilder { + + /** + * fixed32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + int getVal(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedFixed64RuleEdition2023.java b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedFixed64RuleEdition2023.java new file mode 100644 index 00000000..3a1d8996 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedFixed64RuleEdition2023.java @@ -0,0 +1,457 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/predefined_rules_proto_editions.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.PredefinedFixed64RuleEdition2023} + */ +public final class PredefinedFixed64RuleEdition2023 extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.PredefinedFixed64RuleEdition2023) + PredefinedFixed64RuleEdition2023OrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 1, + /* suffix= */ "", + PredefinedFixed64RuleEdition2023.class.getName()); + } + // Use PredefinedFixed64RuleEdition2023.newBuilder() to construct. + private PredefinedFixed64RuleEdition2023(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private PredefinedFixed64RuleEdition2023() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.internal_static_buf_validate_conformance_cases_PredefinedFixed64RuleEdition2023_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.internal_static_buf_validate_conformance_cases_PredefinedFixed64RuleEdition2023_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.PredefinedFixed64RuleEdition2023.class, build.buf.validate.conformance.cases.PredefinedFixed64RuleEdition2023.Builder.class); + } + + private int bitField0_; + public static final int VAL_FIELD_NUMBER = 1; + private long val_ = 0L; + /** + * fixed64 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); + } + /** + * fixed64 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public long getVal() { + return val_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + output.writeFixed64(1, val_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeFixed64Size(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.PredefinedFixed64RuleEdition2023)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.PredefinedFixed64RuleEdition2023 other = (build.buf.validate.conformance.cases.PredefinedFixed64RuleEdition2023) obj; + + if (hasVal() != other.hasVal()) return false; + if (hasVal()) { + if (getVal() + != other.getVal()) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasVal()) { + hash = (37 * hash) + VAL_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getVal()); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.PredefinedFixed64RuleEdition2023 parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedFixed64RuleEdition2023 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.PredefinedFixed64RuleEdition2023 parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedFixed64RuleEdition2023 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.PredefinedFixed64RuleEdition2023 parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedFixed64RuleEdition2023 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.PredefinedFixed64RuleEdition2023 parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.PredefinedFixed64RuleEdition2023 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.PredefinedFixed64RuleEdition2023 parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.PredefinedFixed64RuleEdition2023 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.PredefinedFixed64RuleEdition2023 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.PredefinedFixed64RuleEdition2023 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.PredefinedFixed64RuleEdition2023 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.PredefinedFixed64RuleEdition2023} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.PredefinedFixed64RuleEdition2023) + build.buf.validate.conformance.cases.PredefinedFixed64RuleEdition2023OrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.internal_static_buf_validate_conformance_cases_PredefinedFixed64RuleEdition2023_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.internal_static_buf_validate_conformance_cases_PredefinedFixed64RuleEdition2023_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.PredefinedFixed64RuleEdition2023.class, build.buf.validate.conformance.cases.PredefinedFixed64RuleEdition2023.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.PredefinedFixed64RuleEdition2023.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + val_ = 0L; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.internal_static_buf_validate_conformance_cases_PredefinedFixed64RuleEdition2023_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedFixed64RuleEdition2023 getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.PredefinedFixed64RuleEdition2023.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedFixed64RuleEdition2023 build() { + build.buf.validate.conformance.cases.PredefinedFixed64RuleEdition2023 result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedFixed64RuleEdition2023 buildPartial() { + build.buf.validate.conformance.cases.PredefinedFixed64RuleEdition2023 result = new build.buf.validate.conformance.cases.PredefinedFixed64RuleEdition2023(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.PredefinedFixed64RuleEdition2023 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.PredefinedFixed64RuleEdition2023) { + return mergeFrom((build.buf.validate.conformance.cases.PredefinedFixed64RuleEdition2023)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.PredefinedFixed64RuleEdition2023 other) { + if (other == build.buf.validate.conformance.cases.PredefinedFixed64RuleEdition2023.getDefaultInstance()) return this; + if (other.hasVal()) { + setVal(other.getVal()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 9: { + val_ = input.readFixed64(); + bitField0_ |= 0x00000001; + break; + } // case 9 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private long val_ ; + /** + * fixed64 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); + } + /** + * fixed64 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public long getVal() { + return val_; + } + /** + * fixed64 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param value The val to set. + * @return This builder for chaining. + */ + public Builder setVal(long value) { + + val_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * fixed64 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return This builder for chaining. + */ + public Builder clearVal() { + bitField0_ = (bitField0_ & ~0x00000001); + val_ = 0L; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.PredefinedFixed64RuleEdition2023) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.PredefinedFixed64RuleEdition2023) + private static final build.buf.validate.conformance.cases.PredefinedFixed64RuleEdition2023 DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.PredefinedFixed64RuleEdition2023(); + } + + public static build.buf.validate.conformance.cases.PredefinedFixed64RuleEdition2023 getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PredefinedFixed64RuleEdition2023 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.PredefinedFixed64RuleEdition2023 getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedFixed64RuleEdition2023OrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedFixed64RuleEdition2023OrBuilder.java new file mode 100644 index 00000000..eea1c829 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedFixed64RuleEdition2023OrBuilder.java @@ -0,0 +1,22 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/predefined_rules_proto_editions.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +public interface PredefinedFixed64RuleEdition2023OrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.PredefinedFixed64RuleEdition2023) + com.google.protobuf.MessageOrBuilder { + + /** + * fixed64 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + boolean hasVal(); + /** + * fixed64 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + long getVal(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedFixed64RuleProto2.java b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedFixed64RuleProto2.java new file mode 100644 index 00000000..35727f58 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedFixed64RuleProto2.java @@ -0,0 +1,457 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/predefined_rules_proto2.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.PredefinedFixed64RuleProto2} + */ +public final class PredefinedFixed64RuleProto2 extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.PredefinedFixed64RuleProto2) + PredefinedFixed64RuleProto2OrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 1, + /* suffix= */ "", + PredefinedFixed64RuleProto2.class.getName()); + } + // Use PredefinedFixed64RuleProto2.newBuilder() to construct. + private PredefinedFixed64RuleProto2(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private PredefinedFixed64RuleProto2() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.internal_static_buf_validate_conformance_cases_PredefinedFixed64RuleProto2_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.internal_static_buf_validate_conformance_cases_PredefinedFixed64RuleProto2_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.PredefinedFixed64RuleProto2.class, build.buf.validate.conformance.cases.PredefinedFixed64RuleProto2.Builder.class); + } + + private int bitField0_; + public static final int VAL_FIELD_NUMBER = 1; + private long val_ = 0L; + /** + * optional fixed64 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 fixed64 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public long getVal() { + return val_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + output.writeFixed64(1, val_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeFixed64Size(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.PredefinedFixed64RuleProto2)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.PredefinedFixed64RuleProto2 other = (build.buf.validate.conformance.cases.PredefinedFixed64RuleProto2) obj; + + if (hasVal() != other.hasVal()) return false; + if (hasVal()) { + if (getVal() + != other.getVal()) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasVal()) { + hash = (37 * hash) + VAL_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getVal()); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.PredefinedFixed64RuleProto2 parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedFixed64RuleProto2 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.PredefinedFixed64RuleProto2 parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedFixed64RuleProto2 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.PredefinedFixed64RuleProto2 parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedFixed64RuleProto2 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.PredefinedFixed64RuleProto2 parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.PredefinedFixed64RuleProto2 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.PredefinedFixed64RuleProto2 parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.PredefinedFixed64RuleProto2 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.PredefinedFixed64RuleProto2 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.PredefinedFixed64RuleProto2 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.PredefinedFixed64RuleProto2 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.PredefinedFixed64RuleProto2} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.PredefinedFixed64RuleProto2) + build.buf.validate.conformance.cases.PredefinedFixed64RuleProto2OrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.internal_static_buf_validate_conformance_cases_PredefinedFixed64RuleProto2_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.internal_static_buf_validate_conformance_cases_PredefinedFixed64RuleProto2_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.PredefinedFixed64RuleProto2.class, build.buf.validate.conformance.cases.PredefinedFixed64RuleProto2.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.PredefinedFixed64RuleProto2.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + val_ = 0L; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.internal_static_buf_validate_conformance_cases_PredefinedFixed64RuleProto2_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedFixed64RuleProto2 getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.PredefinedFixed64RuleProto2.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedFixed64RuleProto2 build() { + build.buf.validate.conformance.cases.PredefinedFixed64RuleProto2 result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedFixed64RuleProto2 buildPartial() { + build.buf.validate.conformance.cases.PredefinedFixed64RuleProto2 result = new build.buf.validate.conformance.cases.PredefinedFixed64RuleProto2(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.PredefinedFixed64RuleProto2 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.PredefinedFixed64RuleProto2) { + return mergeFrom((build.buf.validate.conformance.cases.PredefinedFixed64RuleProto2)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.PredefinedFixed64RuleProto2 other) { + if (other == build.buf.validate.conformance.cases.PredefinedFixed64RuleProto2.getDefaultInstance()) return this; + if (other.hasVal()) { + setVal(other.getVal()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 9: { + val_ = input.readFixed64(); + bitField0_ |= 0x00000001; + break; + } // case 9 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private long val_ ; + /** + * optional fixed64 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 fixed64 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public long getVal() { + return val_; + } + /** + * optional fixed64 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param value The val to set. + * @return This builder for chaining. + */ + public Builder setVal(long value) { + + val_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * optional fixed64 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return This builder for chaining. + */ + public Builder clearVal() { + bitField0_ = (bitField0_ & ~0x00000001); + val_ = 0L; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.PredefinedFixed64RuleProto2) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.PredefinedFixed64RuleProto2) + private static final build.buf.validate.conformance.cases.PredefinedFixed64RuleProto2 DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.PredefinedFixed64RuleProto2(); + } + + public static build.buf.validate.conformance.cases.PredefinedFixed64RuleProto2 getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PredefinedFixed64RuleProto2 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.PredefinedFixed64RuleProto2 getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedFixed64RuleProto2OrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedFixed64RuleProto2OrBuilder.java new file mode 100644 index 00000000..e244ef93 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedFixed64RuleProto2OrBuilder.java @@ -0,0 +1,22 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/predefined_rules_proto2.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +public interface PredefinedFixed64RuleProto2OrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.PredefinedFixed64RuleProto2) + com.google.protobuf.MessageOrBuilder { + + /** + * optional fixed64 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + boolean hasVal(); + /** + * optional fixed64 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + long getVal(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedFixed64RuleProto3.java b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedFixed64RuleProto3.java new file mode 100644 index 00000000..7652af15 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedFixed64RuleProto3.java @@ -0,0 +1,432 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/predefined_rules_proto3.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.PredefinedFixed64RuleProto3} + */ +public final class PredefinedFixed64RuleProto3 extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.PredefinedFixed64RuleProto3) + PredefinedFixed64RuleProto3OrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 1, + /* suffix= */ "", + PredefinedFixed64RuleProto3.class.getName()); + } + // Use PredefinedFixed64RuleProto3.newBuilder() to construct. + private PredefinedFixed64RuleProto3(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private PredefinedFixed64RuleProto3() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.PredefinedRulesProto3Proto.internal_static_buf_validate_conformance_cases_PredefinedFixed64RuleProto3_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.PredefinedRulesProto3Proto.internal_static_buf_validate_conformance_cases_PredefinedFixed64RuleProto3_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.PredefinedFixed64RuleProto3.class, build.buf.validate.conformance.cases.PredefinedFixed64RuleProto3.Builder.class); + } + + public static final int VAL_FIELD_NUMBER = 1; + private long val_ = 0L; + /** + * fixed64 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public long getVal() { + return val_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (val_ != 0L) { + output.writeFixed64(1, val_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (val_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeFixed64Size(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.PredefinedFixed64RuleProto3)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.PredefinedFixed64RuleProto3 other = (build.buf.validate.conformance.cases.PredefinedFixed64RuleProto3) obj; + + if (getVal() + != other.getVal()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + VAL_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getVal()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.PredefinedFixed64RuleProto3 parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedFixed64RuleProto3 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.PredefinedFixed64RuleProto3 parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedFixed64RuleProto3 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.PredefinedFixed64RuleProto3 parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedFixed64RuleProto3 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.PredefinedFixed64RuleProto3 parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.PredefinedFixed64RuleProto3 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.PredefinedFixed64RuleProto3 parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.PredefinedFixed64RuleProto3 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.PredefinedFixed64RuleProto3 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.PredefinedFixed64RuleProto3 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.PredefinedFixed64RuleProto3 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.PredefinedFixed64RuleProto3} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.PredefinedFixed64RuleProto3) + build.buf.validate.conformance.cases.PredefinedFixed64RuleProto3OrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.PredefinedRulesProto3Proto.internal_static_buf_validate_conformance_cases_PredefinedFixed64RuleProto3_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.PredefinedRulesProto3Proto.internal_static_buf_validate_conformance_cases_PredefinedFixed64RuleProto3_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.PredefinedFixed64RuleProto3.class, build.buf.validate.conformance.cases.PredefinedFixed64RuleProto3.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.PredefinedFixed64RuleProto3.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + val_ = 0L; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.PredefinedRulesProto3Proto.internal_static_buf_validate_conformance_cases_PredefinedFixed64RuleProto3_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedFixed64RuleProto3 getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.PredefinedFixed64RuleProto3.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedFixed64RuleProto3 build() { + build.buf.validate.conformance.cases.PredefinedFixed64RuleProto3 result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedFixed64RuleProto3 buildPartial() { + build.buf.validate.conformance.cases.PredefinedFixed64RuleProto3 result = new build.buf.validate.conformance.cases.PredefinedFixed64RuleProto3(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.PredefinedFixed64RuleProto3 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.PredefinedFixed64RuleProto3) { + return mergeFrom((build.buf.validate.conformance.cases.PredefinedFixed64RuleProto3)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.PredefinedFixed64RuleProto3 other) { + if (other == build.buf.validate.conformance.cases.PredefinedFixed64RuleProto3.getDefaultInstance()) return this; + if (other.getVal() != 0L) { + setVal(other.getVal()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 9: { + val_ = input.readFixed64(); + bitField0_ |= 0x00000001; + break; + } // case 9 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private long val_ ; + /** + * fixed64 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public long getVal() { + return val_; + } + /** + * fixed64 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param value The val to set. + * @return This builder for chaining. + */ + public Builder setVal(long value) { + + val_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * fixed64 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return This builder for chaining. + */ + public Builder clearVal() { + bitField0_ = (bitField0_ & ~0x00000001); + val_ = 0L; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.PredefinedFixed64RuleProto3) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.PredefinedFixed64RuleProto3) + private static final build.buf.validate.conformance.cases.PredefinedFixed64RuleProto3 DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.PredefinedFixed64RuleProto3(); + } + + public static build.buf.validate.conformance.cases.PredefinedFixed64RuleProto3 getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PredefinedFixed64RuleProto3 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.PredefinedFixed64RuleProto3 getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedFixed64RuleProto3OrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedFixed64RuleProto3OrBuilder.java new file mode 100644 index 00000000..072c058b --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedFixed64RuleProto3OrBuilder.java @@ -0,0 +1,17 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/predefined_rules_proto3.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +public interface PredefinedFixed64RuleProto3OrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.PredefinedFixed64RuleProto3) + com.google.protobuf.MessageOrBuilder { + + /** + * fixed64 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + long getVal(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedFloatRuleEdition2023.java b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedFloatRuleEdition2023.java new file mode 100644 index 00000000..7dac40c3 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedFloatRuleEdition2023.java @@ -0,0 +1,458 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/predefined_rules_proto_editions.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.PredefinedFloatRuleEdition2023} + */ +public final class PredefinedFloatRuleEdition2023 extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.PredefinedFloatRuleEdition2023) + PredefinedFloatRuleEdition2023OrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 1, + /* suffix= */ "", + PredefinedFloatRuleEdition2023.class.getName()); + } + // Use PredefinedFloatRuleEdition2023.newBuilder() to construct. + private PredefinedFloatRuleEdition2023(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private PredefinedFloatRuleEdition2023() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.internal_static_buf_validate_conformance_cases_PredefinedFloatRuleEdition2023_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.internal_static_buf_validate_conformance_cases_PredefinedFloatRuleEdition2023_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.PredefinedFloatRuleEdition2023.class, build.buf.validate.conformance.cases.PredefinedFloatRuleEdition2023.Builder.class); + } + + private int bitField0_; + public static final int VAL_FIELD_NUMBER = 1; + private float val_ = 0F; + /** + * float 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); + } + /** + * float val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public float getVal() { + return val_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + output.writeFloat(1, val_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(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.PredefinedFloatRuleEdition2023)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.PredefinedFloatRuleEdition2023 other = (build.buf.validate.conformance.cases.PredefinedFloatRuleEdition2023) obj; + + if (hasVal() != other.hasVal()) return false; + if (hasVal()) { + if (java.lang.Float.floatToIntBits(getVal()) + != java.lang.Float.floatToIntBits( + 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) + java.lang.Float.floatToIntBits( + getVal()); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.PredefinedFloatRuleEdition2023 parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedFloatRuleEdition2023 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.PredefinedFloatRuleEdition2023 parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedFloatRuleEdition2023 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.PredefinedFloatRuleEdition2023 parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedFloatRuleEdition2023 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.PredefinedFloatRuleEdition2023 parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.PredefinedFloatRuleEdition2023 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.PredefinedFloatRuleEdition2023 parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.PredefinedFloatRuleEdition2023 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.PredefinedFloatRuleEdition2023 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.PredefinedFloatRuleEdition2023 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.PredefinedFloatRuleEdition2023 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.PredefinedFloatRuleEdition2023} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.PredefinedFloatRuleEdition2023) + build.buf.validate.conformance.cases.PredefinedFloatRuleEdition2023OrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.internal_static_buf_validate_conformance_cases_PredefinedFloatRuleEdition2023_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.internal_static_buf_validate_conformance_cases_PredefinedFloatRuleEdition2023_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.PredefinedFloatRuleEdition2023.class, build.buf.validate.conformance.cases.PredefinedFloatRuleEdition2023.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.PredefinedFloatRuleEdition2023.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + val_ = 0F; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.internal_static_buf_validate_conformance_cases_PredefinedFloatRuleEdition2023_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedFloatRuleEdition2023 getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.PredefinedFloatRuleEdition2023.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedFloatRuleEdition2023 build() { + build.buf.validate.conformance.cases.PredefinedFloatRuleEdition2023 result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedFloatRuleEdition2023 buildPartial() { + build.buf.validate.conformance.cases.PredefinedFloatRuleEdition2023 result = new build.buf.validate.conformance.cases.PredefinedFloatRuleEdition2023(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.PredefinedFloatRuleEdition2023 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.PredefinedFloatRuleEdition2023) { + return mergeFrom((build.buf.validate.conformance.cases.PredefinedFloatRuleEdition2023)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.PredefinedFloatRuleEdition2023 other) { + if (other == build.buf.validate.conformance.cases.PredefinedFloatRuleEdition2023.getDefaultInstance()) return this; + if (other.hasVal()) { + setVal(other.getVal()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 13: { + val_ = input.readFloat(); + bitField0_ |= 0x00000001; + break; + } // case 13 + 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 float val_ ; + /** + * float 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); + } + /** + * float val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public float getVal() { + return val_; + } + /** + * float val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param value The val to set. + * @return This builder for chaining. + */ + public Builder setVal(float value) { + + val_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * float val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return This builder for chaining. + */ + public Builder clearVal() { + bitField0_ = (bitField0_ & ~0x00000001); + val_ = 0F; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.PredefinedFloatRuleEdition2023) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.PredefinedFloatRuleEdition2023) + private static final build.buf.validate.conformance.cases.PredefinedFloatRuleEdition2023 DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.PredefinedFloatRuleEdition2023(); + } + + public static build.buf.validate.conformance.cases.PredefinedFloatRuleEdition2023 getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PredefinedFloatRuleEdition2023 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.PredefinedFloatRuleEdition2023 getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedFloatRuleEdition2023OrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedFloatRuleEdition2023OrBuilder.java new file mode 100644 index 00000000..4dcb3fda --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedFloatRuleEdition2023OrBuilder.java @@ -0,0 +1,22 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/predefined_rules_proto_editions.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +public interface PredefinedFloatRuleEdition2023OrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.PredefinedFloatRuleEdition2023) + com.google.protobuf.MessageOrBuilder { + + /** + * float val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + boolean hasVal(); + /** + * float val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + float getVal(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedFloatRuleProto2.java b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedFloatRuleProto2.java new file mode 100644 index 00000000..fa9f6b36 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedFloatRuleProto2.java @@ -0,0 +1,458 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/predefined_rules_proto2.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.PredefinedFloatRuleProto2} + */ +public final class PredefinedFloatRuleProto2 extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.PredefinedFloatRuleProto2) + PredefinedFloatRuleProto2OrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 1, + /* suffix= */ "", + PredefinedFloatRuleProto2.class.getName()); + } + // Use PredefinedFloatRuleProto2.newBuilder() to construct. + private PredefinedFloatRuleProto2(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private PredefinedFloatRuleProto2() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.internal_static_buf_validate_conformance_cases_PredefinedFloatRuleProto2_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.internal_static_buf_validate_conformance_cases_PredefinedFloatRuleProto2_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.PredefinedFloatRuleProto2.class, build.buf.validate.conformance.cases.PredefinedFloatRuleProto2.Builder.class); + } + + private int bitField0_; + public static final int VAL_FIELD_NUMBER = 1; + private float val_ = 0F; + /** + * optional float 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 float val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public float getVal() { + return val_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + output.writeFloat(1, val_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(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.PredefinedFloatRuleProto2)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.PredefinedFloatRuleProto2 other = (build.buf.validate.conformance.cases.PredefinedFloatRuleProto2) obj; + + if (hasVal() != other.hasVal()) return false; + if (hasVal()) { + if (java.lang.Float.floatToIntBits(getVal()) + != java.lang.Float.floatToIntBits( + 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) + java.lang.Float.floatToIntBits( + getVal()); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.PredefinedFloatRuleProto2 parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedFloatRuleProto2 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.PredefinedFloatRuleProto2 parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedFloatRuleProto2 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.PredefinedFloatRuleProto2 parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedFloatRuleProto2 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.PredefinedFloatRuleProto2 parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.PredefinedFloatRuleProto2 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.PredefinedFloatRuleProto2 parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.PredefinedFloatRuleProto2 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.PredefinedFloatRuleProto2 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.PredefinedFloatRuleProto2 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.PredefinedFloatRuleProto2 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.PredefinedFloatRuleProto2} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.PredefinedFloatRuleProto2) + build.buf.validate.conformance.cases.PredefinedFloatRuleProto2OrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.internal_static_buf_validate_conformance_cases_PredefinedFloatRuleProto2_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.internal_static_buf_validate_conformance_cases_PredefinedFloatRuleProto2_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.PredefinedFloatRuleProto2.class, build.buf.validate.conformance.cases.PredefinedFloatRuleProto2.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.PredefinedFloatRuleProto2.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + val_ = 0F; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.internal_static_buf_validate_conformance_cases_PredefinedFloatRuleProto2_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedFloatRuleProto2 getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.PredefinedFloatRuleProto2.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedFloatRuleProto2 build() { + build.buf.validate.conformance.cases.PredefinedFloatRuleProto2 result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedFloatRuleProto2 buildPartial() { + build.buf.validate.conformance.cases.PredefinedFloatRuleProto2 result = new build.buf.validate.conformance.cases.PredefinedFloatRuleProto2(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.PredefinedFloatRuleProto2 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.PredefinedFloatRuleProto2) { + return mergeFrom((build.buf.validate.conformance.cases.PredefinedFloatRuleProto2)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.PredefinedFloatRuleProto2 other) { + if (other == build.buf.validate.conformance.cases.PredefinedFloatRuleProto2.getDefaultInstance()) return this; + if (other.hasVal()) { + setVal(other.getVal()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 13: { + val_ = input.readFloat(); + bitField0_ |= 0x00000001; + break; + } // case 13 + 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 float val_ ; + /** + * optional float 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 float val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public float getVal() { + return val_; + } + /** + * optional float val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param value The val to set. + * @return This builder for chaining. + */ + public Builder setVal(float value) { + + val_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * optional float val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return This builder for chaining. + */ + public Builder clearVal() { + bitField0_ = (bitField0_ & ~0x00000001); + val_ = 0F; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.PredefinedFloatRuleProto2) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.PredefinedFloatRuleProto2) + private static final build.buf.validate.conformance.cases.PredefinedFloatRuleProto2 DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.PredefinedFloatRuleProto2(); + } + + public static build.buf.validate.conformance.cases.PredefinedFloatRuleProto2 getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PredefinedFloatRuleProto2 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.PredefinedFloatRuleProto2 getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedFloatRuleProto2OrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedFloatRuleProto2OrBuilder.java new file mode 100644 index 00000000..78722682 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedFloatRuleProto2OrBuilder.java @@ -0,0 +1,22 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/predefined_rules_proto2.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +public interface PredefinedFloatRuleProto2OrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.PredefinedFloatRuleProto2) + com.google.protobuf.MessageOrBuilder { + + /** + * optional float val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + boolean hasVal(); + /** + * optional float val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + float getVal(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedFloatRuleProto3.java b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedFloatRuleProto3.java new file mode 100644 index 00000000..a0892911 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedFloatRuleProto3.java @@ -0,0 +1,433 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/predefined_rules_proto3.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.PredefinedFloatRuleProto3} + */ +public final class PredefinedFloatRuleProto3 extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.PredefinedFloatRuleProto3) + PredefinedFloatRuleProto3OrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 1, + /* suffix= */ "", + PredefinedFloatRuleProto3.class.getName()); + } + // Use PredefinedFloatRuleProto3.newBuilder() to construct. + private PredefinedFloatRuleProto3(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private PredefinedFloatRuleProto3() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.PredefinedRulesProto3Proto.internal_static_buf_validate_conformance_cases_PredefinedFloatRuleProto3_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.PredefinedRulesProto3Proto.internal_static_buf_validate_conformance_cases_PredefinedFloatRuleProto3_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.PredefinedFloatRuleProto3.class, build.buf.validate.conformance.cases.PredefinedFloatRuleProto3.Builder.class); + } + + public static final int VAL_FIELD_NUMBER = 1; + private float val_ = 0F; + /** + * float val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public float getVal() { + return val_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (java.lang.Float.floatToRawIntBits(val_) != 0) { + output.writeFloat(1, val_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (java.lang.Float.floatToRawIntBits(val_) != 0) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(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.PredefinedFloatRuleProto3)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.PredefinedFloatRuleProto3 other = (build.buf.validate.conformance.cases.PredefinedFloatRuleProto3) obj; + + if (java.lang.Float.floatToIntBits(getVal()) + != java.lang.Float.floatToIntBits( + 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) + java.lang.Float.floatToIntBits( + getVal()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.PredefinedFloatRuleProto3 parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedFloatRuleProto3 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.PredefinedFloatRuleProto3 parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedFloatRuleProto3 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.PredefinedFloatRuleProto3 parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedFloatRuleProto3 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.PredefinedFloatRuleProto3 parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.PredefinedFloatRuleProto3 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.PredefinedFloatRuleProto3 parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.PredefinedFloatRuleProto3 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.PredefinedFloatRuleProto3 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.PredefinedFloatRuleProto3 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.PredefinedFloatRuleProto3 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.PredefinedFloatRuleProto3} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.PredefinedFloatRuleProto3) + build.buf.validate.conformance.cases.PredefinedFloatRuleProto3OrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.PredefinedRulesProto3Proto.internal_static_buf_validate_conformance_cases_PredefinedFloatRuleProto3_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.PredefinedRulesProto3Proto.internal_static_buf_validate_conformance_cases_PredefinedFloatRuleProto3_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.PredefinedFloatRuleProto3.class, build.buf.validate.conformance.cases.PredefinedFloatRuleProto3.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.PredefinedFloatRuleProto3.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + val_ = 0F; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.PredefinedRulesProto3Proto.internal_static_buf_validate_conformance_cases_PredefinedFloatRuleProto3_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedFloatRuleProto3 getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.PredefinedFloatRuleProto3.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedFloatRuleProto3 build() { + build.buf.validate.conformance.cases.PredefinedFloatRuleProto3 result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedFloatRuleProto3 buildPartial() { + build.buf.validate.conformance.cases.PredefinedFloatRuleProto3 result = new build.buf.validate.conformance.cases.PredefinedFloatRuleProto3(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.PredefinedFloatRuleProto3 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.PredefinedFloatRuleProto3) { + return mergeFrom((build.buf.validate.conformance.cases.PredefinedFloatRuleProto3)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.PredefinedFloatRuleProto3 other) { + if (other == build.buf.validate.conformance.cases.PredefinedFloatRuleProto3.getDefaultInstance()) return this; + if (other.getVal() != 0F) { + setVal(other.getVal()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 13: { + val_ = input.readFloat(); + bitField0_ |= 0x00000001; + break; + } // case 13 + 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 float val_ ; + /** + * float val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public float getVal() { + return val_; + } + /** + * float val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param value The val to set. + * @return This builder for chaining. + */ + public Builder setVal(float value) { + + val_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * float val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return This builder for chaining. + */ + public Builder clearVal() { + bitField0_ = (bitField0_ & ~0x00000001); + val_ = 0F; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.PredefinedFloatRuleProto3) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.PredefinedFloatRuleProto3) + private static final build.buf.validate.conformance.cases.PredefinedFloatRuleProto3 DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.PredefinedFloatRuleProto3(); + } + + public static build.buf.validate.conformance.cases.PredefinedFloatRuleProto3 getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PredefinedFloatRuleProto3 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.PredefinedFloatRuleProto3 getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedFloatRuleProto3OrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedFloatRuleProto3OrBuilder.java new file mode 100644 index 00000000..d1863db0 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedFloatRuleProto3OrBuilder.java @@ -0,0 +1,17 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/predefined_rules_proto3.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +public interface PredefinedFloatRuleProto3OrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.PredefinedFloatRuleProto3) + com.google.protobuf.MessageOrBuilder { + + /** + * float val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + float getVal(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedInt32RuleEdition2023.java b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedInt32RuleEdition2023.java new file mode 100644 index 00000000..25d842aa --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedInt32RuleEdition2023.java @@ -0,0 +1,456 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/predefined_rules_proto_editions.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.PredefinedInt32RuleEdition2023} + */ +public final class PredefinedInt32RuleEdition2023 extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.PredefinedInt32RuleEdition2023) + PredefinedInt32RuleEdition2023OrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 1, + /* suffix= */ "", + PredefinedInt32RuleEdition2023.class.getName()); + } + // Use PredefinedInt32RuleEdition2023.newBuilder() to construct. + private PredefinedInt32RuleEdition2023(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private PredefinedInt32RuleEdition2023() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.internal_static_buf_validate_conformance_cases_PredefinedInt32RuleEdition2023_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.internal_static_buf_validate_conformance_cases_PredefinedInt32RuleEdition2023_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.PredefinedInt32RuleEdition2023.class, build.buf.validate.conformance.cases.PredefinedInt32RuleEdition2023.Builder.class); + } + + private int bitField0_; + public static final int VAL_FIELD_NUMBER = 1; + private int val_ = 0; + /** + * int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + @java.lang.Override + public boolean hasVal() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public int getVal() { + return val_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + output.writeInt32(1, val_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(1, val_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof build.buf.validate.conformance.cases.PredefinedInt32RuleEdition2023)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.PredefinedInt32RuleEdition2023 other = (build.buf.validate.conformance.cases.PredefinedInt32RuleEdition2023) obj; + + if (hasVal() != other.hasVal()) return false; + if (hasVal()) { + if (getVal() + != other.getVal()) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasVal()) { + hash = (37 * hash) + VAL_FIELD_NUMBER; + hash = (53 * hash) + getVal(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.PredefinedInt32RuleEdition2023 parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedInt32RuleEdition2023 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.PredefinedInt32RuleEdition2023 parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedInt32RuleEdition2023 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.PredefinedInt32RuleEdition2023 parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedInt32RuleEdition2023 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.PredefinedInt32RuleEdition2023 parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.PredefinedInt32RuleEdition2023 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.PredefinedInt32RuleEdition2023 parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.PredefinedInt32RuleEdition2023 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.PredefinedInt32RuleEdition2023 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.PredefinedInt32RuleEdition2023 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.PredefinedInt32RuleEdition2023 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.PredefinedInt32RuleEdition2023} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.PredefinedInt32RuleEdition2023) + build.buf.validate.conformance.cases.PredefinedInt32RuleEdition2023OrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.internal_static_buf_validate_conformance_cases_PredefinedInt32RuleEdition2023_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.internal_static_buf_validate_conformance_cases_PredefinedInt32RuleEdition2023_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.PredefinedInt32RuleEdition2023.class, build.buf.validate.conformance.cases.PredefinedInt32RuleEdition2023.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.PredefinedInt32RuleEdition2023.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + val_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.internal_static_buf_validate_conformance_cases_PredefinedInt32RuleEdition2023_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedInt32RuleEdition2023 getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.PredefinedInt32RuleEdition2023.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedInt32RuleEdition2023 build() { + build.buf.validate.conformance.cases.PredefinedInt32RuleEdition2023 result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedInt32RuleEdition2023 buildPartial() { + build.buf.validate.conformance.cases.PredefinedInt32RuleEdition2023 result = new build.buf.validate.conformance.cases.PredefinedInt32RuleEdition2023(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.PredefinedInt32RuleEdition2023 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.PredefinedInt32RuleEdition2023) { + return mergeFrom((build.buf.validate.conformance.cases.PredefinedInt32RuleEdition2023)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.PredefinedInt32RuleEdition2023 other) { + if (other == build.buf.validate.conformance.cases.PredefinedInt32RuleEdition2023.getDefaultInstance()) return this; + if (other.hasVal()) { + setVal(other.getVal()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + val_ = input.readInt32(); + bitField0_ |= 0x00000001; + break; + } // case 8 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private int val_ ; + /** + * int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + @java.lang.Override + public boolean hasVal() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public int getVal() { + return val_; + } + /** + * int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param value The val to set. + * @return This builder for chaining. + */ + public Builder setVal(int value) { + + val_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return This builder for chaining. + */ + public Builder clearVal() { + bitField0_ = (bitField0_ & ~0x00000001); + val_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.PredefinedInt32RuleEdition2023) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.PredefinedInt32RuleEdition2023) + private static final build.buf.validate.conformance.cases.PredefinedInt32RuleEdition2023 DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.PredefinedInt32RuleEdition2023(); + } + + public static build.buf.validate.conformance.cases.PredefinedInt32RuleEdition2023 getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PredefinedInt32RuleEdition2023 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.PredefinedInt32RuleEdition2023 getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedInt32RuleEdition2023OrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedInt32RuleEdition2023OrBuilder.java new file mode 100644 index 00000000..9ceaa680 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedInt32RuleEdition2023OrBuilder.java @@ -0,0 +1,22 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/predefined_rules_proto_editions.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +public interface PredefinedInt32RuleEdition2023OrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.PredefinedInt32RuleEdition2023) + com.google.protobuf.MessageOrBuilder { + + /** + * int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + boolean hasVal(); + /** + * int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + int getVal(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedInt32RuleProto2.java b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedInt32RuleProto2.java new file mode 100644 index 00000000..b3c30900 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedInt32RuleProto2.java @@ -0,0 +1,456 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/predefined_rules_proto2.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.PredefinedInt32RuleProto2} + */ +public final class PredefinedInt32RuleProto2 extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.PredefinedInt32RuleProto2) + PredefinedInt32RuleProto2OrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 1, + /* suffix= */ "", + PredefinedInt32RuleProto2.class.getName()); + } + // Use PredefinedInt32RuleProto2.newBuilder() to construct. + private PredefinedInt32RuleProto2(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private PredefinedInt32RuleProto2() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.internal_static_buf_validate_conformance_cases_PredefinedInt32RuleProto2_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.internal_static_buf_validate_conformance_cases_PredefinedInt32RuleProto2_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.PredefinedInt32RuleProto2.class, build.buf.validate.conformance.cases.PredefinedInt32RuleProto2.Builder.class); + } + + private int bitField0_; + public static final int VAL_FIELD_NUMBER = 1; + private int val_ = 0; + /** + * optional int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + @java.lang.Override + public boolean hasVal() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * optional int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public int getVal() { + return val_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + output.writeInt32(1, val_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(1, val_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof build.buf.validate.conformance.cases.PredefinedInt32RuleProto2)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.PredefinedInt32RuleProto2 other = (build.buf.validate.conformance.cases.PredefinedInt32RuleProto2) obj; + + if (hasVal() != other.hasVal()) return false; + if (hasVal()) { + if (getVal() + != other.getVal()) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasVal()) { + hash = (37 * hash) + VAL_FIELD_NUMBER; + hash = (53 * hash) + getVal(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.PredefinedInt32RuleProto2 parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedInt32RuleProto2 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.PredefinedInt32RuleProto2 parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedInt32RuleProto2 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.PredefinedInt32RuleProto2 parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedInt32RuleProto2 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.PredefinedInt32RuleProto2 parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.PredefinedInt32RuleProto2 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.PredefinedInt32RuleProto2 parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.PredefinedInt32RuleProto2 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.PredefinedInt32RuleProto2 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.PredefinedInt32RuleProto2 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.PredefinedInt32RuleProto2 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.PredefinedInt32RuleProto2} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.PredefinedInt32RuleProto2) + build.buf.validate.conformance.cases.PredefinedInt32RuleProto2OrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.internal_static_buf_validate_conformance_cases_PredefinedInt32RuleProto2_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.internal_static_buf_validate_conformance_cases_PredefinedInt32RuleProto2_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.PredefinedInt32RuleProto2.class, build.buf.validate.conformance.cases.PredefinedInt32RuleProto2.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.PredefinedInt32RuleProto2.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + val_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.internal_static_buf_validate_conformance_cases_PredefinedInt32RuleProto2_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedInt32RuleProto2 getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.PredefinedInt32RuleProto2.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedInt32RuleProto2 build() { + build.buf.validate.conformance.cases.PredefinedInt32RuleProto2 result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedInt32RuleProto2 buildPartial() { + build.buf.validate.conformance.cases.PredefinedInt32RuleProto2 result = new build.buf.validate.conformance.cases.PredefinedInt32RuleProto2(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.PredefinedInt32RuleProto2 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.PredefinedInt32RuleProto2) { + return mergeFrom((build.buf.validate.conformance.cases.PredefinedInt32RuleProto2)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.PredefinedInt32RuleProto2 other) { + if (other == build.buf.validate.conformance.cases.PredefinedInt32RuleProto2.getDefaultInstance()) return this; + if (other.hasVal()) { + setVal(other.getVal()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + val_ = input.readInt32(); + bitField0_ |= 0x00000001; + break; + } // case 8 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private int val_ ; + /** + * optional int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + @java.lang.Override + public boolean hasVal() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * optional int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public int getVal() { + return val_; + } + /** + * optional int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param value The val to set. + * @return This builder for chaining. + */ + public Builder setVal(int value) { + + val_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * optional int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return This builder for chaining. + */ + public Builder clearVal() { + bitField0_ = (bitField0_ & ~0x00000001); + val_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.PredefinedInt32RuleProto2) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.PredefinedInt32RuleProto2) + private static final build.buf.validate.conformance.cases.PredefinedInt32RuleProto2 DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.PredefinedInt32RuleProto2(); + } + + public static build.buf.validate.conformance.cases.PredefinedInt32RuleProto2 getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PredefinedInt32RuleProto2 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.PredefinedInt32RuleProto2 getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedInt32RuleProto2OrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedInt32RuleProto2OrBuilder.java new file mode 100644 index 00000000..b4dcfb4c --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedInt32RuleProto2OrBuilder.java @@ -0,0 +1,22 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/predefined_rules_proto2.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +public interface PredefinedInt32RuleProto2OrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.PredefinedInt32RuleProto2) + com.google.protobuf.MessageOrBuilder { + + /** + * optional int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + boolean hasVal(); + /** + * optional int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + int getVal(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedInt32RuleProto3.java b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedInt32RuleProto3.java new file mode 100644 index 00000000..dc9ae6e8 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedInt32RuleProto3.java @@ -0,0 +1,431 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/predefined_rules_proto3.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.PredefinedInt32RuleProto3} + */ +public final class PredefinedInt32RuleProto3 extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.PredefinedInt32RuleProto3) + PredefinedInt32RuleProto3OrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 1, + /* suffix= */ "", + PredefinedInt32RuleProto3.class.getName()); + } + // Use PredefinedInt32RuleProto3.newBuilder() to construct. + private PredefinedInt32RuleProto3(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private PredefinedInt32RuleProto3() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.PredefinedRulesProto3Proto.internal_static_buf_validate_conformance_cases_PredefinedInt32RuleProto3_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.PredefinedRulesProto3Proto.internal_static_buf_validate_conformance_cases_PredefinedInt32RuleProto3_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.PredefinedInt32RuleProto3.class, build.buf.validate.conformance.cases.PredefinedInt32RuleProto3.Builder.class); + } + + public static final int VAL_FIELD_NUMBER = 1; + private int val_ = 0; + /** + * int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public int getVal() { + return val_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (val_ != 0) { + output.writeInt32(1, val_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (val_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(1, val_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof build.buf.validate.conformance.cases.PredefinedInt32RuleProto3)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.PredefinedInt32RuleProto3 other = (build.buf.validate.conformance.cases.PredefinedInt32RuleProto3) obj; + + if (getVal() + != other.getVal()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + VAL_FIELD_NUMBER; + hash = (53 * hash) + getVal(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.PredefinedInt32RuleProto3 parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedInt32RuleProto3 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.PredefinedInt32RuleProto3 parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedInt32RuleProto3 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.PredefinedInt32RuleProto3 parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedInt32RuleProto3 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.PredefinedInt32RuleProto3 parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.PredefinedInt32RuleProto3 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.PredefinedInt32RuleProto3 parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.PredefinedInt32RuleProto3 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.PredefinedInt32RuleProto3 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.PredefinedInt32RuleProto3 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.PredefinedInt32RuleProto3 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.PredefinedInt32RuleProto3} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.PredefinedInt32RuleProto3) + build.buf.validate.conformance.cases.PredefinedInt32RuleProto3OrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.PredefinedRulesProto3Proto.internal_static_buf_validate_conformance_cases_PredefinedInt32RuleProto3_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.PredefinedRulesProto3Proto.internal_static_buf_validate_conformance_cases_PredefinedInt32RuleProto3_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.PredefinedInt32RuleProto3.class, build.buf.validate.conformance.cases.PredefinedInt32RuleProto3.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.PredefinedInt32RuleProto3.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + val_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.PredefinedRulesProto3Proto.internal_static_buf_validate_conformance_cases_PredefinedInt32RuleProto3_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedInt32RuleProto3 getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.PredefinedInt32RuleProto3.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedInt32RuleProto3 build() { + build.buf.validate.conformance.cases.PredefinedInt32RuleProto3 result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedInt32RuleProto3 buildPartial() { + build.buf.validate.conformance.cases.PredefinedInt32RuleProto3 result = new build.buf.validate.conformance.cases.PredefinedInt32RuleProto3(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.PredefinedInt32RuleProto3 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.PredefinedInt32RuleProto3) { + return mergeFrom((build.buf.validate.conformance.cases.PredefinedInt32RuleProto3)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.PredefinedInt32RuleProto3 other) { + if (other == build.buf.validate.conformance.cases.PredefinedInt32RuleProto3.getDefaultInstance()) return this; + if (other.getVal() != 0) { + setVal(other.getVal()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + val_ = input.readInt32(); + bitField0_ |= 0x00000001; + break; + } // case 8 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private int val_ ; + /** + * int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public int getVal() { + return val_; + } + /** + * int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param value The val to set. + * @return This builder for chaining. + */ + public Builder setVal(int value) { + + val_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return This builder for chaining. + */ + public Builder clearVal() { + bitField0_ = (bitField0_ & ~0x00000001); + val_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.PredefinedInt32RuleProto3) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.PredefinedInt32RuleProto3) + private static final build.buf.validate.conformance.cases.PredefinedInt32RuleProto3 DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.PredefinedInt32RuleProto3(); + } + + public static build.buf.validate.conformance.cases.PredefinedInt32RuleProto3 getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PredefinedInt32RuleProto3 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.PredefinedInt32RuleProto3 getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedInt32RuleProto3OrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedInt32RuleProto3OrBuilder.java new file mode 100644 index 00000000..7fa355b5 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedInt32RuleProto3OrBuilder.java @@ -0,0 +1,17 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/predefined_rules_proto3.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +public interface PredefinedInt32RuleProto3OrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.PredefinedInt32RuleProto3) + com.google.protobuf.MessageOrBuilder { + + /** + * int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + int getVal(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedInt64RuleEdition2023.java b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedInt64RuleEdition2023.java new file mode 100644 index 00000000..efa97706 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedInt64RuleEdition2023.java @@ -0,0 +1,457 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/predefined_rules_proto_editions.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.PredefinedInt64RuleEdition2023} + */ +public final class PredefinedInt64RuleEdition2023 extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.PredefinedInt64RuleEdition2023) + PredefinedInt64RuleEdition2023OrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 1, + /* suffix= */ "", + PredefinedInt64RuleEdition2023.class.getName()); + } + // Use PredefinedInt64RuleEdition2023.newBuilder() to construct. + private PredefinedInt64RuleEdition2023(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private PredefinedInt64RuleEdition2023() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.internal_static_buf_validate_conformance_cases_PredefinedInt64RuleEdition2023_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.internal_static_buf_validate_conformance_cases_PredefinedInt64RuleEdition2023_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.PredefinedInt64RuleEdition2023.class, build.buf.validate.conformance.cases.PredefinedInt64RuleEdition2023.Builder.class); + } + + private int bitField0_; + public static final int VAL_FIELD_NUMBER = 1; + private long val_ = 0L; + /** + * int64 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); + } + /** + * int64 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public long getVal() { + return val_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + output.writeInt64(1, val_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(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.PredefinedInt64RuleEdition2023)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.PredefinedInt64RuleEdition2023 other = (build.buf.validate.conformance.cases.PredefinedInt64RuleEdition2023) obj; + + if (hasVal() != other.hasVal()) return false; + if (hasVal()) { + if (getVal() + != other.getVal()) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasVal()) { + hash = (37 * hash) + VAL_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getVal()); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.PredefinedInt64RuleEdition2023 parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedInt64RuleEdition2023 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.PredefinedInt64RuleEdition2023 parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedInt64RuleEdition2023 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.PredefinedInt64RuleEdition2023 parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedInt64RuleEdition2023 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.PredefinedInt64RuleEdition2023 parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.PredefinedInt64RuleEdition2023 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.PredefinedInt64RuleEdition2023 parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.PredefinedInt64RuleEdition2023 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.PredefinedInt64RuleEdition2023 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.PredefinedInt64RuleEdition2023 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.PredefinedInt64RuleEdition2023 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.PredefinedInt64RuleEdition2023} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.PredefinedInt64RuleEdition2023) + build.buf.validate.conformance.cases.PredefinedInt64RuleEdition2023OrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.internal_static_buf_validate_conformance_cases_PredefinedInt64RuleEdition2023_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.internal_static_buf_validate_conformance_cases_PredefinedInt64RuleEdition2023_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.PredefinedInt64RuleEdition2023.class, build.buf.validate.conformance.cases.PredefinedInt64RuleEdition2023.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.PredefinedInt64RuleEdition2023.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + val_ = 0L; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.internal_static_buf_validate_conformance_cases_PredefinedInt64RuleEdition2023_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedInt64RuleEdition2023 getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.PredefinedInt64RuleEdition2023.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedInt64RuleEdition2023 build() { + build.buf.validate.conformance.cases.PredefinedInt64RuleEdition2023 result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedInt64RuleEdition2023 buildPartial() { + build.buf.validate.conformance.cases.PredefinedInt64RuleEdition2023 result = new build.buf.validate.conformance.cases.PredefinedInt64RuleEdition2023(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.PredefinedInt64RuleEdition2023 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.PredefinedInt64RuleEdition2023) { + return mergeFrom((build.buf.validate.conformance.cases.PredefinedInt64RuleEdition2023)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.PredefinedInt64RuleEdition2023 other) { + if (other == build.buf.validate.conformance.cases.PredefinedInt64RuleEdition2023.getDefaultInstance()) return this; + if (other.hasVal()) { + setVal(other.getVal()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + val_ = input.readInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private long val_ ; + /** + * int64 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); + } + /** + * int64 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public long getVal() { + return val_; + } + /** + * int64 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param value The val to set. + * @return This builder for chaining. + */ + public Builder setVal(long value) { + + val_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * int64 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return This builder for chaining. + */ + public Builder clearVal() { + bitField0_ = (bitField0_ & ~0x00000001); + val_ = 0L; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.PredefinedInt64RuleEdition2023) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.PredefinedInt64RuleEdition2023) + private static final build.buf.validate.conformance.cases.PredefinedInt64RuleEdition2023 DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.PredefinedInt64RuleEdition2023(); + } + + public static build.buf.validate.conformance.cases.PredefinedInt64RuleEdition2023 getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PredefinedInt64RuleEdition2023 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.PredefinedInt64RuleEdition2023 getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedInt64RuleEdition2023OrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedInt64RuleEdition2023OrBuilder.java new file mode 100644 index 00000000..9c7f5939 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedInt64RuleEdition2023OrBuilder.java @@ -0,0 +1,22 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/predefined_rules_proto_editions.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +public interface PredefinedInt64RuleEdition2023OrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.PredefinedInt64RuleEdition2023) + com.google.protobuf.MessageOrBuilder { + + /** + * int64 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + boolean hasVal(); + /** + * int64 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + long getVal(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedInt64RuleProto2.java b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedInt64RuleProto2.java new file mode 100644 index 00000000..02f52299 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedInt64RuleProto2.java @@ -0,0 +1,457 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/predefined_rules_proto2.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.PredefinedInt64RuleProto2} + */ +public final class PredefinedInt64RuleProto2 extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.PredefinedInt64RuleProto2) + PredefinedInt64RuleProto2OrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 1, + /* suffix= */ "", + PredefinedInt64RuleProto2.class.getName()); + } + // Use PredefinedInt64RuleProto2.newBuilder() to construct. + private PredefinedInt64RuleProto2(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private PredefinedInt64RuleProto2() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.internal_static_buf_validate_conformance_cases_PredefinedInt64RuleProto2_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.internal_static_buf_validate_conformance_cases_PredefinedInt64RuleProto2_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.PredefinedInt64RuleProto2.class, build.buf.validate.conformance.cases.PredefinedInt64RuleProto2.Builder.class); + } + + private int bitField0_; + public static final int VAL_FIELD_NUMBER = 1; + private long val_ = 0L; + /** + * optional int64 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 int64 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public long getVal() { + return val_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + output.writeInt64(1, val_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(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.PredefinedInt64RuleProto2)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.PredefinedInt64RuleProto2 other = (build.buf.validate.conformance.cases.PredefinedInt64RuleProto2) obj; + + if (hasVal() != other.hasVal()) return false; + if (hasVal()) { + if (getVal() + != other.getVal()) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasVal()) { + hash = (37 * hash) + VAL_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getVal()); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.PredefinedInt64RuleProto2 parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedInt64RuleProto2 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.PredefinedInt64RuleProto2 parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedInt64RuleProto2 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.PredefinedInt64RuleProto2 parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedInt64RuleProto2 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.PredefinedInt64RuleProto2 parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.PredefinedInt64RuleProto2 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.PredefinedInt64RuleProto2 parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.PredefinedInt64RuleProto2 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.PredefinedInt64RuleProto2 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.PredefinedInt64RuleProto2 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.PredefinedInt64RuleProto2 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.PredefinedInt64RuleProto2} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.PredefinedInt64RuleProto2) + build.buf.validate.conformance.cases.PredefinedInt64RuleProto2OrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.internal_static_buf_validate_conformance_cases_PredefinedInt64RuleProto2_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.internal_static_buf_validate_conformance_cases_PredefinedInt64RuleProto2_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.PredefinedInt64RuleProto2.class, build.buf.validate.conformance.cases.PredefinedInt64RuleProto2.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.PredefinedInt64RuleProto2.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + val_ = 0L; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.internal_static_buf_validate_conformance_cases_PredefinedInt64RuleProto2_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedInt64RuleProto2 getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.PredefinedInt64RuleProto2.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedInt64RuleProto2 build() { + build.buf.validate.conformance.cases.PredefinedInt64RuleProto2 result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedInt64RuleProto2 buildPartial() { + build.buf.validate.conformance.cases.PredefinedInt64RuleProto2 result = new build.buf.validate.conformance.cases.PredefinedInt64RuleProto2(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.PredefinedInt64RuleProto2 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.PredefinedInt64RuleProto2) { + return mergeFrom((build.buf.validate.conformance.cases.PredefinedInt64RuleProto2)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.PredefinedInt64RuleProto2 other) { + if (other == build.buf.validate.conformance.cases.PredefinedInt64RuleProto2.getDefaultInstance()) return this; + if (other.hasVal()) { + setVal(other.getVal()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + val_ = input.readInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private long val_ ; + /** + * optional int64 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 int64 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public long getVal() { + return val_; + } + /** + * optional int64 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param value The val to set. + * @return This builder for chaining. + */ + public Builder setVal(long value) { + + val_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * optional int64 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return This builder for chaining. + */ + public Builder clearVal() { + bitField0_ = (bitField0_ & ~0x00000001); + val_ = 0L; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.PredefinedInt64RuleProto2) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.PredefinedInt64RuleProto2) + private static final build.buf.validate.conformance.cases.PredefinedInt64RuleProto2 DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.PredefinedInt64RuleProto2(); + } + + public static build.buf.validate.conformance.cases.PredefinedInt64RuleProto2 getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PredefinedInt64RuleProto2 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.PredefinedInt64RuleProto2 getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedInt64RuleProto2OrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedInt64RuleProto2OrBuilder.java new file mode 100644 index 00000000..90c32258 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedInt64RuleProto2OrBuilder.java @@ -0,0 +1,22 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/predefined_rules_proto2.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +public interface PredefinedInt64RuleProto2OrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.PredefinedInt64RuleProto2) + com.google.protobuf.MessageOrBuilder { + + /** + * optional int64 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + boolean hasVal(); + /** + * optional int64 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + long getVal(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedInt64RuleProto3.java b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedInt64RuleProto3.java new file mode 100644 index 00000000..699f02ef --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedInt64RuleProto3.java @@ -0,0 +1,432 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/predefined_rules_proto3.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.PredefinedInt64RuleProto3} + */ +public final class PredefinedInt64RuleProto3 extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.PredefinedInt64RuleProto3) + PredefinedInt64RuleProto3OrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 1, + /* suffix= */ "", + PredefinedInt64RuleProto3.class.getName()); + } + // Use PredefinedInt64RuleProto3.newBuilder() to construct. + private PredefinedInt64RuleProto3(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private PredefinedInt64RuleProto3() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.PredefinedRulesProto3Proto.internal_static_buf_validate_conformance_cases_PredefinedInt64RuleProto3_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.PredefinedRulesProto3Proto.internal_static_buf_validate_conformance_cases_PredefinedInt64RuleProto3_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.PredefinedInt64RuleProto3.class, build.buf.validate.conformance.cases.PredefinedInt64RuleProto3.Builder.class); + } + + public static final int VAL_FIELD_NUMBER = 1; + private long val_ = 0L; + /** + * int64 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public long getVal() { + return val_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (val_ != 0L) { + output.writeInt64(1, val_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (val_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(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.PredefinedInt64RuleProto3)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.PredefinedInt64RuleProto3 other = (build.buf.validate.conformance.cases.PredefinedInt64RuleProto3) obj; + + if (getVal() + != other.getVal()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + VAL_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getVal()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.PredefinedInt64RuleProto3 parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedInt64RuleProto3 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.PredefinedInt64RuleProto3 parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedInt64RuleProto3 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.PredefinedInt64RuleProto3 parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedInt64RuleProto3 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.PredefinedInt64RuleProto3 parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.PredefinedInt64RuleProto3 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.PredefinedInt64RuleProto3 parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.PredefinedInt64RuleProto3 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.PredefinedInt64RuleProto3 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.PredefinedInt64RuleProto3 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.PredefinedInt64RuleProto3 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.PredefinedInt64RuleProto3} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.PredefinedInt64RuleProto3) + build.buf.validate.conformance.cases.PredefinedInt64RuleProto3OrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.PredefinedRulesProto3Proto.internal_static_buf_validate_conformance_cases_PredefinedInt64RuleProto3_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.PredefinedRulesProto3Proto.internal_static_buf_validate_conformance_cases_PredefinedInt64RuleProto3_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.PredefinedInt64RuleProto3.class, build.buf.validate.conformance.cases.PredefinedInt64RuleProto3.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.PredefinedInt64RuleProto3.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + val_ = 0L; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.PredefinedRulesProto3Proto.internal_static_buf_validate_conformance_cases_PredefinedInt64RuleProto3_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedInt64RuleProto3 getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.PredefinedInt64RuleProto3.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedInt64RuleProto3 build() { + build.buf.validate.conformance.cases.PredefinedInt64RuleProto3 result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedInt64RuleProto3 buildPartial() { + build.buf.validate.conformance.cases.PredefinedInt64RuleProto3 result = new build.buf.validate.conformance.cases.PredefinedInt64RuleProto3(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.PredefinedInt64RuleProto3 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.PredefinedInt64RuleProto3) { + return mergeFrom((build.buf.validate.conformance.cases.PredefinedInt64RuleProto3)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.PredefinedInt64RuleProto3 other) { + if (other == build.buf.validate.conformance.cases.PredefinedInt64RuleProto3.getDefaultInstance()) return this; + if (other.getVal() != 0L) { + setVal(other.getVal()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + val_ = input.readInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private long val_ ; + /** + * int64 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public long getVal() { + return val_; + } + /** + * int64 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param value The val to set. + * @return This builder for chaining. + */ + public Builder setVal(long value) { + + val_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * int64 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return This builder for chaining. + */ + public Builder clearVal() { + bitField0_ = (bitField0_ & ~0x00000001); + val_ = 0L; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.PredefinedInt64RuleProto3) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.PredefinedInt64RuleProto3) + private static final build.buf.validate.conformance.cases.PredefinedInt64RuleProto3 DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.PredefinedInt64RuleProto3(); + } + + public static build.buf.validate.conformance.cases.PredefinedInt64RuleProto3 getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PredefinedInt64RuleProto3 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.PredefinedInt64RuleProto3 getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedInt64RuleProto3OrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedInt64RuleProto3OrBuilder.java new file mode 100644 index 00000000..d268bf2f --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedInt64RuleProto3OrBuilder.java @@ -0,0 +1,17 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/predefined_rules_proto3.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +public interface PredefinedInt64RuleProto3OrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.PredefinedInt64RuleProto3) + com.google.protobuf.MessageOrBuilder { + + /** + * int64 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + long getVal(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedMapRuleEdition2023.java b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedMapRuleEdition2023.java new file mode 100644 index 00000000..b89089f7 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedMapRuleEdition2023.java @@ -0,0 +1,640 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/predefined_rules_proto_editions.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.PredefinedMapRuleEdition2023} + */ +public final class PredefinedMapRuleEdition2023 extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.PredefinedMapRuleEdition2023) + PredefinedMapRuleEdition2023OrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 1, + /* suffix= */ "", + PredefinedMapRuleEdition2023.class.getName()); + } + // Use PredefinedMapRuleEdition2023.newBuilder() to construct. + private PredefinedMapRuleEdition2023(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private PredefinedMapRuleEdition2023() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.internal_static_buf_validate_conformance_cases_PredefinedMapRuleEdition2023_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.PredefinedRulesProtoEditionsProto.internal_static_buf_validate_conformance_cases_PredefinedMapRuleEdition2023_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.PredefinedMapRuleEdition2023.class, build.buf.validate.conformance.cases.PredefinedMapRuleEdition2023.Builder.class); + } + + public static final int VAL_FIELD_NUMBER = 1; + private static final class ValDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.Long, java.lang.Long> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.internal_static_buf_validate_conformance_cases_PredefinedMapRuleEdition2023_ValEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.UINT64, + 0L, + com.google.protobuf.WireFormat.FieldType.UINT64, + 0L); + } + @SuppressWarnings("serial") + private com.google.protobuf.MapField< + java.lang.Long, java.lang.Long> 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<uint64, uint64> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public boolean containsVal( + long key) { + + return internalGetVal().getMap().containsKey(key); + } + /** + * Use {@link #getValMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getVal() { + return getValMap(); + } + /** + * map<uint64, uint64> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public java.util.Map getValMap() { + return internalGetVal().getMap(); + } + /** + * map<uint64, uint64> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public long getValOrDefault( + long key, + long defaultValue) { + + java.util.Map map = + internalGetVal().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * map<uint64, uint64> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public long getValOrThrow( + long 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 + .serializeLongMapTo( + 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.PredefinedMapRuleEdition2023)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.PredefinedMapRuleEdition2023 other = (build.buf.validate.conformance.cases.PredefinedMapRuleEdition2023) 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.PredefinedMapRuleEdition2023 parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedMapRuleEdition2023 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.PredefinedMapRuleEdition2023 parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedMapRuleEdition2023 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.PredefinedMapRuleEdition2023 parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedMapRuleEdition2023 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.PredefinedMapRuleEdition2023 parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.PredefinedMapRuleEdition2023 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.PredefinedMapRuleEdition2023 parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.PredefinedMapRuleEdition2023 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.PredefinedMapRuleEdition2023 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.PredefinedMapRuleEdition2023 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.PredefinedMapRuleEdition2023 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.PredefinedMapRuleEdition2023} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.PredefinedMapRuleEdition2023) + build.buf.validate.conformance.cases.PredefinedMapRuleEdition2023OrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.internal_static_buf_validate_conformance_cases_PredefinedMapRuleEdition2023_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.PredefinedRulesProtoEditionsProto.internal_static_buf_validate_conformance_cases_PredefinedMapRuleEdition2023_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.PredefinedMapRuleEdition2023.class, build.buf.validate.conformance.cases.PredefinedMapRuleEdition2023.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.PredefinedMapRuleEdition2023.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.PredefinedRulesProtoEditionsProto.internal_static_buf_validate_conformance_cases_PredefinedMapRuleEdition2023_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedMapRuleEdition2023 getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.PredefinedMapRuleEdition2023.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedMapRuleEdition2023 build() { + build.buf.validate.conformance.cases.PredefinedMapRuleEdition2023 result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedMapRuleEdition2023 buildPartial() { + build.buf.validate.conformance.cases.PredefinedMapRuleEdition2023 result = new build.buf.validate.conformance.cases.PredefinedMapRuleEdition2023(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.PredefinedMapRuleEdition2023 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.PredefinedMapRuleEdition2023) { + return mergeFrom((build.buf.validate.conformance.cases.PredefinedMapRuleEdition2023)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.PredefinedMapRuleEdition2023 other) { + if (other == build.buf.validate.conformance.cases.PredefinedMapRuleEdition2023.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.Long, java.lang.Long> 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<uint64, uint64> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public boolean containsVal( + long key) { + + return internalGetVal().getMap().containsKey(key); + } + /** + * Use {@link #getValMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getVal() { + return getValMap(); + } + /** + * map<uint64, uint64> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public java.util.Map getValMap() { + return internalGetVal().getMap(); + } + /** + * map<uint64, uint64> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public long getValOrDefault( + long key, + long defaultValue) { + + java.util.Map map = + internalGetVal().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * map<uint64, uint64> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public long getValOrThrow( + long 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<uint64, uint64> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder removeVal( + long 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<uint64, uint64> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder putVal( + long key, + long value) { + + + internalGetMutableVal().getMutableMap() + .put(key, value); + bitField0_ |= 0x00000001; + return this; + } + /** + * map<uint64, uint64> 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.PredefinedMapRuleEdition2023) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.PredefinedMapRuleEdition2023) + private static final build.buf.validate.conformance.cases.PredefinedMapRuleEdition2023 DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.PredefinedMapRuleEdition2023(); + } + + public static build.buf.validate.conformance.cases.PredefinedMapRuleEdition2023 getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PredefinedMapRuleEdition2023 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.PredefinedMapRuleEdition2023 getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedMapRuleEdition2023OrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedMapRuleEdition2023OrBuilder.java new file mode 100644 index 00000000..6bf4ae85 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedMapRuleEdition2023OrBuilder.java @@ -0,0 +1,43 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/predefined_rules_proto_editions.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +public interface PredefinedMapRuleEdition2023OrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.PredefinedMapRuleEdition2023) + com.google.protobuf.MessageOrBuilder { + + /** + * map<uint64, uint64> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + int getValCount(); + /** + * map<uint64, uint64> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + boolean containsVal( + long key); + /** + * Use {@link #getValMap()} instead. + */ + @java.lang.Deprecated + java.util.Map + getVal(); + /** + * map<uint64, uint64> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + java.util.Map + getValMap(); + /** + * map<uint64, uint64> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + long getValOrDefault( + long key, + long defaultValue); + /** + * map<uint64, uint64> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + long getValOrThrow( + long key); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedMapRuleProto3.java b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedMapRuleProto3.java new file mode 100644 index 00000000..355194c8 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedMapRuleProto3.java @@ -0,0 +1,640 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/predefined_rules_proto3.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.PredefinedMapRuleProto3} + */ +public final class PredefinedMapRuleProto3 extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.PredefinedMapRuleProto3) + PredefinedMapRuleProto3OrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 1, + /* suffix= */ "", + PredefinedMapRuleProto3.class.getName()); + } + // Use PredefinedMapRuleProto3.newBuilder() to construct. + private PredefinedMapRuleProto3(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private PredefinedMapRuleProto3() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.PredefinedRulesProto3Proto.internal_static_buf_validate_conformance_cases_PredefinedMapRuleProto3_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.PredefinedRulesProto3Proto.internal_static_buf_validate_conformance_cases_PredefinedMapRuleProto3_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.PredefinedMapRuleProto3.class, build.buf.validate.conformance.cases.PredefinedMapRuleProto3.Builder.class); + } + + public static final int VAL_FIELD_NUMBER = 1; + private static final class ValDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.Long, java.lang.Long> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + build.buf.validate.conformance.cases.PredefinedRulesProto3Proto.internal_static_buf_validate_conformance_cases_PredefinedMapRuleProto3_ValEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.UINT64, + 0L, + com.google.protobuf.WireFormat.FieldType.UINT64, + 0L); + } + @SuppressWarnings("serial") + private com.google.protobuf.MapField< + java.lang.Long, java.lang.Long> 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<uint64, uint64> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public boolean containsVal( + long key) { + + return internalGetVal().getMap().containsKey(key); + } + /** + * Use {@link #getValMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getVal() { + return getValMap(); + } + /** + * map<uint64, uint64> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public java.util.Map getValMap() { + return internalGetVal().getMap(); + } + /** + * map<uint64, uint64> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public long getValOrDefault( + long key, + long defaultValue) { + + java.util.Map map = + internalGetVal().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * map<uint64, uint64> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public long getValOrThrow( + long 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 + .serializeLongMapTo( + 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.PredefinedMapRuleProto3)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.PredefinedMapRuleProto3 other = (build.buf.validate.conformance.cases.PredefinedMapRuleProto3) 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.PredefinedMapRuleProto3 parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedMapRuleProto3 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.PredefinedMapRuleProto3 parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedMapRuleProto3 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.PredefinedMapRuleProto3 parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedMapRuleProto3 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.PredefinedMapRuleProto3 parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.PredefinedMapRuleProto3 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.PredefinedMapRuleProto3 parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.PredefinedMapRuleProto3 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.PredefinedMapRuleProto3 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.PredefinedMapRuleProto3 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.PredefinedMapRuleProto3 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.PredefinedMapRuleProto3} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.PredefinedMapRuleProto3) + build.buf.validate.conformance.cases.PredefinedMapRuleProto3OrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.PredefinedRulesProto3Proto.internal_static_buf_validate_conformance_cases_PredefinedMapRuleProto3_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.PredefinedRulesProto3Proto.internal_static_buf_validate_conformance_cases_PredefinedMapRuleProto3_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.PredefinedMapRuleProto3.class, build.buf.validate.conformance.cases.PredefinedMapRuleProto3.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.PredefinedMapRuleProto3.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.PredefinedRulesProto3Proto.internal_static_buf_validate_conformance_cases_PredefinedMapRuleProto3_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedMapRuleProto3 getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.PredefinedMapRuleProto3.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedMapRuleProto3 build() { + build.buf.validate.conformance.cases.PredefinedMapRuleProto3 result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedMapRuleProto3 buildPartial() { + build.buf.validate.conformance.cases.PredefinedMapRuleProto3 result = new build.buf.validate.conformance.cases.PredefinedMapRuleProto3(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.PredefinedMapRuleProto3 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.PredefinedMapRuleProto3) { + return mergeFrom((build.buf.validate.conformance.cases.PredefinedMapRuleProto3)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.PredefinedMapRuleProto3 other) { + if (other == build.buf.validate.conformance.cases.PredefinedMapRuleProto3.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.Long, java.lang.Long> 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<uint64, uint64> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public boolean containsVal( + long key) { + + return internalGetVal().getMap().containsKey(key); + } + /** + * Use {@link #getValMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getVal() { + return getValMap(); + } + /** + * map<uint64, uint64> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public java.util.Map getValMap() { + return internalGetVal().getMap(); + } + /** + * map<uint64, uint64> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public long getValOrDefault( + long key, + long defaultValue) { + + java.util.Map map = + internalGetVal().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * map<uint64, uint64> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public long getValOrThrow( + long 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<uint64, uint64> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder removeVal( + long 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<uint64, uint64> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder putVal( + long key, + long value) { + + + internalGetMutableVal().getMutableMap() + .put(key, value); + bitField0_ |= 0x00000001; + return this; + } + /** + * map<uint64, uint64> 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.PredefinedMapRuleProto3) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.PredefinedMapRuleProto3) + private static final build.buf.validate.conformance.cases.PredefinedMapRuleProto3 DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.PredefinedMapRuleProto3(); + } + + public static build.buf.validate.conformance.cases.PredefinedMapRuleProto3 getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PredefinedMapRuleProto3 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.PredefinedMapRuleProto3 getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedMapRuleProto3OrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedMapRuleProto3OrBuilder.java new file mode 100644 index 00000000..94eba758 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedMapRuleProto3OrBuilder.java @@ -0,0 +1,43 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/predefined_rules_proto3.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +public interface PredefinedMapRuleProto3OrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.PredefinedMapRuleProto3) + com.google.protobuf.MessageOrBuilder { + + /** + * map<uint64, uint64> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + int getValCount(); + /** + * map<uint64, uint64> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + boolean containsVal( + long key); + /** + * Use {@link #getValMap()} instead. + */ + @java.lang.Deprecated + java.util.Map + getVal(); + /** + * map<uint64, uint64> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + java.util.Map + getValMap(); + /** + * map<uint64, uint64> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + long getValOrDefault( + long key, + long defaultValue); + /** + * map<uint64, uint64> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + long getValOrThrow( + long key); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedRepeatedRuleEdition2023.java b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedRepeatedRuleEdition2023.java new file mode 100644 index 00000000..303c54d7 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedRepeatedRuleEdition2023.java @@ -0,0 +1,540 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/predefined_rules_proto_editions.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.PredefinedRepeatedRuleEdition2023} + */ +public final class PredefinedRepeatedRuleEdition2023 extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.PredefinedRepeatedRuleEdition2023) + PredefinedRepeatedRuleEdition2023OrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 1, + /* suffix= */ "", + PredefinedRepeatedRuleEdition2023.class.getName()); + } + // Use PredefinedRepeatedRuleEdition2023.newBuilder() to construct. + private PredefinedRepeatedRuleEdition2023(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private PredefinedRepeatedRuleEdition2023() { + val_ = emptyLongList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.internal_static_buf_validate_conformance_cases_PredefinedRepeatedRuleEdition2023_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.internal_static_buf_validate_conformance_cases_PredefinedRepeatedRuleEdition2023_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.PredefinedRepeatedRuleEdition2023.class, build.buf.validate.conformance.cases.PredefinedRepeatedRuleEdition2023.Builder.class); + } + + public static final int VAL_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private com.google.protobuf.Internal.LongList val_ = + emptyLongList(); + /** + * repeated uint64 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return A list containing the val. + */ + @java.lang.Override + public java.util.List + getValList() { + return val_; + } + /** + * repeated uint64 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The count of val. + */ + public int getValCount() { + return val_.size(); + } + /** + * repeated uint64 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 long getVal(int index) { + return val_.getLong(index); + } + private int valMemoizedSerializedSize = -1; + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + getSerializedSize(); + if (getValList().size() > 0) { + output.writeUInt32NoTag(10); + output.writeUInt32NoTag(valMemoizedSerializedSize); + } + for (int i = 0; i < val_.size(); i++) { + output.writeUInt64NoTag(val_.getLong(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + for (int i = 0; i < val_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream + .computeUInt64SizeNoTag(val_.getLong(i)); + } + size += dataSize; + if (!getValList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream + .computeInt32SizeNoTag(dataSize); + } + valMemoizedSerializedSize = dataSize; + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof build.buf.validate.conformance.cases.PredefinedRepeatedRuleEdition2023)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.PredefinedRepeatedRuleEdition2023 other = (build.buf.validate.conformance.cases.PredefinedRepeatedRuleEdition2023) 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.PredefinedRepeatedRuleEdition2023 parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedRepeatedRuleEdition2023 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.PredefinedRepeatedRuleEdition2023 parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedRepeatedRuleEdition2023 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.PredefinedRepeatedRuleEdition2023 parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedRepeatedRuleEdition2023 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.PredefinedRepeatedRuleEdition2023 parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.PredefinedRepeatedRuleEdition2023 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.PredefinedRepeatedRuleEdition2023 parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.PredefinedRepeatedRuleEdition2023 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.PredefinedRepeatedRuleEdition2023 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.PredefinedRepeatedRuleEdition2023 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.PredefinedRepeatedRuleEdition2023 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.PredefinedRepeatedRuleEdition2023} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.PredefinedRepeatedRuleEdition2023) + build.buf.validate.conformance.cases.PredefinedRepeatedRuleEdition2023OrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.internal_static_buf_validate_conformance_cases_PredefinedRepeatedRuleEdition2023_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.internal_static_buf_validate_conformance_cases_PredefinedRepeatedRuleEdition2023_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.PredefinedRepeatedRuleEdition2023.class, build.buf.validate.conformance.cases.PredefinedRepeatedRuleEdition2023.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.PredefinedRepeatedRuleEdition2023.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + val_ = emptyLongList(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.internal_static_buf_validate_conformance_cases_PredefinedRepeatedRuleEdition2023_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedRepeatedRuleEdition2023 getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.PredefinedRepeatedRuleEdition2023.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedRepeatedRuleEdition2023 build() { + build.buf.validate.conformance.cases.PredefinedRepeatedRuleEdition2023 result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedRepeatedRuleEdition2023 buildPartial() { + build.buf.validate.conformance.cases.PredefinedRepeatedRuleEdition2023 result = new build.buf.validate.conformance.cases.PredefinedRepeatedRuleEdition2023(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.PredefinedRepeatedRuleEdition2023 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.PredefinedRepeatedRuleEdition2023) { + return mergeFrom((build.buf.validate.conformance.cases.PredefinedRepeatedRuleEdition2023)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.PredefinedRepeatedRuleEdition2023 other) { + if (other == build.buf.validate.conformance.cases.PredefinedRepeatedRuleEdition2023.getDefaultInstance()) return this; + if (!other.val_.isEmpty()) { + if (val_.isEmpty()) { + val_ = other.val_; + val_.makeImmutable(); + bitField0_ |= 0x00000001; + } else { + ensureValIsMutable(); + val_.addAll(other.val_); + } + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + long v = input.readUInt64(); + ensureValIsMutable(); + val_.addLong(v); + break; + } // case 8 + case 10: { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + ensureValIsMutable(); + while (input.getBytesUntilLimit() > 0) { + val_.addLong(input.readUInt64()); + } + input.popLimit(limit); + break; + } // case 10 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private com.google.protobuf.Internal.LongList val_ = emptyLongList(); + private void ensureValIsMutable() { + if (!val_.isModifiable()) { + val_ = makeMutableCopy(val_); + } + bitField0_ |= 0x00000001; + } + /** + * repeated uint64 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return A list containing the val. + */ + public java.util.List + getValList() { + val_.makeImmutable(); + return val_; + } + /** + * repeated uint64 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The count of val. + */ + public int getValCount() { + return val_.size(); + } + /** + * repeated uint64 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 long getVal(int index) { + return val_.getLong(index); + } + /** + * repeated uint64 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, long value) { + + ensureValIsMutable(); + val_.setLong(index, value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * repeated uint64 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param value The val to add. + * @return This builder for chaining. + */ + public Builder addVal(long value) { + + ensureValIsMutable(); + val_.addLong(value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * repeated uint64 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 uint64 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return This builder for chaining. + */ + public Builder clearVal() { + val_ = emptyLongList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.PredefinedRepeatedRuleEdition2023) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.PredefinedRepeatedRuleEdition2023) + private static final build.buf.validate.conformance.cases.PredefinedRepeatedRuleEdition2023 DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.PredefinedRepeatedRuleEdition2023(); + } + + public static build.buf.validate.conformance.cases.PredefinedRepeatedRuleEdition2023 getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PredefinedRepeatedRuleEdition2023 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.PredefinedRepeatedRuleEdition2023 getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedRepeatedRuleEdition2023OrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedRepeatedRuleEdition2023OrBuilder.java new file mode 100644 index 00000000..998440bf --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedRepeatedRuleEdition2023OrBuilder.java @@ -0,0 +1,28 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/predefined_rules_proto_editions.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +public interface PredefinedRepeatedRuleEdition2023OrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.PredefinedRepeatedRuleEdition2023) + com.google.protobuf.MessageOrBuilder { + + /** + * repeated uint64 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return A list containing the val. + */ + java.util.List getValList(); + /** + * repeated uint64 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The count of val. + */ + int getValCount(); + /** + * repeated uint64 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param index The index of the element to return. + * @return The val at the given index. + */ + long getVal(int index); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedRepeatedRuleProto2.java b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedRepeatedRuleProto2.java new file mode 100644 index 00000000..eb549ae1 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedRepeatedRuleProto2.java @@ -0,0 +1,529 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/predefined_rules_proto2.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.PredefinedRepeatedRuleProto2} + */ +public final class PredefinedRepeatedRuleProto2 extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.PredefinedRepeatedRuleProto2) + PredefinedRepeatedRuleProto2OrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 1, + /* suffix= */ "", + PredefinedRepeatedRuleProto2.class.getName()); + } + // Use PredefinedRepeatedRuleProto2.newBuilder() to construct. + private PredefinedRepeatedRuleProto2(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private PredefinedRepeatedRuleProto2() { + val_ = emptyLongList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.internal_static_buf_validate_conformance_cases_PredefinedRepeatedRuleProto2_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.internal_static_buf_validate_conformance_cases_PredefinedRepeatedRuleProto2_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.PredefinedRepeatedRuleProto2.class, build.buf.validate.conformance.cases.PredefinedRepeatedRuleProto2.Builder.class); + } + + public static final int VAL_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private com.google.protobuf.Internal.LongList val_ = + emptyLongList(); + /** + * repeated uint64 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return A list containing the val. + */ + @java.lang.Override + public java.util.List + getValList() { + return val_; + } + /** + * repeated uint64 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The count of val. + */ + public int getValCount() { + return val_.size(); + } + /** + * repeated uint64 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 long getVal(int index) { + return val_.getLong(index); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + for (int i = 0; i < val_.size(); i++) { + output.writeUInt64(1, val_.getLong(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + for (int i = 0; i < val_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream + .computeUInt64SizeNoTag(val_.getLong(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.PredefinedRepeatedRuleProto2)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.PredefinedRepeatedRuleProto2 other = (build.buf.validate.conformance.cases.PredefinedRepeatedRuleProto2) 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.PredefinedRepeatedRuleProto2 parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedRepeatedRuleProto2 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.PredefinedRepeatedRuleProto2 parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedRepeatedRuleProto2 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.PredefinedRepeatedRuleProto2 parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedRepeatedRuleProto2 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.PredefinedRepeatedRuleProto2 parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.PredefinedRepeatedRuleProto2 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.PredefinedRepeatedRuleProto2 parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.PredefinedRepeatedRuleProto2 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.PredefinedRepeatedRuleProto2 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.PredefinedRepeatedRuleProto2 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.PredefinedRepeatedRuleProto2 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.PredefinedRepeatedRuleProto2} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.PredefinedRepeatedRuleProto2) + build.buf.validate.conformance.cases.PredefinedRepeatedRuleProto2OrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.internal_static_buf_validate_conformance_cases_PredefinedRepeatedRuleProto2_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.internal_static_buf_validate_conformance_cases_PredefinedRepeatedRuleProto2_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.PredefinedRepeatedRuleProto2.class, build.buf.validate.conformance.cases.PredefinedRepeatedRuleProto2.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.PredefinedRepeatedRuleProto2.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + val_ = emptyLongList(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.internal_static_buf_validate_conformance_cases_PredefinedRepeatedRuleProto2_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedRepeatedRuleProto2 getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.PredefinedRepeatedRuleProto2.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedRepeatedRuleProto2 build() { + build.buf.validate.conformance.cases.PredefinedRepeatedRuleProto2 result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedRepeatedRuleProto2 buildPartial() { + build.buf.validate.conformance.cases.PredefinedRepeatedRuleProto2 result = new build.buf.validate.conformance.cases.PredefinedRepeatedRuleProto2(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.PredefinedRepeatedRuleProto2 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.PredefinedRepeatedRuleProto2) { + return mergeFrom((build.buf.validate.conformance.cases.PredefinedRepeatedRuleProto2)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.PredefinedRepeatedRuleProto2 other) { + if (other == build.buf.validate.conformance.cases.PredefinedRepeatedRuleProto2.getDefaultInstance()) return this; + if (!other.val_.isEmpty()) { + if (val_.isEmpty()) { + val_ = other.val_; + val_.makeImmutable(); + bitField0_ |= 0x00000001; + } else { + ensureValIsMutable(); + val_.addAll(other.val_); + } + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + long v = input.readUInt64(); + ensureValIsMutable(); + val_.addLong(v); + break; + } // case 8 + case 10: { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + ensureValIsMutable(); + while (input.getBytesUntilLimit() > 0) { + val_.addLong(input.readUInt64()); + } + input.popLimit(limit); + break; + } // case 10 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private com.google.protobuf.Internal.LongList val_ = emptyLongList(); + private void ensureValIsMutable() { + if (!val_.isModifiable()) { + val_ = makeMutableCopy(val_); + } + bitField0_ |= 0x00000001; + } + /** + * repeated uint64 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return A list containing the val. + */ + public java.util.List + getValList() { + val_.makeImmutable(); + return val_; + } + /** + * repeated uint64 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The count of val. + */ + public int getValCount() { + return val_.size(); + } + /** + * repeated uint64 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 long getVal(int index) { + return val_.getLong(index); + } + /** + * repeated uint64 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, long value) { + + ensureValIsMutable(); + val_.setLong(index, value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * repeated uint64 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param value The val to add. + * @return This builder for chaining. + */ + public Builder addVal(long value) { + + ensureValIsMutable(); + val_.addLong(value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * repeated uint64 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 uint64 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return This builder for chaining. + */ + public Builder clearVal() { + val_ = emptyLongList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.PredefinedRepeatedRuleProto2) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.PredefinedRepeatedRuleProto2) + private static final build.buf.validate.conformance.cases.PredefinedRepeatedRuleProto2 DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.PredefinedRepeatedRuleProto2(); + } + + public static build.buf.validate.conformance.cases.PredefinedRepeatedRuleProto2 getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PredefinedRepeatedRuleProto2 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.PredefinedRepeatedRuleProto2 getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedRepeatedRuleProto2OrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedRepeatedRuleProto2OrBuilder.java new file mode 100644 index 00000000..9ddabd5e --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedRepeatedRuleProto2OrBuilder.java @@ -0,0 +1,28 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/predefined_rules_proto2.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +public interface PredefinedRepeatedRuleProto2OrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.PredefinedRepeatedRuleProto2) + com.google.protobuf.MessageOrBuilder { + + /** + * repeated uint64 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return A list containing the val. + */ + java.util.List getValList(); + /** + * repeated uint64 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The count of val. + */ + int getValCount(); + /** + * repeated uint64 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param index The index of the element to return. + * @return The val at the given index. + */ + long getVal(int index); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedRepeatedRuleProto3.java b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedRepeatedRuleProto3.java new file mode 100644 index 00000000..2e5e5a7a --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedRepeatedRuleProto3.java @@ -0,0 +1,540 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/predefined_rules_proto3.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.PredefinedRepeatedRuleProto3} + */ +public final class PredefinedRepeatedRuleProto3 extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.PredefinedRepeatedRuleProto3) + PredefinedRepeatedRuleProto3OrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 1, + /* suffix= */ "", + PredefinedRepeatedRuleProto3.class.getName()); + } + // Use PredefinedRepeatedRuleProto3.newBuilder() to construct. + private PredefinedRepeatedRuleProto3(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private PredefinedRepeatedRuleProto3() { + val_ = emptyLongList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.PredefinedRulesProto3Proto.internal_static_buf_validate_conformance_cases_PredefinedRepeatedRuleProto3_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.PredefinedRulesProto3Proto.internal_static_buf_validate_conformance_cases_PredefinedRepeatedRuleProto3_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.PredefinedRepeatedRuleProto3.class, build.buf.validate.conformance.cases.PredefinedRepeatedRuleProto3.Builder.class); + } + + public static final int VAL_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private com.google.protobuf.Internal.LongList val_ = + emptyLongList(); + /** + * repeated uint64 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return A list containing the val. + */ + @java.lang.Override + public java.util.List + getValList() { + return val_; + } + /** + * repeated uint64 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The count of val. + */ + public int getValCount() { + return val_.size(); + } + /** + * repeated uint64 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 long getVal(int index) { + return val_.getLong(index); + } + private int valMemoizedSerializedSize = -1; + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + getSerializedSize(); + if (getValList().size() > 0) { + output.writeUInt32NoTag(10); + output.writeUInt32NoTag(valMemoizedSerializedSize); + } + for (int i = 0; i < val_.size(); i++) { + output.writeUInt64NoTag(val_.getLong(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + for (int i = 0; i < val_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream + .computeUInt64SizeNoTag(val_.getLong(i)); + } + size += dataSize; + if (!getValList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream + .computeInt32SizeNoTag(dataSize); + } + valMemoizedSerializedSize = dataSize; + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof build.buf.validate.conformance.cases.PredefinedRepeatedRuleProto3)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.PredefinedRepeatedRuleProto3 other = (build.buf.validate.conformance.cases.PredefinedRepeatedRuleProto3) 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.PredefinedRepeatedRuleProto3 parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedRepeatedRuleProto3 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.PredefinedRepeatedRuleProto3 parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedRepeatedRuleProto3 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.PredefinedRepeatedRuleProto3 parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedRepeatedRuleProto3 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.PredefinedRepeatedRuleProto3 parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.PredefinedRepeatedRuleProto3 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.PredefinedRepeatedRuleProto3 parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.PredefinedRepeatedRuleProto3 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.PredefinedRepeatedRuleProto3 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.PredefinedRepeatedRuleProto3 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.PredefinedRepeatedRuleProto3 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.PredefinedRepeatedRuleProto3} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.PredefinedRepeatedRuleProto3) + build.buf.validate.conformance.cases.PredefinedRepeatedRuleProto3OrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.PredefinedRulesProto3Proto.internal_static_buf_validate_conformance_cases_PredefinedRepeatedRuleProto3_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.PredefinedRulesProto3Proto.internal_static_buf_validate_conformance_cases_PredefinedRepeatedRuleProto3_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.PredefinedRepeatedRuleProto3.class, build.buf.validate.conformance.cases.PredefinedRepeatedRuleProto3.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.PredefinedRepeatedRuleProto3.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + val_ = emptyLongList(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.PredefinedRulesProto3Proto.internal_static_buf_validate_conformance_cases_PredefinedRepeatedRuleProto3_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedRepeatedRuleProto3 getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.PredefinedRepeatedRuleProto3.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedRepeatedRuleProto3 build() { + build.buf.validate.conformance.cases.PredefinedRepeatedRuleProto3 result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedRepeatedRuleProto3 buildPartial() { + build.buf.validate.conformance.cases.PredefinedRepeatedRuleProto3 result = new build.buf.validate.conformance.cases.PredefinedRepeatedRuleProto3(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.PredefinedRepeatedRuleProto3 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.PredefinedRepeatedRuleProto3) { + return mergeFrom((build.buf.validate.conformance.cases.PredefinedRepeatedRuleProto3)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.PredefinedRepeatedRuleProto3 other) { + if (other == build.buf.validate.conformance.cases.PredefinedRepeatedRuleProto3.getDefaultInstance()) return this; + if (!other.val_.isEmpty()) { + if (val_.isEmpty()) { + val_ = other.val_; + val_.makeImmutable(); + bitField0_ |= 0x00000001; + } else { + ensureValIsMutable(); + val_.addAll(other.val_); + } + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + long v = input.readUInt64(); + ensureValIsMutable(); + val_.addLong(v); + break; + } // case 8 + case 10: { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + ensureValIsMutable(); + while (input.getBytesUntilLimit() > 0) { + val_.addLong(input.readUInt64()); + } + input.popLimit(limit); + break; + } // case 10 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private com.google.protobuf.Internal.LongList val_ = emptyLongList(); + private void ensureValIsMutable() { + if (!val_.isModifiable()) { + val_ = makeMutableCopy(val_); + } + bitField0_ |= 0x00000001; + } + /** + * repeated uint64 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return A list containing the val. + */ + public java.util.List + getValList() { + val_.makeImmutable(); + return val_; + } + /** + * repeated uint64 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The count of val. + */ + public int getValCount() { + return val_.size(); + } + /** + * repeated uint64 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 long getVal(int index) { + return val_.getLong(index); + } + /** + * repeated uint64 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, long value) { + + ensureValIsMutable(); + val_.setLong(index, value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * repeated uint64 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param value The val to add. + * @return This builder for chaining. + */ + public Builder addVal(long value) { + + ensureValIsMutable(); + val_.addLong(value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * repeated uint64 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 uint64 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return This builder for chaining. + */ + public Builder clearVal() { + val_ = emptyLongList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.PredefinedRepeatedRuleProto3) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.PredefinedRepeatedRuleProto3) + private static final build.buf.validate.conformance.cases.PredefinedRepeatedRuleProto3 DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.PredefinedRepeatedRuleProto3(); + } + + public static build.buf.validate.conformance.cases.PredefinedRepeatedRuleProto3 getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PredefinedRepeatedRuleProto3 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.PredefinedRepeatedRuleProto3 getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedRepeatedRuleProto3OrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedRepeatedRuleProto3OrBuilder.java new file mode 100644 index 00000000..2aa3d5ec --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedRepeatedRuleProto3OrBuilder.java @@ -0,0 +1,28 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/predefined_rules_proto3.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +public interface PredefinedRepeatedRuleProto3OrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.PredefinedRepeatedRuleProto3) + com.google.protobuf.MessageOrBuilder { + + /** + * repeated uint64 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return A list containing the val. + */ + java.util.List getValList(); + /** + * repeated uint64 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The count of val. + */ + int getValCount(); + /** + * repeated uint64 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param index The index of the element to return. + * @return The val at the given index. + */ + long getVal(int index); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedRulesProto2Proto.java b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedRulesProto2Proto.java new file mode 100644 index 00000000..a0da49ca --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedRulesProto2Proto.java @@ -0,0 +1,705 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/predefined_rules_proto2.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +public final class PredefinedRulesProto2Proto { + private PredefinedRulesProto2Proto() {} + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 1, + /* suffix= */ "", + PredefinedRulesProto2Proto.class.getName()); + } + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + registry.add(build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.floatAbsRangeProto2); + registry.add(build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.doubleAbsRangeProto2); + registry.add(build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.int32EvenProto2); + registry.add(build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.int64EvenProto2); + registry.add(build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.uint32EvenProto2); + registry.add(build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.uint64EvenProto2); + registry.add(build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.sint32EvenProto2); + registry.add(build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.sint64EvenProto2); + registry.add(build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.fixed32EvenProto2); + registry.add(build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.fixed64EvenProto2); + registry.add(build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.sfixed32EvenProto2); + registry.add(build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.sfixed64EvenProto2); + registry.add(build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.boolFalseProto2); + registry.add(build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.stringValidPathProto2); + registry.add(build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.bytesValidPathProto2); + registry.add(build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.enumNonZeroProto2); + registry.add(build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.repeatedAtLeastFiveProto2); + registry.add(build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.durationTooLongProto2); + registry.add(build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.timestampInRangeProto2); + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public static final int FLOAT_ABS_RANGE_PROTO2_FIELD_NUMBER = 1161; + /** + * extend .buf.validate.FloatRules { ... } + */ + public static final + com.google.protobuf.GeneratedMessage.GeneratedExtension< + build.buf.validate.FloatRules, + java.lang.Float> floatAbsRangeProto2 = com.google.protobuf.GeneratedMessage + .newFileScopedGeneratedExtension( + java.lang.Float.class, + null); + public static final int DOUBLE_ABS_RANGE_PROTO2_FIELD_NUMBER = 1161; + /** + * extend .buf.validate.DoubleRules { ... } + */ + public static final + com.google.protobuf.GeneratedMessage.GeneratedExtension< + build.buf.validate.DoubleRules, + java.lang.Double> doubleAbsRangeProto2 = com.google.protobuf.GeneratedMessage + .newFileScopedGeneratedExtension( + java.lang.Double.class, + null); + public static final int INT32_EVEN_PROTO2_FIELD_NUMBER = 1161; + /** + * extend .buf.validate.Int32Rules { ... } + */ + public static final + com.google.protobuf.GeneratedMessage.GeneratedExtension< + build.buf.validate.Int32Rules, + java.lang.Boolean> int32EvenProto2 = com.google.protobuf.GeneratedMessage + .newFileScopedGeneratedExtension( + java.lang.Boolean.class, + null); + public static final int INT64_EVEN_PROTO2_FIELD_NUMBER = 1161; + /** + * extend .buf.validate.Int64Rules { ... } + */ + public static final + com.google.protobuf.GeneratedMessage.GeneratedExtension< + build.buf.validate.Int64Rules, + java.lang.Boolean> int64EvenProto2 = com.google.protobuf.GeneratedMessage + .newFileScopedGeneratedExtension( + java.lang.Boolean.class, + null); + public static final int UINT32_EVEN_PROTO2_FIELD_NUMBER = 1161; + /** + * extend .buf.validate.UInt32Rules { ... } + */ + public static final + com.google.protobuf.GeneratedMessage.GeneratedExtension< + build.buf.validate.UInt32Rules, + java.lang.Boolean> uint32EvenProto2 = com.google.protobuf.GeneratedMessage + .newFileScopedGeneratedExtension( + java.lang.Boolean.class, + null); + public static final int UINT64_EVEN_PROTO2_FIELD_NUMBER = 1161; + /** + * extend .buf.validate.UInt64Rules { ... } + */ + public static final + com.google.protobuf.GeneratedMessage.GeneratedExtension< + build.buf.validate.UInt64Rules, + java.lang.Boolean> uint64EvenProto2 = com.google.protobuf.GeneratedMessage + .newFileScopedGeneratedExtension( + java.lang.Boolean.class, + null); + public static final int SINT32_EVEN_PROTO2_FIELD_NUMBER = 1161; + /** + * extend .buf.validate.SInt32Rules { ... } + */ + public static final + com.google.protobuf.GeneratedMessage.GeneratedExtension< + build.buf.validate.SInt32Rules, + java.lang.Boolean> sint32EvenProto2 = com.google.protobuf.GeneratedMessage + .newFileScopedGeneratedExtension( + java.lang.Boolean.class, + null); + public static final int SINT64_EVEN_PROTO2_FIELD_NUMBER = 1161; + /** + * extend .buf.validate.SInt64Rules { ... } + */ + public static final + com.google.protobuf.GeneratedMessage.GeneratedExtension< + build.buf.validate.SInt64Rules, + java.lang.Boolean> sint64EvenProto2 = com.google.protobuf.GeneratedMessage + .newFileScopedGeneratedExtension( + java.lang.Boolean.class, + null); + public static final int FIXED32_EVEN_PROTO2_FIELD_NUMBER = 1161; + /** + * extend .buf.validate.Fixed32Rules { ... } + */ + public static final + com.google.protobuf.GeneratedMessage.GeneratedExtension< + build.buf.validate.Fixed32Rules, + java.lang.Boolean> fixed32EvenProto2 = com.google.protobuf.GeneratedMessage + .newFileScopedGeneratedExtension( + java.lang.Boolean.class, + null); + public static final int FIXED64_EVEN_PROTO2_FIELD_NUMBER = 1161; + /** + * extend .buf.validate.Fixed64Rules { ... } + */ + public static final + com.google.protobuf.GeneratedMessage.GeneratedExtension< + build.buf.validate.Fixed64Rules, + java.lang.Boolean> fixed64EvenProto2 = com.google.protobuf.GeneratedMessage + .newFileScopedGeneratedExtension( + java.lang.Boolean.class, + null); + public static final int SFIXED32_EVEN_PROTO2_FIELD_NUMBER = 1161; + /** + * extend .buf.validate.SFixed32Rules { ... } + */ + public static final + com.google.protobuf.GeneratedMessage.GeneratedExtension< + build.buf.validate.SFixed32Rules, + java.lang.Boolean> sfixed32EvenProto2 = com.google.protobuf.GeneratedMessage + .newFileScopedGeneratedExtension( + java.lang.Boolean.class, + null); + public static final int SFIXED64_EVEN_PROTO2_FIELD_NUMBER = 1161; + /** + * extend .buf.validate.SFixed64Rules { ... } + */ + public static final + com.google.protobuf.GeneratedMessage.GeneratedExtension< + build.buf.validate.SFixed64Rules, + java.lang.Boolean> sfixed64EvenProto2 = com.google.protobuf.GeneratedMessage + .newFileScopedGeneratedExtension( + java.lang.Boolean.class, + null); + public static final int BOOL_FALSE_PROTO2_FIELD_NUMBER = 1161; + /** + * extend .buf.validate.BoolRules { ... } + */ + public static final + com.google.protobuf.GeneratedMessage.GeneratedExtension< + build.buf.validate.BoolRules, + java.lang.Boolean> boolFalseProto2 = com.google.protobuf.GeneratedMessage + .newFileScopedGeneratedExtension( + java.lang.Boolean.class, + null); + public static final int STRING_VALID_PATH_PROTO2_FIELD_NUMBER = 1161; + /** + * extend .buf.validate.StringRules { ... } + */ + public static final + com.google.protobuf.GeneratedMessage.GeneratedExtension< + build.buf.validate.StringRules, + java.lang.Boolean> stringValidPathProto2 = com.google.protobuf.GeneratedMessage + .newFileScopedGeneratedExtension( + java.lang.Boolean.class, + null); + public static final int BYTES_VALID_PATH_PROTO2_FIELD_NUMBER = 1161; + /** + * extend .buf.validate.BytesRules { ... } + */ + public static final + com.google.protobuf.GeneratedMessage.GeneratedExtension< + build.buf.validate.BytesRules, + java.lang.Boolean> bytesValidPathProto2 = com.google.protobuf.GeneratedMessage + .newFileScopedGeneratedExtension( + java.lang.Boolean.class, + null); + public static final int ENUM_NON_ZERO_PROTO2_FIELD_NUMBER = 1161; + /** + * extend .buf.validate.EnumRules { ... } + */ + public static final + com.google.protobuf.GeneratedMessage.GeneratedExtension< + build.buf.validate.EnumRules, + java.lang.Boolean> enumNonZeroProto2 = com.google.protobuf.GeneratedMessage + .newFileScopedGeneratedExtension( + java.lang.Boolean.class, + null); + public static final int REPEATED_AT_LEAST_FIVE_PROTO2_FIELD_NUMBER = 1161; + /** + * extend .buf.validate.RepeatedRules { ... } + */ + public static final + com.google.protobuf.GeneratedMessage.GeneratedExtension< + build.buf.validate.RepeatedRules, + java.lang.Boolean> repeatedAtLeastFiveProto2 = com.google.protobuf.GeneratedMessage + .newFileScopedGeneratedExtension( + java.lang.Boolean.class, + null); + public static final int DURATION_TOO_LONG_PROTO2_FIELD_NUMBER = 1161; + /** + * extend .buf.validate.DurationRules { ... } + */ + public static final + com.google.protobuf.GeneratedMessage.GeneratedExtension< + build.buf.validate.DurationRules, + java.lang.Boolean> durationTooLongProto2 = com.google.protobuf.GeneratedMessage + .newFileScopedGeneratedExtension( + java.lang.Boolean.class, + null); + public static final int TIMESTAMP_IN_RANGE_PROTO2_FIELD_NUMBER = 1161; + /** + * extend .buf.validate.TimestampRules { ... } + */ + public static final + com.google.protobuf.GeneratedMessage.GeneratedExtension< + build.buf.validate.TimestampRules, + java.lang.Boolean> timestampInRangeProto2 = com.google.protobuf.GeneratedMessage + .newFileScopedGeneratedExtension( + java.lang.Boolean.class, + null); + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_PredefinedFloatRuleProto2_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_conformance_cases_PredefinedFloatRuleProto2_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_PredefinedDoubleRuleProto2_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_conformance_cases_PredefinedDoubleRuleProto2_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_PredefinedInt32RuleProto2_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_conformance_cases_PredefinedInt32RuleProto2_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_PredefinedInt64RuleProto2_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_conformance_cases_PredefinedInt64RuleProto2_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_PredefinedUInt32RuleProto2_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_conformance_cases_PredefinedUInt32RuleProto2_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_PredefinedUInt64RuleProto2_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_conformance_cases_PredefinedUInt64RuleProto2_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_PredefinedSInt32RuleProto2_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_conformance_cases_PredefinedSInt32RuleProto2_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_PredefinedSInt64RuleProto2_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_conformance_cases_PredefinedSInt64RuleProto2_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_PredefinedFixed32RuleProto2_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_conformance_cases_PredefinedFixed32RuleProto2_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_PredefinedFixed64RuleProto2_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_conformance_cases_PredefinedFixed64RuleProto2_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_PredefinedSFixed32RuleProto2_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_conformance_cases_PredefinedSFixed32RuleProto2_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_PredefinedSFixed64RuleProto2_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_conformance_cases_PredefinedSFixed64RuleProto2_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_PredefinedBoolRuleProto2_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_conformance_cases_PredefinedBoolRuleProto2_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_PredefinedStringRuleProto2_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_conformance_cases_PredefinedStringRuleProto2_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_PredefinedBytesRuleProto2_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_conformance_cases_PredefinedBytesRuleProto2_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_PredefinedEnumRuleProto2_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_conformance_cases_PredefinedEnumRuleProto2_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_PredefinedRepeatedRuleProto2_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_conformance_cases_PredefinedRepeatedRuleProto2_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_PredefinedDurationRuleProto2_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_conformance_cases_PredefinedDurationRuleProto2_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_PredefinedTimestampRuleProto2_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_conformance_cases_PredefinedTimestampRuleProto2_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_PredefinedAndCustomRuleProto2_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_conformance_cases_PredefinedAndCustomRuleProto2_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_PredefinedAndCustomRuleProto2_Nested_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_conformance_cases_PredefinedAndCustomRuleProto2_Nested_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_StandardPredefinedAndCustomRuleProto2_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_conformance_cases_StandardPredefinedAndCustomRuleProto2_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n 24 ? \'\' : \'a must be greater" + + " than 24\'R\001a\022\264\001\n\001b\030\002 \001(\0132D.buf.validate." + + "conformance.cases.PredefinedAndCustomRul" + + "eProto2.NestedB`\272H]\272\001Z\n*predefined_and_c" + + "ustom_rule_embedded_proto2\022\033b.c must be " + + "a multiple of 3\032\017this.c % 3 == 0R\001b\032s\n\006N" + + "ested\022i\n\001c\030\001 \001(\005B[\272HX\032\003\310H\001\272\001P\n(predefine" + + "d_and_custom_rule_nested_proto2\032$this > " + + "0 ? \'\' : \'c must be positive\'R\001c\"\245\001\n%Sta" + + "ndardPredefinedAndCustomRuleProto2\022|\n\001a\030" + + "\001 \001(\005Bn\272Hk\032\005\020\034\310H\001\272\001a\n1standard_predefine" + + "d_and_custom_rule_scalar_proto2\032,this > " + + "24 ? \'\' : \'a must be greater than 24\'R\001a" + + ":\251\001\n\026float_abs_range_proto2\022\030.buf.valida" + + "te.FloatRules\030\211\t \001(\002BY\302HV\nT\n\026float.abs_r" + + "ange.proto2\022\033float value is out of range" + + "\032\035this >= -rule && this <= ruleR\023floatAb" + + "sRangeProto2:\256\001\n\027double_abs_range_proto2" + + "\022\031.buf.validate.DoubleRules\030\211\t \001(\001B[\302HX\n" + + "V\n\027double.abs_range.proto2\022\034double value" + + " is out of range\032\035this >= -rule && this " + + "<= ruleR\024doubleAbsRangeProto2:\207\001\n\021int32_" + + "even_proto2\022\030.buf.validate.Int32Rules\030\211\t" + + " \001(\010B@\302H=\n;\n\021int32.even.proto2\022\027int32 va" + + "lue is not even\032\rthis % 2 == 0R\017int32Eve" + + "nProto2:\207\001\n\021int64_even_proto2\022\030.buf.vali" + + "date.Int64Rules\030\211\t \001(\010B@\302H=\n;\n\021int64.eve" + + "n.proto2\022\027int64 value is not even\032\rthis " + + "% 2 == 0R\017int64EvenProto2:\216\001\n\022uint32_eve" + + "n_proto2\022\031.buf.validate.UInt32Rules\030\211\t \001" + + "(\010BD\302HA\n?\n\022uint32.even.proto2\022\030uint32 va" + + "lue is not even\032\017this % 2u == 0uR\020uint32" + + "EvenProto2:\216\001\n\022uint64_even_proto2\022\031.buf." + + "validate.UInt64Rules\030\211\t \001(\010BD\302HA\n?\n\022uint" + + "64.even.proto2\022\030uint64 value is not even" + + "\032\017this % 2u == 0uR\020uint64EvenProto2:\214\001\n\022" + + "sint32_even_proto2\022\031.buf.validate.SInt32" + + "Rules\030\211\t \001(\010BB\302H?\n=\n\022sint32.even.proto2\022" + + "\030sint32 value is not even\032\rthis % 2 == 0" + + "R\020sint32EvenProto2:\214\001\n\022sint64_even_proto" + + "2\022\031.buf.validate.SInt64Rules\030\211\t \001(\010BB\302H?" + + "\n=\n\022sint64.even.proto2\022\030sint64 value is " + + "not even\032\rthis % 2 == 0R\020sint64EvenProto" + + "2:\223\001\n\023fixed32_even_proto2\022\032.buf.validate" + + ".Fixed32Rules\030\211\t \001(\010BF\302HC\nA\n\023fixed32.eve" + + "n.proto2\022\031fixed32 value is not even\032\017thi" + + "s % 2u == 0uR\021fixed32EvenProto2:\223\001\n\023fixe" + + "d64_even_proto2\022\032.buf.validate.Fixed64Ru" + + "les\030\211\t \001(\010BF\302HC\nA\n\023fixed64.even.proto2\022\031" + + "fixed64 value is not even\032\017this % 2u == " + + "0uR\021fixed64EvenProto2:\226\001\n\024sfixed32_even_" + + "proto2\022\033.buf.validate.SFixed32Rules\030\211\t \001" + + "(\010BF\302HC\nA\n\024sfixed32.even.proto2\022\032sfixed3" + + "2 value is not even\032\rthis % 2 == 0R\022sfix" + + "ed32EvenProto2:\226\001\n\024sfixed64_even_proto2\022" + + "\033.buf.validate.SFixed64Rules\030\211\t \001(\010BF\302HC" + + "\nA\n\024sfixed64.even.proto2\022\032sfixed64 value" + + " is not even\032\rthis % 2 == 0R\022sfixed64Eve" + + "nProto2:\206\001\n\021bool_false_proto2\022\027.buf.vali" + + "date.BoolRules\030\211\t \001(\010B@\302H=\n;\n\021bool.false" + + ".proto2\022\027bool value is not false\032\rthis =" + + "= falseR\017boolFalseProto2:\376\001\n\030string_vali" + + "d_path_proto2\022\031.buf.validate.StringRules" + + "\030\211\t \001(\010B\250\001\302H\244\001\n\241\001\n\030string.valid_path.pro" + + "to2\032\204\001!this.matches(\'^([^/.][^/]?|[^/][^" + + "/.]|[^/]{3,})(/([^/.][^/]?|[^/][^/.]|[^/" + + "]{3,}))*$\') ? \'not a valid path: `%s`\'.f" + + "ormat([this]) : \'\'R\025stringValidPathProto" + + "2:\202\002\n\027bytes_valid_path_proto2\022\030.buf.vali" + + "date.BytesRules\030\211\t \001(\010B\257\001\302H\253\001\n\250\001\n\027bytes." + + "valid_path.proto2\032\214\001!string(this).matche" + + "s(\'^([^/.][^/]?|[^/][^/.]|[^/]{3,})(/([^" + + "/.][^/]?|[^/][^/.]|[^/]{3,}))*$\') ? \'not" + + " a valid path: `%s`\'.format([this]) : \'\'" + + "R\024bytesValidPathProto2:\222\001\n\024enum_non_zero" + + "_proto2\022\027.buf.validate.EnumRules\030\211\t \001(\010B" + + "G\302HD\nB\n\024enum.non_zero.proto2\022\032enum value" + + " is not non-zero\032\016int(this) != 0R\021enumNo" + + "nZeroProto2:\314\001\n\035repeated_at_least_five_p" + + "roto2\022\033.buf.validate.RepeatedRules\030\211\t \001(" + + "\010Bl\302Hi\ng\n\035repeated.at_least_five.proto2\022" + + "-repeated field must have at least five " + + "values\032\027uint(this.size()) >= 5uR\031repeate" + + "dAtLeastFiveProto2:\271\001\n\030duration_too_long" + + "_proto2\022\033.buf.validate.DurationRules\030\211\t " + + "\001(\010Bb\302H_\n]\n\030duration.too_long.proto2\022(du" + + "ration can\'t be longer than 10 seconds\032\027" + + "this <= duration(\'10s\')R\025durationTooLong" + + "Proto2:\310\001\n\031timestamp_in_range_proto2\022\034.b" + + "uf.validate.TimestampRules\030\211\t \001(\010Bn\302Hk\ni" + + "\n\033timestamp.time_range.proto2\022\026timestamp" + + " out of range\0322int(this) >= 1049587200 &" + + "& int(this) <= 1080432000R\026timestampInRa" + + "ngeProto2B\336\001\n$build.buf.validate.conform" + + "ance.casesB\032PredefinedRulesProto2ProtoP\001" + + "\242\002\004BVCC\252\002\036Buf.Validate.Conformance.Cases" + + "\312\002\036Buf\\Validate\\Conformance\\Cases\342\002*Buf\\" + + "Validate\\Conformance\\Cases\\GPBMetadata\352\002" + + "!Buf::Validate::Conformance::Cases" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + build.buf.validate.ValidateProto.getDescriptor(), + com.google.protobuf.DurationProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + }); + internal_static_buf_validate_conformance_cases_PredefinedFloatRuleProto2_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_buf_validate_conformance_cases_PredefinedFloatRuleProto2_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_PredefinedFloatRuleProto2_descriptor, + new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_PredefinedDoubleRuleProto2_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_buf_validate_conformance_cases_PredefinedDoubleRuleProto2_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_PredefinedDoubleRuleProto2_descriptor, + new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_PredefinedInt32RuleProto2_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_buf_validate_conformance_cases_PredefinedInt32RuleProto2_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_PredefinedInt32RuleProto2_descriptor, + new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_PredefinedInt64RuleProto2_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_buf_validate_conformance_cases_PredefinedInt64RuleProto2_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_PredefinedInt64RuleProto2_descriptor, + new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_PredefinedUInt32RuleProto2_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_buf_validate_conformance_cases_PredefinedUInt32RuleProto2_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_PredefinedUInt32RuleProto2_descriptor, + new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_PredefinedUInt64RuleProto2_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_buf_validate_conformance_cases_PredefinedUInt64RuleProto2_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_PredefinedUInt64RuleProto2_descriptor, + new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_PredefinedSInt32RuleProto2_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_buf_validate_conformance_cases_PredefinedSInt32RuleProto2_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_PredefinedSInt32RuleProto2_descriptor, + new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_PredefinedSInt64RuleProto2_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_buf_validate_conformance_cases_PredefinedSInt64RuleProto2_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_PredefinedSInt64RuleProto2_descriptor, + new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_PredefinedFixed32RuleProto2_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_buf_validate_conformance_cases_PredefinedFixed32RuleProto2_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_PredefinedFixed32RuleProto2_descriptor, + new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_PredefinedFixed64RuleProto2_descriptor = + getDescriptor().getMessageTypes().get(9); + internal_static_buf_validate_conformance_cases_PredefinedFixed64RuleProto2_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_PredefinedFixed64RuleProto2_descriptor, + new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_PredefinedSFixed32RuleProto2_descriptor = + getDescriptor().getMessageTypes().get(10); + internal_static_buf_validate_conformance_cases_PredefinedSFixed32RuleProto2_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_PredefinedSFixed32RuleProto2_descriptor, + new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_PredefinedSFixed64RuleProto2_descriptor = + getDescriptor().getMessageTypes().get(11); + internal_static_buf_validate_conformance_cases_PredefinedSFixed64RuleProto2_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_PredefinedSFixed64RuleProto2_descriptor, + new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_PredefinedBoolRuleProto2_descriptor = + getDescriptor().getMessageTypes().get(12); + internal_static_buf_validate_conformance_cases_PredefinedBoolRuleProto2_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_PredefinedBoolRuleProto2_descriptor, + new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_PredefinedStringRuleProto2_descriptor = + getDescriptor().getMessageTypes().get(13); + internal_static_buf_validate_conformance_cases_PredefinedStringRuleProto2_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_PredefinedStringRuleProto2_descriptor, + new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_PredefinedBytesRuleProto2_descriptor = + getDescriptor().getMessageTypes().get(14); + internal_static_buf_validate_conformance_cases_PredefinedBytesRuleProto2_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_PredefinedBytesRuleProto2_descriptor, + new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_PredefinedEnumRuleProto2_descriptor = + getDescriptor().getMessageTypes().get(15); + internal_static_buf_validate_conformance_cases_PredefinedEnumRuleProto2_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_PredefinedEnumRuleProto2_descriptor, + new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_PredefinedRepeatedRuleProto2_descriptor = + getDescriptor().getMessageTypes().get(16); + internal_static_buf_validate_conformance_cases_PredefinedRepeatedRuleProto2_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_PredefinedRepeatedRuleProto2_descriptor, + new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_PredefinedDurationRuleProto2_descriptor = + getDescriptor().getMessageTypes().get(17); + internal_static_buf_validate_conformance_cases_PredefinedDurationRuleProto2_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_PredefinedDurationRuleProto2_descriptor, + new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_PredefinedTimestampRuleProto2_descriptor = + getDescriptor().getMessageTypes().get(18); + internal_static_buf_validate_conformance_cases_PredefinedTimestampRuleProto2_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_PredefinedTimestampRuleProto2_descriptor, + new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_PredefinedAndCustomRuleProto2_descriptor = + getDescriptor().getMessageTypes().get(19); + internal_static_buf_validate_conformance_cases_PredefinedAndCustomRuleProto2_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_PredefinedAndCustomRuleProto2_descriptor, + new java.lang.String[] { "A", "B", }); + internal_static_buf_validate_conformance_cases_PredefinedAndCustomRuleProto2_Nested_descriptor = + internal_static_buf_validate_conformance_cases_PredefinedAndCustomRuleProto2_descriptor.getNestedTypes().get(0); + internal_static_buf_validate_conformance_cases_PredefinedAndCustomRuleProto2_Nested_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_PredefinedAndCustomRuleProto2_Nested_descriptor, + new java.lang.String[] { "C", }); + internal_static_buf_validate_conformance_cases_StandardPredefinedAndCustomRuleProto2_descriptor = + getDescriptor().getMessageTypes().get(20); + internal_static_buf_validate_conformance_cases_StandardPredefinedAndCustomRuleProto2_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_StandardPredefinedAndCustomRuleProto2_descriptor, + new java.lang.String[] { "A", }); + floatAbsRangeProto2.internalInit(descriptor.getExtensions().get(0)); + doubleAbsRangeProto2.internalInit(descriptor.getExtensions().get(1)); + int32EvenProto2.internalInit(descriptor.getExtensions().get(2)); + int64EvenProto2.internalInit(descriptor.getExtensions().get(3)); + uint32EvenProto2.internalInit(descriptor.getExtensions().get(4)); + uint64EvenProto2.internalInit(descriptor.getExtensions().get(5)); + sint32EvenProto2.internalInit(descriptor.getExtensions().get(6)); + sint64EvenProto2.internalInit(descriptor.getExtensions().get(7)); + fixed32EvenProto2.internalInit(descriptor.getExtensions().get(8)); + fixed64EvenProto2.internalInit(descriptor.getExtensions().get(9)); + sfixed32EvenProto2.internalInit(descriptor.getExtensions().get(10)); + sfixed64EvenProto2.internalInit(descriptor.getExtensions().get(11)); + boolFalseProto2.internalInit(descriptor.getExtensions().get(12)); + stringValidPathProto2.internalInit(descriptor.getExtensions().get(13)); + bytesValidPathProto2.internalInit(descriptor.getExtensions().get(14)); + enumNonZeroProto2.internalInit(descriptor.getExtensions().get(15)); + repeatedAtLeastFiveProto2.internalInit(descriptor.getExtensions().get(16)); + durationTooLongProto2.internalInit(descriptor.getExtensions().get(17)); + timestampInRangeProto2.internalInit(descriptor.getExtensions().get(18)); + descriptor.resolveAllFeaturesImmutable(); + build.buf.validate.ValidateProto.getDescriptor(); + com.google.protobuf.DurationProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.boolFalseProto2); + registry.add(build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.bytesValidPathProto2); + registry.add(build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.doubleAbsRangeProto2); + registry.add(build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.durationTooLongProto2); + registry.add(build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.enumNonZeroProto2); + registry.add(build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.fixed32EvenProto2); + registry.add(build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.fixed64EvenProto2); + registry.add(build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.floatAbsRangeProto2); + registry.add(build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.int32EvenProto2); + registry.add(build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.int64EvenProto2); + registry.add(build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.repeatedAtLeastFiveProto2); + registry.add(build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.sfixed32EvenProto2); + registry.add(build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.sfixed64EvenProto2); + registry.add(build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.sint32EvenProto2); + registry.add(build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.sint64EvenProto2); + registry.add(build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.stringValidPathProto2); + registry.add(build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.timestampInRangeProto2); + registry.add(build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.uint32EvenProto2); + registry.add(build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.uint64EvenProto2); + registry.add(build.buf.validate.ValidateProto.field); + registry.add(build.buf.validate.ValidateProto.predefined); + com.google.protobuf.Descriptors.FileDescriptor + .internalUpdateFileDescriptor(descriptor, registry); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedRulesProto3Proto.java b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedRulesProto3Proto.java new file mode 100644 index 00000000..4f3990af --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedRulesProto3Proto.java @@ -0,0 +1,431 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/predefined_rules_proto3.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +public final class PredefinedRulesProto3Proto { + private PredefinedRulesProto3Proto() {} + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 1, + /* suffix= */ "", + PredefinedRulesProto3Proto.class.getName()); + } + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_PredefinedFloatRuleProto3_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_conformance_cases_PredefinedFloatRuleProto3_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_PredefinedDoubleRuleProto3_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_conformance_cases_PredefinedDoubleRuleProto3_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_PredefinedInt32RuleProto3_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_conformance_cases_PredefinedInt32RuleProto3_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_PredefinedInt64RuleProto3_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_conformance_cases_PredefinedInt64RuleProto3_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_PredefinedUInt32RuleProto3_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_conformance_cases_PredefinedUInt32RuleProto3_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_PredefinedUInt64RuleProto3_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_conformance_cases_PredefinedUInt64RuleProto3_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_PredefinedSInt32RuleProto3_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_conformance_cases_PredefinedSInt32RuleProto3_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_PredefinedSInt64RuleProto3_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_conformance_cases_PredefinedSInt64RuleProto3_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_PredefinedFixed32RuleProto3_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_conformance_cases_PredefinedFixed32RuleProto3_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_PredefinedFixed64RuleProto3_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_conformance_cases_PredefinedFixed64RuleProto3_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_PredefinedSFixed32RuleProto3_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_conformance_cases_PredefinedSFixed32RuleProto3_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_PredefinedSFixed64RuleProto3_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_conformance_cases_PredefinedSFixed64RuleProto3_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_PredefinedBoolRuleProto3_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_conformance_cases_PredefinedBoolRuleProto3_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_PredefinedStringRuleProto3_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_conformance_cases_PredefinedStringRuleProto3_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_PredefinedBytesRuleProto3_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_conformance_cases_PredefinedBytesRuleProto3_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_PredefinedEnumRuleProto3_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_conformance_cases_PredefinedEnumRuleProto3_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_PredefinedMapRuleProto3_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_conformance_cases_PredefinedMapRuleProto3_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_PredefinedMapRuleProto3_ValEntry_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_conformance_cases_PredefinedMapRuleProto3_ValEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_PredefinedRepeatedRuleProto3_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_conformance_cases_PredefinedRepeatedRuleProto3_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_PredefinedDurationRuleProto3_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_conformance_cases_PredefinedDurationRuleProto3_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_PredefinedTimestampRuleProto3_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_conformance_cases_PredefinedTimestampRuleProto3_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_PredefinedAndCustomRuleProto3_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_conformance_cases_PredefinedAndCustomRuleProto3_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_PredefinedAndCustomRuleProto3_Nested_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_conformance_cases_PredefinedAndCustomRuleProto3_Nested_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_StandardPredefinedAndCustomRuleProto3_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_conformance_cases_StandardPredefinedAndCustomRuleProto3_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_PredefinedRulesProto3UnusedImportBugWorkaround_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_conformance_cases_PredefinedRulesProto3UnusedImportBugWorkaround_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n 24 ? \'\' : \'a must be greater than 24\'" + + "R\001a\022\271\001\n\001b\030\002 \001(\0132D.buf.validate.conforman" + + "ce.cases.PredefinedAndCustomRuleProto3.N" + + "estedB`\272H]\272\001Z\n*predefined_and_custom_rul" + + "e_embedded_proto3\022\033b.c must be a multipl" + + "e of 3\032\017this.c % 3 == 0H\000R\001b\210\001\001\032s\n\006Neste" + + "d\022i\n\001c\030\001 \001(\005B[\272HX\032\003\320H\001\272\001P\n(predefined_an" + + "d_custom_rule_nested_proto3\032$this > 0 ? " + + "\'\' : \'c must be positive\'R\001cB\004\n\002_b\"\245\001\n%S" + + "tandardPredefinedAndCustomRuleProto3\022|\n\001" + + "a\030\001 \001(\005Bn\272Hk\032\005\020\034\310H\001\272\001a\n1standard_predefi" + + "ned_and_custom_rule_scalar_proto3\032,this " + + "> 24 ? \'\' : \'a must be greater than 24\'R" + + "\001a\"\365\001\n.PredefinedRulesProto3UnusedImport" + + "BugWorkaround\022^\n\007dummy_1\030\001 \001(\0132E.buf.val" + + "idate.conformance.cases.StandardPredefin" + + "edAndCustomRuleProto2R\006dummy1\022c\n\007dummy_2" + + "\030\002 \001(\0132J.buf.validate.conformance.cases." + + "StandardPredefinedAndCustomRuleEdition20" + + "23R\006dummy2B\336\001\n$build.buf.validate.confor" + + "mance.casesB\032PredefinedRulesProto3ProtoP" + + "\001\242\002\004BVCC\252\002\036Buf.Validate.Conformance.Case" + + "s\312\002\036Buf\\Validate\\Conformance\\Cases\342\002*Buf" + + "\\Validate\\Conformance\\Cases\\GPBMetadata\352" + + "\002!Buf::Validate::Conformance::Casesb\006pro" + + "to3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.getDescriptor(), + build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.getDescriptor(), + build.buf.validate.ValidateProto.getDescriptor(), + com.google.protobuf.DurationProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + }); + internal_static_buf_validate_conformance_cases_PredefinedFloatRuleProto3_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_buf_validate_conformance_cases_PredefinedFloatRuleProto3_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_PredefinedFloatRuleProto3_descriptor, + new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_PredefinedDoubleRuleProto3_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_buf_validate_conformance_cases_PredefinedDoubleRuleProto3_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_PredefinedDoubleRuleProto3_descriptor, + new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_PredefinedInt32RuleProto3_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_buf_validate_conformance_cases_PredefinedInt32RuleProto3_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_PredefinedInt32RuleProto3_descriptor, + new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_PredefinedInt64RuleProto3_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_buf_validate_conformance_cases_PredefinedInt64RuleProto3_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_PredefinedInt64RuleProto3_descriptor, + new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_PredefinedUInt32RuleProto3_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_buf_validate_conformance_cases_PredefinedUInt32RuleProto3_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_PredefinedUInt32RuleProto3_descriptor, + new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_PredefinedUInt64RuleProto3_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_buf_validate_conformance_cases_PredefinedUInt64RuleProto3_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_PredefinedUInt64RuleProto3_descriptor, + new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_PredefinedSInt32RuleProto3_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_buf_validate_conformance_cases_PredefinedSInt32RuleProto3_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_PredefinedSInt32RuleProto3_descriptor, + new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_PredefinedSInt64RuleProto3_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_buf_validate_conformance_cases_PredefinedSInt64RuleProto3_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_PredefinedSInt64RuleProto3_descriptor, + new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_PredefinedFixed32RuleProto3_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_buf_validate_conformance_cases_PredefinedFixed32RuleProto3_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_PredefinedFixed32RuleProto3_descriptor, + new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_PredefinedFixed64RuleProto3_descriptor = + getDescriptor().getMessageTypes().get(9); + internal_static_buf_validate_conformance_cases_PredefinedFixed64RuleProto3_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_PredefinedFixed64RuleProto3_descriptor, + new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_PredefinedSFixed32RuleProto3_descriptor = + getDescriptor().getMessageTypes().get(10); + internal_static_buf_validate_conformance_cases_PredefinedSFixed32RuleProto3_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_PredefinedSFixed32RuleProto3_descriptor, + new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_PredefinedSFixed64RuleProto3_descriptor = + getDescriptor().getMessageTypes().get(11); + internal_static_buf_validate_conformance_cases_PredefinedSFixed64RuleProto3_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_PredefinedSFixed64RuleProto3_descriptor, + new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_PredefinedBoolRuleProto3_descriptor = + getDescriptor().getMessageTypes().get(12); + internal_static_buf_validate_conformance_cases_PredefinedBoolRuleProto3_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_PredefinedBoolRuleProto3_descriptor, + new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_PredefinedStringRuleProto3_descriptor = + getDescriptor().getMessageTypes().get(13); + internal_static_buf_validate_conformance_cases_PredefinedStringRuleProto3_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_PredefinedStringRuleProto3_descriptor, + new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_PredefinedBytesRuleProto3_descriptor = + getDescriptor().getMessageTypes().get(14); + internal_static_buf_validate_conformance_cases_PredefinedBytesRuleProto3_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_PredefinedBytesRuleProto3_descriptor, + new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_PredefinedEnumRuleProto3_descriptor = + getDescriptor().getMessageTypes().get(15); + internal_static_buf_validate_conformance_cases_PredefinedEnumRuleProto3_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_PredefinedEnumRuleProto3_descriptor, + new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_PredefinedMapRuleProto3_descriptor = + getDescriptor().getMessageTypes().get(16); + internal_static_buf_validate_conformance_cases_PredefinedMapRuleProto3_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_PredefinedMapRuleProto3_descriptor, + new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_PredefinedMapRuleProto3_ValEntry_descriptor = + internal_static_buf_validate_conformance_cases_PredefinedMapRuleProto3_descriptor.getNestedTypes().get(0); + internal_static_buf_validate_conformance_cases_PredefinedMapRuleProto3_ValEntry_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_PredefinedMapRuleProto3_ValEntry_descriptor, + new java.lang.String[] { "Key", "Value", }); + internal_static_buf_validate_conformance_cases_PredefinedRepeatedRuleProto3_descriptor = + getDescriptor().getMessageTypes().get(17); + internal_static_buf_validate_conformance_cases_PredefinedRepeatedRuleProto3_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_PredefinedRepeatedRuleProto3_descriptor, + new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_PredefinedDurationRuleProto3_descriptor = + getDescriptor().getMessageTypes().get(18); + internal_static_buf_validate_conformance_cases_PredefinedDurationRuleProto3_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_PredefinedDurationRuleProto3_descriptor, + new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_PredefinedTimestampRuleProto3_descriptor = + getDescriptor().getMessageTypes().get(19); + internal_static_buf_validate_conformance_cases_PredefinedTimestampRuleProto3_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_PredefinedTimestampRuleProto3_descriptor, + new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_PredefinedAndCustomRuleProto3_descriptor = + getDescriptor().getMessageTypes().get(20); + internal_static_buf_validate_conformance_cases_PredefinedAndCustomRuleProto3_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_PredefinedAndCustomRuleProto3_descriptor, + new java.lang.String[] { "A", "B", }); + internal_static_buf_validate_conformance_cases_PredefinedAndCustomRuleProto3_Nested_descriptor = + internal_static_buf_validate_conformance_cases_PredefinedAndCustomRuleProto3_descriptor.getNestedTypes().get(0); + internal_static_buf_validate_conformance_cases_PredefinedAndCustomRuleProto3_Nested_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_PredefinedAndCustomRuleProto3_Nested_descriptor, + new java.lang.String[] { "C", }); + internal_static_buf_validate_conformance_cases_StandardPredefinedAndCustomRuleProto3_descriptor = + getDescriptor().getMessageTypes().get(21); + internal_static_buf_validate_conformance_cases_StandardPredefinedAndCustomRuleProto3_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_StandardPredefinedAndCustomRuleProto3_descriptor, + new java.lang.String[] { "A", }); + internal_static_buf_validate_conformance_cases_PredefinedRulesProto3UnusedImportBugWorkaround_descriptor = + getDescriptor().getMessageTypes().get(22); + internal_static_buf_validate_conformance_cases_PredefinedRulesProto3UnusedImportBugWorkaround_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_PredefinedRulesProto3UnusedImportBugWorkaround_descriptor, + new java.lang.String[] { "Dummy1", "Dummy2", }); + descriptor.resolveAllFeaturesImmutable(); + build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.getDescriptor(); + build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.getDescriptor(); + build.buf.validate.ValidateProto.getDescriptor(); + com.google.protobuf.DurationProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.boolFalseProto2); + registry.add(build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.bytesValidPathProto2); + registry.add(build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.doubleAbsRangeProto2); + registry.add(build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.durationTooLongProto2); + registry.add(build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.enumNonZeroProto2); + registry.add(build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.fixed32EvenProto2); + registry.add(build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.fixed64EvenProto2); + registry.add(build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.floatAbsRangeProto2); + registry.add(build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.int32EvenEdition2023); + registry.add(build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.int32EvenProto2); + registry.add(build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.int64EvenProto2); + registry.add(build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.mapAtLeastFiveEdition2023); + registry.add(build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.repeatedAtLeastFiveProto2); + registry.add(build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.sfixed32EvenProto2); + registry.add(build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.sfixed64EvenProto2); + registry.add(build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.sint32EvenProto2); + registry.add(build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.sint64EvenProto2); + registry.add(build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.stringValidPathProto2); + registry.add(build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.timestampInRangeProto2); + registry.add(build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.uint32EvenProto2); + registry.add(build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.uint64EvenProto2); + registry.add(build.buf.validate.ValidateProto.field); + com.google.protobuf.Descriptors.FileDescriptor + .internalUpdateFileDescriptor(descriptor, registry); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedRulesProto3UnusedImportBugWorkaround.java b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedRulesProto3UnusedImportBugWorkaround.java new file mode 100644 index 00000000..9a1ef6e6 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedRulesProto3UnusedImportBugWorkaround.java @@ -0,0 +1,753 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/predefined_rules_proto3.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +/** + *
+ * This is a workaround for https://github.com/bufbuild/buf/issues/3306.
+ * TODO(jchadwick-buf): Remove this when bufbuild/buf#3306 is fixed.
+ * 
+ * + * Protobuf type {@code buf.validate.conformance.cases.PredefinedRulesProto3UnusedImportBugWorkaround} + */ +public final class PredefinedRulesProto3UnusedImportBugWorkaround extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.PredefinedRulesProto3UnusedImportBugWorkaround) + PredefinedRulesProto3UnusedImportBugWorkaroundOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 1, + /* suffix= */ "", + PredefinedRulesProto3UnusedImportBugWorkaround.class.getName()); + } + // Use PredefinedRulesProto3UnusedImportBugWorkaround.newBuilder() to construct. + private PredefinedRulesProto3UnusedImportBugWorkaround(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private PredefinedRulesProto3UnusedImportBugWorkaround() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.PredefinedRulesProto3Proto.internal_static_buf_validate_conformance_cases_PredefinedRulesProto3UnusedImportBugWorkaround_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.PredefinedRulesProto3Proto.internal_static_buf_validate_conformance_cases_PredefinedRulesProto3UnusedImportBugWorkaround_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.PredefinedRulesProto3UnusedImportBugWorkaround.class, build.buf.validate.conformance.cases.PredefinedRulesProto3UnusedImportBugWorkaround.Builder.class); + } + + private int bitField0_; + public static final int DUMMY_1_FIELD_NUMBER = 1; + private build.buf.validate.conformance.cases.StandardPredefinedAndCustomRuleProto2 dummy1_; + /** + * .buf.validate.conformance.cases.StandardPredefinedAndCustomRuleProto2 dummy_1 = 1 [json_name = "dummy1"]; + * @return Whether the dummy1 field is set. + */ + @java.lang.Override + public boolean hasDummy1() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * .buf.validate.conformance.cases.StandardPredefinedAndCustomRuleProto2 dummy_1 = 1 [json_name = "dummy1"]; + * @return The dummy1. + */ + @java.lang.Override + public build.buf.validate.conformance.cases.StandardPredefinedAndCustomRuleProto2 getDummy1() { + return dummy1_ == null ? build.buf.validate.conformance.cases.StandardPredefinedAndCustomRuleProto2.getDefaultInstance() : dummy1_; + } + /** + * .buf.validate.conformance.cases.StandardPredefinedAndCustomRuleProto2 dummy_1 = 1 [json_name = "dummy1"]; + */ + @java.lang.Override + public build.buf.validate.conformance.cases.StandardPredefinedAndCustomRuleProto2OrBuilder getDummy1OrBuilder() { + return dummy1_ == null ? build.buf.validate.conformance.cases.StandardPredefinedAndCustomRuleProto2.getDefaultInstance() : dummy1_; + } + + public static final int DUMMY_2_FIELD_NUMBER = 2; + private build.buf.validate.conformance.cases.StandardPredefinedAndCustomRuleEdition2023 dummy2_; + /** + * .buf.validate.conformance.cases.StandardPredefinedAndCustomRuleEdition2023 dummy_2 = 2 [json_name = "dummy2"]; + * @return Whether the dummy2 field is set. + */ + @java.lang.Override + public boolean hasDummy2() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * .buf.validate.conformance.cases.StandardPredefinedAndCustomRuleEdition2023 dummy_2 = 2 [json_name = "dummy2"]; + * @return The dummy2. + */ + @java.lang.Override + public build.buf.validate.conformance.cases.StandardPredefinedAndCustomRuleEdition2023 getDummy2() { + return dummy2_ == null ? build.buf.validate.conformance.cases.StandardPredefinedAndCustomRuleEdition2023.getDefaultInstance() : dummy2_; + } + /** + * .buf.validate.conformance.cases.StandardPredefinedAndCustomRuleEdition2023 dummy_2 = 2 [json_name = "dummy2"]; + */ + @java.lang.Override + public build.buf.validate.conformance.cases.StandardPredefinedAndCustomRuleEdition2023OrBuilder getDummy2OrBuilder() { + return dummy2_ == null ? build.buf.validate.conformance.cases.StandardPredefinedAndCustomRuleEdition2023.getDefaultInstance() : dummy2_; + } + + 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, getDummy1()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(2, getDummy2()); + } + 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, getDummy1()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getDummy2()); + } + 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.PredefinedRulesProto3UnusedImportBugWorkaround)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.PredefinedRulesProto3UnusedImportBugWorkaround other = (build.buf.validate.conformance.cases.PredefinedRulesProto3UnusedImportBugWorkaround) obj; + + if (hasDummy1() != other.hasDummy1()) return false; + if (hasDummy1()) { + if (!getDummy1() + .equals(other.getDummy1())) return false; + } + if (hasDummy2() != other.hasDummy2()) return false; + if (hasDummy2()) { + if (!getDummy2() + .equals(other.getDummy2())) 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 (hasDummy1()) { + hash = (37 * hash) + DUMMY_1_FIELD_NUMBER; + hash = (53 * hash) + getDummy1().hashCode(); + } + if (hasDummy2()) { + hash = (37 * hash) + DUMMY_2_FIELD_NUMBER; + hash = (53 * hash) + getDummy2().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.PredefinedRulesProto3UnusedImportBugWorkaround parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedRulesProto3UnusedImportBugWorkaround 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.PredefinedRulesProto3UnusedImportBugWorkaround parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedRulesProto3UnusedImportBugWorkaround 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.PredefinedRulesProto3UnusedImportBugWorkaround parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedRulesProto3UnusedImportBugWorkaround 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.PredefinedRulesProto3UnusedImportBugWorkaround parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.PredefinedRulesProto3UnusedImportBugWorkaround 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.PredefinedRulesProto3UnusedImportBugWorkaround parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.PredefinedRulesProto3UnusedImportBugWorkaround 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.PredefinedRulesProto3UnusedImportBugWorkaround 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.PredefinedRulesProto3UnusedImportBugWorkaround 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.PredefinedRulesProto3UnusedImportBugWorkaround 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; + } + /** + *
+   * This is a workaround for https://github.com/bufbuild/buf/issues/3306.
+   * TODO(jchadwick-buf): Remove this when bufbuild/buf#3306 is fixed.
+   * 
+ * + * Protobuf type {@code buf.validate.conformance.cases.PredefinedRulesProto3UnusedImportBugWorkaround} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.PredefinedRulesProto3UnusedImportBugWorkaround) + build.buf.validate.conformance.cases.PredefinedRulesProto3UnusedImportBugWorkaroundOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.PredefinedRulesProto3Proto.internal_static_buf_validate_conformance_cases_PredefinedRulesProto3UnusedImportBugWorkaround_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.PredefinedRulesProto3Proto.internal_static_buf_validate_conformance_cases_PredefinedRulesProto3UnusedImportBugWorkaround_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.PredefinedRulesProto3UnusedImportBugWorkaround.class, build.buf.validate.conformance.cases.PredefinedRulesProto3UnusedImportBugWorkaround.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.PredefinedRulesProto3UnusedImportBugWorkaround.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage + .alwaysUseFieldBuilders) { + getDummy1FieldBuilder(); + getDummy2FieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + dummy1_ = null; + if (dummy1Builder_ != null) { + dummy1Builder_.dispose(); + dummy1Builder_ = null; + } + dummy2_ = null; + if (dummy2Builder_ != null) { + dummy2Builder_.dispose(); + dummy2Builder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.PredefinedRulesProto3Proto.internal_static_buf_validate_conformance_cases_PredefinedRulesProto3UnusedImportBugWorkaround_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedRulesProto3UnusedImportBugWorkaround getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.PredefinedRulesProto3UnusedImportBugWorkaround.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedRulesProto3UnusedImportBugWorkaround build() { + build.buf.validate.conformance.cases.PredefinedRulesProto3UnusedImportBugWorkaround result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedRulesProto3UnusedImportBugWorkaround buildPartial() { + build.buf.validate.conformance.cases.PredefinedRulesProto3UnusedImportBugWorkaround result = new build.buf.validate.conformance.cases.PredefinedRulesProto3UnusedImportBugWorkaround(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.PredefinedRulesProto3UnusedImportBugWorkaround result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.dummy1_ = dummy1Builder_ == null + ? dummy1_ + : dummy1Builder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.dummy2_ = dummy2Builder_ == null + ? dummy2_ + : dummy2Builder_.build(); + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof build.buf.validate.conformance.cases.PredefinedRulesProto3UnusedImportBugWorkaround) { + return mergeFrom((build.buf.validate.conformance.cases.PredefinedRulesProto3UnusedImportBugWorkaround)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.PredefinedRulesProto3UnusedImportBugWorkaround other) { + if (other == build.buf.validate.conformance.cases.PredefinedRulesProto3UnusedImportBugWorkaround.getDefaultInstance()) return this; + if (other.hasDummy1()) { + mergeDummy1(other.getDummy1()); + } + if (other.hasDummy2()) { + mergeDummy2(other.getDummy2()); + } + 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( + getDummy1FieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: { + input.readMessage( + getDummy2FieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000002; + 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 bitField0_; + + private build.buf.validate.conformance.cases.StandardPredefinedAndCustomRuleProto2 dummy1_; + private com.google.protobuf.SingleFieldBuilder< + build.buf.validate.conformance.cases.StandardPredefinedAndCustomRuleProto2, build.buf.validate.conformance.cases.StandardPredefinedAndCustomRuleProto2.Builder, build.buf.validate.conformance.cases.StandardPredefinedAndCustomRuleProto2OrBuilder> dummy1Builder_; + /** + * .buf.validate.conformance.cases.StandardPredefinedAndCustomRuleProto2 dummy_1 = 1 [json_name = "dummy1"]; + * @return Whether the dummy1 field is set. + */ + public boolean hasDummy1() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * .buf.validate.conformance.cases.StandardPredefinedAndCustomRuleProto2 dummy_1 = 1 [json_name = "dummy1"]; + * @return The dummy1. + */ + public build.buf.validate.conformance.cases.StandardPredefinedAndCustomRuleProto2 getDummy1() { + if (dummy1Builder_ == null) { + return dummy1_ == null ? build.buf.validate.conformance.cases.StandardPredefinedAndCustomRuleProto2.getDefaultInstance() : dummy1_; + } else { + return dummy1Builder_.getMessage(); + } + } + /** + * .buf.validate.conformance.cases.StandardPredefinedAndCustomRuleProto2 dummy_1 = 1 [json_name = "dummy1"]; + */ + public Builder setDummy1(build.buf.validate.conformance.cases.StandardPredefinedAndCustomRuleProto2 value) { + if (dummy1Builder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + dummy1_ = value; + } else { + dummy1Builder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * .buf.validate.conformance.cases.StandardPredefinedAndCustomRuleProto2 dummy_1 = 1 [json_name = "dummy1"]; + */ + public Builder setDummy1( + build.buf.validate.conformance.cases.StandardPredefinedAndCustomRuleProto2.Builder builderForValue) { + if (dummy1Builder_ == null) { + dummy1_ = builderForValue.build(); + } else { + dummy1Builder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * .buf.validate.conformance.cases.StandardPredefinedAndCustomRuleProto2 dummy_1 = 1 [json_name = "dummy1"]; + */ + public Builder mergeDummy1(build.buf.validate.conformance.cases.StandardPredefinedAndCustomRuleProto2 value) { + if (dummy1Builder_ == null) { + if (((bitField0_ & 0x00000001) != 0) && + dummy1_ != null && + dummy1_ != build.buf.validate.conformance.cases.StandardPredefinedAndCustomRuleProto2.getDefaultInstance()) { + getDummy1Builder().mergeFrom(value); + } else { + dummy1_ = value; + } + } else { + dummy1Builder_.mergeFrom(value); + } + if (dummy1_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + /** + * .buf.validate.conformance.cases.StandardPredefinedAndCustomRuleProto2 dummy_1 = 1 [json_name = "dummy1"]; + */ + public Builder clearDummy1() { + bitField0_ = (bitField0_ & ~0x00000001); + dummy1_ = null; + if (dummy1Builder_ != null) { + dummy1Builder_.dispose(); + dummy1Builder_ = null; + } + onChanged(); + return this; + } + /** + * .buf.validate.conformance.cases.StandardPredefinedAndCustomRuleProto2 dummy_1 = 1 [json_name = "dummy1"]; + */ + public build.buf.validate.conformance.cases.StandardPredefinedAndCustomRuleProto2.Builder getDummy1Builder() { + bitField0_ |= 0x00000001; + onChanged(); + return getDummy1FieldBuilder().getBuilder(); + } + /** + * .buf.validate.conformance.cases.StandardPredefinedAndCustomRuleProto2 dummy_1 = 1 [json_name = "dummy1"]; + */ + public build.buf.validate.conformance.cases.StandardPredefinedAndCustomRuleProto2OrBuilder getDummy1OrBuilder() { + if (dummy1Builder_ != null) { + return dummy1Builder_.getMessageOrBuilder(); + } else { + return dummy1_ == null ? + build.buf.validate.conformance.cases.StandardPredefinedAndCustomRuleProto2.getDefaultInstance() : dummy1_; + } + } + /** + * .buf.validate.conformance.cases.StandardPredefinedAndCustomRuleProto2 dummy_1 = 1 [json_name = "dummy1"]; + */ + private com.google.protobuf.SingleFieldBuilder< + build.buf.validate.conformance.cases.StandardPredefinedAndCustomRuleProto2, build.buf.validate.conformance.cases.StandardPredefinedAndCustomRuleProto2.Builder, build.buf.validate.conformance.cases.StandardPredefinedAndCustomRuleProto2OrBuilder> + getDummy1FieldBuilder() { + if (dummy1Builder_ == null) { + dummy1Builder_ = new com.google.protobuf.SingleFieldBuilder< + build.buf.validate.conformance.cases.StandardPredefinedAndCustomRuleProto2, build.buf.validate.conformance.cases.StandardPredefinedAndCustomRuleProto2.Builder, build.buf.validate.conformance.cases.StandardPredefinedAndCustomRuleProto2OrBuilder>( + getDummy1(), + getParentForChildren(), + isClean()); + dummy1_ = null; + } + return dummy1Builder_; + } + + private build.buf.validate.conformance.cases.StandardPredefinedAndCustomRuleEdition2023 dummy2_; + private com.google.protobuf.SingleFieldBuilder< + build.buf.validate.conformance.cases.StandardPredefinedAndCustomRuleEdition2023, build.buf.validate.conformance.cases.StandardPredefinedAndCustomRuleEdition2023.Builder, build.buf.validate.conformance.cases.StandardPredefinedAndCustomRuleEdition2023OrBuilder> dummy2Builder_; + /** + * .buf.validate.conformance.cases.StandardPredefinedAndCustomRuleEdition2023 dummy_2 = 2 [json_name = "dummy2"]; + * @return Whether the dummy2 field is set. + */ + public boolean hasDummy2() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * .buf.validate.conformance.cases.StandardPredefinedAndCustomRuleEdition2023 dummy_2 = 2 [json_name = "dummy2"]; + * @return The dummy2. + */ + public build.buf.validate.conformance.cases.StandardPredefinedAndCustomRuleEdition2023 getDummy2() { + if (dummy2Builder_ == null) { + return dummy2_ == null ? build.buf.validate.conformance.cases.StandardPredefinedAndCustomRuleEdition2023.getDefaultInstance() : dummy2_; + } else { + return dummy2Builder_.getMessage(); + } + } + /** + * .buf.validate.conformance.cases.StandardPredefinedAndCustomRuleEdition2023 dummy_2 = 2 [json_name = "dummy2"]; + */ + public Builder setDummy2(build.buf.validate.conformance.cases.StandardPredefinedAndCustomRuleEdition2023 value) { + if (dummy2Builder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + dummy2_ = value; + } else { + dummy2Builder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * .buf.validate.conformance.cases.StandardPredefinedAndCustomRuleEdition2023 dummy_2 = 2 [json_name = "dummy2"]; + */ + public Builder setDummy2( + build.buf.validate.conformance.cases.StandardPredefinedAndCustomRuleEdition2023.Builder builderForValue) { + if (dummy2Builder_ == null) { + dummy2_ = builderForValue.build(); + } else { + dummy2Builder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * .buf.validate.conformance.cases.StandardPredefinedAndCustomRuleEdition2023 dummy_2 = 2 [json_name = "dummy2"]; + */ + public Builder mergeDummy2(build.buf.validate.conformance.cases.StandardPredefinedAndCustomRuleEdition2023 value) { + if (dummy2Builder_ == null) { + if (((bitField0_ & 0x00000002) != 0) && + dummy2_ != null && + dummy2_ != build.buf.validate.conformance.cases.StandardPredefinedAndCustomRuleEdition2023.getDefaultInstance()) { + getDummy2Builder().mergeFrom(value); + } else { + dummy2_ = value; + } + } else { + dummy2Builder_.mergeFrom(value); + } + if (dummy2_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + /** + * .buf.validate.conformance.cases.StandardPredefinedAndCustomRuleEdition2023 dummy_2 = 2 [json_name = "dummy2"]; + */ + public Builder clearDummy2() { + bitField0_ = (bitField0_ & ~0x00000002); + dummy2_ = null; + if (dummy2Builder_ != null) { + dummy2Builder_.dispose(); + dummy2Builder_ = null; + } + onChanged(); + return this; + } + /** + * .buf.validate.conformance.cases.StandardPredefinedAndCustomRuleEdition2023 dummy_2 = 2 [json_name = "dummy2"]; + */ + public build.buf.validate.conformance.cases.StandardPredefinedAndCustomRuleEdition2023.Builder getDummy2Builder() { + bitField0_ |= 0x00000002; + onChanged(); + return getDummy2FieldBuilder().getBuilder(); + } + /** + * .buf.validate.conformance.cases.StandardPredefinedAndCustomRuleEdition2023 dummy_2 = 2 [json_name = "dummy2"]; + */ + public build.buf.validate.conformance.cases.StandardPredefinedAndCustomRuleEdition2023OrBuilder getDummy2OrBuilder() { + if (dummy2Builder_ != null) { + return dummy2Builder_.getMessageOrBuilder(); + } else { + return dummy2_ == null ? + build.buf.validate.conformance.cases.StandardPredefinedAndCustomRuleEdition2023.getDefaultInstance() : dummy2_; + } + } + /** + * .buf.validate.conformance.cases.StandardPredefinedAndCustomRuleEdition2023 dummy_2 = 2 [json_name = "dummy2"]; + */ + private com.google.protobuf.SingleFieldBuilder< + build.buf.validate.conformance.cases.StandardPredefinedAndCustomRuleEdition2023, build.buf.validate.conformance.cases.StandardPredefinedAndCustomRuleEdition2023.Builder, build.buf.validate.conformance.cases.StandardPredefinedAndCustomRuleEdition2023OrBuilder> + getDummy2FieldBuilder() { + if (dummy2Builder_ == null) { + dummy2Builder_ = new com.google.protobuf.SingleFieldBuilder< + build.buf.validate.conformance.cases.StandardPredefinedAndCustomRuleEdition2023, build.buf.validate.conformance.cases.StandardPredefinedAndCustomRuleEdition2023.Builder, build.buf.validate.conformance.cases.StandardPredefinedAndCustomRuleEdition2023OrBuilder>( + getDummy2(), + getParentForChildren(), + isClean()); + dummy2_ = null; + } + return dummy2Builder_; + } + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.PredefinedRulesProto3UnusedImportBugWorkaround) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.PredefinedRulesProto3UnusedImportBugWorkaround) + private static final build.buf.validate.conformance.cases.PredefinedRulesProto3UnusedImportBugWorkaround DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.PredefinedRulesProto3UnusedImportBugWorkaround(); + } + + public static build.buf.validate.conformance.cases.PredefinedRulesProto3UnusedImportBugWorkaround getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PredefinedRulesProto3UnusedImportBugWorkaround 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.PredefinedRulesProto3UnusedImportBugWorkaround getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedRulesProto3UnusedImportBugWorkaroundOrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedRulesProto3UnusedImportBugWorkaroundOrBuilder.java new file mode 100644 index 00000000..e8dda40f --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedRulesProto3UnusedImportBugWorkaroundOrBuilder.java @@ -0,0 +1,41 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/predefined_rules_proto3.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +public interface PredefinedRulesProto3UnusedImportBugWorkaroundOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.PredefinedRulesProto3UnusedImportBugWorkaround) + com.google.protobuf.MessageOrBuilder { + + /** + * .buf.validate.conformance.cases.StandardPredefinedAndCustomRuleProto2 dummy_1 = 1 [json_name = "dummy1"]; + * @return Whether the dummy1 field is set. + */ + boolean hasDummy1(); + /** + * .buf.validate.conformance.cases.StandardPredefinedAndCustomRuleProto2 dummy_1 = 1 [json_name = "dummy1"]; + * @return The dummy1. + */ + build.buf.validate.conformance.cases.StandardPredefinedAndCustomRuleProto2 getDummy1(); + /** + * .buf.validate.conformance.cases.StandardPredefinedAndCustomRuleProto2 dummy_1 = 1 [json_name = "dummy1"]; + */ + build.buf.validate.conformance.cases.StandardPredefinedAndCustomRuleProto2OrBuilder getDummy1OrBuilder(); + + /** + * .buf.validate.conformance.cases.StandardPredefinedAndCustomRuleEdition2023 dummy_2 = 2 [json_name = "dummy2"]; + * @return Whether the dummy2 field is set. + */ + boolean hasDummy2(); + /** + * .buf.validate.conformance.cases.StandardPredefinedAndCustomRuleEdition2023 dummy_2 = 2 [json_name = "dummy2"]; + * @return The dummy2. + */ + build.buf.validate.conformance.cases.StandardPredefinedAndCustomRuleEdition2023 getDummy2(); + /** + * .buf.validate.conformance.cases.StandardPredefinedAndCustomRuleEdition2023 dummy_2 = 2 [json_name = "dummy2"]; + */ + build.buf.validate.conformance.cases.StandardPredefinedAndCustomRuleEdition2023OrBuilder getDummy2OrBuilder(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedRulesProtoEditionsProto.java b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedRulesProtoEditionsProto.java new file mode 100644 index 00000000..ab2f297e --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedRulesProtoEditionsProto.java @@ -0,0 +1,764 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/predefined_rules_proto_editions.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +public final class PredefinedRulesProtoEditionsProto { + private PredefinedRulesProtoEditionsProto() {} + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 1, + /* suffix= */ "", + PredefinedRulesProtoEditionsProto.class.getName()); + } + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + registry.add(build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.floatAbsRangeEdition2023); + registry.add(build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.doubleAbsRangeEdition2023); + registry.add(build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.int32EvenEdition2023); + registry.add(build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.int64EvenEdition2023); + registry.add(build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.uint32EvenEdition2023); + registry.add(build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.uint64EvenEdition2023); + registry.add(build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.sint32EvenEdition2023); + registry.add(build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.sint64EvenEdition2023); + registry.add(build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.fixed32EvenEdition2023); + registry.add(build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.fixed64EvenEdition2023); + registry.add(build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.sfixed32EvenEdition2023); + registry.add(build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.sfixed64EvenEdition2023); + registry.add(build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.boolFalseEdition2023); + registry.add(build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.stringValidPathEdition2023); + registry.add(build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.bytesValidPathEdition2023); + registry.add(build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.enumNonZeroEdition2023); + registry.add(build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.repeatedAtLeastFiveEdition2023); + registry.add(build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.mapAtLeastFiveEdition2023); + registry.add(build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.durationTooLongEdition2023); + registry.add(build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.timestampInRangeEdition2023); + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public static final int FLOAT_ABS_RANGE_EDITION_2023_FIELD_NUMBER = 1162; + /** + * extend .buf.validate.FloatRules { ... } + */ + public static final + com.google.protobuf.GeneratedMessage.GeneratedExtension< + build.buf.validate.FloatRules, + java.lang.Float> floatAbsRangeEdition2023 = com.google.protobuf.GeneratedMessage + .newFileScopedGeneratedExtension( + java.lang.Float.class, + null); + public static final int DOUBLE_ABS_RANGE_EDITION_2023_FIELD_NUMBER = 1162; + /** + * extend .buf.validate.DoubleRules { ... } + */ + public static final + com.google.protobuf.GeneratedMessage.GeneratedExtension< + build.buf.validate.DoubleRules, + java.lang.Double> doubleAbsRangeEdition2023 = com.google.protobuf.GeneratedMessage + .newFileScopedGeneratedExtension( + java.lang.Double.class, + null); + public static final int INT32_EVEN_EDITION_2023_FIELD_NUMBER = 1162; + /** + * extend .buf.validate.Int32Rules { ... } + */ + public static final + com.google.protobuf.GeneratedMessage.GeneratedExtension< + build.buf.validate.Int32Rules, + java.lang.Boolean> int32EvenEdition2023 = com.google.protobuf.GeneratedMessage + .newFileScopedGeneratedExtension( + java.lang.Boolean.class, + null); + public static final int INT64_EVEN_EDITION_2023_FIELD_NUMBER = 1162; + /** + * extend .buf.validate.Int64Rules { ... } + */ + public static final + com.google.protobuf.GeneratedMessage.GeneratedExtension< + build.buf.validate.Int64Rules, + java.lang.Boolean> int64EvenEdition2023 = com.google.protobuf.GeneratedMessage + .newFileScopedGeneratedExtension( + java.lang.Boolean.class, + null); + public static final int UINT32_EVEN_EDITION_2023_FIELD_NUMBER = 1162; + /** + * extend .buf.validate.UInt32Rules { ... } + */ + public static final + com.google.protobuf.GeneratedMessage.GeneratedExtension< + build.buf.validate.UInt32Rules, + java.lang.Boolean> uint32EvenEdition2023 = com.google.protobuf.GeneratedMessage + .newFileScopedGeneratedExtension( + java.lang.Boolean.class, + null); + public static final int UINT64_EVEN_EDITION_2023_FIELD_NUMBER = 1162; + /** + * extend .buf.validate.UInt64Rules { ... } + */ + public static final + com.google.protobuf.GeneratedMessage.GeneratedExtension< + build.buf.validate.UInt64Rules, + java.lang.Boolean> uint64EvenEdition2023 = com.google.protobuf.GeneratedMessage + .newFileScopedGeneratedExtension( + java.lang.Boolean.class, + null); + public static final int SINT32_EVEN_EDITION_2023_FIELD_NUMBER = 1162; + /** + * extend .buf.validate.SInt32Rules { ... } + */ + public static final + com.google.protobuf.GeneratedMessage.GeneratedExtension< + build.buf.validate.SInt32Rules, + java.lang.Boolean> sint32EvenEdition2023 = com.google.protobuf.GeneratedMessage + .newFileScopedGeneratedExtension( + java.lang.Boolean.class, + null); + public static final int SINT64_EVEN_EDITION_2023_FIELD_NUMBER = 1162; + /** + * extend .buf.validate.SInt64Rules { ... } + */ + public static final + com.google.protobuf.GeneratedMessage.GeneratedExtension< + build.buf.validate.SInt64Rules, + java.lang.Boolean> sint64EvenEdition2023 = com.google.protobuf.GeneratedMessage + .newFileScopedGeneratedExtension( + java.lang.Boolean.class, + null); + public static final int FIXED32_EVEN_EDITION_2023_FIELD_NUMBER = 1162; + /** + * extend .buf.validate.Fixed32Rules { ... } + */ + public static final + com.google.protobuf.GeneratedMessage.GeneratedExtension< + build.buf.validate.Fixed32Rules, + java.lang.Boolean> fixed32EvenEdition2023 = com.google.protobuf.GeneratedMessage + .newFileScopedGeneratedExtension( + java.lang.Boolean.class, + null); + public static final int FIXED64_EVEN_EDITION_2023_FIELD_NUMBER = 1162; + /** + * extend .buf.validate.Fixed64Rules { ... } + */ + public static final + com.google.protobuf.GeneratedMessage.GeneratedExtension< + build.buf.validate.Fixed64Rules, + java.lang.Boolean> fixed64EvenEdition2023 = com.google.protobuf.GeneratedMessage + .newFileScopedGeneratedExtension( + java.lang.Boolean.class, + null); + public static final int SFIXED32_EVEN_EDITION_2023_FIELD_NUMBER = 1162; + /** + * extend .buf.validate.SFixed32Rules { ... } + */ + public static final + com.google.protobuf.GeneratedMessage.GeneratedExtension< + build.buf.validate.SFixed32Rules, + java.lang.Boolean> sfixed32EvenEdition2023 = com.google.protobuf.GeneratedMessage + .newFileScopedGeneratedExtension( + java.lang.Boolean.class, + null); + public static final int SFIXED64_EVEN_EDITION_2023_FIELD_NUMBER = 1162; + /** + * extend .buf.validate.SFixed64Rules { ... } + */ + public static final + com.google.protobuf.GeneratedMessage.GeneratedExtension< + build.buf.validate.SFixed64Rules, + java.lang.Boolean> sfixed64EvenEdition2023 = com.google.protobuf.GeneratedMessage + .newFileScopedGeneratedExtension( + java.lang.Boolean.class, + null); + public static final int BOOL_FALSE_EDITION_2023_FIELD_NUMBER = 1162; + /** + * extend .buf.validate.BoolRules { ... } + */ + public static final + com.google.protobuf.GeneratedMessage.GeneratedExtension< + build.buf.validate.BoolRules, + java.lang.Boolean> boolFalseEdition2023 = com.google.protobuf.GeneratedMessage + .newFileScopedGeneratedExtension( + java.lang.Boolean.class, + null); + public static final int STRING_VALID_PATH_EDITION_2023_FIELD_NUMBER = 1162; + /** + * extend .buf.validate.StringRules { ... } + */ + public static final + com.google.protobuf.GeneratedMessage.GeneratedExtension< + build.buf.validate.StringRules, + java.lang.Boolean> stringValidPathEdition2023 = com.google.protobuf.GeneratedMessage + .newFileScopedGeneratedExtension( + java.lang.Boolean.class, + null); + public static final int BYTES_VALID_PATH_EDITION_2023_FIELD_NUMBER = 1162; + /** + * extend .buf.validate.BytesRules { ... } + */ + public static final + com.google.protobuf.GeneratedMessage.GeneratedExtension< + build.buf.validate.BytesRules, + java.lang.Boolean> bytesValidPathEdition2023 = com.google.protobuf.GeneratedMessage + .newFileScopedGeneratedExtension( + java.lang.Boolean.class, + null); + public static final int ENUM_NON_ZERO_EDITION_2023_FIELD_NUMBER = 1162; + /** + * extend .buf.validate.EnumRules { ... } + */ + public static final + com.google.protobuf.GeneratedMessage.GeneratedExtension< + build.buf.validate.EnumRules, + java.lang.Boolean> enumNonZeroEdition2023 = com.google.protobuf.GeneratedMessage + .newFileScopedGeneratedExtension( + java.lang.Boolean.class, + null); + public static final int REPEATED_AT_LEAST_FIVE_EDITION_2023_FIELD_NUMBER = 1162; + /** + * extend .buf.validate.RepeatedRules { ... } + */ + public static final + com.google.protobuf.GeneratedMessage.GeneratedExtension< + build.buf.validate.RepeatedRules, + java.lang.Boolean> repeatedAtLeastFiveEdition2023 = com.google.protobuf.GeneratedMessage + .newFileScopedGeneratedExtension( + java.lang.Boolean.class, + null); + public static final int MAP_AT_LEAST_FIVE_EDITION_2023_FIELD_NUMBER = 1162; + /** + * extend .buf.validate.MapRules { ... } + */ + public static final + com.google.protobuf.GeneratedMessage.GeneratedExtension< + build.buf.validate.MapRules, + java.lang.Boolean> mapAtLeastFiveEdition2023 = com.google.protobuf.GeneratedMessage + .newFileScopedGeneratedExtension( + java.lang.Boolean.class, + null); + public static final int DURATION_TOO_LONG_EDITION_2023_FIELD_NUMBER = 1162; + /** + * extend .buf.validate.DurationRules { ... } + */ + public static final + com.google.protobuf.GeneratedMessage.GeneratedExtension< + build.buf.validate.DurationRules, + java.lang.Boolean> durationTooLongEdition2023 = com.google.protobuf.GeneratedMessage + .newFileScopedGeneratedExtension( + java.lang.Boolean.class, + null); + public static final int TIMESTAMP_IN_RANGE_EDITION_2023_FIELD_NUMBER = 1162; + /** + * extend .buf.validate.TimestampRules { ... } + */ + public static final + com.google.protobuf.GeneratedMessage.GeneratedExtension< + build.buf.validate.TimestampRules, + java.lang.Boolean> timestampInRangeEdition2023 = com.google.protobuf.GeneratedMessage + .newFileScopedGeneratedExtension( + java.lang.Boolean.class, + null); + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_PredefinedFloatRuleEdition2023_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_conformance_cases_PredefinedFloatRuleEdition2023_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_PredefinedDoubleRuleEdition2023_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_conformance_cases_PredefinedDoubleRuleEdition2023_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_PredefinedInt32RuleEdition2023_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_conformance_cases_PredefinedInt32RuleEdition2023_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_PredefinedInt64RuleEdition2023_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_conformance_cases_PredefinedInt64RuleEdition2023_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_PredefinedUInt32RuleEdition2023_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_conformance_cases_PredefinedUInt32RuleEdition2023_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_PredefinedUInt64RuleEdition2023_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_conformance_cases_PredefinedUInt64RuleEdition2023_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_PredefinedSInt32RuleEdition2023_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_conformance_cases_PredefinedSInt32RuleEdition2023_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_PredefinedSInt64RuleEdition2023_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_conformance_cases_PredefinedSInt64RuleEdition2023_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_PredefinedFixed32RuleEdition2023_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_conformance_cases_PredefinedFixed32RuleEdition2023_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_PredefinedFixed64RuleEdition2023_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_conformance_cases_PredefinedFixed64RuleEdition2023_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_PredefinedSFixed32RuleEdition2023_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_conformance_cases_PredefinedSFixed32RuleEdition2023_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_PredefinedSFixed64RuleEdition2023_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_conformance_cases_PredefinedSFixed64RuleEdition2023_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_PredefinedBoolRuleEdition2023_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_conformance_cases_PredefinedBoolRuleEdition2023_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_PredefinedStringRuleEdition2023_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_conformance_cases_PredefinedStringRuleEdition2023_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_PredefinedBytesRuleEdition2023_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_conformance_cases_PredefinedBytesRuleEdition2023_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_PredefinedEnumRuleEdition2023_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_conformance_cases_PredefinedEnumRuleEdition2023_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_PredefinedRepeatedRuleEdition2023_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_conformance_cases_PredefinedRepeatedRuleEdition2023_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_PredefinedMapRuleEdition2023_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_conformance_cases_PredefinedMapRuleEdition2023_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_PredefinedMapRuleEdition2023_ValEntry_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_conformance_cases_PredefinedMapRuleEdition2023_ValEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_PredefinedDurationRuleEdition2023_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_conformance_cases_PredefinedDurationRuleEdition2023_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_PredefinedTimestampRuleEdition2023_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_conformance_cases_PredefinedTimestampRuleEdition2023_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_PredefinedAndCustomRuleEdition2023_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_conformance_cases_PredefinedAndCustomRuleEdition2023_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_PredefinedAndCustomRuleEdition2023_Nested_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_conformance_cases_PredefinedAndCustomRuleEdition2023_Nested_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_StandardPredefinedAndCustomRuleEdition2023_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_conformance_cases_StandardPredefinedAndCustomRuleEdition2023_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\nDbuf/validate/conformance/cases/predefi" + + "ned_rules_proto_editions.proto\022\036buf.vali" + + "date.conformance.cases\032\033buf/validate/val" + + "idate.proto\032\036google/protobuf/duration.pr" + + "oto\032\037google/protobuf/timestamp.proto\"?\n\036" + + "PredefinedFloatRuleEdition2023\022\035\n\003val\030\001 " + + "\001(\002B\013\272H\010\n\006\325H\000\000\200?R\003val\"D\n\037PredefinedDoubl" + + "eRuleEdition2023\022!\n\003val\030\001 \001(\001B\017\272H\014\022\n\321H\000\000" + + "\000\000\000\000\360?R\003val\"<\n\036PredefinedInt32RuleEditio" + + "n2023\022\032\n\003val\030\001 \001(\005B\010\272H\005\032\003\320H\001R\003val\"<\n\036Pre" + + "definedInt64RuleEdition2023\022\032\n\003val\030\001 \001(\003" + + "B\010\272H\005\"\003\320H\001R\003val\"=\n\037PredefinedUInt32RuleE" + + "dition2023\022\032\n\003val\030\001 \001(\rB\010\272H\005*\003\320H\001R\003val\"=" + + "\n\037PredefinedUInt64RuleEdition2023\022\032\n\003val" + + "\030\001 \001(\004B\010\272H\0052\003\320H\001R\003val\"=\n\037PredefinedSInt3" + + "2RuleEdition2023\022\032\n\003val\030\001 \001(\021B\010\272H\005:\003\320H\001R" + + "\003val\"=\n\037PredefinedSInt64RuleEdition2023\022" + + "\032\n\003val\030\001 \001(\022B\010\272H\005B\003\320H\001R\003val\">\n Predefine" + + "dFixed32RuleEdition2023\022\032\n\003val\030\001 \001(\007B\010\272H" + + "\005J\003\320H\001R\003val\">\n PredefinedFixed64RuleEdit" + + "ion2023\022\032\n\003val\030\001 \001(\006B\010\272H\005R\003\320H\001R\003val\"?\n!P" + + "redefinedSFixed32RuleEdition2023\022\032\n\003val\030" + + "\001 \001(\017B\010\272H\005Z\003\320H\001R\003val\"?\n!PredefinedSFixed" + + "64RuleEdition2023\022\032\n\003val\030\001 \001(\020B\010\272H\005b\003\320H\001" + + "R\003val\";\n\035PredefinedBoolRuleEdition2023\022\032" + + "\n\003val\030\001 \001(\010B\010\272H\005j\003\320H\001R\003val\"=\n\037Predefined" + + "StringRuleEdition2023\022\032\n\003val\030\001 \001(\tB\010\272H\005r" + + "\003\320H\001R\003val\"<\n\036PredefinedBytesRuleEdition2" + + "023\022\032\n\003val\030\001 \001(\014B\010\272H\005z\003\320H\001R\003val\"\337\001\n\035Pred" + + "efinedEnumRuleEdition2023\022j\n\003val\030\001 \001(\0162M" + + ".buf.validate.conformance.cases.Predefin" + + "edEnumRuleEdition2023.EnumEdition2023B\t\272" + + "H\006\202\001\003\320H\001R\003val\"R\n\017EnumEdition2023\022%\n!ENUM" + + "_EDITION2023_ZERO_UNSPECIFIED\020\000\022\030\n\024ENUM_" + + "EDITION2023_ONE\020\001\"@\n!PredefinedRepeatedR" + + "uleEdition2023\022\033\n\003val\030\001 \003(\004B\t\272H\006\222\001\003\320H\001R\003" + + "val\"\272\001\n\034PredefinedMapRuleEdition2023\022b\n\003" + + "val\030\001 \003(\0132E.buf.validate.conformance.cas" + + "es.PredefinedMapRuleEdition2023.ValEntry" + + "B\t\272H\006\232\001\003\320H\001R\003val\0326\n\010ValEntry\022\020\n\003key\030\001 \001(" + + "\004R\003key\022\024\n\005value\030\002 \001(\004R\005value:\0028\001\"[\n!Pred" + + "efinedDurationRuleEdition2023\0226\n\003val\030\001 \001" + + "(\0132\031.google.protobuf.DurationB\t\272H\006\252\001\003\320H\001" + + "R\003val\"]\n\"PredefinedTimestampRuleEdition2" + + "023\0227\n\003val\030\001 \001(\0132\032.google.protobuf.Times" + + "tampB\t\272H\006\262\001\003\320H\001R\003val\"\332\003\n\"PredefinedAndCu" + + "stomRuleEdition2023\022w\n\001a\030\001 \001(\005Bi\272Hf\032\003\320H\001" + + "\272\001^\n.predefined_and_custom_rule_scalar_e" + + "dition_2023\032,this > 24 ? \'\' : \'a must be" + + " greater than 24\'R\001a\022\277\001\n\001b\030\002 \001(\0132I.buf.v" + + "alidate.conformance.cases.PredefinedAndC" + + "ustomRuleEdition2023.NestedBf\272Hc\272\001`\n0pre" + + "defined_and_custom_rule_embedded_edition" + + "_2023\022\033b.c must be a multiple of 3\032\017this" + + ".c % 3 == 0R\001b\032y\n\006Nested\022o\n\001c\030\001 \001(\005Ba\272H^" + + "\032\003\320H\001\272\001V\n.predefined_and_custom_rule_nes" + + "ted_edition_2023\032$this > 0 ? \'\' : \'c mus" + + "t be positive\'R\001c\"\261\001\n*StandardPredefined" + + "AndCustomRuleEdition2023\022\202\001\n\001a\030\001 \001(\005Bt\272H" + + "q\032\005\020\034\320H\001\272\001g\n7standard_predefined_and_cus" + + "tom_rule_scalar_edition_2023\032,this > 24 " + + "? \'\' : \'a must be greater than 24\'R\001a:\272\001" + + "\n\034float_abs_range_edition_2023\022\030.buf.val" + + "idate.FloatRules\030\212\t \001(\002B_\302H\\\nZ\n\034float.ab" + + "s_range.edition_2023\022\033float value is out" + + " of range\032\035this >= -rule && this <= rule" + + "R\030floatAbsRangeEdition2023:\277\001\n\035double_ab" + + "s_range_edition_2023\022\031.buf.validate.Doub" + + "leRules\030\212\t \001(\001Ba\302H^\n\\\n\035double.abs_range." + + "edition_2023\022\034double value is out of ran" + + "ge\032\035this >= -rule && this <= ruleR\031doubl" + + "eAbsRangeEdition2023:\230\001\n\027int32_even_edit" + + "ion_2023\022\030.buf.validate.Int32Rules\030\212\t \001(" + + "\010BF\302HC\nA\n\027int32.even.edition_2023\022\027int32" + + " value is not even\032\rthis % 2 == 0R\024int32" + + "EvenEdition2023:\230\001\n\027int64_even_edition_2" + + "023\022\030.buf.validate.Int64Rules\030\212\t \001(\010BF\302H" + + "C\nA\n\027int64.even.edition_2023\022\027int64 valu" + + "e is not even\032\rthis % 2 == 0R\024int64EvenE" + + "dition2023:\237\001\n\030uint32_even_edition_2023\022" + + "\031.buf.validate.UInt32Rules\030\212\t \001(\010BJ\302HG\nE" + + "\n\030uint32.even.edition_2023\022\030uint32 value" + + " is not even\032\017this % 2u == 0uR\025uint32Eve" + + "nEdition2023:\237\001\n\030uint64_even_edition_202" + + "3\022\031.buf.validate.UInt64Rules\030\212\t \001(\010BJ\302HG" + + "\nE\n\030uint64.even.edition_2023\022\030uint64 val" + + "ue is not even\032\017this % 2u == 0uR\025uint64E" + + "venEdition2023:\235\001\n\030sint32_even_edition_2" + + "023\022\031.buf.validate.SInt32Rules\030\212\t \001(\010BH\302" + + "HE\nC\n\030sint32.even.edition_2023\022\030sint32 v" + + "alue is not even\032\rthis % 2 == 0R\025sint32E" + + "venEdition2023:\235\001\n\030sint64_even_edition_2" + + "023\022\031.buf.validate.SInt64Rules\030\212\t \001(\010BH\302" + + "HE\nC\n\030sint64.even.edition_2023\022\030sint64 v" + + "alue is not even\032\rthis % 2 == 0R\025sint64E" + + "venEdition2023:\244\001\n\031fixed32_even_edition_" + + "2023\022\032.buf.validate.Fixed32Rules\030\212\t \001(\010B" + + "L\302HI\nG\n\031fixed32.even.edition_2023\022\031fixed" + + "32 value is not even\032\017this % 2u == 0uR\026f" + + "ixed32EvenEdition2023:\244\001\n\031fixed64_even_e" + + "dition_2023\022\032.buf.validate.Fixed64Rules\030" + + "\212\t \001(\010BL\302HI\nG\n\031fixed64.even.edition_2023" + + "\022\031fixed64 value is not even\032\017this % 2u =" + + "= 0uR\026fixed64EvenEdition2023:\247\001\n\032sfixed3" + + "2_even_edition_2023\022\033.buf.validate.SFixe" + + "d32Rules\030\212\t \001(\010BL\302HI\nG\n\032sfixed32.even.ed" + + "ition_2023\022\032sfixed32 value is not even\032\r" + + "this % 2 == 0R\027sfixed32EvenEdition2023:\247" + + "\001\n\032sfixed64_even_edition_2023\022\033.buf.vali" + + "date.SFixed64Rules\030\212\t \001(\010BL\302HI\nG\n\032sfixed" + + "64.even.edition_2023\022\032sfixed64 value is " + + "not even\032\rthis % 2 == 0R\027sfixed64EvenEdi" + + "tion2023:\227\001\n\027bool_false_edition_2023\022\027.b" + + "uf.validate.BoolRules\030\212\t \001(\010BF\302HC\nA\n\027boo" + + "l.false.edition_2023\022\027bool value is not " + + "false\032\rthis == falseR\024boolFalseEdition20" + + "23:\217\002\n\036string_valid_path_edition_2023\022\031." + + "buf.validate.StringRules\030\212\t \001(\010B\256\001\302H\252\001\n\247" + + "\001\n\036string.valid_path.edition_2023\032\204\001!thi" + + "s.matches(\'^([^/.][^/]?|[^/][^/.]|[^/]{3" + + ",})(/([^/.][^/]?|[^/][^/.]|[^/]{3,}))*$\'" + + ") ? \'not a valid path: `%s`\'.format([thi" + + "s]) : \'\'R\032stringValidPathEdition2023:\223\002\n" + + "\035bytes_valid_path_edition_2023\022\030.buf.val" + + "idate.BytesRules\030\212\t \001(\010B\265\001\302H\261\001\n\256\001\n\035bytes" + + ".valid_path.edition_2023\032\214\001!string(this)" + + ".matches(\'^([^/.][^/]?|[^/][^/.]|[^/]{3," + + "})(/([^/.][^/]?|[^/][^/.]|[^/]{3,}))*$\')" + + " ? \'not a valid path: `%s`\'.format([this" + + "]) : \'\'R\031bytesValidPathEdition2023:\243\001\n\032e" + + "num_non_zero_edition_2023\022\027.buf.validate" + + ".EnumRules\030\212\t \001(\010BM\302HJ\nH\n\032enum.non_zero." + + "edition_2023\022\032enum value is not non-zero" + + "\032\016int(this) != 0R\026enumNonZeroEdition2023" + + ":\335\001\n#repeated_at_least_five_edition_2023" + + "\022\033.buf.validate.RepeatedRules\030\212\t \001(\010Br\302H" + + "o\nm\n#repeated.at_least_five.edition_2023" + + "\022-repeated field must have at least five" + + " values\032\027uint(this.size()) >= 5uR\036repeat" + + "edAtLeastFiveEdition2023:\275\001\n\036map_at_leas" + + "t_five_edition_2023\022\026.buf.validate.MapRu" + + "les\030\212\t \001(\010Ba\302H^\n\\\n\036map.at_least_five.edi" + + "tion_2023\022!map must have at least five p" + + "airs\032\027uint(this.size()) >= 5uR\031mapAtLeas" + + "tFiveEdition2023:\312\001\n\036duration_too_long_e" + + "dition_2023\022\033.buf.validate.DurationRules" + + "\030\212\t \001(\010Bh\302He\nc\n\036duration.too_long.editio" + + "n_2023\022(duration can\'t be longer than 10" + + " seconds\032\027this <= duration(\'10s\')R\032durat" + + "ionTooLongEdition2023:\331\001\n\037timestamp_in_r" + + "ange_edition_2023\022\034.buf.validate.Timesta" + + "mpRules\030\212\t \001(\010Bt\302Hq\no\n!timestamp.time_ra" + + "nge.edition_2023\022\026timestamp out of range" + + "\0322int(this) >= 1049587200 && int(this) <" + + "= 1080432000R\033timestampInRangeEdition202" + + "3B\345\001\n$build.buf.validate.conformance.cas" + + "esB!PredefinedRulesProtoEditionsProtoP\001\242" + + "\002\004BVCC\252\002\036Buf.Validate.Conformance.Cases\312" + + "\002\036Buf\\Validate\\Conformance\\Cases\342\002*Buf\\V" + + "alidate\\Conformance\\Cases\\GPBMetadata\352\002!" + + "Buf::Validate::Conformance::Casesb\010editi" + + "onsp\350\007" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + build.buf.validate.ValidateProto.getDescriptor(), + com.google.protobuf.DurationProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + }); + internal_static_buf_validate_conformance_cases_PredefinedFloatRuleEdition2023_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_buf_validate_conformance_cases_PredefinedFloatRuleEdition2023_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_PredefinedFloatRuleEdition2023_descriptor, + new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_PredefinedDoubleRuleEdition2023_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_buf_validate_conformance_cases_PredefinedDoubleRuleEdition2023_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_PredefinedDoubleRuleEdition2023_descriptor, + new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_PredefinedInt32RuleEdition2023_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_buf_validate_conformance_cases_PredefinedInt32RuleEdition2023_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_PredefinedInt32RuleEdition2023_descriptor, + new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_PredefinedInt64RuleEdition2023_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_buf_validate_conformance_cases_PredefinedInt64RuleEdition2023_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_PredefinedInt64RuleEdition2023_descriptor, + new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_PredefinedUInt32RuleEdition2023_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_buf_validate_conformance_cases_PredefinedUInt32RuleEdition2023_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_PredefinedUInt32RuleEdition2023_descriptor, + new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_PredefinedUInt64RuleEdition2023_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_buf_validate_conformance_cases_PredefinedUInt64RuleEdition2023_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_PredefinedUInt64RuleEdition2023_descriptor, + new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_PredefinedSInt32RuleEdition2023_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_buf_validate_conformance_cases_PredefinedSInt32RuleEdition2023_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_PredefinedSInt32RuleEdition2023_descriptor, + new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_PredefinedSInt64RuleEdition2023_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_buf_validate_conformance_cases_PredefinedSInt64RuleEdition2023_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_PredefinedSInt64RuleEdition2023_descriptor, + new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_PredefinedFixed32RuleEdition2023_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_buf_validate_conformance_cases_PredefinedFixed32RuleEdition2023_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_PredefinedFixed32RuleEdition2023_descriptor, + new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_PredefinedFixed64RuleEdition2023_descriptor = + getDescriptor().getMessageTypes().get(9); + internal_static_buf_validate_conformance_cases_PredefinedFixed64RuleEdition2023_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_PredefinedFixed64RuleEdition2023_descriptor, + new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_PredefinedSFixed32RuleEdition2023_descriptor = + getDescriptor().getMessageTypes().get(10); + internal_static_buf_validate_conformance_cases_PredefinedSFixed32RuleEdition2023_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_PredefinedSFixed32RuleEdition2023_descriptor, + new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_PredefinedSFixed64RuleEdition2023_descriptor = + getDescriptor().getMessageTypes().get(11); + internal_static_buf_validate_conformance_cases_PredefinedSFixed64RuleEdition2023_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_PredefinedSFixed64RuleEdition2023_descriptor, + new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_PredefinedBoolRuleEdition2023_descriptor = + getDescriptor().getMessageTypes().get(12); + internal_static_buf_validate_conformance_cases_PredefinedBoolRuleEdition2023_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_PredefinedBoolRuleEdition2023_descriptor, + new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_PredefinedStringRuleEdition2023_descriptor = + getDescriptor().getMessageTypes().get(13); + internal_static_buf_validate_conformance_cases_PredefinedStringRuleEdition2023_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_PredefinedStringRuleEdition2023_descriptor, + new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_PredefinedBytesRuleEdition2023_descriptor = + getDescriptor().getMessageTypes().get(14); + internal_static_buf_validate_conformance_cases_PredefinedBytesRuleEdition2023_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_PredefinedBytesRuleEdition2023_descriptor, + new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_PredefinedEnumRuleEdition2023_descriptor = + getDescriptor().getMessageTypes().get(15); + internal_static_buf_validate_conformance_cases_PredefinedEnumRuleEdition2023_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_PredefinedEnumRuleEdition2023_descriptor, + new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_PredefinedRepeatedRuleEdition2023_descriptor = + getDescriptor().getMessageTypes().get(16); + internal_static_buf_validate_conformance_cases_PredefinedRepeatedRuleEdition2023_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_PredefinedRepeatedRuleEdition2023_descriptor, + new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_PredefinedMapRuleEdition2023_descriptor = + getDescriptor().getMessageTypes().get(17); + internal_static_buf_validate_conformance_cases_PredefinedMapRuleEdition2023_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_PredefinedMapRuleEdition2023_descriptor, + new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_PredefinedMapRuleEdition2023_ValEntry_descriptor = + internal_static_buf_validate_conformance_cases_PredefinedMapRuleEdition2023_descriptor.getNestedTypes().get(0); + internal_static_buf_validate_conformance_cases_PredefinedMapRuleEdition2023_ValEntry_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_PredefinedMapRuleEdition2023_ValEntry_descriptor, + new java.lang.String[] { "Key", "Value", }); + internal_static_buf_validate_conformance_cases_PredefinedDurationRuleEdition2023_descriptor = + getDescriptor().getMessageTypes().get(18); + internal_static_buf_validate_conformance_cases_PredefinedDurationRuleEdition2023_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_PredefinedDurationRuleEdition2023_descriptor, + new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_PredefinedTimestampRuleEdition2023_descriptor = + getDescriptor().getMessageTypes().get(19); + internal_static_buf_validate_conformance_cases_PredefinedTimestampRuleEdition2023_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_PredefinedTimestampRuleEdition2023_descriptor, + new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_PredefinedAndCustomRuleEdition2023_descriptor = + getDescriptor().getMessageTypes().get(20); + internal_static_buf_validate_conformance_cases_PredefinedAndCustomRuleEdition2023_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_PredefinedAndCustomRuleEdition2023_descriptor, + new java.lang.String[] { "A", "B", }); + internal_static_buf_validate_conformance_cases_PredefinedAndCustomRuleEdition2023_Nested_descriptor = + internal_static_buf_validate_conformance_cases_PredefinedAndCustomRuleEdition2023_descriptor.getNestedTypes().get(0); + internal_static_buf_validate_conformance_cases_PredefinedAndCustomRuleEdition2023_Nested_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_PredefinedAndCustomRuleEdition2023_Nested_descriptor, + new java.lang.String[] { "C", }); + internal_static_buf_validate_conformance_cases_StandardPredefinedAndCustomRuleEdition2023_descriptor = + getDescriptor().getMessageTypes().get(21); + internal_static_buf_validate_conformance_cases_StandardPredefinedAndCustomRuleEdition2023_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_StandardPredefinedAndCustomRuleEdition2023_descriptor, + new java.lang.String[] { "A", }); + floatAbsRangeEdition2023.internalInit(descriptor.getExtensions().get(0)); + doubleAbsRangeEdition2023.internalInit(descriptor.getExtensions().get(1)); + int32EvenEdition2023.internalInit(descriptor.getExtensions().get(2)); + int64EvenEdition2023.internalInit(descriptor.getExtensions().get(3)); + uint32EvenEdition2023.internalInit(descriptor.getExtensions().get(4)); + uint64EvenEdition2023.internalInit(descriptor.getExtensions().get(5)); + sint32EvenEdition2023.internalInit(descriptor.getExtensions().get(6)); + sint64EvenEdition2023.internalInit(descriptor.getExtensions().get(7)); + fixed32EvenEdition2023.internalInit(descriptor.getExtensions().get(8)); + fixed64EvenEdition2023.internalInit(descriptor.getExtensions().get(9)); + sfixed32EvenEdition2023.internalInit(descriptor.getExtensions().get(10)); + sfixed64EvenEdition2023.internalInit(descriptor.getExtensions().get(11)); + boolFalseEdition2023.internalInit(descriptor.getExtensions().get(12)); + stringValidPathEdition2023.internalInit(descriptor.getExtensions().get(13)); + bytesValidPathEdition2023.internalInit(descriptor.getExtensions().get(14)); + enumNonZeroEdition2023.internalInit(descriptor.getExtensions().get(15)); + repeatedAtLeastFiveEdition2023.internalInit(descriptor.getExtensions().get(16)); + mapAtLeastFiveEdition2023.internalInit(descriptor.getExtensions().get(17)); + durationTooLongEdition2023.internalInit(descriptor.getExtensions().get(18)); + timestampInRangeEdition2023.internalInit(descriptor.getExtensions().get(19)); + descriptor.resolveAllFeaturesImmutable(); + build.buf.validate.ValidateProto.getDescriptor(); + com.google.protobuf.DurationProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.boolFalseEdition2023); + registry.add(build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.bytesValidPathEdition2023); + registry.add(build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.doubleAbsRangeEdition2023); + registry.add(build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.durationTooLongEdition2023); + registry.add(build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.enumNonZeroEdition2023); + registry.add(build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.fixed32EvenEdition2023); + registry.add(build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.fixed64EvenEdition2023); + registry.add(build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.floatAbsRangeEdition2023); + registry.add(build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.int32EvenEdition2023); + registry.add(build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.int64EvenEdition2023); + registry.add(build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.mapAtLeastFiveEdition2023); + registry.add(build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.repeatedAtLeastFiveEdition2023); + registry.add(build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.sfixed32EvenEdition2023); + registry.add(build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.sfixed64EvenEdition2023); + registry.add(build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.sint32EvenEdition2023); + registry.add(build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.sint64EvenEdition2023); + registry.add(build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.stringValidPathEdition2023); + registry.add(build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.timestampInRangeEdition2023); + registry.add(build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.uint32EvenEdition2023); + registry.add(build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.uint64EvenEdition2023); + registry.add(build.buf.validate.ValidateProto.field); + registry.add(build.buf.validate.ValidateProto.predefined); + com.google.protobuf.Descriptors.FileDescriptor + .internalUpdateFileDescriptor(descriptor, registry); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedSFixed32RuleEdition2023.java b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedSFixed32RuleEdition2023.java new file mode 100644 index 00000000..aa56c9d0 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedSFixed32RuleEdition2023.java @@ -0,0 +1,456 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/predefined_rules_proto_editions.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.PredefinedSFixed32RuleEdition2023} + */ +public final class PredefinedSFixed32RuleEdition2023 extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.PredefinedSFixed32RuleEdition2023) + PredefinedSFixed32RuleEdition2023OrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 1, + /* suffix= */ "", + PredefinedSFixed32RuleEdition2023.class.getName()); + } + // Use PredefinedSFixed32RuleEdition2023.newBuilder() to construct. + private PredefinedSFixed32RuleEdition2023(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private PredefinedSFixed32RuleEdition2023() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.internal_static_buf_validate_conformance_cases_PredefinedSFixed32RuleEdition2023_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.internal_static_buf_validate_conformance_cases_PredefinedSFixed32RuleEdition2023_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.PredefinedSFixed32RuleEdition2023.class, build.buf.validate.conformance.cases.PredefinedSFixed32RuleEdition2023.Builder.class); + } + + private int bitField0_; + public static final int VAL_FIELD_NUMBER = 1; + private int val_ = 0; + /** + * sfixed32 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); + } + /** + * sfixed32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public int getVal() { + return val_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + output.writeSFixed32(1, val_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeSFixed32Size(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.PredefinedSFixed32RuleEdition2023)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.PredefinedSFixed32RuleEdition2023 other = (build.buf.validate.conformance.cases.PredefinedSFixed32RuleEdition2023) obj; + + if (hasVal() != other.hasVal()) return false; + if (hasVal()) { + if (getVal() + != other.getVal()) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasVal()) { + hash = (37 * hash) + VAL_FIELD_NUMBER; + hash = (53 * hash) + getVal(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.PredefinedSFixed32RuleEdition2023 parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedSFixed32RuleEdition2023 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.PredefinedSFixed32RuleEdition2023 parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedSFixed32RuleEdition2023 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.PredefinedSFixed32RuleEdition2023 parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedSFixed32RuleEdition2023 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.PredefinedSFixed32RuleEdition2023 parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.PredefinedSFixed32RuleEdition2023 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.PredefinedSFixed32RuleEdition2023 parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.PredefinedSFixed32RuleEdition2023 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.PredefinedSFixed32RuleEdition2023 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.PredefinedSFixed32RuleEdition2023 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.PredefinedSFixed32RuleEdition2023 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.PredefinedSFixed32RuleEdition2023} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.PredefinedSFixed32RuleEdition2023) + build.buf.validate.conformance.cases.PredefinedSFixed32RuleEdition2023OrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.internal_static_buf_validate_conformance_cases_PredefinedSFixed32RuleEdition2023_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.internal_static_buf_validate_conformance_cases_PredefinedSFixed32RuleEdition2023_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.PredefinedSFixed32RuleEdition2023.class, build.buf.validate.conformance.cases.PredefinedSFixed32RuleEdition2023.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.PredefinedSFixed32RuleEdition2023.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + val_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.internal_static_buf_validate_conformance_cases_PredefinedSFixed32RuleEdition2023_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedSFixed32RuleEdition2023 getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.PredefinedSFixed32RuleEdition2023.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedSFixed32RuleEdition2023 build() { + build.buf.validate.conformance.cases.PredefinedSFixed32RuleEdition2023 result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedSFixed32RuleEdition2023 buildPartial() { + build.buf.validate.conformance.cases.PredefinedSFixed32RuleEdition2023 result = new build.buf.validate.conformance.cases.PredefinedSFixed32RuleEdition2023(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.PredefinedSFixed32RuleEdition2023 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.PredefinedSFixed32RuleEdition2023) { + return mergeFrom((build.buf.validate.conformance.cases.PredefinedSFixed32RuleEdition2023)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.PredefinedSFixed32RuleEdition2023 other) { + if (other == build.buf.validate.conformance.cases.PredefinedSFixed32RuleEdition2023.getDefaultInstance()) return this; + if (other.hasVal()) { + setVal(other.getVal()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 13: { + val_ = input.readSFixed32(); + bitField0_ |= 0x00000001; + break; + } // case 13 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private int val_ ; + /** + * sfixed32 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); + } + /** + * sfixed32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public int getVal() { + return val_; + } + /** + * sfixed32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param value The val to set. + * @return This builder for chaining. + */ + public Builder setVal(int value) { + + val_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * sfixed32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return This builder for chaining. + */ + public Builder clearVal() { + bitField0_ = (bitField0_ & ~0x00000001); + val_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.PredefinedSFixed32RuleEdition2023) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.PredefinedSFixed32RuleEdition2023) + private static final build.buf.validate.conformance.cases.PredefinedSFixed32RuleEdition2023 DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.PredefinedSFixed32RuleEdition2023(); + } + + public static build.buf.validate.conformance.cases.PredefinedSFixed32RuleEdition2023 getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PredefinedSFixed32RuleEdition2023 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.PredefinedSFixed32RuleEdition2023 getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedSFixed32RuleEdition2023OrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedSFixed32RuleEdition2023OrBuilder.java new file mode 100644 index 00000000..831e2dfd --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedSFixed32RuleEdition2023OrBuilder.java @@ -0,0 +1,22 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/predefined_rules_proto_editions.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +public interface PredefinedSFixed32RuleEdition2023OrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.PredefinedSFixed32RuleEdition2023) + com.google.protobuf.MessageOrBuilder { + + /** + * sfixed32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + boolean hasVal(); + /** + * sfixed32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + int getVal(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedSFixed32RuleProto2.java b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedSFixed32RuleProto2.java new file mode 100644 index 00000000..5de43406 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedSFixed32RuleProto2.java @@ -0,0 +1,456 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/predefined_rules_proto2.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.PredefinedSFixed32RuleProto2} + */ +public final class PredefinedSFixed32RuleProto2 extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.PredefinedSFixed32RuleProto2) + PredefinedSFixed32RuleProto2OrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 1, + /* suffix= */ "", + PredefinedSFixed32RuleProto2.class.getName()); + } + // Use PredefinedSFixed32RuleProto2.newBuilder() to construct. + private PredefinedSFixed32RuleProto2(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private PredefinedSFixed32RuleProto2() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.internal_static_buf_validate_conformance_cases_PredefinedSFixed32RuleProto2_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.internal_static_buf_validate_conformance_cases_PredefinedSFixed32RuleProto2_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.PredefinedSFixed32RuleProto2.class, build.buf.validate.conformance.cases.PredefinedSFixed32RuleProto2.Builder.class); + } + + private int bitField0_; + public static final int VAL_FIELD_NUMBER = 1; + private int val_ = 0; + /** + * optional sfixed32 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 sfixed32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public int getVal() { + return val_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + output.writeSFixed32(1, val_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeSFixed32Size(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.PredefinedSFixed32RuleProto2)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.PredefinedSFixed32RuleProto2 other = (build.buf.validate.conformance.cases.PredefinedSFixed32RuleProto2) obj; + + if (hasVal() != other.hasVal()) return false; + if (hasVal()) { + if (getVal() + != other.getVal()) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasVal()) { + hash = (37 * hash) + VAL_FIELD_NUMBER; + hash = (53 * hash) + getVal(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.PredefinedSFixed32RuleProto2 parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedSFixed32RuleProto2 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.PredefinedSFixed32RuleProto2 parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedSFixed32RuleProto2 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.PredefinedSFixed32RuleProto2 parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedSFixed32RuleProto2 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.PredefinedSFixed32RuleProto2 parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.PredefinedSFixed32RuleProto2 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.PredefinedSFixed32RuleProto2 parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.PredefinedSFixed32RuleProto2 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.PredefinedSFixed32RuleProto2 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.PredefinedSFixed32RuleProto2 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.PredefinedSFixed32RuleProto2 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.PredefinedSFixed32RuleProto2} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.PredefinedSFixed32RuleProto2) + build.buf.validate.conformance.cases.PredefinedSFixed32RuleProto2OrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.internal_static_buf_validate_conformance_cases_PredefinedSFixed32RuleProto2_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.internal_static_buf_validate_conformance_cases_PredefinedSFixed32RuleProto2_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.PredefinedSFixed32RuleProto2.class, build.buf.validate.conformance.cases.PredefinedSFixed32RuleProto2.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.PredefinedSFixed32RuleProto2.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + val_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.internal_static_buf_validate_conformance_cases_PredefinedSFixed32RuleProto2_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedSFixed32RuleProto2 getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.PredefinedSFixed32RuleProto2.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedSFixed32RuleProto2 build() { + build.buf.validate.conformance.cases.PredefinedSFixed32RuleProto2 result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedSFixed32RuleProto2 buildPartial() { + build.buf.validate.conformance.cases.PredefinedSFixed32RuleProto2 result = new build.buf.validate.conformance.cases.PredefinedSFixed32RuleProto2(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.PredefinedSFixed32RuleProto2 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.PredefinedSFixed32RuleProto2) { + return mergeFrom((build.buf.validate.conformance.cases.PredefinedSFixed32RuleProto2)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.PredefinedSFixed32RuleProto2 other) { + if (other == build.buf.validate.conformance.cases.PredefinedSFixed32RuleProto2.getDefaultInstance()) return this; + if (other.hasVal()) { + setVal(other.getVal()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 13: { + val_ = input.readSFixed32(); + bitField0_ |= 0x00000001; + break; + } // case 13 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private int val_ ; + /** + * optional sfixed32 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 sfixed32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public int getVal() { + return val_; + } + /** + * optional sfixed32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param value The val to set. + * @return This builder for chaining. + */ + public Builder setVal(int value) { + + val_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * optional sfixed32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return This builder for chaining. + */ + public Builder clearVal() { + bitField0_ = (bitField0_ & ~0x00000001); + val_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.PredefinedSFixed32RuleProto2) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.PredefinedSFixed32RuleProto2) + private static final build.buf.validate.conformance.cases.PredefinedSFixed32RuleProto2 DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.PredefinedSFixed32RuleProto2(); + } + + public static build.buf.validate.conformance.cases.PredefinedSFixed32RuleProto2 getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PredefinedSFixed32RuleProto2 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.PredefinedSFixed32RuleProto2 getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedSFixed32RuleProto2OrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedSFixed32RuleProto2OrBuilder.java new file mode 100644 index 00000000..7697282c --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedSFixed32RuleProto2OrBuilder.java @@ -0,0 +1,22 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/predefined_rules_proto2.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +public interface PredefinedSFixed32RuleProto2OrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.PredefinedSFixed32RuleProto2) + com.google.protobuf.MessageOrBuilder { + + /** + * optional sfixed32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + boolean hasVal(); + /** + * optional sfixed32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + int getVal(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedSFixed32RuleProto3.java b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedSFixed32RuleProto3.java new file mode 100644 index 00000000..1229d7e5 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedSFixed32RuleProto3.java @@ -0,0 +1,431 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/predefined_rules_proto3.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.PredefinedSFixed32RuleProto3} + */ +public final class PredefinedSFixed32RuleProto3 extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.PredefinedSFixed32RuleProto3) + PredefinedSFixed32RuleProto3OrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 1, + /* suffix= */ "", + PredefinedSFixed32RuleProto3.class.getName()); + } + // Use PredefinedSFixed32RuleProto3.newBuilder() to construct. + private PredefinedSFixed32RuleProto3(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private PredefinedSFixed32RuleProto3() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.PredefinedRulesProto3Proto.internal_static_buf_validate_conformance_cases_PredefinedSFixed32RuleProto3_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.PredefinedRulesProto3Proto.internal_static_buf_validate_conformance_cases_PredefinedSFixed32RuleProto3_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.PredefinedSFixed32RuleProto3.class, build.buf.validate.conformance.cases.PredefinedSFixed32RuleProto3.Builder.class); + } + + public static final int VAL_FIELD_NUMBER = 1; + private int val_ = 0; + /** + * sfixed32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public int getVal() { + return val_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (val_ != 0) { + output.writeSFixed32(1, val_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (val_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeSFixed32Size(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.PredefinedSFixed32RuleProto3)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.PredefinedSFixed32RuleProto3 other = (build.buf.validate.conformance.cases.PredefinedSFixed32RuleProto3) obj; + + if (getVal() + != other.getVal()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + VAL_FIELD_NUMBER; + hash = (53 * hash) + getVal(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.PredefinedSFixed32RuleProto3 parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedSFixed32RuleProto3 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.PredefinedSFixed32RuleProto3 parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedSFixed32RuleProto3 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.PredefinedSFixed32RuleProto3 parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedSFixed32RuleProto3 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.PredefinedSFixed32RuleProto3 parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.PredefinedSFixed32RuleProto3 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.PredefinedSFixed32RuleProto3 parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.PredefinedSFixed32RuleProto3 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.PredefinedSFixed32RuleProto3 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.PredefinedSFixed32RuleProto3 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.PredefinedSFixed32RuleProto3 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.PredefinedSFixed32RuleProto3} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.PredefinedSFixed32RuleProto3) + build.buf.validate.conformance.cases.PredefinedSFixed32RuleProto3OrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.PredefinedRulesProto3Proto.internal_static_buf_validate_conformance_cases_PredefinedSFixed32RuleProto3_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.PredefinedRulesProto3Proto.internal_static_buf_validate_conformance_cases_PredefinedSFixed32RuleProto3_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.PredefinedSFixed32RuleProto3.class, build.buf.validate.conformance.cases.PredefinedSFixed32RuleProto3.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.PredefinedSFixed32RuleProto3.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + val_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.PredefinedRulesProto3Proto.internal_static_buf_validate_conformance_cases_PredefinedSFixed32RuleProto3_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedSFixed32RuleProto3 getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.PredefinedSFixed32RuleProto3.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedSFixed32RuleProto3 build() { + build.buf.validate.conformance.cases.PredefinedSFixed32RuleProto3 result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedSFixed32RuleProto3 buildPartial() { + build.buf.validate.conformance.cases.PredefinedSFixed32RuleProto3 result = new build.buf.validate.conformance.cases.PredefinedSFixed32RuleProto3(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.PredefinedSFixed32RuleProto3 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.PredefinedSFixed32RuleProto3) { + return mergeFrom((build.buf.validate.conformance.cases.PredefinedSFixed32RuleProto3)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.PredefinedSFixed32RuleProto3 other) { + if (other == build.buf.validate.conformance.cases.PredefinedSFixed32RuleProto3.getDefaultInstance()) return this; + if (other.getVal() != 0) { + setVal(other.getVal()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 13: { + val_ = input.readSFixed32(); + bitField0_ |= 0x00000001; + break; + } // case 13 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private int val_ ; + /** + * sfixed32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public int getVal() { + return val_; + } + /** + * sfixed32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param value The val to set. + * @return This builder for chaining. + */ + public Builder setVal(int value) { + + val_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * sfixed32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return This builder for chaining. + */ + public Builder clearVal() { + bitField0_ = (bitField0_ & ~0x00000001); + val_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.PredefinedSFixed32RuleProto3) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.PredefinedSFixed32RuleProto3) + private static final build.buf.validate.conformance.cases.PredefinedSFixed32RuleProto3 DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.PredefinedSFixed32RuleProto3(); + } + + public static build.buf.validate.conformance.cases.PredefinedSFixed32RuleProto3 getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PredefinedSFixed32RuleProto3 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.PredefinedSFixed32RuleProto3 getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedSFixed32RuleProto3OrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedSFixed32RuleProto3OrBuilder.java new file mode 100644 index 00000000..683104f1 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedSFixed32RuleProto3OrBuilder.java @@ -0,0 +1,17 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/predefined_rules_proto3.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +public interface PredefinedSFixed32RuleProto3OrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.PredefinedSFixed32RuleProto3) + com.google.protobuf.MessageOrBuilder { + + /** + * sfixed32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + int getVal(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedSFixed64RuleEdition2023.java b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedSFixed64RuleEdition2023.java new file mode 100644 index 00000000..0272cc27 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedSFixed64RuleEdition2023.java @@ -0,0 +1,457 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/predefined_rules_proto_editions.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.PredefinedSFixed64RuleEdition2023} + */ +public final class PredefinedSFixed64RuleEdition2023 extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.PredefinedSFixed64RuleEdition2023) + PredefinedSFixed64RuleEdition2023OrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 1, + /* suffix= */ "", + PredefinedSFixed64RuleEdition2023.class.getName()); + } + // Use PredefinedSFixed64RuleEdition2023.newBuilder() to construct. + private PredefinedSFixed64RuleEdition2023(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private PredefinedSFixed64RuleEdition2023() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.internal_static_buf_validate_conformance_cases_PredefinedSFixed64RuleEdition2023_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.internal_static_buf_validate_conformance_cases_PredefinedSFixed64RuleEdition2023_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.PredefinedSFixed64RuleEdition2023.class, build.buf.validate.conformance.cases.PredefinedSFixed64RuleEdition2023.Builder.class); + } + + private int bitField0_; + public static final int VAL_FIELD_NUMBER = 1; + private long val_ = 0L; + /** + * sfixed64 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); + } + /** + * sfixed64 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public long getVal() { + return val_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + output.writeSFixed64(1, val_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeSFixed64Size(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.PredefinedSFixed64RuleEdition2023)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.PredefinedSFixed64RuleEdition2023 other = (build.buf.validate.conformance.cases.PredefinedSFixed64RuleEdition2023) obj; + + if (hasVal() != other.hasVal()) return false; + if (hasVal()) { + if (getVal() + != other.getVal()) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasVal()) { + hash = (37 * hash) + VAL_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getVal()); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.PredefinedSFixed64RuleEdition2023 parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedSFixed64RuleEdition2023 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.PredefinedSFixed64RuleEdition2023 parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedSFixed64RuleEdition2023 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.PredefinedSFixed64RuleEdition2023 parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedSFixed64RuleEdition2023 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.PredefinedSFixed64RuleEdition2023 parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.PredefinedSFixed64RuleEdition2023 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.PredefinedSFixed64RuleEdition2023 parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.PredefinedSFixed64RuleEdition2023 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.PredefinedSFixed64RuleEdition2023 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.PredefinedSFixed64RuleEdition2023 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.PredefinedSFixed64RuleEdition2023 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.PredefinedSFixed64RuleEdition2023} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.PredefinedSFixed64RuleEdition2023) + build.buf.validate.conformance.cases.PredefinedSFixed64RuleEdition2023OrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.internal_static_buf_validate_conformance_cases_PredefinedSFixed64RuleEdition2023_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.internal_static_buf_validate_conformance_cases_PredefinedSFixed64RuleEdition2023_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.PredefinedSFixed64RuleEdition2023.class, build.buf.validate.conformance.cases.PredefinedSFixed64RuleEdition2023.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.PredefinedSFixed64RuleEdition2023.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + val_ = 0L; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.internal_static_buf_validate_conformance_cases_PredefinedSFixed64RuleEdition2023_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedSFixed64RuleEdition2023 getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.PredefinedSFixed64RuleEdition2023.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedSFixed64RuleEdition2023 build() { + build.buf.validate.conformance.cases.PredefinedSFixed64RuleEdition2023 result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedSFixed64RuleEdition2023 buildPartial() { + build.buf.validate.conformance.cases.PredefinedSFixed64RuleEdition2023 result = new build.buf.validate.conformance.cases.PredefinedSFixed64RuleEdition2023(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.PredefinedSFixed64RuleEdition2023 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.PredefinedSFixed64RuleEdition2023) { + return mergeFrom((build.buf.validate.conformance.cases.PredefinedSFixed64RuleEdition2023)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.PredefinedSFixed64RuleEdition2023 other) { + if (other == build.buf.validate.conformance.cases.PredefinedSFixed64RuleEdition2023.getDefaultInstance()) return this; + if (other.hasVal()) { + setVal(other.getVal()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 9: { + val_ = input.readSFixed64(); + bitField0_ |= 0x00000001; + break; + } // case 9 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private long val_ ; + /** + * sfixed64 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); + } + /** + * sfixed64 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public long getVal() { + return val_; + } + /** + * sfixed64 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param value The val to set. + * @return This builder for chaining. + */ + public Builder setVal(long value) { + + val_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * sfixed64 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return This builder for chaining. + */ + public Builder clearVal() { + bitField0_ = (bitField0_ & ~0x00000001); + val_ = 0L; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.PredefinedSFixed64RuleEdition2023) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.PredefinedSFixed64RuleEdition2023) + private static final build.buf.validate.conformance.cases.PredefinedSFixed64RuleEdition2023 DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.PredefinedSFixed64RuleEdition2023(); + } + + public static build.buf.validate.conformance.cases.PredefinedSFixed64RuleEdition2023 getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PredefinedSFixed64RuleEdition2023 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.PredefinedSFixed64RuleEdition2023 getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedSFixed64RuleEdition2023OrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedSFixed64RuleEdition2023OrBuilder.java new file mode 100644 index 00000000..c91dc22c --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedSFixed64RuleEdition2023OrBuilder.java @@ -0,0 +1,22 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/predefined_rules_proto_editions.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +public interface PredefinedSFixed64RuleEdition2023OrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.PredefinedSFixed64RuleEdition2023) + com.google.protobuf.MessageOrBuilder { + + /** + * sfixed64 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + boolean hasVal(); + /** + * sfixed64 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + long getVal(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedSFixed64RuleProto2.java b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedSFixed64RuleProto2.java new file mode 100644 index 00000000..4e2e4024 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedSFixed64RuleProto2.java @@ -0,0 +1,457 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/predefined_rules_proto2.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.PredefinedSFixed64RuleProto2} + */ +public final class PredefinedSFixed64RuleProto2 extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.PredefinedSFixed64RuleProto2) + PredefinedSFixed64RuleProto2OrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 1, + /* suffix= */ "", + PredefinedSFixed64RuleProto2.class.getName()); + } + // Use PredefinedSFixed64RuleProto2.newBuilder() to construct. + private PredefinedSFixed64RuleProto2(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private PredefinedSFixed64RuleProto2() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.internal_static_buf_validate_conformance_cases_PredefinedSFixed64RuleProto2_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.internal_static_buf_validate_conformance_cases_PredefinedSFixed64RuleProto2_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.PredefinedSFixed64RuleProto2.class, build.buf.validate.conformance.cases.PredefinedSFixed64RuleProto2.Builder.class); + } + + private int bitField0_; + public static final int VAL_FIELD_NUMBER = 1; + private long val_ = 0L; + /** + * optional sfixed64 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 sfixed64 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public long getVal() { + return val_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + output.writeSFixed64(1, val_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeSFixed64Size(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.PredefinedSFixed64RuleProto2)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.PredefinedSFixed64RuleProto2 other = (build.buf.validate.conformance.cases.PredefinedSFixed64RuleProto2) obj; + + if (hasVal() != other.hasVal()) return false; + if (hasVal()) { + if (getVal() + != other.getVal()) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasVal()) { + hash = (37 * hash) + VAL_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getVal()); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.PredefinedSFixed64RuleProto2 parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedSFixed64RuleProto2 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.PredefinedSFixed64RuleProto2 parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedSFixed64RuleProto2 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.PredefinedSFixed64RuleProto2 parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedSFixed64RuleProto2 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.PredefinedSFixed64RuleProto2 parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.PredefinedSFixed64RuleProto2 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.PredefinedSFixed64RuleProto2 parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.PredefinedSFixed64RuleProto2 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.PredefinedSFixed64RuleProto2 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.PredefinedSFixed64RuleProto2 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.PredefinedSFixed64RuleProto2 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.PredefinedSFixed64RuleProto2} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.PredefinedSFixed64RuleProto2) + build.buf.validate.conformance.cases.PredefinedSFixed64RuleProto2OrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.internal_static_buf_validate_conformance_cases_PredefinedSFixed64RuleProto2_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.internal_static_buf_validate_conformance_cases_PredefinedSFixed64RuleProto2_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.PredefinedSFixed64RuleProto2.class, build.buf.validate.conformance.cases.PredefinedSFixed64RuleProto2.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.PredefinedSFixed64RuleProto2.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + val_ = 0L; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.internal_static_buf_validate_conformance_cases_PredefinedSFixed64RuleProto2_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedSFixed64RuleProto2 getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.PredefinedSFixed64RuleProto2.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedSFixed64RuleProto2 build() { + build.buf.validate.conformance.cases.PredefinedSFixed64RuleProto2 result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedSFixed64RuleProto2 buildPartial() { + build.buf.validate.conformance.cases.PredefinedSFixed64RuleProto2 result = new build.buf.validate.conformance.cases.PredefinedSFixed64RuleProto2(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.PredefinedSFixed64RuleProto2 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.PredefinedSFixed64RuleProto2) { + return mergeFrom((build.buf.validate.conformance.cases.PredefinedSFixed64RuleProto2)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.PredefinedSFixed64RuleProto2 other) { + if (other == build.buf.validate.conformance.cases.PredefinedSFixed64RuleProto2.getDefaultInstance()) return this; + if (other.hasVal()) { + setVal(other.getVal()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 9: { + val_ = input.readSFixed64(); + bitField0_ |= 0x00000001; + break; + } // case 9 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private long val_ ; + /** + * optional sfixed64 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 sfixed64 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public long getVal() { + return val_; + } + /** + * optional sfixed64 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param value The val to set. + * @return This builder for chaining. + */ + public Builder setVal(long value) { + + val_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * optional sfixed64 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return This builder for chaining. + */ + public Builder clearVal() { + bitField0_ = (bitField0_ & ~0x00000001); + val_ = 0L; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.PredefinedSFixed64RuleProto2) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.PredefinedSFixed64RuleProto2) + private static final build.buf.validate.conformance.cases.PredefinedSFixed64RuleProto2 DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.PredefinedSFixed64RuleProto2(); + } + + public static build.buf.validate.conformance.cases.PredefinedSFixed64RuleProto2 getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PredefinedSFixed64RuleProto2 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.PredefinedSFixed64RuleProto2 getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedSFixed64RuleProto2OrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedSFixed64RuleProto2OrBuilder.java new file mode 100644 index 00000000..70b5fa80 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedSFixed64RuleProto2OrBuilder.java @@ -0,0 +1,22 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/predefined_rules_proto2.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +public interface PredefinedSFixed64RuleProto2OrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.PredefinedSFixed64RuleProto2) + com.google.protobuf.MessageOrBuilder { + + /** + * optional sfixed64 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + boolean hasVal(); + /** + * optional sfixed64 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + long getVal(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedSFixed64RuleProto3.java b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedSFixed64RuleProto3.java new file mode 100644 index 00000000..9888c08f --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedSFixed64RuleProto3.java @@ -0,0 +1,432 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/predefined_rules_proto3.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.PredefinedSFixed64RuleProto3} + */ +public final class PredefinedSFixed64RuleProto3 extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.PredefinedSFixed64RuleProto3) + PredefinedSFixed64RuleProto3OrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 1, + /* suffix= */ "", + PredefinedSFixed64RuleProto3.class.getName()); + } + // Use PredefinedSFixed64RuleProto3.newBuilder() to construct. + private PredefinedSFixed64RuleProto3(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private PredefinedSFixed64RuleProto3() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.PredefinedRulesProto3Proto.internal_static_buf_validate_conformance_cases_PredefinedSFixed64RuleProto3_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.PredefinedRulesProto3Proto.internal_static_buf_validate_conformance_cases_PredefinedSFixed64RuleProto3_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.PredefinedSFixed64RuleProto3.class, build.buf.validate.conformance.cases.PredefinedSFixed64RuleProto3.Builder.class); + } + + public static final int VAL_FIELD_NUMBER = 1; + private long val_ = 0L; + /** + * sfixed64 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public long getVal() { + return val_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (val_ != 0L) { + output.writeSFixed64(1, val_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (val_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeSFixed64Size(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.PredefinedSFixed64RuleProto3)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.PredefinedSFixed64RuleProto3 other = (build.buf.validate.conformance.cases.PredefinedSFixed64RuleProto3) obj; + + if (getVal() + != other.getVal()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + VAL_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getVal()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.PredefinedSFixed64RuleProto3 parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedSFixed64RuleProto3 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.PredefinedSFixed64RuleProto3 parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedSFixed64RuleProto3 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.PredefinedSFixed64RuleProto3 parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedSFixed64RuleProto3 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.PredefinedSFixed64RuleProto3 parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.PredefinedSFixed64RuleProto3 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.PredefinedSFixed64RuleProto3 parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.PredefinedSFixed64RuleProto3 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.PredefinedSFixed64RuleProto3 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.PredefinedSFixed64RuleProto3 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.PredefinedSFixed64RuleProto3 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.PredefinedSFixed64RuleProto3} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.PredefinedSFixed64RuleProto3) + build.buf.validate.conformance.cases.PredefinedSFixed64RuleProto3OrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.PredefinedRulesProto3Proto.internal_static_buf_validate_conformance_cases_PredefinedSFixed64RuleProto3_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.PredefinedRulesProto3Proto.internal_static_buf_validate_conformance_cases_PredefinedSFixed64RuleProto3_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.PredefinedSFixed64RuleProto3.class, build.buf.validate.conformance.cases.PredefinedSFixed64RuleProto3.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.PredefinedSFixed64RuleProto3.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + val_ = 0L; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.PredefinedRulesProto3Proto.internal_static_buf_validate_conformance_cases_PredefinedSFixed64RuleProto3_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedSFixed64RuleProto3 getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.PredefinedSFixed64RuleProto3.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedSFixed64RuleProto3 build() { + build.buf.validate.conformance.cases.PredefinedSFixed64RuleProto3 result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedSFixed64RuleProto3 buildPartial() { + build.buf.validate.conformance.cases.PredefinedSFixed64RuleProto3 result = new build.buf.validate.conformance.cases.PredefinedSFixed64RuleProto3(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.PredefinedSFixed64RuleProto3 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.PredefinedSFixed64RuleProto3) { + return mergeFrom((build.buf.validate.conformance.cases.PredefinedSFixed64RuleProto3)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.PredefinedSFixed64RuleProto3 other) { + if (other == build.buf.validate.conformance.cases.PredefinedSFixed64RuleProto3.getDefaultInstance()) return this; + if (other.getVal() != 0L) { + setVal(other.getVal()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 9: { + val_ = input.readSFixed64(); + bitField0_ |= 0x00000001; + break; + } // case 9 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private long val_ ; + /** + * sfixed64 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public long getVal() { + return val_; + } + /** + * sfixed64 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param value The val to set. + * @return This builder for chaining. + */ + public Builder setVal(long value) { + + val_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * sfixed64 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return This builder for chaining. + */ + public Builder clearVal() { + bitField0_ = (bitField0_ & ~0x00000001); + val_ = 0L; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.PredefinedSFixed64RuleProto3) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.PredefinedSFixed64RuleProto3) + private static final build.buf.validate.conformance.cases.PredefinedSFixed64RuleProto3 DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.PredefinedSFixed64RuleProto3(); + } + + public static build.buf.validate.conformance.cases.PredefinedSFixed64RuleProto3 getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PredefinedSFixed64RuleProto3 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.PredefinedSFixed64RuleProto3 getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedSFixed64RuleProto3OrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedSFixed64RuleProto3OrBuilder.java new file mode 100644 index 00000000..c9fac129 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedSFixed64RuleProto3OrBuilder.java @@ -0,0 +1,17 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/predefined_rules_proto3.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +public interface PredefinedSFixed64RuleProto3OrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.PredefinedSFixed64RuleProto3) + com.google.protobuf.MessageOrBuilder { + + /** + * sfixed64 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + long getVal(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedSInt32RuleEdition2023.java b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedSInt32RuleEdition2023.java new file mode 100644 index 00000000..f73ada93 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedSInt32RuleEdition2023.java @@ -0,0 +1,456 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/predefined_rules_proto_editions.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.PredefinedSInt32RuleEdition2023} + */ +public final class PredefinedSInt32RuleEdition2023 extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.PredefinedSInt32RuleEdition2023) + PredefinedSInt32RuleEdition2023OrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 1, + /* suffix= */ "", + PredefinedSInt32RuleEdition2023.class.getName()); + } + // Use PredefinedSInt32RuleEdition2023.newBuilder() to construct. + private PredefinedSInt32RuleEdition2023(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private PredefinedSInt32RuleEdition2023() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.internal_static_buf_validate_conformance_cases_PredefinedSInt32RuleEdition2023_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.internal_static_buf_validate_conformance_cases_PredefinedSInt32RuleEdition2023_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.PredefinedSInt32RuleEdition2023.class, build.buf.validate.conformance.cases.PredefinedSInt32RuleEdition2023.Builder.class); + } + + private int bitField0_; + public static final int VAL_FIELD_NUMBER = 1; + private int val_ = 0; + /** + * sint32 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); + } + /** + * sint32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public int getVal() { + return val_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + output.writeSInt32(1, val_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeSInt32Size(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.PredefinedSInt32RuleEdition2023)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.PredefinedSInt32RuleEdition2023 other = (build.buf.validate.conformance.cases.PredefinedSInt32RuleEdition2023) obj; + + if (hasVal() != other.hasVal()) return false; + if (hasVal()) { + if (getVal() + != other.getVal()) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasVal()) { + hash = (37 * hash) + VAL_FIELD_NUMBER; + hash = (53 * hash) + getVal(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.PredefinedSInt32RuleEdition2023 parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedSInt32RuleEdition2023 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.PredefinedSInt32RuleEdition2023 parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedSInt32RuleEdition2023 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.PredefinedSInt32RuleEdition2023 parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedSInt32RuleEdition2023 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.PredefinedSInt32RuleEdition2023 parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.PredefinedSInt32RuleEdition2023 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.PredefinedSInt32RuleEdition2023 parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.PredefinedSInt32RuleEdition2023 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.PredefinedSInt32RuleEdition2023 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.PredefinedSInt32RuleEdition2023 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.PredefinedSInt32RuleEdition2023 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.PredefinedSInt32RuleEdition2023} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.PredefinedSInt32RuleEdition2023) + build.buf.validate.conformance.cases.PredefinedSInt32RuleEdition2023OrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.internal_static_buf_validate_conformance_cases_PredefinedSInt32RuleEdition2023_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.internal_static_buf_validate_conformance_cases_PredefinedSInt32RuleEdition2023_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.PredefinedSInt32RuleEdition2023.class, build.buf.validate.conformance.cases.PredefinedSInt32RuleEdition2023.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.PredefinedSInt32RuleEdition2023.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + val_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.internal_static_buf_validate_conformance_cases_PredefinedSInt32RuleEdition2023_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedSInt32RuleEdition2023 getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.PredefinedSInt32RuleEdition2023.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedSInt32RuleEdition2023 build() { + build.buf.validate.conformance.cases.PredefinedSInt32RuleEdition2023 result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedSInt32RuleEdition2023 buildPartial() { + build.buf.validate.conformance.cases.PredefinedSInt32RuleEdition2023 result = new build.buf.validate.conformance.cases.PredefinedSInt32RuleEdition2023(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.PredefinedSInt32RuleEdition2023 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.PredefinedSInt32RuleEdition2023) { + return mergeFrom((build.buf.validate.conformance.cases.PredefinedSInt32RuleEdition2023)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.PredefinedSInt32RuleEdition2023 other) { + if (other == build.buf.validate.conformance.cases.PredefinedSInt32RuleEdition2023.getDefaultInstance()) return this; + if (other.hasVal()) { + setVal(other.getVal()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + val_ = input.readSInt32(); + bitField0_ |= 0x00000001; + break; + } // case 8 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private int val_ ; + /** + * sint32 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); + } + /** + * sint32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public int getVal() { + return val_; + } + /** + * sint32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param value The val to set. + * @return This builder for chaining. + */ + public Builder setVal(int value) { + + val_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * sint32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return This builder for chaining. + */ + public Builder clearVal() { + bitField0_ = (bitField0_ & ~0x00000001); + val_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.PredefinedSInt32RuleEdition2023) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.PredefinedSInt32RuleEdition2023) + private static final build.buf.validate.conformance.cases.PredefinedSInt32RuleEdition2023 DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.PredefinedSInt32RuleEdition2023(); + } + + public static build.buf.validate.conformance.cases.PredefinedSInt32RuleEdition2023 getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PredefinedSInt32RuleEdition2023 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.PredefinedSInt32RuleEdition2023 getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedSInt32RuleEdition2023OrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedSInt32RuleEdition2023OrBuilder.java new file mode 100644 index 00000000..b5ac1b05 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedSInt32RuleEdition2023OrBuilder.java @@ -0,0 +1,22 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/predefined_rules_proto_editions.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +public interface PredefinedSInt32RuleEdition2023OrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.PredefinedSInt32RuleEdition2023) + com.google.protobuf.MessageOrBuilder { + + /** + * sint32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + boolean hasVal(); + /** + * sint32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + int getVal(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedSInt32RuleProto2.java b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedSInt32RuleProto2.java new file mode 100644 index 00000000..b237ad14 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedSInt32RuleProto2.java @@ -0,0 +1,456 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/predefined_rules_proto2.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.PredefinedSInt32RuleProto2} + */ +public final class PredefinedSInt32RuleProto2 extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.PredefinedSInt32RuleProto2) + PredefinedSInt32RuleProto2OrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 1, + /* suffix= */ "", + PredefinedSInt32RuleProto2.class.getName()); + } + // Use PredefinedSInt32RuleProto2.newBuilder() to construct. + private PredefinedSInt32RuleProto2(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private PredefinedSInt32RuleProto2() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.internal_static_buf_validate_conformance_cases_PredefinedSInt32RuleProto2_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.internal_static_buf_validate_conformance_cases_PredefinedSInt32RuleProto2_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.PredefinedSInt32RuleProto2.class, build.buf.validate.conformance.cases.PredefinedSInt32RuleProto2.Builder.class); + } + + private int bitField0_; + public static final int VAL_FIELD_NUMBER = 1; + private int val_ = 0; + /** + * optional sint32 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 sint32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public int getVal() { + return val_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + output.writeSInt32(1, val_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeSInt32Size(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.PredefinedSInt32RuleProto2)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.PredefinedSInt32RuleProto2 other = (build.buf.validate.conformance.cases.PredefinedSInt32RuleProto2) obj; + + if (hasVal() != other.hasVal()) return false; + if (hasVal()) { + if (getVal() + != other.getVal()) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasVal()) { + hash = (37 * hash) + VAL_FIELD_NUMBER; + hash = (53 * hash) + getVal(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.PredefinedSInt32RuleProto2 parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedSInt32RuleProto2 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.PredefinedSInt32RuleProto2 parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedSInt32RuleProto2 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.PredefinedSInt32RuleProto2 parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedSInt32RuleProto2 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.PredefinedSInt32RuleProto2 parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.PredefinedSInt32RuleProto2 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.PredefinedSInt32RuleProto2 parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.PredefinedSInt32RuleProto2 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.PredefinedSInt32RuleProto2 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.PredefinedSInt32RuleProto2 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.PredefinedSInt32RuleProto2 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.PredefinedSInt32RuleProto2} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.PredefinedSInt32RuleProto2) + build.buf.validate.conformance.cases.PredefinedSInt32RuleProto2OrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.internal_static_buf_validate_conformance_cases_PredefinedSInt32RuleProto2_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.internal_static_buf_validate_conformance_cases_PredefinedSInt32RuleProto2_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.PredefinedSInt32RuleProto2.class, build.buf.validate.conformance.cases.PredefinedSInt32RuleProto2.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.PredefinedSInt32RuleProto2.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + val_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.internal_static_buf_validate_conformance_cases_PredefinedSInt32RuleProto2_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedSInt32RuleProto2 getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.PredefinedSInt32RuleProto2.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedSInt32RuleProto2 build() { + build.buf.validate.conformance.cases.PredefinedSInt32RuleProto2 result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedSInt32RuleProto2 buildPartial() { + build.buf.validate.conformance.cases.PredefinedSInt32RuleProto2 result = new build.buf.validate.conformance.cases.PredefinedSInt32RuleProto2(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.PredefinedSInt32RuleProto2 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.PredefinedSInt32RuleProto2) { + return mergeFrom((build.buf.validate.conformance.cases.PredefinedSInt32RuleProto2)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.PredefinedSInt32RuleProto2 other) { + if (other == build.buf.validate.conformance.cases.PredefinedSInt32RuleProto2.getDefaultInstance()) return this; + if (other.hasVal()) { + setVal(other.getVal()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + val_ = input.readSInt32(); + bitField0_ |= 0x00000001; + break; + } // case 8 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private int val_ ; + /** + * optional sint32 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 sint32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public int getVal() { + return val_; + } + /** + * optional sint32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param value The val to set. + * @return This builder for chaining. + */ + public Builder setVal(int value) { + + val_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * optional sint32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return This builder for chaining. + */ + public Builder clearVal() { + bitField0_ = (bitField0_ & ~0x00000001); + val_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.PredefinedSInt32RuleProto2) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.PredefinedSInt32RuleProto2) + private static final build.buf.validate.conformance.cases.PredefinedSInt32RuleProto2 DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.PredefinedSInt32RuleProto2(); + } + + public static build.buf.validate.conformance.cases.PredefinedSInt32RuleProto2 getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PredefinedSInt32RuleProto2 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.PredefinedSInt32RuleProto2 getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedSInt32RuleProto2OrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedSInt32RuleProto2OrBuilder.java new file mode 100644 index 00000000..89226d20 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedSInt32RuleProto2OrBuilder.java @@ -0,0 +1,22 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/predefined_rules_proto2.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +public interface PredefinedSInt32RuleProto2OrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.PredefinedSInt32RuleProto2) + com.google.protobuf.MessageOrBuilder { + + /** + * optional sint32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + boolean hasVal(); + /** + * optional sint32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + int getVal(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedSInt32RuleProto3.java b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedSInt32RuleProto3.java new file mode 100644 index 00000000..9bc51861 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedSInt32RuleProto3.java @@ -0,0 +1,431 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/predefined_rules_proto3.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.PredefinedSInt32RuleProto3} + */ +public final class PredefinedSInt32RuleProto3 extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.PredefinedSInt32RuleProto3) + PredefinedSInt32RuleProto3OrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 1, + /* suffix= */ "", + PredefinedSInt32RuleProto3.class.getName()); + } + // Use PredefinedSInt32RuleProto3.newBuilder() to construct. + private PredefinedSInt32RuleProto3(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private PredefinedSInt32RuleProto3() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.PredefinedRulesProto3Proto.internal_static_buf_validate_conformance_cases_PredefinedSInt32RuleProto3_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.PredefinedRulesProto3Proto.internal_static_buf_validate_conformance_cases_PredefinedSInt32RuleProto3_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.PredefinedSInt32RuleProto3.class, build.buf.validate.conformance.cases.PredefinedSInt32RuleProto3.Builder.class); + } + + public static final int VAL_FIELD_NUMBER = 1; + private int val_ = 0; + /** + * sint32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public int getVal() { + return val_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (val_ != 0) { + output.writeSInt32(1, val_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (val_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeSInt32Size(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.PredefinedSInt32RuleProto3)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.PredefinedSInt32RuleProto3 other = (build.buf.validate.conformance.cases.PredefinedSInt32RuleProto3) obj; + + if (getVal() + != other.getVal()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + VAL_FIELD_NUMBER; + hash = (53 * hash) + getVal(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.PredefinedSInt32RuleProto3 parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedSInt32RuleProto3 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.PredefinedSInt32RuleProto3 parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedSInt32RuleProto3 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.PredefinedSInt32RuleProto3 parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedSInt32RuleProto3 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.PredefinedSInt32RuleProto3 parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.PredefinedSInt32RuleProto3 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.PredefinedSInt32RuleProto3 parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.PredefinedSInt32RuleProto3 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.PredefinedSInt32RuleProto3 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.PredefinedSInt32RuleProto3 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.PredefinedSInt32RuleProto3 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.PredefinedSInt32RuleProto3} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.PredefinedSInt32RuleProto3) + build.buf.validate.conformance.cases.PredefinedSInt32RuleProto3OrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.PredefinedRulesProto3Proto.internal_static_buf_validate_conformance_cases_PredefinedSInt32RuleProto3_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.PredefinedRulesProto3Proto.internal_static_buf_validate_conformance_cases_PredefinedSInt32RuleProto3_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.PredefinedSInt32RuleProto3.class, build.buf.validate.conformance.cases.PredefinedSInt32RuleProto3.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.PredefinedSInt32RuleProto3.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + val_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.PredefinedRulesProto3Proto.internal_static_buf_validate_conformance_cases_PredefinedSInt32RuleProto3_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedSInt32RuleProto3 getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.PredefinedSInt32RuleProto3.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedSInt32RuleProto3 build() { + build.buf.validate.conformance.cases.PredefinedSInt32RuleProto3 result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedSInt32RuleProto3 buildPartial() { + build.buf.validate.conformance.cases.PredefinedSInt32RuleProto3 result = new build.buf.validate.conformance.cases.PredefinedSInt32RuleProto3(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.PredefinedSInt32RuleProto3 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.PredefinedSInt32RuleProto3) { + return mergeFrom((build.buf.validate.conformance.cases.PredefinedSInt32RuleProto3)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.PredefinedSInt32RuleProto3 other) { + if (other == build.buf.validate.conformance.cases.PredefinedSInt32RuleProto3.getDefaultInstance()) return this; + if (other.getVal() != 0) { + setVal(other.getVal()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + val_ = input.readSInt32(); + bitField0_ |= 0x00000001; + break; + } // case 8 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private int val_ ; + /** + * sint32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public int getVal() { + return val_; + } + /** + * sint32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param value The val to set. + * @return This builder for chaining. + */ + public Builder setVal(int value) { + + val_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * sint32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return This builder for chaining. + */ + public Builder clearVal() { + bitField0_ = (bitField0_ & ~0x00000001); + val_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.PredefinedSInt32RuleProto3) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.PredefinedSInt32RuleProto3) + private static final build.buf.validate.conformance.cases.PredefinedSInt32RuleProto3 DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.PredefinedSInt32RuleProto3(); + } + + public static build.buf.validate.conformance.cases.PredefinedSInt32RuleProto3 getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PredefinedSInt32RuleProto3 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.PredefinedSInt32RuleProto3 getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedSInt32RuleProto3OrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedSInt32RuleProto3OrBuilder.java new file mode 100644 index 00000000..37c6515f --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedSInt32RuleProto3OrBuilder.java @@ -0,0 +1,17 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/predefined_rules_proto3.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +public interface PredefinedSInt32RuleProto3OrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.PredefinedSInt32RuleProto3) + com.google.protobuf.MessageOrBuilder { + + /** + * sint32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + int getVal(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedSInt64RuleEdition2023.java b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedSInt64RuleEdition2023.java new file mode 100644 index 00000000..b9e6e542 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedSInt64RuleEdition2023.java @@ -0,0 +1,457 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/predefined_rules_proto_editions.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.PredefinedSInt64RuleEdition2023} + */ +public final class PredefinedSInt64RuleEdition2023 extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.PredefinedSInt64RuleEdition2023) + PredefinedSInt64RuleEdition2023OrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 1, + /* suffix= */ "", + PredefinedSInt64RuleEdition2023.class.getName()); + } + // Use PredefinedSInt64RuleEdition2023.newBuilder() to construct. + private PredefinedSInt64RuleEdition2023(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private PredefinedSInt64RuleEdition2023() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.internal_static_buf_validate_conformance_cases_PredefinedSInt64RuleEdition2023_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.internal_static_buf_validate_conformance_cases_PredefinedSInt64RuleEdition2023_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.PredefinedSInt64RuleEdition2023.class, build.buf.validate.conformance.cases.PredefinedSInt64RuleEdition2023.Builder.class); + } + + private int bitField0_; + public static final int VAL_FIELD_NUMBER = 1; + private long val_ = 0L; + /** + * sint64 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); + } + /** + * sint64 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public long getVal() { + return val_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + output.writeSInt64(1, val_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeSInt64Size(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.PredefinedSInt64RuleEdition2023)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.PredefinedSInt64RuleEdition2023 other = (build.buf.validate.conformance.cases.PredefinedSInt64RuleEdition2023) obj; + + if (hasVal() != other.hasVal()) return false; + if (hasVal()) { + if (getVal() + != other.getVal()) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasVal()) { + hash = (37 * hash) + VAL_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getVal()); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.PredefinedSInt64RuleEdition2023 parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedSInt64RuleEdition2023 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.PredefinedSInt64RuleEdition2023 parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedSInt64RuleEdition2023 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.PredefinedSInt64RuleEdition2023 parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedSInt64RuleEdition2023 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.PredefinedSInt64RuleEdition2023 parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.PredefinedSInt64RuleEdition2023 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.PredefinedSInt64RuleEdition2023 parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.PredefinedSInt64RuleEdition2023 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.PredefinedSInt64RuleEdition2023 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.PredefinedSInt64RuleEdition2023 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.PredefinedSInt64RuleEdition2023 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.PredefinedSInt64RuleEdition2023} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.PredefinedSInt64RuleEdition2023) + build.buf.validate.conformance.cases.PredefinedSInt64RuleEdition2023OrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.internal_static_buf_validate_conformance_cases_PredefinedSInt64RuleEdition2023_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.internal_static_buf_validate_conformance_cases_PredefinedSInt64RuleEdition2023_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.PredefinedSInt64RuleEdition2023.class, build.buf.validate.conformance.cases.PredefinedSInt64RuleEdition2023.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.PredefinedSInt64RuleEdition2023.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + val_ = 0L; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.internal_static_buf_validate_conformance_cases_PredefinedSInt64RuleEdition2023_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedSInt64RuleEdition2023 getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.PredefinedSInt64RuleEdition2023.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedSInt64RuleEdition2023 build() { + build.buf.validate.conformance.cases.PredefinedSInt64RuleEdition2023 result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedSInt64RuleEdition2023 buildPartial() { + build.buf.validate.conformance.cases.PredefinedSInt64RuleEdition2023 result = new build.buf.validate.conformance.cases.PredefinedSInt64RuleEdition2023(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.PredefinedSInt64RuleEdition2023 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.PredefinedSInt64RuleEdition2023) { + return mergeFrom((build.buf.validate.conformance.cases.PredefinedSInt64RuleEdition2023)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.PredefinedSInt64RuleEdition2023 other) { + if (other == build.buf.validate.conformance.cases.PredefinedSInt64RuleEdition2023.getDefaultInstance()) return this; + if (other.hasVal()) { + setVal(other.getVal()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + val_ = input.readSInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private long val_ ; + /** + * sint64 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); + } + /** + * sint64 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public long getVal() { + return val_; + } + /** + * sint64 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param value The val to set. + * @return This builder for chaining. + */ + public Builder setVal(long value) { + + val_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * sint64 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return This builder for chaining. + */ + public Builder clearVal() { + bitField0_ = (bitField0_ & ~0x00000001); + val_ = 0L; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.PredefinedSInt64RuleEdition2023) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.PredefinedSInt64RuleEdition2023) + private static final build.buf.validate.conformance.cases.PredefinedSInt64RuleEdition2023 DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.PredefinedSInt64RuleEdition2023(); + } + + public static build.buf.validate.conformance.cases.PredefinedSInt64RuleEdition2023 getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PredefinedSInt64RuleEdition2023 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.PredefinedSInt64RuleEdition2023 getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedSInt64RuleEdition2023OrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedSInt64RuleEdition2023OrBuilder.java new file mode 100644 index 00000000..2b6cd99c --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedSInt64RuleEdition2023OrBuilder.java @@ -0,0 +1,22 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/predefined_rules_proto_editions.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +public interface PredefinedSInt64RuleEdition2023OrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.PredefinedSInt64RuleEdition2023) + com.google.protobuf.MessageOrBuilder { + + /** + * sint64 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + boolean hasVal(); + /** + * sint64 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + long getVal(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedSInt64RuleProto2.java b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedSInt64RuleProto2.java new file mode 100644 index 00000000..91b15e36 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedSInt64RuleProto2.java @@ -0,0 +1,457 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/predefined_rules_proto2.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.PredefinedSInt64RuleProto2} + */ +public final class PredefinedSInt64RuleProto2 extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.PredefinedSInt64RuleProto2) + PredefinedSInt64RuleProto2OrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 1, + /* suffix= */ "", + PredefinedSInt64RuleProto2.class.getName()); + } + // Use PredefinedSInt64RuleProto2.newBuilder() to construct. + private PredefinedSInt64RuleProto2(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private PredefinedSInt64RuleProto2() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.internal_static_buf_validate_conformance_cases_PredefinedSInt64RuleProto2_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.internal_static_buf_validate_conformance_cases_PredefinedSInt64RuleProto2_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.PredefinedSInt64RuleProto2.class, build.buf.validate.conformance.cases.PredefinedSInt64RuleProto2.Builder.class); + } + + private int bitField0_; + public static final int VAL_FIELD_NUMBER = 1; + private long val_ = 0L; + /** + * optional sint64 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 sint64 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public long getVal() { + return val_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + output.writeSInt64(1, val_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeSInt64Size(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.PredefinedSInt64RuleProto2)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.PredefinedSInt64RuleProto2 other = (build.buf.validate.conformance.cases.PredefinedSInt64RuleProto2) obj; + + if (hasVal() != other.hasVal()) return false; + if (hasVal()) { + if (getVal() + != other.getVal()) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasVal()) { + hash = (37 * hash) + VAL_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getVal()); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.PredefinedSInt64RuleProto2 parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedSInt64RuleProto2 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.PredefinedSInt64RuleProto2 parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedSInt64RuleProto2 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.PredefinedSInt64RuleProto2 parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedSInt64RuleProto2 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.PredefinedSInt64RuleProto2 parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.PredefinedSInt64RuleProto2 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.PredefinedSInt64RuleProto2 parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.PredefinedSInt64RuleProto2 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.PredefinedSInt64RuleProto2 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.PredefinedSInt64RuleProto2 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.PredefinedSInt64RuleProto2 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.PredefinedSInt64RuleProto2} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.PredefinedSInt64RuleProto2) + build.buf.validate.conformance.cases.PredefinedSInt64RuleProto2OrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.internal_static_buf_validate_conformance_cases_PredefinedSInt64RuleProto2_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.internal_static_buf_validate_conformance_cases_PredefinedSInt64RuleProto2_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.PredefinedSInt64RuleProto2.class, build.buf.validate.conformance.cases.PredefinedSInt64RuleProto2.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.PredefinedSInt64RuleProto2.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + val_ = 0L; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.internal_static_buf_validate_conformance_cases_PredefinedSInt64RuleProto2_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedSInt64RuleProto2 getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.PredefinedSInt64RuleProto2.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedSInt64RuleProto2 build() { + build.buf.validate.conformance.cases.PredefinedSInt64RuleProto2 result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedSInt64RuleProto2 buildPartial() { + build.buf.validate.conformance.cases.PredefinedSInt64RuleProto2 result = new build.buf.validate.conformance.cases.PredefinedSInt64RuleProto2(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.PredefinedSInt64RuleProto2 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.PredefinedSInt64RuleProto2) { + return mergeFrom((build.buf.validate.conformance.cases.PredefinedSInt64RuleProto2)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.PredefinedSInt64RuleProto2 other) { + if (other == build.buf.validate.conformance.cases.PredefinedSInt64RuleProto2.getDefaultInstance()) return this; + if (other.hasVal()) { + setVal(other.getVal()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + val_ = input.readSInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private long val_ ; + /** + * optional sint64 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 sint64 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public long getVal() { + return val_; + } + /** + * optional sint64 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param value The val to set. + * @return This builder for chaining. + */ + public Builder setVal(long value) { + + val_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * optional sint64 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return This builder for chaining. + */ + public Builder clearVal() { + bitField0_ = (bitField0_ & ~0x00000001); + val_ = 0L; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.PredefinedSInt64RuleProto2) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.PredefinedSInt64RuleProto2) + private static final build.buf.validate.conformance.cases.PredefinedSInt64RuleProto2 DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.PredefinedSInt64RuleProto2(); + } + + public static build.buf.validate.conformance.cases.PredefinedSInt64RuleProto2 getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PredefinedSInt64RuleProto2 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.PredefinedSInt64RuleProto2 getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedSInt64RuleProto2OrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedSInt64RuleProto2OrBuilder.java new file mode 100644 index 00000000..0064f466 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedSInt64RuleProto2OrBuilder.java @@ -0,0 +1,22 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/predefined_rules_proto2.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +public interface PredefinedSInt64RuleProto2OrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.PredefinedSInt64RuleProto2) + com.google.protobuf.MessageOrBuilder { + + /** + * optional sint64 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + boolean hasVal(); + /** + * optional sint64 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + long getVal(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedSInt64RuleProto3.java b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedSInt64RuleProto3.java new file mode 100644 index 00000000..bb6a5209 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedSInt64RuleProto3.java @@ -0,0 +1,432 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/predefined_rules_proto3.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.PredefinedSInt64RuleProto3} + */ +public final class PredefinedSInt64RuleProto3 extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.PredefinedSInt64RuleProto3) + PredefinedSInt64RuleProto3OrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 1, + /* suffix= */ "", + PredefinedSInt64RuleProto3.class.getName()); + } + // Use PredefinedSInt64RuleProto3.newBuilder() to construct. + private PredefinedSInt64RuleProto3(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private PredefinedSInt64RuleProto3() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.PredefinedRulesProto3Proto.internal_static_buf_validate_conformance_cases_PredefinedSInt64RuleProto3_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.PredefinedRulesProto3Proto.internal_static_buf_validate_conformance_cases_PredefinedSInt64RuleProto3_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.PredefinedSInt64RuleProto3.class, build.buf.validate.conformance.cases.PredefinedSInt64RuleProto3.Builder.class); + } + + public static final int VAL_FIELD_NUMBER = 1; + private long val_ = 0L; + /** + * sint64 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public long getVal() { + return val_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (val_ != 0L) { + output.writeSInt64(1, val_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (val_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeSInt64Size(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.PredefinedSInt64RuleProto3)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.PredefinedSInt64RuleProto3 other = (build.buf.validate.conformance.cases.PredefinedSInt64RuleProto3) obj; + + if (getVal() + != other.getVal()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + VAL_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getVal()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.PredefinedSInt64RuleProto3 parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedSInt64RuleProto3 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.PredefinedSInt64RuleProto3 parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedSInt64RuleProto3 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.PredefinedSInt64RuleProto3 parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedSInt64RuleProto3 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.PredefinedSInt64RuleProto3 parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.PredefinedSInt64RuleProto3 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.PredefinedSInt64RuleProto3 parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.PredefinedSInt64RuleProto3 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.PredefinedSInt64RuleProto3 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.PredefinedSInt64RuleProto3 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.PredefinedSInt64RuleProto3 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.PredefinedSInt64RuleProto3} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.PredefinedSInt64RuleProto3) + build.buf.validate.conformance.cases.PredefinedSInt64RuleProto3OrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.PredefinedRulesProto3Proto.internal_static_buf_validate_conformance_cases_PredefinedSInt64RuleProto3_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.PredefinedRulesProto3Proto.internal_static_buf_validate_conformance_cases_PredefinedSInt64RuleProto3_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.PredefinedSInt64RuleProto3.class, build.buf.validate.conformance.cases.PredefinedSInt64RuleProto3.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.PredefinedSInt64RuleProto3.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + val_ = 0L; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.PredefinedRulesProto3Proto.internal_static_buf_validate_conformance_cases_PredefinedSInt64RuleProto3_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedSInt64RuleProto3 getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.PredefinedSInt64RuleProto3.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedSInt64RuleProto3 build() { + build.buf.validate.conformance.cases.PredefinedSInt64RuleProto3 result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedSInt64RuleProto3 buildPartial() { + build.buf.validate.conformance.cases.PredefinedSInt64RuleProto3 result = new build.buf.validate.conformance.cases.PredefinedSInt64RuleProto3(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.PredefinedSInt64RuleProto3 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.PredefinedSInt64RuleProto3) { + return mergeFrom((build.buf.validate.conformance.cases.PredefinedSInt64RuleProto3)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.PredefinedSInt64RuleProto3 other) { + if (other == build.buf.validate.conformance.cases.PredefinedSInt64RuleProto3.getDefaultInstance()) return this; + if (other.getVal() != 0L) { + setVal(other.getVal()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + val_ = input.readSInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private long val_ ; + /** + * sint64 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public long getVal() { + return val_; + } + /** + * sint64 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param value The val to set. + * @return This builder for chaining. + */ + public Builder setVal(long value) { + + val_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * sint64 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return This builder for chaining. + */ + public Builder clearVal() { + bitField0_ = (bitField0_ & ~0x00000001); + val_ = 0L; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.PredefinedSInt64RuleProto3) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.PredefinedSInt64RuleProto3) + private static final build.buf.validate.conformance.cases.PredefinedSInt64RuleProto3 DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.PredefinedSInt64RuleProto3(); + } + + public static build.buf.validate.conformance.cases.PredefinedSInt64RuleProto3 getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PredefinedSInt64RuleProto3 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.PredefinedSInt64RuleProto3 getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedSInt64RuleProto3OrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedSInt64RuleProto3OrBuilder.java new file mode 100644 index 00000000..7c666db8 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedSInt64RuleProto3OrBuilder.java @@ -0,0 +1,17 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/predefined_rules_proto3.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +public interface PredefinedSInt64RuleProto3OrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.PredefinedSInt64RuleProto3) + com.google.protobuf.MessageOrBuilder { + + /** + * sint64 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + long getVal(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedStringRuleEdition2023.java b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedStringRuleEdition2023.java new file mode 100644 index 00000000..27779b63 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedStringRuleEdition2023.java @@ -0,0 +1,525 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/predefined_rules_proto_editions.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.PredefinedStringRuleEdition2023} + */ +public final class PredefinedStringRuleEdition2023 extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.PredefinedStringRuleEdition2023) + PredefinedStringRuleEdition2023OrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 1, + /* suffix= */ "", + PredefinedStringRuleEdition2023.class.getName()); + } + // Use PredefinedStringRuleEdition2023.newBuilder() to construct. + private PredefinedStringRuleEdition2023(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private PredefinedStringRuleEdition2023() { + val_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.internal_static_buf_validate_conformance_cases_PredefinedStringRuleEdition2023_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.internal_static_buf_validate_conformance_cases_PredefinedStringRuleEdition2023_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.PredefinedStringRuleEdition2023.class, build.buf.validate.conformance.cases.PredefinedStringRuleEdition2023.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.PredefinedStringRuleEdition2023)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.PredefinedStringRuleEdition2023 other = (build.buf.validate.conformance.cases.PredefinedStringRuleEdition2023) 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.PredefinedStringRuleEdition2023 parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedStringRuleEdition2023 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.PredefinedStringRuleEdition2023 parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedStringRuleEdition2023 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.PredefinedStringRuleEdition2023 parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedStringRuleEdition2023 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.PredefinedStringRuleEdition2023 parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.PredefinedStringRuleEdition2023 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.PredefinedStringRuleEdition2023 parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.PredefinedStringRuleEdition2023 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.PredefinedStringRuleEdition2023 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.PredefinedStringRuleEdition2023 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.PredefinedStringRuleEdition2023 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.PredefinedStringRuleEdition2023} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.PredefinedStringRuleEdition2023) + build.buf.validate.conformance.cases.PredefinedStringRuleEdition2023OrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.internal_static_buf_validate_conformance_cases_PredefinedStringRuleEdition2023_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.internal_static_buf_validate_conformance_cases_PredefinedStringRuleEdition2023_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.PredefinedStringRuleEdition2023.class, build.buf.validate.conformance.cases.PredefinedStringRuleEdition2023.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.PredefinedStringRuleEdition2023.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.PredefinedRulesProtoEditionsProto.internal_static_buf_validate_conformance_cases_PredefinedStringRuleEdition2023_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedStringRuleEdition2023 getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.PredefinedStringRuleEdition2023.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedStringRuleEdition2023 build() { + build.buf.validate.conformance.cases.PredefinedStringRuleEdition2023 result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedStringRuleEdition2023 buildPartial() { + build.buf.validate.conformance.cases.PredefinedStringRuleEdition2023 result = new build.buf.validate.conformance.cases.PredefinedStringRuleEdition2023(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.PredefinedStringRuleEdition2023 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.PredefinedStringRuleEdition2023) { + return mergeFrom((build.buf.validate.conformance.cases.PredefinedStringRuleEdition2023)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.PredefinedStringRuleEdition2023 other) { + if (other == build.buf.validate.conformance.cases.PredefinedStringRuleEdition2023.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.PredefinedStringRuleEdition2023) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.PredefinedStringRuleEdition2023) + private static final build.buf.validate.conformance.cases.PredefinedStringRuleEdition2023 DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.PredefinedStringRuleEdition2023(); + } + + public static build.buf.validate.conformance.cases.PredefinedStringRuleEdition2023 getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PredefinedStringRuleEdition2023 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.PredefinedStringRuleEdition2023 getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedStringRuleEdition2023OrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedStringRuleEdition2023OrBuilder.java new file mode 100644 index 00000000..cf50efa3 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedStringRuleEdition2023OrBuilder.java @@ -0,0 +1,28 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/predefined_rules_proto_editions.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +public interface PredefinedStringRuleEdition2023OrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.PredefinedStringRuleEdition2023) + 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/PredefinedStringRuleProto2.java b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedStringRuleProto2.java new file mode 100644 index 00000000..290674bd --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedStringRuleProto2.java @@ -0,0 +1,528 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/predefined_rules_proto2.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.PredefinedStringRuleProto2} + */ +public final class PredefinedStringRuleProto2 extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.PredefinedStringRuleProto2) + PredefinedStringRuleProto2OrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 1, + /* suffix= */ "", + PredefinedStringRuleProto2.class.getName()); + } + // Use PredefinedStringRuleProto2.newBuilder() to construct. + private PredefinedStringRuleProto2(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private PredefinedStringRuleProto2() { + val_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.internal_static_buf_validate_conformance_cases_PredefinedStringRuleProto2_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.internal_static_buf_validate_conformance_cases_PredefinedStringRuleProto2_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.PredefinedStringRuleProto2.class, build.buf.validate.conformance.cases.PredefinedStringRuleProto2.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.PredefinedStringRuleProto2)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.PredefinedStringRuleProto2 other = (build.buf.validate.conformance.cases.PredefinedStringRuleProto2) 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.PredefinedStringRuleProto2 parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedStringRuleProto2 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.PredefinedStringRuleProto2 parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedStringRuleProto2 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.PredefinedStringRuleProto2 parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedStringRuleProto2 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.PredefinedStringRuleProto2 parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.PredefinedStringRuleProto2 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.PredefinedStringRuleProto2 parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.PredefinedStringRuleProto2 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.PredefinedStringRuleProto2 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.PredefinedStringRuleProto2 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.PredefinedStringRuleProto2 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.PredefinedStringRuleProto2} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.PredefinedStringRuleProto2) + build.buf.validate.conformance.cases.PredefinedStringRuleProto2OrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.internal_static_buf_validate_conformance_cases_PredefinedStringRuleProto2_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.internal_static_buf_validate_conformance_cases_PredefinedStringRuleProto2_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.PredefinedStringRuleProto2.class, build.buf.validate.conformance.cases.PredefinedStringRuleProto2.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.PredefinedStringRuleProto2.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.PredefinedRulesProto2Proto.internal_static_buf_validate_conformance_cases_PredefinedStringRuleProto2_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedStringRuleProto2 getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.PredefinedStringRuleProto2.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedStringRuleProto2 build() { + build.buf.validate.conformance.cases.PredefinedStringRuleProto2 result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedStringRuleProto2 buildPartial() { + build.buf.validate.conformance.cases.PredefinedStringRuleProto2 result = new build.buf.validate.conformance.cases.PredefinedStringRuleProto2(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.PredefinedStringRuleProto2 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.PredefinedStringRuleProto2) { + return mergeFrom((build.buf.validate.conformance.cases.PredefinedStringRuleProto2)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.PredefinedStringRuleProto2 other) { + if (other == build.buf.validate.conformance.cases.PredefinedStringRuleProto2.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.PredefinedStringRuleProto2) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.PredefinedStringRuleProto2) + private static final build.buf.validate.conformance.cases.PredefinedStringRuleProto2 DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.PredefinedStringRuleProto2(); + } + + public static build.buf.validate.conformance.cases.PredefinedStringRuleProto2 getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PredefinedStringRuleProto2 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.PredefinedStringRuleProto2 getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedStringRuleProto2OrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedStringRuleProto2OrBuilder.java new file mode 100644 index 00000000..2cd70c3f --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedStringRuleProto2OrBuilder.java @@ -0,0 +1,28 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/predefined_rules_proto2.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +public interface PredefinedStringRuleProto2OrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.PredefinedStringRuleProto2) + 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/PredefinedStringRuleProto3.java b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedStringRuleProto3.java new file mode 100644 index 00000000..2313089b --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedStringRuleProto3.java @@ -0,0 +1,501 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/predefined_rules_proto3.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.PredefinedStringRuleProto3} + */ +public final class PredefinedStringRuleProto3 extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.PredefinedStringRuleProto3) + PredefinedStringRuleProto3OrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 1, + /* suffix= */ "", + PredefinedStringRuleProto3.class.getName()); + } + // Use PredefinedStringRuleProto3.newBuilder() to construct. + private PredefinedStringRuleProto3(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private PredefinedStringRuleProto3() { + val_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.PredefinedRulesProto3Proto.internal_static_buf_validate_conformance_cases_PredefinedStringRuleProto3_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.PredefinedRulesProto3Proto.internal_static_buf_validate_conformance_cases_PredefinedStringRuleProto3_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.PredefinedStringRuleProto3.class, build.buf.validate.conformance.cases.PredefinedStringRuleProto3.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.PredefinedStringRuleProto3)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.PredefinedStringRuleProto3 other = (build.buf.validate.conformance.cases.PredefinedStringRuleProto3) 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.PredefinedStringRuleProto3 parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedStringRuleProto3 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.PredefinedStringRuleProto3 parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedStringRuleProto3 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.PredefinedStringRuleProto3 parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedStringRuleProto3 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.PredefinedStringRuleProto3 parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.PredefinedStringRuleProto3 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.PredefinedStringRuleProto3 parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.PredefinedStringRuleProto3 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.PredefinedStringRuleProto3 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.PredefinedStringRuleProto3 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.PredefinedStringRuleProto3 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.PredefinedStringRuleProto3} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.PredefinedStringRuleProto3) + build.buf.validate.conformance.cases.PredefinedStringRuleProto3OrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.PredefinedRulesProto3Proto.internal_static_buf_validate_conformance_cases_PredefinedStringRuleProto3_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.PredefinedRulesProto3Proto.internal_static_buf_validate_conformance_cases_PredefinedStringRuleProto3_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.PredefinedStringRuleProto3.class, build.buf.validate.conformance.cases.PredefinedStringRuleProto3.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.PredefinedStringRuleProto3.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.PredefinedRulesProto3Proto.internal_static_buf_validate_conformance_cases_PredefinedStringRuleProto3_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedStringRuleProto3 getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.PredefinedStringRuleProto3.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedStringRuleProto3 build() { + build.buf.validate.conformance.cases.PredefinedStringRuleProto3 result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedStringRuleProto3 buildPartial() { + build.buf.validate.conformance.cases.PredefinedStringRuleProto3 result = new build.buf.validate.conformance.cases.PredefinedStringRuleProto3(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.PredefinedStringRuleProto3 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.PredefinedStringRuleProto3) { + return mergeFrom((build.buf.validate.conformance.cases.PredefinedStringRuleProto3)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.PredefinedStringRuleProto3 other) { + if (other == build.buf.validate.conformance.cases.PredefinedStringRuleProto3.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.PredefinedStringRuleProto3) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.PredefinedStringRuleProto3) + private static final build.buf.validate.conformance.cases.PredefinedStringRuleProto3 DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.PredefinedStringRuleProto3(); + } + + public static build.buf.validate.conformance.cases.PredefinedStringRuleProto3 getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PredefinedStringRuleProto3 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.PredefinedStringRuleProto3 getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedStringRuleProto3OrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedStringRuleProto3OrBuilder.java new file mode 100644 index 00000000..be0a17be --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedStringRuleProto3OrBuilder.java @@ -0,0 +1,23 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/predefined_rules_proto3.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +public interface PredefinedStringRuleProto3OrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.PredefinedStringRuleProto3) + com.google.protobuf.MessageOrBuilder { + + /** + * string val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + java.lang.String getVal(); + /** + * string val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The bytes for val. + */ + com.google.protobuf.ByteString + getValBytes(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedTimestampRuleEdition2023.java b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedTimestampRuleEdition2023.java new file mode 100644 index 00000000..a581446c --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedTimestampRuleEdition2023.java @@ -0,0 +1,558 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/predefined_rules_proto_editions.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.PredefinedTimestampRuleEdition2023} + */ +public final class PredefinedTimestampRuleEdition2023 extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.PredefinedTimestampRuleEdition2023) + PredefinedTimestampRuleEdition2023OrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 1, + /* suffix= */ "", + PredefinedTimestampRuleEdition2023.class.getName()); + } + // Use PredefinedTimestampRuleEdition2023.newBuilder() to construct. + private PredefinedTimestampRuleEdition2023(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private PredefinedTimestampRuleEdition2023() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.internal_static_buf_validate_conformance_cases_PredefinedTimestampRuleEdition2023_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.internal_static_buf_validate_conformance_cases_PredefinedTimestampRuleEdition2023_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.PredefinedTimestampRuleEdition2023.class, build.buf.validate.conformance.cases.PredefinedTimestampRuleEdition2023.Builder.class); + } + + private int bitField0_; + public static final int VAL_FIELD_NUMBER = 1; + private com.google.protobuf.Timestamp val_; + /** + * .google.protobuf.Timestamp 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); + } + /** + * .google.protobuf.Timestamp val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getVal() { + return val_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : val_; + } + /** + * .google.protobuf.Timestamp val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getValOrBuilder() { + return val_ == null ? com.google.protobuf.Timestamp.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.PredefinedTimestampRuleEdition2023)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.PredefinedTimestampRuleEdition2023 other = (build.buf.validate.conformance.cases.PredefinedTimestampRuleEdition2023) 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.PredefinedTimestampRuleEdition2023 parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedTimestampRuleEdition2023 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.PredefinedTimestampRuleEdition2023 parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedTimestampRuleEdition2023 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.PredefinedTimestampRuleEdition2023 parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedTimestampRuleEdition2023 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.PredefinedTimestampRuleEdition2023 parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.PredefinedTimestampRuleEdition2023 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.PredefinedTimestampRuleEdition2023 parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.PredefinedTimestampRuleEdition2023 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.PredefinedTimestampRuleEdition2023 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.PredefinedTimestampRuleEdition2023 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.PredefinedTimestampRuleEdition2023 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.PredefinedTimestampRuleEdition2023} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.PredefinedTimestampRuleEdition2023) + build.buf.validate.conformance.cases.PredefinedTimestampRuleEdition2023OrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.internal_static_buf_validate_conformance_cases_PredefinedTimestampRuleEdition2023_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.internal_static_buf_validate_conformance_cases_PredefinedTimestampRuleEdition2023_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.PredefinedTimestampRuleEdition2023.class, build.buf.validate.conformance.cases.PredefinedTimestampRuleEdition2023.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.PredefinedTimestampRuleEdition2023.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage + .alwaysUseFieldBuilders) { + getValFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + val_ = null; + if (valBuilder_ != null) { + valBuilder_.dispose(); + valBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.internal_static_buf_validate_conformance_cases_PredefinedTimestampRuleEdition2023_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedTimestampRuleEdition2023 getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.PredefinedTimestampRuleEdition2023.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedTimestampRuleEdition2023 build() { + build.buf.validate.conformance.cases.PredefinedTimestampRuleEdition2023 result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedTimestampRuleEdition2023 buildPartial() { + build.buf.validate.conformance.cases.PredefinedTimestampRuleEdition2023 result = new build.buf.validate.conformance.cases.PredefinedTimestampRuleEdition2023(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.PredefinedTimestampRuleEdition2023 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.PredefinedTimestampRuleEdition2023) { + return mergeFrom((build.buf.validate.conformance.cases.PredefinedTimestampRuleEdition2023)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.PredefinedTimestampRuleEdition2023 other) { + if (other == build.buf.validate.conformance.cases.PredefinedTimestampRuleEdition2023.getDefaultInstance()) return this; + if (other.hasVal()) { + mergeVal(other.getVal()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + input.readMessage( + getValFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private com.google.protobuf.Timestamp val_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> valBuilder_; + /** + * .google.protobuf.Timestamp val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + public boolean hasVal() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * .google.protobuf.Timestamp val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + public com.google.protobuf.Timestamp getVal() { + if (valBuilder_ == null) { + return val_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : val_; + } else { + return valBuilder_.getMessage(); + } + } + /** + * .google.protobuf.Timestamp val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder setVal(com.google.protobuf.Timestamp value) { + if (valBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + val_ = value; + } else { + valBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * .google.protobuf.Timestamp val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder setVal( + com.google.protobuf.Timestamp.Builder builderForValue) { + if (valBuilder_ == null) { + val_ = builderForValue.build(); + } else { + valBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * .google.protobuf.Timestamp val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder mergeVal(com.google.protobuf.Timestamp value) { + if (valBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) && + val_ != null && + val_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getValBuilder().mergeFrom(value); + } else { + val_ = value; + } + } else { + valBuilder_.mergeFrom(value); + } + if (val_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + /** + * .google.protobuf.Timestamp 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; + } + /** + * .google.protobuf.Timestamp val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public com.google.protobuf.Timestamp.Builder getValBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getValFieldBuilder().getBuilder(); + } + /** + * .google.protobuf.Timestamp val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public com.google.protobuf.TimestampOrBuilder getValOrBuilder() { + if (valBuilder_ != null) { + return valBuilder_.getMessageOrBuilder(); + } else { + return val_ == null ? + com.google.protobuf.Timestamp.getDefaultInstance() : val_; + } + } + /** + * .google.protobuf.Timestamp val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> + getValFieldBuilder() { + if (valBuilder_ == null) { + valBuilder_ = new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>( + getVal(), + getParentForChildren(), + isClean()); + val_ = null; + } + return valBuilder_; + } + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.PredefinedTimestampRuleEdition2023) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.PredefinedTimestampRuleEdition2023) + private static final build.buf.validate.conformance.cases.PredefinedTimestampRuleEdition2023 DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.PredefinedTimestampRuleEdition2023(); + } + + public static build.buf.validate.conformance.cases.PredefinedTimestampRuleEdition2023 getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PredefinedTimestampRuleEdition2023 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.PredefinedTimestampRuleEdition2023 getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedTimestampRuleEdition2023OrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedTimestampRuleEdition2023OrBuilder.java new file mode 100644 index 00000000..bb5de398 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedTimestampRuleEdition2023OrBuilder.java @@ -0,0 +1,26 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/predefined_rules_proto_editions.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +public interface PredefinedTimestampRuleEdition2023OrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.PredefinedTimestampRuleEdition2023) + com.google.protobuf.MessageOrBuilder { + + /** + * .google.protobuf.Timestamp val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + boolean hasVal(); + /** + * .google.protobuf.Timestamp val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + com.google.protobuf.Timestamp getVal(); + /** + * .google.protobuf.Timestamp val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + com.google.protobuf.TimestampOrBuilder getValOrBuilder(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedTimestampRuleProto2.java b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedTimestampRuleProto2.java new file mode 100644 index 00000000..4bca82c0 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedTimestampRuleProto2.java @@ -0,0 +1,558 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/predefined_rules_proto2.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.PredefinedTimestampRuleProto2} + */ +public final class PredefinedTimestampRuleProto2 extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.PredefinedTimestampRuleProto2) + PredefinedTimestampRuleProto2OrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 1, + /* suffix= */ "", + PredefinedTimestampRuleProto2.class.getName()); + } + // Use PredefinedTimestampRuleProto2.newBuilder() to construct. + private PredefinedTimestampRuleProto2(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private PredefinedTimestampRuleProto2() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.internal_static_buf_validate_conformance_cases_PredefinedTimestampRuleProto2_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.internal_static_buf_validate_conformance_cases_PredefinedTimestampRuleProto2_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.PredefinedTimestampRuleProto2.class, build.buf.validate.conformance.cases.PredefinedTimestampRuleProto2.Builder.class); + } + + private int bitField0_; + public static final int VAL_FIELD_NUMBER = 1; + private com.google.protobuf.Timestamp val_; + /** + * optional .google.protobuf.Timestamp 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 .google.protobuf.Timestamp val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getVal() { + return val_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : val_; + } + /** + * optional .google.protobuf.Timestamp val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getValOrBuilder() { + return val_ == null ? com.google.protobuf.Timestamp.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.PredefinedTimestampRuleProto2)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.PredefinedTimestampRuleProto2 other = (build.buf.validate.conformance.cases.PredefinedTimestampRuleProto2) 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.PredefinedTimestampRuleProto2 parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedTimestampRuleProto2 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.PredefinedTimestampRuleProto2 parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedTimestampRuleProto2 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.PredefinedTimestampRuleProto2 parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedTimestampRuleProto2 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.PredefinedTimestampRuleProto2 parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.PredefinedTimestampRuleProto2 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.PredefinedTimestampRuleProto2 parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.PredefinedTimestampRuleProto2 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.PredefinedTimestampRuleProto2 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.PredefinedTimestampRuleProto2 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.PredefinedTimestampRuleProto2 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.PredefinedTimestampRuleProto2} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.PredefinedTimestampRuleProto2) + build.buf.validate.conformance.cases.PredefinedTimestampRuleProto2OrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.internal_static_buf_validate_conformance_cases_PredefinedTimestampRuleProto2_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.internal_static_buf_validate_conformance_cases_PredefinedTimestampRuleProto2_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.PredefinedTimestampRuleProto2.class, build.buf.validate.conformance.cases.PredefinedTimestampRuleProto2.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.PredefinedTimestampRuleProto2.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage + .alwaysUseFieldBuilders) { + getValFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + val_ = null; + if (valBuilder_ != null) { + valBuilder_.dispose(); + valBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.internal_static_buf_validate_conformance_cases_PredefinedTimestampRuleProto2_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedTimestampRuleProto2 getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.PredefinedTimestampRuleProto2.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedTimestampRuleProto2 build() { + build.buf.validate.conformance.cases.PredefinedTimestampRuleProto2 result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedTimestampRuleProto2 buildPartial() { + build.buf.validate.conformance.cases.PredefinedTimestampRuleProto2 result = new build.buf.validate.conformance.cases.PredefinedTimestampRuleProto2(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.PredefinedTimestampRuleProto2 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.PredefinedTimestampRuleProto2) { + return mergeFrom((build.buf.validate.conformance.cases.PredefinedTimestampRuleProto2)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.PredefinedTimestampRuleProto2 other) { + if (other == build.buf.validate.conformance.cases.PredefinedTimestampRuleProto2.getDefaultInstance()) return this; + if (other.hasVal()) { + mergeVal(other.getVal()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + input.readMessage( + getValFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private com.google.protobuf.Timestamp val_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> valBuilder_; + /** + * optional .google.protobuf.Timestamp val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + public boolean hasVal() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * optional .google.protobuf.Timestamp val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + public com.google.protobuf.Timestamp getVal() { + if (valBuilder_ == null) { + return val_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : val_; + } else { + return valBuilder_.getMessage(); + } + } + /** + * optional .google.protobuf.Timestamp val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder setVal(com.google.protobuf.Timestamp value) { + if (valBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + val_ = value; + } else { + valBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * optional .google.protobuf.Timestamp val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder setVal( + com.google.protobuf.Timestamp.Builder builderForValue) { + if (valBuilder_ == null) { + val_ = builderForValue.build(); + } else { + valBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * optional .google.protobuf.Timestamp val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder mergeVal(com.google.protobuf.Timestamp value) { + if (valBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) && + val_ != null && + val_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getValBuilder().mergeFrom(value); + } else { + val_ = value; + } + } else { + valBuilder_.mergeFrom(value); + } + if (val_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + /** + * optional .google.protobuf.Timestamp 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 .google.protobuf.Timestamp val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public com.google.protobuf.Timestamp.Builder getValBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getValFieldBuilder().getBuilder(); + } + /** + * optional .google.protobuf.Timestamp val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public com.google.protobuf.TimestampOrBuilder getValOrBuilder() { + if (valBuilder_ != null) { + return valBuilder_.getMessageOrBuilder(); + } else { + return val_ == null ? + com.google.protobuf.Timestamp.getDefaultInstance() : val_; + } + } + /** + * optional .google.protobuf.Timestamp val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> + getValFieldBuilder() { + if (valBuilder_ == null) { + valBuilder_ = new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>( + getVal(), + getParentForChildren(), + isClean()); + val_ = null; + } + return valBuilder_; + } + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.PredefinedTimestampRuleProto2) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.PredefinedTimestampRuleProto2) + private static final build.buf.validate.conformance.cases.PredefinedTimestampRuleProto2 DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.PredefinedTimestampRuleProto2(); + } + + public static build.buf.validate.conformance.cases.PredefinedTimestampRuleProto2 getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PredefinedTimestampRuleProto2 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.PredefinedTimestampRuleProto2 getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedTimestampRuleProto2OrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedTimestampRuleProto2OrBuilder.java new file mode 100644 index 00000000..78e49b42 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedTimestampRuleProto2OrBuilder.java @@ -0,0 +1,26 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/predefined_rules_proto2.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +public interface PredefinedTimestampRuleProto2OrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.PredefinedTimestampRuleProto2) + com.google.protobuf.MessageOrBuilder { + + /** + * optional .google.protobuf.Timestamp val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + boolean hasVal(); + /** + * optional .google.protobuf.Timestamp val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + com.google.protobuf.Timestamp getVal(); + /** + * optional .google.protobuf.Timestamp val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + com.google.protobuf.TimestampOrBuilder getValOrBuilder(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedTimestampRuleProto3.java b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedTimestampRuleProto3.java new file mode 100644 index 00000000..220a2c6b --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedTimestampRuleProto3.java @@ -0,0 +1,558 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/predefined_rules_proto3.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.PredefinedTimestampRuleProto3} + */ +public final class PredefinedTimestampRuleProto3 extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.PredefinedTimestampRuleProto3) + PredefinedTimestampRuleProto3OrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 1, + /* suffix= */ "", + PredefinedTimestampRuleProto3.class.getName()); + } + // Use PredefinedTimestampRuleProto3.newBuilder() to construct. + private PredefinedTimestampRuleProto3(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private PredefinedTimestampRuleProto3() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.PredefinedRulesProto3Proto.internal_static_buf_validate_conformance_cases_PredefinedTimestampRuleProto3_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.PredefinedRulesProto3Proto.internal_static_buf_validate_conformance_cases_PredefinedTimestampRuleProto3_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.PredefinedTimestampRuleProto3.class, build.buf.validate.conformance.cases.PredefinedTimestampRuleProto3.Builder.class); + } + + private int bitField0_; + public static final int VAL_FIELD_NUMBER = 1; + private com.google.protobuf.Timestamp val_; + /** + * .google.protobuf.Timestamp 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); + } + /** + * .google.protobuf.Timestamp val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getVal() { + return val_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : val_; + } + /** + * .google.protobuf.Timestamp val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getValOrBuilder() { + return val_ == null ? com.google.protobuf.Timestamp.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.PredefinedTimestampRuleProto3)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.PredefinedTimestampRuleProto3 other = (build.buf.validate.conformance.cases.PredefinedTimestampRuleProto3) 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.PredefinedTimestampRuleProto3 parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedTimestampRuleProto3 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.PredefinedTimestampRuleProto3 parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedTimestampRuleProto3 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.PredefinedTimestampRuleProto3 parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedTimestampRuleProto3 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.PredefinedTimestampRuleProto3 parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.PredefinedTimestampRuleProto3 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.PredefinedTimestampRuleProto3 parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.PredefinedTimestampRuleProto3 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.PredefinedTimestampRuleProto3 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.PredefinedTimestampRuleProto3 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.PredefinedTimestampRuleProto3 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.PredefinedTimestampRuleProto3} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.PredefinedTimestampRuleProto3) + build.buf.validate.conformance.cases.PredefinedTimestampRuleProto3OrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.PredefinedRulesProto3Proto.internal_static_buf_validate_conformance_cases_PredefinedTimestampRuleProto3_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.PredefinedRulesProto3Proto.internal_static_buf_validate_conformance_cases_PredefinedTimestampRuleProto3_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.PredefinedTimestampRuleProto3.class, build.buf.validate.conformance.cases.PredefinedTimestampRuleProto3.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.PredefinedTimestampRuleProto3.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage + .alwaysUseFieldBuilders) { + getValFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + val_ = null; + if (valBuilder_ != null) { + valBuilder_.dispose(); + valBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.PredefinedRulesProto3Proto.internal_static_buf_validate_conformance_cases_PredefinedTimestampRuleProto3_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedTimestampRuleProto3 getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.PredefinedTimestampRuleProto3.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedTimestampRuleProto3 build() { + build.buf.validate.conformance.cases.PredefinedTimestampRuleProto3 result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedTimestampRuleProto3 buildPartial() { + build.buf.validate.conformance.cases.PredefinedTimestampRuleProto3 result = new build.buf.validate.conformance.cases.PredefinedTimestampRuleProto3(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.PredefinedTimestampRuleProto3 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.PredefinedTimestampRuleProto3) { + return mergeFrom((build.buf.validate.conformance.cases.PredefinedTimestampRuleProto3)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.PredefinedTimestampRuleProto3 other) { + if (other == build.buf.validate.conformance.cases.PredefinedTimestampRuleProto3.getDefaultInstance()) return this; + if (other.hasVal()) { + mergeVal(other.getVal()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + input.readMessage( + getValFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private com.google.protobuf.Timestamp val_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> valBuilder_; + /** + * .google.protobuf.Timestamp val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + public boolean hasVal() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * .google.protobuf.Timestamp val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + public com.google.protobuf.Timestamp getVal() { + if (valBuilder_ == null) { + return val_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : val_; + } else { + return valBuilder_.getMessage(); + } + } + /** + * .google.protobuf.Timestamp val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder setVal(com.google.protobuf.Timestamp value) { + if (valBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + val_ = value; + } else { + valBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * .google.protobuf.Timestamp val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder setVal( + com.google.protobuf.Timestamp.Builder builderForValue) { + if (valBuilder_ == null) { + val_ = builderForValue.build(); + } else { + valBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * .google.protobuf.Timestamp val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder mergeVal(com.google.protobuf.Timestamp value) { + if (valBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) && + val_ != null && + val_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getValBuilder().mergeFrom(value); + } else { + val_ = value; + } + } else { + valBuilder_.mergeFrom(value); + } + if (val_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + /** + * .google.protobuf.Timestamp 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; + } + /** + * .google.protobuf.Timestamp val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public com.google.protobuf.Timestamp.Builder getValBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getValFieldBuilder().getBuilder(); + } + /** + * .google.protobuf.Timestamp val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public com.google.protobuf.TimestampOrBuilder getValOrBuilder() { + if (valBuilder_ != null) { + return valBuilder_.getMessageOrBuilder(); + } else { + return val_ == null ? + com.google.protobuf.Timestamp.getDefaultInstance() : val_; + } + } + /** + * .google.protobuf.Timestamp val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> + getValFieldBuilder() { + if (valBuilder_ == null) { + valBuilder_ = new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>( + getVal(), + getParentForChildren(), + isClean()); + val_ = null; + } + return valBuilder_; + } + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.PredefinedTimestampRuleProto3) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.PredefinedTimestampRuleProto3) + private static final build.buf.validate.conformance.cases.PredefinedTimestampRuleProto3 DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.PredefinedTimestampRuleProto3(); + } + + public static build.buf.validate.conformance.cases.PredefinedTimestampRuleProto3 getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PredefinedTimestampRuleProto3 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.PredefinedTimestampRuleProto3 getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedTimestampRuleProto3OrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedTimestampRuleProto3OrBuilder.java new file mode 100644 index 00000000..724350fd --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedTimestampRuleProto3OrBuilder.java @@ -0,0 +1,26 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/predefined_rules_proto3.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +public interface PredefinedTimestampRuleProto3OrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.PredefinedTimestampRuleProto3) + com.google.protobuf.MessageOrBuilder { + + /** + * .google.protobuf.Timestamp val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + boolean hasVal(); + /** + * .google.protobuf.Timestamp val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + com.google.protobuf.Timestamp getVal(); + /** + * .google.protobuf.Timestamp val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + com.google.protobuf.TimestampOrBuilder getValOrBuilder(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedUInt32RuleEdition2023.java b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedUInt32RuleEdition2023.java new file mode 100644 index 00000000..dff4bd1e --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedUInt32RuleEdition2023.java @@ -0,0 +1,456 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/predefined_rules_proto_editions.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.PredefinedUInt32RuleEdition2023} + */ +public final class PredefinedUInt32RuleEdition2023 extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.PredefinedUInt32RuleEdition2023) + PredefinedUInt32RuleEdition2023OrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 1, + /* suffix= */ "", + PredefinedUInt32RuleEdition2023.class.getName()); + } + // Use PredefinedUInt32RuleEdition2023.newBuilder() to construct. + private PredefinedUInt32RuleEdition2023(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private PredefinedUInt32RuleEdition2023() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.internal_static_buf_validate_conformance_cases_PredefinedUInt32RuleEdition2023_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.internal_static_buf_validate_conformance_cases_PredefinedUInt32RuleEdition2023_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.PredefinedUInt32RuleEdition2023.class, build.buf.validate.conformance.cases.PredefinedUInt32RuleEdition2023.Builder.class); + } + + private int bitField0_; + public static final int VAL_FIELD_NUMBER = 1; + private int val_ = 0; + /** + * uint32 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); + } + /** + * uint32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public int getVal() { + return val_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + output.writeUInt32(1, val_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(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.PredefinedUInt32RuleEdition2023)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.PredefinedUInt32RuleEdition2023 other = (build.buf.validate.conformance.cases.PredefinedUInt32RuleEdition2023) obj; + + if (hasVal() != other.hasVal()) return false; + if (hasVal()) { + if (getVal() + != other.getVal()) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasVal()) { + hash = (37 * hash) + VAL_FIELD_NUMBER; + hash = (53 * hash) + getVal(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.PredefinedUInt32RuleEdition2023 parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedUInt32RuleEdition2023 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.PredefinedUInt32RuleEdition2023 parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedUInt32RuleEdition2023 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.PredefinedUInt32RuleEdition2023 parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedUInt32RuleEdition2023 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.PredefinedUInt32RuleEdition2023 parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.PredefinedUInt32RuleEdition2023 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.PredefinedUInt32RuleEdition2023 parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.PredefinedUInt32RuleEdition2023 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.PredefinedUInt32RuleEdition2023 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.PredefinedUInt32RuleEdition2023 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.PredefinedUInt32RuleEdition2023 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.PredefinedUInt32RuleEdition2023} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.PredefinedUInt32RuleEdition2023) + build.buf.validate.conformance.cases.PredefinedUInt32RuleEdition2023OrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.internal_static_buf_validate_conformance_cases_PredefinedUInt32RuleEdition2023_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.internal_static_buf_validate_conformance_cases_PredefinedUInt32RuleEdition2023_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.PredefinedUInt32RuleEdition2023.class, build.buf.validate.conformance.cases.PredefinedUInt32RuleEdition2023.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.PredefinedUInt32RuleEdition2023.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + val_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.internal_static_buf_validate_conformance_cases_PredefinedUInt32RuleEdition2023_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedUInt32RuleEdition2023 getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.PredefinedUInt32RuleEdition2023.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedUInt32RuleEdition2023 build() { + build.buf.validate.conformance.cases.PredefinedUInt32RuleEdition2023 result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedUInt32RuleEdition2023 buildPartial() { + build.buf.validate.conformance.cases.PredefinedUInt32RuleEdition2023 result = new build.buf.validate.conformance.cases.PredefinedUInt32RuleEdition2023(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.PredefinedUInt32RuleEdition2023 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.PredefinedUInt32RuleEdition2023) { + return mergeFrom((build.buf.validate.conformance.cases.PredefinedUInt32RuleEdition2023)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.PredefinedUInt32RuleEdition2023 other) { + if (other == build.buf.validate.conformance.cases.PredefinedUInt32RuleEdition2023.getDefaultInstance()) return this; + if (other.hasVal()) { + setVal(other.getVal()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + val_ = input.readUInt32(); + bitField0_ |= 0x00000001; + break; + } // case 8 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private int val_ ; + /** + * uint32 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); + } + /** + * uint32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public int getVal() { + return val_; + } + /** + * uint32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param value The val to set. + * @return This builder for chaining. + */ + public Builder setVal(int value) { + + val_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * uint32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return This builder for chaining. + */ + public Builder clearVal() { + bitField0_ = (bitField0_ & ~0x00000001); + val_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.PredefinedUInt32RuleEdition2023) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.PredefinedUInt32RuleEdition2023) + private static final build.buf.validate.conformance.cases.PredefinedUInt32RuleEdition2023 DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.PredefinedUInt32RuleEdition2023(); + } + + public static build.buf.validate.conformance.cases.PredefinedUInt32RuleEdition2023 getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PredefinedUInt32RuleEdition2023 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.PredefinedUInt32RuleEdition2023 getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedUInt32RuleEdition2023OrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedUInt32RuleEdition2023OrBuilder.java new file mode 100644 index 00000000..134a906e --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedUInt32RuleEdition2023OrBuilder.java @@ -0,0 +1,22 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/predefined_rules_proto_editions.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +public interface PredefinedUInt32RuleEdition2023OrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.PredefinedUInt32RuleEdition2023) + com.google.protobuf.MessageOrBuilder { + + /** + * uint32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + boolean hasVal(); + /** + * uint32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + int getVal(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedUInt32RuleProto2.java b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedUInt32RuleProto2.java new file mode 100644 index 00000000..27ac7967 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedUInt32RuleProto2.java @@ -0,0 +1,456 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/predefined_rules_proto2.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.PredefinedUInt32RuleProto2} + */ +public final class PredefinedUInt32RuleProto2 extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.PredefinedUInt32RuleProto2) + PredefinedUInt32RuleProto2OrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 1, + /* suffix= */ "", + PredefinedUInt32RuleProto2.class.getName()); + } + // Use PredefinedUInt32RuleProto2.newBuilder() to construct. + private PredefinedUInt32RuleProto2(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private PredefinedUInt32RuleProto2() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.internal_static_buf_validate_conformance_cases_PredefinedUInt32RuleProto2_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.internal_static_buf_validate_conformance_cases_PredefinedUInt32RuleProto2_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.PredefinedUInt32RuleProto2.class, build.buf.validate.conformance.cases.PredefinedUInt32RuleProto2.Builder.class); + } + + private int bitField0_; + public static final int VAL_FIELD_NUMBER = 1; + private int val_ = 0; + /** + * optional uint32 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 uint32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public int getVal() { + return val_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + output.writeUInt32(1, val_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(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.PredefinedUInt32RuleProto2)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.PredefinedUInt32RuleProto2 other = (build.buf.validate.conformance.cases.PredefinedUInt32RuleProto2) obj; + + if (hasVal() != other.hasVal()) return false; + if (hasVal()) { + if (getVal() + != other.getVal()) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasVal()) { + hash = (37 * hash) + VAL_FIELD_NUMBER; + hash = (53 * hash) + getVal(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.PredefinedUInt32RuleProto2 parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedUInt32RuleProto2 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.PredefinedUInt32RuleProto2 parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedUInt32RuleProto2 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.PredefinedUInt32RuleProto2 parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedUInt32RuleProto2 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.PredefinedUInt32RuleProto2 parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.PredefinedUInt32RuleProto2 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.PredefinedUInt32RuleProto2 parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.PredefinedUInt32RuleProto2 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.PredefinedUInt32RuleProto2 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.PredefinedUInt32RuleProto2 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.PredefinedUInt32RuleProto2 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.PredefinedUInt32RuleProto2} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.PredefinedUInt32RuleProto2) + build.buf.validate.conformance.cases.PredefinedUInt32RuleProto2OrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.internal_static_buf_validate_conformance_cases_PredefinedUInt32RuleProto2_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.internal_static_buf_validate_conformance_cases_PredefinedUInt32RuleProto2_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.PredefinedUInt32RuleProto2.class, build.buf.validate.conformance.cases.PredefinedUInt32RuleProto2.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.PredefinedUInt32RuleProto2.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + val_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.internal_static_buf_validate_conformance_cases_PredefinedUInt32RuleProto2_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedUInt32RuleProto2 getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.PredefinedUInt32RuleProto2.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedUInt32RuleProto2 build() { + build.buf.validate.conformance.cases.PredefinedUInt32RuleProto2 result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedUInt32RuleProto2 buildPartial() { + build.buf.validate.conformance.cases.PredefinedUInt32RuleProto2 result = new build.buf.validate.conformance.cases.PredefinedUInt32RuleProto2(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.PredefinedUInt32RuleProto2 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.PredefinedUInt32RuleProto2) { + return mergeFrom((build.buf.validate.conformance.cases.PredefinedUInt32RuleProto2)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.PredefinedUInt32RuleProto2 other) { + if (other == build.buf.validate.conformance.cases.PredefinedUInt32RuleProto2.getDefaultInstance()) return this; + if (other.hasVal()) { + setVal(other.getVal()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + val_ = input.readUInt32(); + bitField0_ |= 0x00000001; + break; + } // case 8 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private int val_ ; + /** + * optional uint32 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 uint32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public int getVal() { + return val_; + } + /** + * optional uint32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param value The val to set. + * @return This builder for chaining. + */ + public Builder setVal(int value) { + + val_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * optional uint32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return This builder for chaining. + */ + public Builder clearVal() { + bitField0_ = (bitField0_ & ~0x00000001); + val_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.PredefinedUInt32RuleProto2) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.PredefinedUInt32RuleProto2) + private static final build.buf.validate.conformance.cases.PredefinedUInt32RuleProto2 DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.PredefinedUInt32RuleProto2(); + } + + public static build.buf.validate.conformance.cases.PredefinedUInt32RuleProto2 getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PredefinedUInt32RuleProto2 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.PredefinedUInt32RuleProto2 getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedUInt32RuleProto2OrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedUInt32RuleProto2OrBuilder.java new file mode 100644 index 00000000..f4aee2da --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedUInt32RuleProto2OrBuilder.java @@ -0,0 +1,22 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/predefined_rules_proto2.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +public interface PredefinedUInt32RuleProto2OrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.PredefinedUInt32RuleProto2) + com.google.protobuf.MessageOrBuilder { + + /** + * optional uint32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + boolean hasVal(); + /** + * optional uint32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + int getVal(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedUInt32RuleProto3.java b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedUInt32RuleProto3.java new file mode 100644 index 00000000..1be99b47 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedUInt32RuleProto3.java @@ -0,0 +1,431 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/predefined_rules_proto3.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.PredefinedUInt32RuleProto3} + */ +public final class PredefinedUInt32RuleProto3 extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.PredefinedUInt32RuleProto3) + PredefinedUInt32RuleProto3OrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 1, + /* suffix= */ "", + PredefinedUInt32RuleProto3.class.getName()); + } + // Use PredefinedUInt32RuleProto3.newBuilder() to construct. + private PredefinedUInt32RuleProto3(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private PredefinedUInt32RuleProto3() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.PredefinedRulesProto3Proto.internal_static_buf_validate_conformance_cases_PredefinedUInt32RuleProto3_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.PredefinedRulesProto3Proto.internal_static_buf_validate_conformance_cases_PredefinedUInt32RuleProto3_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.PredefinedUInt32RuleProto3.class, build.buf.validate.conformance.cases.PredefinedUInt32RuleProto3.Builder.class); + } + + public static final int VAL_FIELD_NUMBER = 1; + private int val_ = 0; + /** + * uint32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public int getVal() { + return val_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (val_ != 0) { + output.writeUInt32(1, val_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (val_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(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.PredefinedUInt32RuleProto3)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.PredefinedUInt32RuleProto3 other = (build.buf.validate.conformance.cases.PredefinedUInt32RuleProto3) obj; + + if (getVal() + != other.getVal()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + VAL_FIELD_NUMBER; + hash = (53 * hash) + getVal(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.PredefinedUInt32RuleProto3 parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedUInt32RuleProto3 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.PredefinedUInt32RuleProto3 parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedUInt32RuleProto3 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.PredefinedUInt32RuleProto3 parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedUInt32RuleProto3 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.PredefinedUInt32RuleProto3 parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.PredefinedUInt32RuleProto3 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.PredefinedUInt32RuleProto3 parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.PredefinedUInt32RuleProto3 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.PredefinedUInt32RuleProto3 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.PredefinedUInt32RuleProto3 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.PredefinedUInt32RuleProto3 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.PredefinedUInt32RuleProto3} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.PredefinedUInt32RuleProto3) + build.buf.validate.conformance.cases.PredefinedUInt32RuleProto3OrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.PredefinedRulesProto3Proto.internal_static_buf_validate_conformance_cases_PredefinedUInt32RuleProto3_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.PredefinedRulesProto3Proto.internal_static_buf_validate_conformance_cases_PredefinedUInt32RuleProto3_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.PredefinedUInt32RuleProto3.class, build.buf.validate.conformance.cases.PredefinedUInt32RuleProto3.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.PredefinedUInt32RuleProto3.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + val_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.PredefinedRulesProto3Proto.internal_static_buf_validate_conformance_cases_PredefinedUInt32RuleProto3_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedUInt32RuleProto3 getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.PredefinedUInt32RuleProto3.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedUInt32RuleProto3 build() { + build.buf.validate.conformance.cases.PredefinedUInt32RuleProto3 result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedUInt32RuleProto3 buildPartial() { + build.buf.validate.conformance.cases.PredefinedUInt32RuleProto3 result = new build.buf.validate.conformance.cases.PredefinedUInt32RuleProto3(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.PredefinedUInt32RuleProto3 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.PredefinedUInt32RuleProto3) { + return mergeFrom((build.buf.validate.conformance.cases.PredefinedUInt32RuleProto3)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.PredefinedUInt32RuleProto3 other) { + if (other == build.buf.validate.conformance.cases.PredefinedUInt32RuleProto3.getDefaultInstance()) return this; + if (other.getVal() != 0) { + setVal(other.getVal()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + val_ = input.readUInt32(); + bitField0_ |= 0x00000001; + break; + } // case 8 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private int val_ ; + /** + * uint32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public int getVal() { + return val_; + } + /** + * uint32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param value The val to set. + * @return This builder for chaining. + */ + public Builder setVal(int value) { + + val_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * uint32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return This builder for chaining. + */ + public Builder clearVal() { + bitField0_ = (bitField0_ & ~0x00000001); + val_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.PredefinedUInt32RuleProto3) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.PredefinedUInt32RuleProto3) + private static final build.buf.validate.conformance.cases.PredefinedUInt32RuleProto3 DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.PredefinedUInt32RuleProto3(); + } + + public static build.buf.validate.conformance.cases.PredefinedUInt32RuleProto3 getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PredefinedUInt32RuleProto3 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.PredefinedUInt32RuleProto3 getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedUInt32RuleProto3OrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedUInt32RuleProto3OrBuilder.java new file mode 100644 index 00000000..dd7d1c6d --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedUInt32RuleProto3OrBuilder.java @@ -0,0 +1,17 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/predefined_rules_proto3.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +public interface PredefinedUInt32RuleProto3OrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.PredefinedUInt32RuleProto3) + com.google.protobuf.MessageOrBuilder { + + /** + * uint32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + int getVal(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedUInt64RuleEdition2023.java b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedUInt64RuleEdition2023.java new file mode 100644 index 00000000..f0559230 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedUInt64RuleEdition2023.java @@ -0,0 +1,457 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/predefined_rules_proto_editions.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.PredefinedUInt64RuleEdition2023} + */ +public final class PredefinedUInt64RuleEdition2023 extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.PredefinedUInt64RuleEdition2023) + PredefinedUInt64RuleEdition2023OrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 1, + /* suffix= */ "", + PredefinedUInt64RuleEdition2023.class.getName()); + } + // Use PredefinedUInt64RuleEdition2023.newBuilder() to construct. + private PredefinedUInt64RuleEdition2023(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private PredefinedUInt64RuleEdition2023() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.internal_static_buf_validate_conformance_cases_PredefinedUInt64RuleEdition2023_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.internal_static_buf_validate_conformance_cases_PredefinedUInt64RuleEdition2023_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.PredefinedUInt64RuleEdition2023.class, build.buf.validate.conformance.cases.PredefinedUInt64RuleEdition2023.Builder.class); + } + + private int bitField0_; + public static final int VAL_FIELD_NUMBER = 1; + private long val_ = 0L; + /** + * uint64 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); + } + /** + * uint64 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public long getVal() { + return val_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + output.writeUInt64(1, val_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(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.PredefinedUInt64RuleEdition2023)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.PredefinedUInt64RuleEdition2023 other = (build.buf.validate.conformance.cases.PredefinedUInt64RuleEdition2023) obj; + + if (hasVal() != other.hasVal()) return false; + if (hasVal()) { + if (getVal() + != other.getVal()) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasVal()) { + hash = (37 * hash) + VAL_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getVal()); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.PredefinedUInt64RuleEdition2023 parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedUInt64RuleEdition2023 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.PredefinedUInt64RuleEdition2023 parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedUInt64RuleEdition2023 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.PredefinedUInt64RuleEdition2023 parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedUInt64RuleEdition2023 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.PredefinedUInt64RuleEdition2023 parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.PredefinedUInt64RuleEdition2023 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.PredefinedUInt64RuleEdition2023 parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.PredefinedUInt64RuleEdition2023 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.PredefinedUInt64RuleEdition2023 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.PredefinedUInt64RuleEdition2023 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.PredefinedUInt64RuleEdition2023 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.PredefinedUInt64RuleEdition2023} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.PredefinedUInt64RuleEdition2023) + build.buf.validate.conformance.cases.PredefinedUInt64RuleEdition2023OrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.internal_static_buf_validate_conformance_cases_PredefinedUInt64RuleEdition2023_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.internal_static_buf_validate_conformance_cases_PredefinedUInt64RuleEdition2023_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.PredefinedUInt64RuleEdition2023.class, build.buf.validate.conformance.cases.PredefinedUInt64RuleEdition2023.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.PredefinedUInt64RuleEdition2023.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + val_ = 0L; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.internal_static_buf_validate_conformance_cases_PredefinedUInt64RuleEdition2023_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedUInt64RuleEdition2023 getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.PredefinedUInt64RuleEdition2023.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedUInt64RuleEdition2023 build() { + build.buf.validate.conformance.cases.PredefinedUInt64RuleEdition2023 result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedUInt64RuleEdition2023 buildPartial() { + build.buf.validate.conformance.cases.PredefinedUInt64RuleEdition2023 result = new build.buf.validate.conformance.cases.PredefinedUInt64RuleEdition2023(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.PredefinedUInt64RuleEdition2023 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.PredefinedUInt64RuleEdition2023) { + return mergeFrom((build.buf.validate.conformance.cases.PredefinedUInt64RuleEdition2023)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.PredefinedUInt64RuleEdition2023 other) { + if (other == build.buf.validate.conformance.cases.PredefinedUInt64RuleEdition2023.getDefaultInstance()) return this; + if (other.hasVal()) { + setVal(other.getVal()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + val_ = input.readUInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private long val_ ; + /** + * uint64 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); + } + /** + * uint64 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public long getVal() { + return val_; + } + /** + * uint64 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param value The val to set. + * @return This builder for chaining. + */ + public Builder setVal(long value) { + + val_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * uint64 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return This builder for chaining. + */ + public Builder clearVal() { + bitField0_ = (bitField0_ & ~0x00000001); + val_ = 0L; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.PredefinedUInt64RuleEdition2023) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.PredefinedUInt64RuleEdition2023) + private static final build.buf.validate.conformance.cases.PredefinedUInt64RuleEdition2023 DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.PredefinedUInt64RuleEdition2023(); + } + + public static build.buf.validate.conformance.cases.PredefinedUInt64RuleEdition2023 getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PredefinedUInt64RuleEdition2023 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.PredefinedUInt64RuleEdition2023 getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedUInt64RuleEdition2023OrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedUInt64RuleEdition2023OrBuilder.java new file mode 100644 index 00000000..09d53561 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedUInt64RuleEdition2023OrBuilder.java @@ -0,0 +1,22 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/predefined_rules_proto_editions.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +public interface PredefinedUInt64RuleEdition2023OrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.PredefinedUInt64RuleEdition2023) + com.google.protobuf.MessageOrBuilder { + + /** + * uint64 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + boolean hasVal(); + /** + * uint64 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + long getVal(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedUInt64RuleProto2.java b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedUInt64RuleProto2.java new file mode 100644 index 00000000..c6f298a2 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedUInt64RuleProto2.java @@ -0,0 +1,457 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/predefined_rules_proto2.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.PredefinedUInt64RuleProto2} + */ +public final class PredefinedUInt64RuleProto2 extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.PredefinedUInt64RuleProto2) + PredefinedUInt64RuleProto2OrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 1, + /* suffix= */ "", + PredefinedUInt64RuleProto2.class.getName()); + } + // Use PredefinedUInt64RuleProto2.newBuilder() to construct. + private PredefinedUInt64RuleProto2(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private PredefinedUInt64RuleProto2() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.internal_static_buf_validate_conformance_cases_PredefinedUInt64RuleProto2_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.internal_static_buf_validate_conformance_cases_PredefinedUInt64RuleProto2_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.PredefinedUInt64RuleProto2.class, build.buf.validate.conformance.cases.PredefinedUInt64RuleProto2.Builder.class); + } + + private int bitField0_; + public static final int VAL_FIELD_NUMBER = 1; + private long val_ = 0L; + /** + * optional uint64 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 uint64 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public long getVal() { + return val_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + output.writeUInt64(1, val_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(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.PredefinedUInt64RuleProto2)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.PredefinedUInt64RuleProto2 other = (build.buf.validate.conformance.cases.PredefinedUInt64RuleProto2) obj; + + if (hasVal() != other.hasVal()) return false; + if (hasVal()) { + if (getVal() + != other.getVal()) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasVal()) { + hash = (37 * hash) + VAL_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getVal()); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.PredefinedUInt64RuleProto2 parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedUInt64RuleProto2 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.PredefinedUInt64RuleProto2 parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedUInt64RuleProto2 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.PredefinedUInt64RuleProto2 parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedUInt64RuleProto2 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.PredefinedUInt64RuleProto2 parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.PredefinedUInt64RuleProto2 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.PredefinedUInt64RuleProto2 parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.PredefinedUInt64RuleProto2 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.PredefinedUInt64RuleProto2 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.PredefinedUInt64RuleProto2 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.PredefinedUInt64RuleProto2 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.PredefinedUInt64RuleProto2} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.PredefinedUInt64RuleProto2) + build.buf.validate.conformance.cases.PredefinedUInt64RuleProto2OrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.internal_static_buf_validate_conformance_cases_PredefinedUInt64RuleProto2_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.internal_static_buf_validate_conformance_cases_PredefinedUInt64RuleProto2_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.PredefinedUInt64RuleProto2.class, build.buf.validate.conformance.cases.PredefinedUInt64RuleProto2.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.PredefinedUInt64RuleProto2.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + val_ = 0L; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.internal_static_buf_validate_conformance_cases_PredefinedUInt64RuleProto2_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedUInt64RuleProto2 getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.PredefinedUInt64RuleProto2.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedUInt64RuleProto2 build() { + build.buf.validate.conformance.cases.PredefinedUInt64RuleProto2 result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedUInt64RuleProto2 buildPartial() { + build.buf.validate.conformance.cases.PredefinedUInt64RuleProto2 result = new build.buf.validate.conformance.cases.PredefinedUInt64RuleProto2(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.PredefinedUInt64RuleProto2 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.PredefinedUInt64RuleProto2) { + return mergeFrom((build.buf.validate.conformance.cases.PredefinedUInt64RuleProto2)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.PredefinedUInt64RuleProto2 other) { + if (other == build.buf.validate.conformance.cases.PredefinedUInt64RuleProto2.getDefaultInstance()) return this; + if (other.hasVal()) { + setVal(other.getVal()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + val_ = input.readUInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private long val_ ; + /** + * optional uint64 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 uint64 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public long getVal() { + return val_; + } + /** + * optional uint64 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param value The val to set. + * @return This builder for chaining. + */ + public Builder setVal(long value) { + + val_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * optional uint64 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return This builder for chaining. + */ + public Builder clearVal() { + bitField0_ = (bitField0_ & ~0x00000001); + val_ = 0L; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.PredefinedUInt64RuleProto2) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.PredefinedUInt64RuleProto2) + private static final build.buf.validate.conformance.cases.PredefinedUInt64RuleProto2 DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.PredefinedUInt64RuleProto2(); + } + + public static build.buf.validate.conformance.cases.PredefinedUInt64RuleProto2 getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PredefinedUInt64RuleProto2 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.PredefinedUInt64RuleProto2 getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedUInt64RuleProto2OrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedUInt64RuleProto2OrBuilder.java new file mode 100644 index 00000000..a1986388 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedUInt64RuleProto2OrBuilder.java @@ -0,0 +1,22 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/predefined_rules_proto2.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +public interface PredefinedUInt64RuleProto2OrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.PredefinedUInt64RuleProto2) + com.google.protobuf.MessageOrBuilder { + + /** + * optional uint64 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + boolean hasVal(); + /** + * optional uint64 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + long getVal(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedUInt64RuleProto3.java b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedUInt64RuleProto3.java new file mode 100644 index 00000000..91b2feeb --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedUInt64RuleProto3.java @@ -0,0 +1,432 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/predefined_rules_proto3.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.PredefinedUInt64RuleProto3} + */ +public final class PredefinedUInt64RuleProto3 extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.PredefinedUInt64RuleProto3) + PredefinedUInt64RuleProto3OrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 1, + /* suffix= */ "", + PredefinedUInt64RuleProto3.class.getName()); + } + // Use PredefinedUInt64RuleProto3.newBuilder() to construct. + private PredefinedUInt64RuleProto3(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private PredefinedUInt64RuleProto3() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.PredefinedRulesProto3Proto.internal_static_buf_validate_conformance_cases_PredefinedUInt64RuleProto3_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.PredefinedRulesProto3Proto.internal_static_buf_validate_conformance_cases_PredefinedUInt64RuleProto3_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.PredefinedUInt64RuleProto3.class, build.buf.validate.conformance.cases.PredefinedUInt64RuleProto3.Builder.class); + } + + public static final int VAL_FIELD_NUMBER = 1; + private long val_ = 0L; + /** + * uint64 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public long getVal() { + return val_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (val_ != 0L) { + output.writeUInt64(1, val_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (val_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(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.PredefinedUInt64RuleProto3)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.PredefinedUInt64RuleProto3 other = (build.buf.validate.conformance.cases.PredefinedUInt64RuleProto3) obj; + + if (getVal() + != other.getVal()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + VAL_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getVal()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.PredefinedUInt64RuleProto3 parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedUInt64RuleProto3 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.PredefinedUInt64RuleProto3 parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedUInt64RuleProto3 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.PredefinedUInt64RuleProto3 parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.PredefinedUInt64RuleProto3 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.PredefinedUInt64RuleProto3 parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.PredefinedUInt64RuleProto3 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.PredefinedUInt64RuleProto3 parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.PredefinedUInt64RuleProto3 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.PredefinedUInt64RuleProto3 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.PredefinedUInt64RuleProto3 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.PredefinedUInt64RuleProto3 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.PredefinedUInt64RuleProto3} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.PredefinedUInt64RuleProto3) + build.buf.validate.conformance.cases.PredefinedUInt64RuleProto3OrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.PredefinedRulesProto3Proto.internal_static_buf_validate_conformance_cases_PredefinedUInt64RuleProto3_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.PredefinedRulesProto3Proto.internal_static_buf_validate_conformance_cases_PredefinedUInt64RuleProto3_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.PredefinedUInt64RuleProto3.class, build.buf.validate.conformance.cases.PredefinedUInt64RuleProto3.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.PredefinedUInt64RuleProto3.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + val_ = 0L; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.PredefinedRulesProto3Proto.internal_static_buf_validate_conformance_cases_PredefinedUInt64RuleProto3_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedUInt64RuleProto3 getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.PredefinedUInt64RuleProto3.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedUInt64RuleProto3 build() { + build.buf.validate.conformance.cases.PredefinedUInt64RuleProto3 result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.PredefinedUInt64RuleProto3 buildPartial() { + build.buf.validate.conformance.cases.PredefinedUInt64RuleProto3 result = new build.buf.validate.conformance.cases.PredefinedUInt64RuleProto3(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.PredefinedUInt64RuleProto3 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.PredefinedUInt64RuleProto3) { + return mergeFrom((build.buf.validate.conformance.cases.PredefinedUInt64RuleProto3)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.PredefinedUInt64RuleProto3 other) { + if (other == build.buf.validate.conformance.cases.PredefinedUInt64RuleProto3.getDefaultInstance()) return this; + if (other.getVal() != 0L) { + setVal(other.getVal()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + val_ = input.readUInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private long val_ ; + /** + * uint64 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public long getVal() { + return val_; + } + /** + * uint64 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param value The val to set. + * @return This builder for chaining. + */ + public Builder setVal(long value) { + + val_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * uint64 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return This builder for chaining. + */ + public Builder clearVal() { + bitField0_ = (bitField0_ & ~0x00000001); + val_ = 0L; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.PredefinedUInt64RuleProto3) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.PredefinedUInt64RuleProto3) + private static final build.buf.validate.conformance.cases.PredefinedUInt64RuleProto3 DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.PredefinedUInt64RuleProto3(); + } + + public static build.buf.validate.conformance.cases.PredefinedUInt64RuleProto3 getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PredefinedUInt64RuleProto3 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.PredefinedUInt64RuleProto3 getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedUInt64RuleProto3OrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedUInt64RuleProto3OrBuilder.java new file mode 100644 index 00000000..34ae3ddd --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/PredefinedUInt64RuleProto3OrBuilder.java @@ -0,0 +1,17 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/predefined_rules_proto3.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +public interface PredefinedUInt64RuleProto3OrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.PredefinedUInt64RuleProto3) + com.google.protobuf.MessageOrBuilder { + + /** + * uint64 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + long getVal(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/RepeatedNotUnique.java b/conformance/src/main/java/build/buf/validate/conformance/cases/RepeatedNotUnique.java new file mode 100644 index 00000000..0c5162f8 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/RepeatedNotUnique.java @@ -0,0 +1,554 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/repeated.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.RepeatedNotUnique} + */ +public final class RepeatedNotUnique extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.RepeatedNotUnique) + RepeatedNotUniqueOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 1, + /* suffix= */ "", + RepeatedNotUnique.class.getName()); + } + // Use RepeatedNotUnique.newBuilder() to construct. + private RepeatedNotUnique(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private RepeatedNotUnique() { + val_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.RepeatedProto.internal_static_buf_validate_conformance_cases_RepeatedNotUnique_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.RepeatedProto.internal_static_buf_validate_conformance_cases_RepeatedNotUnique_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.RepeatedNotUnique.class, build.buf.validate.conformance.cases.RepeatedNotUnique.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.RepeatedNotUnique)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.RepeatedNotUnique other = (build.buf.validate.conformance.cases.RepeatedNotUnique) 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.RepeatedNotUnique parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.RepeatedNotUnique 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.RepeatedNotUnique parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.RepeatedNotUnique 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.RepeatedNotUnique parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.RepeatedNotUnique 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.RepeatedNotUnique parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.RepeatedNotUnique 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.RepeatedNotUnique parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.RepeatedNotUnique 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.RepeatedNotUnique 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.RepeatedNotUnique 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.RepeatedNotUnique 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.RepeatedNotUnique} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.RepeatedNotUnique) + build.buf.validate.conformance.cases.RepeatedNotUniqueOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.RepeatedProto.internal_static_buf_validate_conformance_cases_RepeatedNotUnique_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.RepeatedProto.internal_static_buf_validate_conformance_cases_RepeatedNotUnique_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.RepeatedNotUnique.class, build.buf.validate.conformance.cases.RepeatedNotUnique.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.RepeatedNotUnique.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.RepeatedProto.internal_static_buf_validate_conformance_cases_RepeatedNotUnique_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.RepeatedNotUnique getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.RepeatedNotUnique.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.RepeatedNotUnique build() { + build.buf.validate.conformance.cases.RepeatedNotUnique result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.RepeatedNotUnique buildPartial() { + build.buf.validate.conformance.cases.RepeatedNotUnique result = new build.buf.validate.conformance.cases.RepeatedNotUnique(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.RepeatedNotUnique 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.RepeatedNotUnique) { + return mergeFrom((build.buf.validate.conformance.cases.RepeatedNotUnique)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.RepeatedNotUnique other) { + if (other == build.buf.validate.conformance.cases.RepeatedNotUnique.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.RepeatedNotUnique) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.RepeatedNotUnique) + private static final build.buf.validate.conformance.cases.RepeatedNotUnique DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.RepeatedNotUnique(); + } + + public static build.buf.validate.conformance.cases.RepeatedNotUnique getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RepeatedNotUnique 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.RepeatedNotUnique getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/RepeatedNotUniqueOrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/RepeatedNotUniqueOrBuilder.java new file mode 100644 index 00000000..5fafa09a --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/RepeatedNotUniqueOrBuilder.java @@ -0,0 +1,36 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/repeated.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +public interface RepeatedNotUniqueOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.RepeatedNotUnique) + 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/RepeatedProto.java b/conformance/src/main/java/build/buf/validate/conformance/cases/RepeatedProto.java index 519dcd7d..ec97f031 100644 --- a/conformance/src/main/java/build/buf/validate/conformance/cases/RepeatedProto.java +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/RepeatedProto.java @@ -70,6 +70,11 @@ public static void registerAllExtensions( static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_buf_validate_conformance_cases_RepeatedUnique_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_RepeatedNotUnique_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_conformance_cases_RepeatedNotUnique_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_buf_validate_conformance_cases_RepeatedMultipleUnique_descriptor; static final @@ -177,53 +182,55 @@ public static void registerAllExtensions( "al\".\n\016RepeatedMinMax\022\034\n\003val\030\001 \003(\017B\n\272H\007\222\001" + "\004\010\002\020\004R\003val\"-\n\rRepeatedExact\022\034\n\003val\030\001 \003(\r" + "B\n\272H\007\222\001\004\010\003\020\003R\003val\",\n\016RepeatedUnique\022\032\n\003v" + - "al\030\001 \003(\tB\010\272H\005\222\001\002\030\001R\003val\"H\n\026RepeatedMulti" + - "pleUnique\022\026\n\001a\030\001 \003(\tB\010\272H\005\222\001\002\030\001R\001a\022\026\n\001b\030\002" + - " \003(\005B\010\272H\005\222\001\002\030\001R\001b\"5\n\020RepeatedItemRule\022!\n" + - "\003val\030\001 \003(\002B\017\272H\014\222\001\t\"\007\n\005%\000\000\000\000R\003val\"D\n\023Repe" + - "atedItemPattern\022-\n\003val\030\001 \003(\tB\033\272H\030\222\001\025\"\023r\021" + - "2\017(?i)^[a-z0-9]+$R\003val\"Y\n\021RepeatedEmbedS" + - "kip\022D\n\003val\030\001 \003(\0132%.buf.validate.conforma" + - "nce.cases.EmbedB\013\272H\010\222\001\005\"\003\330\001\003R\003val\"8\n\016Rep" + - "eatedItemIn\022&\n\003val\030\001 \003(\tB\024\272H\021\222\001\016\"\014r\nR\003fo" + - "oR\003barR\003val\";\n\021RepeatedItemNotIn\022&\n\003val\030" + - "\001 \003(\tB\024\272H\021\222\001\016\"\014r\nZ\003fooZ\003barR\003val\"Z\n\016Repe" + - "atedEnumIn\022H\n\003val\030\001 \003(\0162&.buf.validate.c" + - "onformance.cases.AnEnumB\016\272H\013\222\001\010\"\006\202\001\003\032\001\000R" + - "\003val\"]\n\021RepeatedEnumNotIn\022H\n\003val\030\001 \003(\0162&" + - ".buf.validate.conformance.cases.AnEnumB\016" + - "\272H\013\222\001\010\"\006\202\001\003\"\001\000R\003val\"\340\001\n\026RepeatedEmbedded" + - "EnumIn\022f\n\003val\030\001 \003(\0162D.buf.validate.confo" + - "rmance.cases.RepeatedEmbeddedEnumIn.Anot" + - "herInEnumB\016\272H\013\222\001\010\"\006\202\001\003\032\001\000R\003val\"^\n\rAnothe" + - "rInEnum\022\037\n\033ANOTHER_IN_ENUM_UNSPECIFIED\020\000" + - "\022\025\n\021ANOTHER_IN_ENUM_A\020\001\022\025\n\021ANOTHER_IN_EN" + - "UM_B\020\002\"\370\001\n\031RepeatedEmbeddedEnumNotIn\022l\n\003" + - "val\030\001 \003(\0162J.buf.validate.conformance.cas" + - "es.RepeatedEmbeddedEnumNotIn.AnotherNotI" + - "nEnumB\016\272H\013\222\001\010\"\006\202\001\003\"\001\000R\003val\"m\n\020AnotherNot" + - "InEnum\022#\n\037ANOTHER_NOT_IN_ENUM_UNSPECIFIE" + - "D\020\000\022\031\n\025ANOTHER_NOT_IN_ENUM_A\020\001\022\031\n\025ANOTHE" + - "R_NOT_IN_ENUM_B\020\002\"r\n\rRepeatedAnyIn\022a\n\003va" + - "l\030\001 \003(\0132\024.google.protobuf.AnyB9\272H6\222\0013\"1\242" + - "\001.\022,type.googleapis.com/google.protobuf." + - "DurationR\003val\"v\n\020RepeatedAnyNotIn\022b\n\003val" + - "\030\001 \003(\0132\024.google.protobuf.AnyB:\272H7\222\0014\"2\242\001" + - "/\032-type.googleapis.com/google.protobuf.T" + - "imestampR\003val\":\n\025RepeatedMinAndItemLen\022!" + - "\n\003val\030\001 \003(\tB\017\272H\014\222\001\t\010\001\"\005r\003\230\001\003R\003val\"8\n\030Rep" + - "eatedMinAndMaxItemLen\022\034\n\003val\030\001 \003(\tB\n\272H\007\222" + - "\001\004\010\001\020\003R\003val\"R\n\020RepeatedDuration\022>\n\003val\030\001" + - " \003(\0132\031.google.protobuf.DurationB\021\272H\016\222\001\013\"" + - "\t\252\001\0062\004\020\300\204=R\003val\"6\n\023RepeatedExactIgnore\022\037" + - "\n\003val\030\001 \003(\rB\r\272H\n\222\001\004\010\003\020\003\320\001\001R\003val*?\n\006AnEnu" + - "m\022\027\n\023AN_ENUM_UNSPECIFIED\020\000\022\r\n\tAN_ENUM_X\020" + - "\001\022\r\n\tAN_ENUM_Y\020\002B\321\001\n$build.buf.validate." + - "conformance.casesB\rRepeatedProtoP\001\242\002\004BVC" + - "C\252\002\036Buf.Validate.Conformance.Cases\312\002\036Buf" + - "\\Validate\\Conformance\\Cases\342\002*Buf\\Valida" + - "te\\Conformance\\Cases\\GPBMetadata\352\002!Buf::" + - "Validate::Conformance::Casesb\006proto3" + "al\030\001 \003(\tB\010\272H\005\222\001\002\030\001R\003val\"/\n\021RepeatedNotUn" + + "ique\022\032\n\003val\030\001 \003(\tB\010\272H\005\222\001\002\030\000R\003val\"H\n\026Repe" + + "atedMultipleUnique\022\026\n\001a\030\001 \003(\tB\010\272H\005\222\001\002\030\001R" + + "\001a\022\026\n\001b\030\002 \003(\005B\010\272H\005\222\001\002\030\001R\001b\"5\n\020RepeatedIt" + + "emRule\022!\n\003val\030\001 \003(\002B\017\272H\014\222\001\t\"\007\n\005%\000\000\000\000R\003va" + + "l\"D\n\023RepeatedItemPattern\022-\n\003val\030\001 \003(\tB\033\272" + + "H\030\222\001\025\"\023r\0212\017(?i)^[a-z0-9]+$R\003val\"Y\n\021Repea" + + "tedEmbedSkip\022D\n\003val\030\001 \003(\0132%.buf.validate" + + ".conformance.cases.EmbedB\013\272H\010\222\001\005\"\003\330\001\003R\003v" + + "al\"8\n\016RepeatedItemIn\022&\n\003val\030\001 \003(\tB\024\272H\021\222\001" + + "\016\"\014r\nR\003fooR\003barR\003val\";\n\021RepeatedItemNotI" + + "n\022&\n\003val\030\001 \003(\tB\024\272H\021\222\001\016\"\014r\nZ\003fooZ\003barR\003va" + + "l\"Y\n\016RepeatedEnumIn\022G\n\003val\030\001 \003(\0162&.buf.v" + + "alidate.conformance.cases.AnEnumB\r\272H\n\222\001\007" + + "\"\005\202\001\002\030\000R\003val\"\\\n\021RepeatedEnumNotIn\022G\n\003val" + + "\030\001 \003(\0162&.buf.validate.conformance.cases." + + "AnEnumB\r\272H\n\222\001\007\"\005\202\001\002 \000R\003val\"\337\001\n\026RepeatedE" + + "mbeddedEnumIn\022e\n\003val\030\001 \003(\0162D.buf.validat" + + "e.conformance.cases.RepeatedEmbeddedEnum" + + "In.AnotherInEnumB\r\272H\n\222\001\007\"\005\202\001\002\030\000R\003val\"^\n\r" + + "AnotherInEnum\022\037\n\033ANOTHER_IN_ENUM_UNSPECI" + + "FIED\020\000\022\025\n\021ANOTHER_IN_ENUM_A\020\001\022\025\n\021ANOTHER" + + "_IN_ENUM_B\020\002\"\367\001\n\031RepeatedEmbeddedEnumNot" + + "In\022k\n\003val\030\001 \003(\0162J.buf.validate.conforman" + + "ce.cases.RepeatedEmbeddedEnumNotIn.Anoth" + + "erNotInEnumB\r\272H\n\222\001\007\"\005\202\001\002 \000R\003val\"m\n\020Anoth" + + "erNotInEnum\022#\n\037ANOTHER_NOT_IN_ENUM_UNSPE" + + "CIFIED\020\000\022\031\n\025ANOTHER_NOT_IN_ENUM_A\020\001\022\031\n\025A" + + "NOTHER_NOT_IN_ENUM_B\020\002\"r\n\rRepeatedAnyIn\022" + + "a\n\003val\030\001 \003(\0132\024.google.protobuf.AnyB9\272H6\222" + + "\0013\"1\242\001.\022,type.googleapis.com/google.prot" + + "obuf.DurationR\003val\"v\n\020RepeatedAnyNotIn\022b" + + "\n\003val\030\001 \003(\0132\024.google.protobuf.AnyB:\272H7\222\001" + + "4\"2\242\001/\032-type.googleapis.com/google.proto" + + "buf.TimestampR\003val\":\n\025RepeatedMinAndItem" + + "Len\022!\n\003val\030\001 \003(\tB\017\272H\014\222\001\t\010\001\"\005r\003\230\001\003R\003val\"8" + + "\n\030RepeatedMinAndMaxItemLen\022\034\n\003val\030\001 \003(\tB" + + "\n\272H\007\222\001\004\010\001\020\003R\003val\"R\n\020RepeatedDuration\022>\n\003" + + "val\030\001 \003(\0132\031.google.protobuf.DurationB\021\272H" + + "\016\222\001\013\"\t\252\001\0062\004\020\300\204=R\003val\"6\n\023RepeatedExactIgn" + + "ore\022\037\n\003val\030\001 \003(\rB\r\272H\n\222\001\004\010\003\020\003\320\001\001R\003val*?\n\006" + + "AnEnum\022\027\n\023AN_ENUM_UNSPECIFIED\020\000\022\r\n\tAN_EN" + + "UM_X\020\001\022\r\n\tAN_ENUM_Y\020\002B\321\001\n$build.buf.vali" + + "date.conformance.casesB\rRepeatedProtoP\001\242" + + "\002\004BVCC\252\002\036Buf.Validate.Conformance.Cases\312" + + "\002\036Buf\\Validate\\Conformance\\Cases\342\002*Buf\\V" + + "alidate\\Conformance\\Cases\\GPBMetadata\352\002!" + + "Buf::Validate::Conformance::Casesb\006proto" + + "3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor .internalBuildGeneratedFileFrom(descriptorData, @@ -287,98 +294,104 @@ public static void registerAllExtensions( com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_RepeatedUnique_descriptor, new java.lang.String[] { "Val", }); - internal_static_buf_validate_conformance_cases_RepeatedMultipleUnique_descriptor = + internal_static_buf_validate_conformance_cases_RepeatedNotUnique_descriptor = getDescriptor().getMessageTypes().get(9); + internal_static_buf_validate_conformance_cases_RepeatedNotUnique_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_RepeatedNotUnique_descriptor, + new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_RepeatedMultipleUnique_descriptor = + getDescriptor().getMessageTypes().get(10); internal_static_buf_validate_conformance_cases_RepeatedMultipleUnique_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_RepeatedMultipleUnique_descriptor, new java.lang.String[] { "A", "B", }); internal_static_buf_validate_conformance_cases_RepeatedItemRule_descriptor = - getDescriptor().getMessageTypes().get(10); + getDescriptor().getMessageTypes().get(11); internal_static_buf_validate_conformance_cases_RepeatedItemRule_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_RepeatedItemRule_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_RepeatedItemPattern_descriptor = - getDescriptor().getMessageTypes().get(11); + getDescriptor().getMessageTypes().get(12); internal_static_buf_validate_conformance_cases_RepeatedItemPattern_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_RepeatedItemPattern_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_RepeatedEmbedSkip_descriptor = - getDescriptor().getMessageTypes().get(12); + getDescriptor().getMessageTypes().get(13); internal_static_buf_validate_conformance_cases_RepeatedEmbedSkip_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_RepeatedEmbedSkip_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_RepeatedItemIn_descriptor = - getDescriptor().getMessageTypes().get(13); + getDescriptor().getMessageTypes().get(14); internal_static_buf_validate_conformance_cases_RepeatedItemIn_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_RepeatedItemIn_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_RepeatedItemNotIn_descriptor = - getDescriptor().getMessageTypes().get(14); + getDescriptor().getMessageTypes().get(15); internal_static_buf_validate_conformance_cases_RepeatedItemNotIn_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_RepeatedItemNotIn_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_RepeatedEnumIn_descriptor = - getDescriptor().getMessageTypes().get(15); + getDescriptor().getMessageTypes().get(16); internal_static_buf_validate_conformance_cases_RepeatedEnumIn_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_RepeatedEnumIn_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_RepeatedEnumNotIn_descriptor = - getDescriptor().getMessageTypes().get(16); + getDescriptor().getMessageTypes().get(17); internal_static_buf_validate_conformance_cases_RepeatedEnumNotIn_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_RepeatedEnumNotIn_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_RepeatedEmbeddedEnumIn_descriptor = - getDescriptor().getMessageTypes().get(17); + getDescriptor().getMessageTypes().get(18); internal_static_buf_validate_conformance_cases_RepeatedEmbeddedEnumIn_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_RepeatedEmbeddedEnumIn_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_RepeatedEmbeddedEnumNotIn_descriptor = - getDescriptor().getMessageTypes().get(18); + getDescriptor().getMessageTypes().get(19); internal_static_buf_validate_conformance_cases_RepeatedEmbeddedEnumNotIn_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_RepeatedEmbeddedEnumNotIn_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_RepeatedAnyIn_descriptor = - getDescriptor().getMessageTypes().get(19); + getDescriptor().getMessageTypes().get(20); internal_static_buf_validate_conformance_cases_RepeatedAnyIn_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_RepeatedAnyIn_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_RepeatedAnyNotIn_descriptor = - getDescriptor().getMessageTypes().get(20); + getDescriptor().getMessageTypes().get(21); internal_static_buf_validate_conformance_cases_RepeatedAnyNotIn_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_RepeatedAnyNotIn_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_RepeatedMinAndItemLen_descriptor = - getDescriptor().getMessageTypes().get(21); + getDescriptor().getMessageTypes().get(22); internal_static_buf_validate_conformance_cases_RepeatedMinAndItemLen_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_RepeatedMinAndItemLen_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_RepeatedMinAndMaxItemLen_descriptor = - getDescriptor().getMessageTypes().get(22); + getDescriptor().getMessageTypes().get(23); internal_static_buf_validate_conformance_cases_RepeatedMinAndMaxItemLen_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_RepeatedMinAndMaxItemLen_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_RepeatedDuration_descriptor = - getDescriptor().getMessageTypes().get(23); + getDescriptor().getMessageTypes().get(24); internal_static_buf_validate_conformance_cases_RepeatedDuration_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_RepeatedDuration_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_RepeatedExactIgnore_descriptor = - getDescriptor().getMessageTypes().get(24); + getDescriptor().getMessageTypes().get(25); internal_static_buf_validate_conformance_cases_RepeatedExactIgnore_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_RepeatedExactIgnore_descriptor, diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/SFixed32Example.java b/conformance/src/main/java/build/buf/validate/conformance/cases/SFixed32Example.java new file mode 100644 index 00000000..a53b9d2c --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/SFixed32Example.java @@ -0,0 +1,431 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/numbers.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.SFixed32Example} + */ +public final class SFixed32Example extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.SFixed32Example) + SFixed32ExampleOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 1, + /* suffix= */ "", + SFixed32Example.class.getName()); + } + // Use SFixed32Example.newBuilder() to construct. + private SFixed32Example(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private SFixed32Example() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.NumbersProto.internal_static_buf_validate_conformance_cases_SFixed32Example_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.NumbersProto.internal_static_buf_validate_conformance_cases_SFixed32Example_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.SFixed32Example.class, build.buf.validate.conformance.cases.SFixed32Example.Builder.class); + } + + public static final int VAL_FIELD_NUMBER = 1; + private int val_ = 0; + /** + * sfixed32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public int getVal() { + return val_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (val_ != 0) { + output.writeSFixed32(1, val_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (val_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeSFixed32Size(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.SFixed32Example)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.SFixed32Example other = (build.buf.validate.conformance.cases.SFixed32Example) obj; + + if (getVal() + != other.getVal()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + VAL_FIELD_NUMBER; + hash = (53 * hash) + getVal(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.SFixed32Example parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.SFixed32Example 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.SFixed32Example parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.SFixed32Example 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.SFixed32Example parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.SFixed32Example 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.SFixed32Example parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.SFixed32Example 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.SFixed32Example parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.SFixed32Example 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.SFixed32Example 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.SFixed32Example 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.SFixed32Example 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.SFixed32Example} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.SFixed32Example) + build.buf.validate.conformance.cases.SFixed32ExampleOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.NumbersProto.internal_static_buf_validate_conformance_cases_SFixed32Example_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.NumbersProto.internal_static_buf_validate_conformance_cases_SFixed32Example_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.SFixed32Example.class, build.buf.validate.conformance.cases.SFixed32Example.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.SFixed32Example.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + val_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.NumbersProto.internal_static_buf_validate_conformance_cases_SFixed32Example_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.SFixed32Example getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.SFixed32Example.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.SFixed32Example build() { + build.buf.validate.conformance.cases.SFixed32Example result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.SFixed32Example buildPartial() { + build.buf.validate.conformance.cases.SFixed32Example result = new build.buf.validate.conformance.cases.SFixed32Example(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.SFixed32Example 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.SFixed32Example) { + return mergeFrom((build.buf.validate.conformance.cases.SFixed32Example)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.SFixed32Example other) { + if (other == build.buf.validate.conformance.cases.SFixed32Example.getDefaultInstance()) return this; + if (other.getVal() != 0) { + setVal(other.getVal()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 13: { + val_ = input.readSFixed32(); + bitField0_ |= 0x00000001; + break; + } // case 13 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private int val_ ; + /** + * sfixed32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public int getVal() { + return val_; + } + /** + * sfixed32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param value The val to set. + * @return This builder for chaining. + */ + public Builder setVal(int value) { + + val_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * sfixed32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return This builder for chaining. + */ + public Builder clearVal() { + bitField0_ = (bitField0_ & ~0x00000001); + val_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.SFixed32Example) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.SFixed32Example) + private static final build.buf.validate.conformance.cases.SFixed32Example DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.SFixed32Example(); + } + + public static build.buf.validate.conformance.cases.SFixed32Example getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SFixed32Example 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.SFixed32Example getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/SFixed32ExampleOrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/SFixed32ExampleOrBuilder.java new file mode 100644 index 00000000..48db9a0a --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/SFixed32ExampleOrBuilder.java @@ -0,0 +1,17 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/numbers.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +public interface SFixed32ExampleOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.SFixed32Example) + com.google.protobuf.MessageOrBuilder { + + /** + * sfixed32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + int getVal(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/SFixed64Example.java b/conformance/src/main/java/build/buf/validate/conformance/cases/SFixed64Example.java new file mode 100644 index 00000000..db6c97fa --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/SFixed64Example.java @@ -0,0 +1,432 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/numbers.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.SFixed64Example} + */ +public final class SFixed64Example extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.SFixed64Example) + SFixed64ExampleOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 1, + /* suffix= */ "", + SFixed64Example.class.getName()); + } + // Use SFixed64Example.newBuilder() to construct. + private SFixed64Example(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private SFixed64Example() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.NumbersProto.internal_static_buf_validate_conformance_cases_SFixed64Example_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.NumbersProto.internal_static_buf_validate_conformance_cases_SFixed64Example_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.SFixed64Example.class, build.buf.validate.conformance.cases.SFixed64Example.Builder.class); + } + + public static final int VAL_FIELD_NUMBER = 1; + private long val_ = 0L; + /** + * sfixed64 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public long getVal() { + return val_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (val_ != 0L) { + output.writeSFixed64(1, val_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (val_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeSFixed64Size(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.SFixed64Example)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.SFixed64Example other = (build.buf.validate.conformance.cases.SFixed64Example) obj; + + if (getVal() + != other.getVal()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + VAL_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getVal()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.SFixed64Example parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.SFixed64Example 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.SFixed64Example parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.SFixed64Example 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.SFixed64Example parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.SFixed64Example 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.SFixed64Example parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.SFixed64Example 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.SFixed64Example parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.SFixed64Example 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.SFixed64Example 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.SFixed64Example 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.SFixed64Example 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.SFixed64Example} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.SFixed64Example) + build.buf.validate.conformance.cases.SFixed64ExampleOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.NumbersProto.internal_static_buf_validate_conformance_cases_SFixed64Example_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.NumbersProto.internal_static_buf_validate_conformance_cases_SFixed64Example_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.SFixed64Example.class, build.buf.validate.conformance.cases.SFixed64Example.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.SFixed64Example.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + val_ = 0L; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.NumbersProto.internal_static_buf_validate_conformance_cases_SFixed64Example_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.SFixed64Example getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.SFixed64Example.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.SFixed64Example build() { + build.buf.validate.conformance.cases.SFixed64Example result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.SFixed64Example buildPartial() { + build.buf.validate.conformance.cases.SFixed64Example result = new build.buf.validate.conformance.cases.SFixed64Example(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.SFixed64Example 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.SFixed64Example) { + return mergeFrom((build.buf.validate.conformance.cases.SFixed64Example)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.SFixed64Example other) { + if (other == build.buf.validate.conformance.cases.SFixed64Example.getDefaultInstance()) return this; + if (other.getVal() != 0L) { + setVal(other.getVal()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 9: { + val_ = input.readSFixed64(); + bitField0_ |= 0x00000001; + break; + } // case 9 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private long val_ ; + /** + * sfixed64 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public long getVal() { + return val_; + } + /** + * sfixed64 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param value The val to set. + * @return This builder for chaining. + */ + public Builder setVal(long value) { + + val_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * sfixed64 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return This builder for chaining. + */ + public Builder clearVal() { + bitField0_ = (bitField0_ & ~0x00000001); + val_ = 0L; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.SFixed64Example) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.SFixed64Example) + private static final build.buf.validate.conformance.cases.SFixed64Example DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.SFixed64Example(); + } + + public static build.buf.validate.conformance.cases.SFixed64Example getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SFixed64Example 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.SFixed64Example getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/SFixed64ExampleOrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/SFixed64ExampleOrBuilder.java new file mode 100644 index 00000000..ac32b9e1 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/SFixed64ExampleOrBuilder.java @@ -0,0 +1,17 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/numbers.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +public interface SFixed64ExampleOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.SFixed64Example) + com.google.protobuf.MessageOrBuilder { + + /** + * sfixed64 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + long getVal(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/SInt32Example.java b/conformance/src/main/java/build/buf/validate/conformance/cases/SInt32Example.java new file mode 100644 index 00000000..aadc6df2 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/SInt32Example.java @@ -0,0 +1,431 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/numbers.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.SInt32Example} + */ +public final class SInt32Example extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.SInt32Example) + SInt32ExampleOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 1, + /* suffix= */ "", + SInt32Example.class.getName()); + } + // Use SInt32Example.newBuilder() to construct. + private SInt32Example(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private SInt32Example() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.NumbersProto.internal_static_buf_validate_conformance_cases_SInt32Example_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.NumbersProto.internal_static_buf_validate_conformance_cases_SInt32Example_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.SInt32Example.class, build.buf.validate.conformance.cases.SInt32Example.Builder.class); + } + + public static final int VAL_FIELD_NUMBER = 1; + private int val_ = 0; + /** + * sint32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public int getVal() { + return val_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (val_ != 0) { + output.writeSInt32(1, val_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (val_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeSInt32Size(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.SInt32Example)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.SInt32Example other = (build.buf.validate.conformance.cases.SInt32Example) obj; + + if (getVal() + != other.getVal()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + VAL_FIELD_NUMBER; + hash = (53 * hash) + getVal(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.SInt32Example parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.SInt32Example 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.SInt32Example parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.SInt32Example 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.SInt32Example parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.SInt32Example 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.SInt32Example parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.SInt32Example 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.SInt32Example parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.SInt32Example 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.SInt32Example 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.SInt32Example 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.SInt32Example 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.SInt32Example} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.SInt32Example) + build.buf.validate.conformance.cases.SInt32ExampleOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.NumbersProto.internal_static_buf_validate_conformance_cases_SInt32Example_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.NumbersProto.internal_static_buf_validate_conformance_cases_SInt32Example_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.SInt32Example.class, build.buf.validate.conformance.cases.SInt32Example.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.SInt32Example.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + val_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.NumbersProto.internal_static_buf_validate_conformance_cases_SInt32Example_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.SInt32Example getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.SInt32Example.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.SInt32Example build() { + build.buf.validate.conformance.cases.SInt32Example result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.SInt32Example buildPartial() { + build.buf.validate.conformance.cases.SInt32Example result = new build.buf.validate.conformance.cases.SInt32Example(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.SInt32Example 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.SInt32Example) { + return mergeFrom((build.buf.validate.conformance.cases.SInt32Example)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.SInt32Example other) { + if (other == build.buf.validate.conformance.cases.SInt32Example.getDefaultInstance()) return this; + if (other.getVal() != 0) { + setVal(other.getVal()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + val_ = input.readSInt32(); + bitField0_ |= 0x00000001; + break; + } // case 8 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private int val_ ; + /** + * sint32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public int getVal() { + return val_; + } + /** + * sint32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param value The val to set. + * @return This builder for chaining. + */ + public Builder setVal(int value) { + + val_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * sint32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return This builder for chaining. + */ + public Builder clearVal() { + bitField0_ = (bitField0_ & ~0x00000001); + val_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.SInt32Example) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.SInt32Example) + private static final build.buf.validate.conformance.cases.SInt32Example DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.SInt32Example(); + } + + public static build.buf.validate.conformance.cases.SInt32Example getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SInt32Example 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.SInt32Example getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/SInt32ExampleOrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/SInt32ExampleOrBuilder.java new file mode 100644 index 00000000..8e1ea1e9 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/SInt32ExampleOrBuilder.java @@ -0,0 +1,17 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/numbers.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +public interface SInt32ExampleOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.SInt32Example) + com.google.protobuf.MessageOrBuilder { + + /** + * sint32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + int getVal(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/SInt64Example.java b/conformance/src/main/java/build/buf/validate/conformance/cases/SInt64Example.java new file mode 100644 index 00000000..b90277fd --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/SInt64Example.java @@ -0,0 +1,432 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/numbers.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.SInt64Example} + */ +public final class SInt64Example extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.SInt64Example) + SInt64ExampleOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 1, + /* suffix= */ "", + SInt64Example.class.getName()); + } + // Use SInt64Example.newBuilder() to construct. + private SInt64Example(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private SInt64Example() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.NumbersProto.internal_static_buf_validate_conformance_cases_SInt64Example_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.NumbersProto.internal_static_buf_validate_conformance_cases_SInt64Example_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.SInt64Example.class, build.buf.validate.conformance.cases.SInt64Example.Builder.class); + } + + public static final int VAL_FIELD_NUMBER = 1; + private long val_ = 0L; + /** + * sint64 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public long getVal() { + return val_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (val_ != 0L) { + output.writeSInt64(1, val_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (val_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeSInt64Size(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.SInt64Example)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.SInt64Example other = (build.buf.validate.conformance.cases.SInt64Example) obj; + + if (getVal() + != other.getVal()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + VAL_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getVal()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.SInt64Example parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.SInt64Example 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.SInt64Example parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.SInt64Example 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.SInt64Example parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.SInt64Example 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.SInt64Example parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.SInt64Example 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.SInt64Example parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.SInt64Example 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.SInt64Example 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.SInt64Example 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.SInt64Example 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.SInt64Example} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.SInt64Example) + build.buf.validate.conformance.cases.SInt64ExampleOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.NumbersProto.internal_static_buf_validate_conformance_cases_SInt64Example_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.NumbersProto.internal_static_buf_validate_conformance_cases_SInt64Example_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.SInt64Example.class, build.buf.validate.conformance.cases.SInt64Example.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.SInt64Example.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + val_ = 0L; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.NumbersProto.internal_static_buf_validate_conformance_cases_SInt64Example_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.SInt64Example getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.SInt64Example.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.SInt64Example build() { + build.buf.validate.conformance.cases.SInt64Example result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.SInt64Example buildPartial() { + build.buf.validate.conformance.cases.SInt64Example result = new build.buf.validate.conformance.cases.SInt64Example(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.SInt64Example 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.SInt64Example) { + return mergeFrom((build.buf.validate.conformance.cases.SInt64Example)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.SInt64Example other) { + if (other == build.buf.validate.conformance.cases.SInt64Example.getDefaultInstance()) return this; + if (other.getVal() != 0L) { + setVal(other.getVal()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + val_ = input.readSInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private long val_ ; + /** + * sint64 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public long getVal() { + return val_; + } + /** + * sint64 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param value The val to set. + * @return This builder for chaining. + */ + public Builder setVal(long value) { + + val_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * sint64 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return This builder for chaining. + */ + public Builder clearVal() { + bitField0_ = (bitField0_ & ~0x00000001); + val_ = 0L; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.SInt64Example) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.SInt64Example) + private static final build.buf.validate.conformance.cases.SInt64Example DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.SInt64Example(); + } + + public static build.buf.validate.conformance.cases.SInt64Example getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SInt64Example 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.SInt64Example getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/SInt64ExampleOrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/SInt64ExampleOrBuilder.java new file mode 100644 index 00000000..079f45f0 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/SInt64ExampleOrBuilder.java @@ -0,0 +1,17 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/numbers.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +public interface SInt64ExampleOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.SInt64Example) + com.google.protobuf.MessageOrBuilder { + + /** + * sint64 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + long getVal(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/StandardPredefinedAndCustomRuleEdition2023.java b/conformance/src/main/java/build/buf/validate/conformance/cases/StandardPredefinedAndCustomRuleEdition2023.java new file mode 100644 index 00000000..8ac73a8e --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/StandardPredefinedAndCustomRuleEdition2023.java @@ -0,0 +1,456 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/predefined_rules_proto_editions.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.StandardPredefinedAndCustomRuleEdition2023} + */ +public final class StandardPredefinedAndCustomRuleEdition2023 extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.StandardPredefinedAndCustomRuleEdition2023) + StandardPredefinedAndCustomRuleEdition2023OrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 1, + /* suffix= */ "", + StandardPredefinedAndCustomRuleEdition2023.class.getName()); + } + // Use StandardPredefinedAndCustomRuleEdition2023.newBuilder() to construct. + private StandardPredefinedAndCustomRuleEdition2023(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private StandardPredefinedAndCustomRuleEdition2023() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.internal_static_buf_validate_conformance_cases_StandardPredefinedAndCustomRuleEdition2023_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.internal_static_buf_validate_conformance_cases_StandardPredefinedAndCustomRuleEdition2023_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.StandardPredefinedAndCustomRuleEdition2023.class, build.buf.validate.conformance.cases.StandardPredefinedAndCustomRuleEdition2023.Builder.class); + } + + private int bitField0_; + public static final int A_FIELD_NUMBER = 1; + private int a_ = 0; + /** + * int32 a = 1 [json_name = "a", (.buf.validate.field) = { ... } + * @return Whether the a field is set. + */ + @java.lang.Override + public boolean hasA() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * int32 a = 1 [json_name = "a", (.buf.validate.field) = { ... } + * @return The a. + */ + @java.lang.Override + public int getA() { + return a_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + output.writeInt32(1, a_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(1, a_); + } + 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.StandardPredefinedAndCustomRuleEdition2023)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.StandardPredefinedAndCustomRuleEdition2023 other = (build.buf.validate.conformance.cases.StandardPredefinedAndCustomRuleEdition2023) obj; + + if (hasA() != other.hasA()) return false; + if (hasA()) { + if (getA() + != other.getA()) 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 (hasA()) { + hash = (37 * hash) + A_FIELD_NUMBER; + hash = (53 * hash) + getA(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.StandardPredefinedAndCustomRuleEdition2023 parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.StandardPredefinedAndCustomRuleEdition2023 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.StandardPredefinedAndCustomRuleEdition2023 parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.StandardPredefinedAndCustomRuleEdition2023 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.StandardPredefinedAndCustomRuleEdition2023 parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.StandardPredefinedAndCustomRuleEdition2023 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.StandardPredefinedAndCustomRuleEdition2023 parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.StandardPredefinedAndCustomRuleEdition2023 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.StandardPredefinedAndCustomRuleEdition2023 parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.StandardPredefinedAndCustomRuleEdition2023 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.StandardPredefinedAndCustomRuleEdition2023 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.StandardPredefinedAndCustomRuleEdition2023 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.StandardPredefinedAndCustomRuleEdition2023 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.StandardPredefinedAndCustomRuleEdition2023} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.StandardPredefinedAndCustomRuleEdition2023) + build.buf.validate.conformance.cases.StandardPredefinedAndCustomRuleEdition2023OrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.internal_static_buf_validate_conformance_cases_StandardPredefinedAndCustomRuleEdition2023_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.internal_static_buf_validate_conformance_cases_StandardPredefinedAndCustomRuleEdition2023_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.StandardPredefinedAndCustomRuleEdition2023.class, build.buf.validate.conformance.cases.StandardPredefinedAndCustomRuleEdition2023.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.StandardPredefinedAndCustomRuleEdition2023.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + a_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.PredefinedRulesProtoEditionsProto.internal_static_buf_validate_conformance_cases_StandardPredefinedAndCustomRuleEdition2023_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.StandardPredefinedAndCustomRuleEdition2023 getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.StandardPredefinedAndCustomRuleEdition2023.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.StandardPredefinedAndCustomRuleEdition2023 build() { + build.buf.validate.conformance.cases.StandardPredefinedAndCustomRuleEdition2023 result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.StandardPredefinedAndCustomRuleEdition2023 buildPartial() { + build.buf.validate.conformance.cases.StandardPredefinedAndCustomRuleEdition2023 result = new build.buf.validate.conformance.cases.StandardPredefinedAndCustomRuleEdition2023(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.StandardPredefinedAndCustomRuleEdition2023 result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.a_ = a_; + 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.StandardPredefinedAndCustomRuleEdition2023) { + return mergeFrom((build.buf.validate.conformance.cases.StandardPredefinedAndCustomRuleEdition2023)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.StandardPredefinedAndCustomRuleEdition2023 other) { + if (other == build.buf.validate.conformance.cases.StandardPredefinedAndCustomRuleEdition2023.getDefaultInstance()) return this; + if (other.hasA()) { + setA(other.getA()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + a_ = input.readInt32(); + bitField0_ |= 0x00000001; + break; + } // case 8 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private int a_ ; + /** + * int32 a = 1 [json_name = "a", (.buf.validate.field) = { ... } + * @return Whether the a field is set. + */ + @java.lang.Override + public boolean hasA() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * int32 a = 1 [json_name = "a", (.buf.validate.field) = { ... } + * @return The a. + */ + @java.lang.Override + public int getA() { + return a_; + } + /** + * int32 a = 1 [json_name = "a", (.buf.validate.field) = { ... } + * @param value The a to set. + * @return This builder for chaining. + */ + public Builder setA(int value) { + + a_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * int32 a = 1 [json_name = "a", (.buf.validate.field) = { ... } + * @return This builder for chaining. + */ + public Builder clearA() { + bitField0_ = (bitField0_ & ~0x00000001); + a_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.StandardPredefinedAndCustomRuleEdition2023) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.StandardPredefinedAndCustomRuleEdition2023) + private static final build.buf.validate.conformance.cases.StandardPredefinedAndCustomRuleEdition2023 DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.StandardPredefinedAndCustomRuleEdition2023(); + } + + public static build.buf.validate.conformance.cases.StandardPredefinedAndCustomRuleEdition2023 getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public StandardPredefinedAndCustomRuleEdition2023 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.StandardPredefinedAndCustomRuleEdition2023 getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/StandardPredefinedAndCustomRuleEdition2023OrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/StandardPredefinedAndCustomRuleEdition2023OrBuilder.java new file mode 100644 index 00000000..9ac3783e --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/StandardPredefinedAndCustomRuleEdition2023OrBuilder.java @@ -0,0 +1,22 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/predefined_rules_proto_editions.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +public interface StandardPredefinedAndCustomRuleEdition2023OrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.StandardPredefinedAndCustomRuleEdition2023) + com.google.protobuf.MessageOrBuilder { + + /** + * int32 a = 1 [json_name = "a", (.buf.validate.field) = { ... } + * @return Whether the a field is set. + */ + boolean hasA(); + /** + * int32 a = 1 [json_name = "a", (.buf.validate.field) = { ... } + * @return The a. + */ + int getA(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/StandardPredefinedAndCustomRuleProto2.java b/conformance/src/main/java/build/buf/validate/conformance/cases/StandardPredefinedAndCustomRuleProto2.java new file mode 100644 index 00000000..c33b4b61 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/StandardPredefinedAndCustomRuleProto2.java @@ -0,0 +1,456 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/predefined_rules_proto2.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.StandardPredefinedAndCustomRuleProto2} + */ +public final class StandardPredefinedAndCustomRuleProto2 extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.StandardPredefinedAndCustomRuleProto2) + StandardPredefinedAndCustomRuleProto2OrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 1, + /* suffix= */ "", + StandardPredefinedAndCustomRuleProto2.class.getName()); + } + // Use StandardPredefinedAndCustomRuleProto2.newBuilder() to construct. + private StandardPredefinedAndCustomRuleProto2(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private StandardPredefinedAndCustomRuleProto2() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.internal_static_buf_validate_conformance_cases_StandardPredefinedAndCustomRuleProto2_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.internal_static_buf_validate_conformance_cases_StandardPredefinedAndCustomRuleProto2_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.StandardPredefinedAndCustomRuleProto2.class, build.buf.validate.conformance.cases.StandardPredefinedAndCustomRuleProto2.Builder.class); + } + + private int bitField0_; + public static final int A_FIELD_NUMBER = 1; + private int a_ = 0; + /** + * optional int32 a = 1 [json_name = "a", (.buf.validate.field) = { ... } + * @return Whether the a field is set. + */ + @java.lang.Override + public boolean hasA() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * optional int32 a = 1 [json_name = "a", (.buf.validate.field) = { ... } + * @return The a. + */ + @java.lang.Override + public int getA() { + return a_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + output.writeInt32(1, a_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(1, a_); + } + 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.StandardPredefinedAndCustomRuleProto2)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.StandardPredefinedAndCustomRuleProto2 other = (build.buf.validate.conformance.cases.StandardPredefinedAndCustomRuleProto2) obj; + + if (hasA() != other.hasA()) return false; + if (hasA()) { + if (getA() + != other.getA()) 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 (hasA()) { + hash = (37 * hash) + A_FIELD_NUMBER; + hash = (53 * hash) + getA(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.StandardPredefinedAndCustomRuleProto2 parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.StandardPredefinedAndCustomRuleProto2 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.StandardPredefinedAndCustomRuleProto2 parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.StandardPredefinedAndCustomRuleProto2 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.StandardPredefinedAndCustomRuleProto2 parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.StandardPredefinedAndCustomRuleProto2 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.StandardPredefinedAndCustomRuleProto2 parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.StandardPredefinedAndCustomRuleProto2 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.StandardPredefinedAndCustomRuleProto2 parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.StandardPredefinedAndCustomRuleProto2 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.StandardPredefinedAndCustomRuleProto2 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.StandardPredefinedAndCustomRuleProto2 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.StandardPredefinedAndCustomRuleProto2 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.StandardPredefinedAndCustomRuleProto2} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.StandardPredefinedAndCustomRuleProto2) + build.buf.validate.conformance.cases.StandardPredefinedAndCustomRuleProto2OrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.internal_static_buf_validate_conformance_cases_StandardPredefinedAndCustomRuleProto2_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.internal_static_buf_validate_conformance_cases_StandardPredefinedAndCustomRuleProto2_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.StandardPredefinedAndCustomRuleProto2.class, build.buf.validate.conformance.cases.StandardPredefinedAndCustomRuleProto2.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.StandardPredefinedAndCustomRuleProto2.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + a_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.PredefinedRulesProto2Proto.internal_static_buf_validate_conformance_cases_StandardPredefinedAndCustomRuleProto2_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.StandardPredefinedAndCustomRuleProto2 getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.StandardPredefinedAndCustomRuleProto2.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.StandardPredefinedAndCustomRuleProto2 build() { + build.buf.validate.conformance.cases.StandardPredefinedAndCustomRuleProto2 result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.StandardPredefinedAndCustomRuleProto2 buildPartial() { + build.buf.validate.conformance.cases.StandardPredefinedAndCustomRuleProto2 result = new build.buf.validate.conformance.cases.StandardPredefinedAndCustomRuleProto2(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.StandardPredefinedAndCustomRuleProto2 result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.a_ = a_; + 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.StandardPredefinedAndCustomRuleProto2) { + return mergeFrom((build.buf.validate.conformance.cases.StandardPredefinedAndCustomRuleProto2)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.StandardPredefinedAndCustomRuleProto2 other) { + if (other == build.buf.validate.conformance.cases.StandardPredefinedAndCustomRuleProto2.getDefaultInstance()) return this; + if (other.hasA()) { + setA(other.getA()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + a_ = input.readInt32(); + bitField0_ |= 0x00000001; + break; + } // case 8 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private int a_ ; + /** + * optional int32 a = 1 [json_name = "a", (.buf.validate.field) = { ... } + * @return Whether the a field is set. + */ + @java.lang.Override + public boolean hasA() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * optional int32 a = 1 [json_name = "a", (.buf.validate.field) = { ... } + * @return The a. + */ + @java.lang.Override + public int getA() { + return a_; + } + /** + * optional int32 a = 1 [json_name = "a", (.buf.validate.field) = { ... } + * @param value The a to set. + * @return This builder for chaining. + */ + public Builder setA(int value) { + + a_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * optional int32 a = 1 [json_name = "a", (.buf.validate.field) = { ... } + * @return This builder for chaining. + */ + public Builder clearA() { + bitField0_ = (bitField0_ & ~0x00000001); + a_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.StandardPredefinedAndCustomRuleProto2) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.StandardPredefinedAndCustomRuleProto2) + private static final build.buf.validate.conformance.cases.StandardPredefinedAndCustomRuleProto2 DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.StandardPredefinedAndCustomRuleProto2(); + } + + public static build.buf.validate.conformance.cases.StandardPredefinedAndCustomRuleProto2 getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public StandardPredefinedAndCustomRuleProto2 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.StandardPredefinedAndCustomRuleProto2 getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/StandardPredefinedAndCustomRuleProto2OrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/StandardPredefinedAndCustomRuleProto2OrBuilder.java new file mode 100644 index 00000000..e8cca5d9 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/StandardPredefinedAndCustomRuleProto2OrBuilder.java @@ -0,0 +1,22 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/predefined_rules_proto2.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +public interface StandardPredefinedAndCustomRuleProto2OrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.StandardPredefinedAndCustomRuleProto2) + com.google.protobuf.MessageOrBuilder { + + /** + * optional int32 a = 1 [json_name = "a", (.buf.validate.field) = { ... } + * @return Whether the a field is set. + */ + boolean hasA(); + /** + * optional int32 a = 1 [json_name = "a", (.buf.validate.field) = { ... } + * @return The a. + */ + int getA(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/StandardPredefinedAndCustomRuleProto3.java b/conformance/src/main/java/build/buf/validate/conformance/cases/StandardPredefinedAndCustomRuleProto3.java new file mode 100644 index 00000000..8c8f249a --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/StandardPredefinedAndCustomRuleProto3.java @@ -0,0 +1,431 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/predefined_rules_proto3.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.StandardPredefinedAndCustomRuleProto3} + */ +public final class StandardPredefinedAndCustomRuleProto3 extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.StandardPredefinedAndCustomRuleProto3) + StandardPredefinedAndCustomRuleProto3OrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 1, + /* suffix= */ "", + StandardPredefinedAndCustomRuleProto3.class.getName()); + } + // Use StandardPredefinedAndCustomRuleProto3.newBuilder() to construct. + private StandardPredefinedAndCustomRuleProto3(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private StandardPredefinedAndCustomRuleProto3() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.PredefinedRulesProto3Proto.internal_static_buf_validate_conformance_cases_StandardPredefinedAndCustomRuleProto3_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.PredefinedRulesProto3Proto.internal_static_buf_validate_conformance_cases_StandardPredefinedAndCustomRuleProto3_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.StandardPredefinedAndCustomRuleProto3.class, build.buf.validate.conformance.cases.StandardPredefinedAndCustomRuleProto3.Builder.class); + } + + public static final int A_FIELD_NUMBER = 1; + private int a_ = 0; + /** + * int32 a = 1 [json_name = "a", (.buf.validate.field) = { ... } + * @return The a. + */ + @java.lang.Override + public int getA() { + return a_; + } + + 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 (a_ != 0) { + output.writeInt32(1, a_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (a_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(1, a_); + } + 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.StandardPredefinedAndCustomRuleProto3)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.StandardPredefinedAndCustomRuleProto3 other = (build.buf.validate.conformance.cases.StandardPredefinedAndCustomRuleProto3) obj; + + if (getA() + != other.getA()) 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) + A_FIELD_NUMBER; + hash = (53 * hash) + getA(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.StandardPredefinedAndCustomRuleProto3 parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.StandardPredefinedAndCustomRuleProto3 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.StandardPredefinedAndCustomRuleProto3 parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.StandardPredefinedAndCustomRuleProto3 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.StandardPredefinedAndCustomRuleProto3 parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.StandardPredefinedAndCustomRuleProto3 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.StandardPredefinedAndCustomRuleProto3 parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.StandardPredefinedAndCustomRuleProto3 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.StandardPredefinedAndCustomRuleProto3 parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.StandardPredefinedAndCustomRuleProto3 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.StandardPredefinedAndCustomRuleProto3 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.StandardPredefinedAndCustomRuleProto3 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.StandardPredefinedAndCustomRuleProto3 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.StandardPredefinedAndCustomRuleProto3} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.StandardPredefinedAndCustomRuleProto3) + build.buf.validate.conformance.cases.StandardPredefinedAndCustomRuleProto3OrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.PredefinedRulesProto3Proto.internal_static_buf_validate_conformance_cases_StandardPredefinedAndCustomRuleProto3_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.PredefinedRulesProto3Proto.internal_static_buf_validate_conformance_cases_StandardPredefinedAndCustomRuleProto3_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.StandardPredefinedAndCustomRuleProto3.class, build.buf.validate.conformance.cases.StandardPredefinedAndCustomRuleProto3.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.StandardPredefinedAndCustomRuleProto3.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + a_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.PredefinedRulesProto3Proto.internal_static_buf_validate_conformance_cases_StandardPredefinedAndCustomRuleProto3_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.StandardPredefinedAndCustomRuleProto3 getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.StandardPredefinedAndCustomRuleProto3.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.StandardPredefinedAndCustomRuleProto3 build() { + build.buf.validate.conformance.cases.StandardPredefinedAndCustomRuleProto3 result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.StandardPredefinedAndCustomRuleProto3 buildPartial() { + build.buf.validate.conformance.cases.StandardPredefinedAndCustomRuleProto3 result = new build.buf.validate.conformance.cases.StandardPredefinedAndCustomRuleProto3(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.StandardPredefinedAndCustomRuleProto3 result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.a_ = a_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof build.buf.validate.conformance.cases.StandardPredefinedAndCustomRuleProto3) { + return mergeFrom((build.buf.validate.conformance.cases.StandardPredefinedAndCustomRuleProto3)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.StandardPredefinedAndCustomRuleProto3 other) { + if (other == build.buf.validate.conformance.cases.StandardPredefinedAndCustomRuleProto3.getDefaultInstance()) return this; + if (other.getA() != 0) { + setA(other.getA()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + a_ = input.readInt32(); + bitField0_ |= 0x00000001; + break; + } // case 8 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private int a_ ; + /** + * int32 a = 1 [json_name = "a", (.buf.validate.field) = { ... } + * @return The a. + */ + @java.lang.Override + public int getA() { + return a_; + } + /** + * int32 a = 1 [json_name = "a", (.buf.validate.field) = { ... } + * @param value The a to set. + * @return This builder for chaining. + */ + public Builder setA(int value) { + + a_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * int32 a = 1 [json_name = "a", (.buf.validate.field) = { ... } + * @return This builder for chaining. + */ + public Builder clearA() { + bitField0_ = (bitField0_ & ~0x00000001); + a_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.StandardPredefinedAndCustomRuleProto3) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.StandardPredefinedAndCustomRuleProto3) + private static final build.buf.validate.conformance.cases.StandardPredefinedAndCustomRuleProto3 DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.StandardPredefinedAndCustomRuleProto3(); + } + + public static build.buf.validate.conformance.cases.StandardPredefinedAndCustomRuleProto3 getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public StandardPredefinedAndCustomRuleProto3 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.StandardPredefinedAndCustomRuleProto3 getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/StandardPredefinedAndCustomRuleProto3OrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/StandardPredefinedAndCustomRuleProto3OrBuilder.java new file mode 100644 index 00000000..e45932d5 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/StandardPredefinedAndCustomRuleProto3OrBuilder.java @@ -0,0 +1,17 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/predefined_rules_proto3.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +public interface StandardPredefinedAndCustomRuleProto3OrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.StandardPredefinedAndCustomRuleProto3) + com.google.protobuf.MessageOrBuilder { + + /** + * int32 a = 1 [json_name = "a", (.buf.validate.field) = { ... } + * @return The a. + */ + int getA(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/StringExample.java b/conformance/src/main/java/build/buf/validate/conformance/cases/StringExample.java new file mode 100644 index 00000000..d8a382d5 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/StringExample.java @@ -0,0 +1,501 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/strings.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.StringExample} + */ +public final class StringExample extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.StringExample) + StringExampleOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 1, + /* suffix= */ "", + StringExample.class.getName()); + } + // Use StringExample.newBuilder() to construct. + private StringExample(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private StringExample() { + val_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.StringsProto.internal_static_buf_validate_conformance_cases_StringExample_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.StringsProto.internal_static_buf_validate_conformance_cases_StringExample_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.StringExample.class, build.buf.validate.conformance.cases.StringExample.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.StringExample)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.StringExample other = (build.buf.validate.conformance.cases.StringExample) 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.StringExample parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.StringExample 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.StringExample parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.StringExample 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.StringExample parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.StringExample 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.StringExample parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.StringExample 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.StringExample parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.StringExample 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.StringExample 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.StringExample 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.StringExample 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.StringExample} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.StringExample) + build.buf.validate.conformance.cases.StringExampleOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.StringsProto.internal_static_buf_validate_conformance_cases_StringExample_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.StringsProto.internal_static_buf_validate_conformance_cases_StringExample_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.StringExample.class, build.buf.validate.conformance.cases.StringExample.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.StringExample.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.StringsProto.internal_static_buf_validate_conformance_cases_StringExample_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.StringExample getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.StringExample.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.StringExample build() { + build.buf.validate.conformance.cases.StringExample result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.StringExample buildPartial() { + build.buf.validate.conformance.cases.StringExample result = new build.buf.validate.conformance.cases.StringExample(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.StringExample 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.StringExample) { + return mergeFrom((build.buf.validate.conformance.cases.StringExample)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.StringExample other) { + if (other == build.buf.validate.conformance.cases.StringExample.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.StringExample) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.StringExample) + private static final build.buf.validate.conformance.cases.StringExample DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.StringExample(); + } + + public static build.buf.validate.conformance.cases.StringExample getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public StringExample 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.StringExample getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/StringExampleOrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/StringExampleOrBuilder.java new file mode 100644 index 00000000..b4a1075e --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/StringExampleOrBuilder.java @@ -0,0 +1,23 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/strings.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +public interface StringExampleOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.StringExample) + com.google.protobuf.MessageOrBuilder { + + /** + * string val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + java.lang.String getVal(); + /** + * string val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The bytes for val. + */ + com.google.protobuf.ByteString + getValBytes(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/StringNotAddress.java b/conformance/src/main/java/build/buf/validate/conformance/cases/StringNotAddress.java new file mode 100644 index 00000000..9aefc9e6 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/StringNotAddress.java @@ -0,0 +1,501 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/strings.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.StringNotAddress} + */ +public final class StringNotAddress extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.StringNotAddress) + StringNotAddressOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 1, + /* suffix= */ "", + StringNotAddress.class.getName()); + } + // Use StringNotAddress.newBuilder() to construct. + private StringNotAddress(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private StringNotAddress() { + val_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.StringsProto.internal_static_buf_validate_conformance_cases_StringNotAddress_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.StringsProto.internal_static_buf_validate_conformance_cases_StringNotAddress_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.StringNotAddress.class, build.buf.validate.conformance.cases.StringNotAddress.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.StringNotAddress)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.StringNotAddress other = (build.buf.validate.conformance.cases.StringNotAddress) 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.StringNotAddress parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.StringNotAddress 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.StringNotAddress parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.StringNotAddress 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.StringNotAddress parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.StringNotAddress 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.StringNotAddress parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.StringNotAddress 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.StringNotAddress parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.StringNotAddress 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.StringNotAddress 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.StringNotAddress 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.StringNotAddress 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.StringNotAddress} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.StringNotAddress) + build.buf.validate.conformance.cases.StringNotAddressOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.StringsProto.internal_static_buf_validate_conformance_cases_StringNotAddress_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.StringsProto.internal_static_buf_validate_conformance_cases_StringNotAddress_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.StringNotAddress.class, build.buf.validate.conformance.cases.StringNotAddress.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.StringNotAddress.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.StringsProto.internal_static_buf_validate_conformance_cases_StringNotAddress_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.StringNotAddress getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.StringNotAddress.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.StringNotAddress build() { + build.buf.validate.conformance.cases.StringNotAddress result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.StringNotAddress buildPartial() { + build.buf.validate.conformance.cases.StringNotAddress result = new build.buf.validate.conformance.cases.StringNotAddress(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.StringNotAddress 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.StringNotAddress) { + return mergeFrom((build.buf.validate.conformance.cases.StringNotAddress)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.StringNotAddress other) { + if (other == build.buf.validate.conformance.cases.StringNotAddress.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.StringNotAddress) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.StringNotAddress) + private static final build.buf.validate.conformance.cases.StringNotAddress DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.StringNotAddress(); + } + + public static build.buf.validate.conformance.cases.StringNotAddress getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public StringNotAddress 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.StringNotAddress getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/StringNotAddressOrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/StringNotAddressOrBuilder.java new file mode 100644 index 00000000..e2d8b8e7 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/StringNotAddressOrBuilder.java @@ -0,0 +1,23 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/strings.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +public interface StringNotAddressOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.StringNotAddress) + com.google.protobuf.MessageOrBuilder { + + /** + * string val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + java.lang.String getVal(); + /** + * string val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The bytes for val. + */ + com.google.protobuf.ByteString + getValBytes(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/StringNotEmail.java b/conformance/src/main/java/build/buf/validate/conformance/cases/StringNotEmail.java new file mode 100644 index 00000000..ed58df37 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/StringNotEmail.java @@ -0,0 +1,501 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/strings.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.StringNotEmail} + */ +public final class StringNotEmail extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.StringNotEmail) + StringNotEmailOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 1, + /* suffix= */ "", + StringNotEmail.class.getName()); + } + // Use StringNotEmail.newBuilder() to construct. + private StringNotEmail(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private StringNotEmail() { + val_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.StringsProto.internal_static_buf_validate_conformance_cases_StringNotEmail_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.StringsProto.internal_static_buf_validate_conformance_cases_StringNotEmail_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.StringNotEmail.class, build.buf.validate.conformance.cases.StringNotEmail.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.StringNotEmail)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.StringNotEmail other = (build.buf.validate.conformance.cases.StringNotEmail) 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.StringNotEmail parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.StringNotEmail 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.StringNotEmail parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.StringNotEmail 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.StringNotEmail parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.StringNotEmail 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.StringNotEmail parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.StringNotEmail 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.StringNotEmail parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.StringNotEmail 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.StringNotEmail 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.StringNotEmail 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.StringNotEmail 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.StringNotEmail} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.StringNotEmail) + build.buf.validate.conformance.cases.StringNotEmailOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.StringsProto.internal_static_buf_validate_conformance_cases_StringNotEmail_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.StringsProto.internal_static_buf_validate_conformance_cases_StringNotEmail_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.StringNotEmail.class, build.buf.validate.conformance.cases.StringNotEmail.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.StringNotEmail.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.StringsProto.internal_static_buf_validate_conformance_cases_StringNotEmail_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.StringNotEmail getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.StringNotEmail.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.StringNotEmail build() { + build.buf.validate.conformance.cases.StringNotEmail result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.StringNotEmail buildPartial() { + build.buf.validate.conformance.cases.StringNotEmail result = new build.buf.validate.conformance.cases.StringNotEmail(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.StringNotEmail 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.StringNotEmail) { + return mergeFrom((build.buf.validate.conformance.cases.StringNotEmail)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.StringNotEmail other) { + if (other == build.buf.validate.conformance.cases.StringNotEmail.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.StringNotEmail) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.StringNotEmail) + private static final build.buf.validate.conformance.cases.StringNotEmail DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.StringNotEmail(); + } + + public static build.buf.validate.conformance.cases.StringNotEmail getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public StringNotEmail 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.StringNotEmail getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/StringNotEmailOrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/StringNotEmailOrBuilder.java new file mode 100644 index 00000000..f13a1051 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/StringNotEmailOrBuilder.java @@ -0,0 +1,23 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/strings.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +public interface StringNotEmailOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.StringNotEmail) + com.google.protobuf.MessageOrBuilder { + + /** + * string val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + java.lang.String getVal(); + /** + * string val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The bytes for val. + */ + com.google.protobuf.ByteString + getValBytes(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/StringNotHostname.java b/conformance/src/main/java/build/buf/validate/conformance/cases/StringNotHostname.java new file mode 100644 index 00000000..bfee308a --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/StringNotHostname.java @@ -0,0 +1,501 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/strings.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.StringNotHostname} + */ +public final class StringNotHostname extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.StringNotHostname) + StringNotHostnameOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 1, + /* suffix= */ "", + StringNotHostname.class.getName()); + } + // Use StringNotHostname.newBuilder() to construct. + private StringNotHostname(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private StringNotHostname() { + val_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.StringsProto.internal_static_buf_validate_conformance_cases_StringNotHostname_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.StringsProto.internal_static_buf_validate_conformance_cases_StringNotHostname_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.StringNotHostname.class, build.buf.validate.conformance.cases.StringNotHostname.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.StringNotHostname)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.StringNotHostname other = (build.buf.validate.conformance.cases.StringNotHostname) 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.StringNotHostname parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.StringNotHostname 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.StringNotHostname parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.StringNotHostname 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.StringNotHostname parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.StringNotHostname 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.StringNotHostname parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.StringNotHostname 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.StringNotHostname parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.StringNotHostname 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.StringNotHostname 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.StringNotHostname 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.StringNotHostname 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.StringNotHostname} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.StringNotHostname) + build.buf.validate.conformance.cases.StringNotHostnameOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.StringsProto.internal_static_buf_validate_conformance_cases_StringNotHostname_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.StringsProto.internal_static_buf_validate_conformance_cases_StringNotHostname_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.StringNotHostname.class, build.buf.validate.conformance.cases.StringNotHostname.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.StringNotHostname.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.StringsProto.internal_static_buf_validate_conformance_cases_StringNotHostname_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.StringNotHostname getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.StringNotHostname.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.StringNotHostname build() { + build.buf.validate.conformance.cases.StringNotHostname result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.StringNotHostname buildPartial() { + build.buf.validate.conformance.cases.StringNotHostname result = new build.buf.validate.conformance.cases.StringNotHostname(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.StringNotHostname 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.StringNotHostname) { + return mergeFrom((build.buf.validate.conformance.cases.StringNotHostname)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.StringNotHostname other) { + if (other == build.buf.validate.conformance.cases.StringNotHostname.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.StringNotHostname) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.StringNotHostname) + private static final build.buf.validate.conformance.cases.StringNotHostname DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.StringNotHostname(); + } + + public static build.buf.validate.conformance.cases.StringNotHostname getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public StringNotHostname 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.StringNotHostname getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/StringNotHostnameOrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/StringNotHostnameOrBuilder.java new file mode 100644 index 00000000..bd704010 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/StringNotHostnameOrBuilder.java @@ -0,0 +1,23 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/strings.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +public interface StringNotHostnameOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.StringNotHostname) + com.google.protobuf.MessageOrBuilder { + + /** + * string val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + java.lang.String getVal(); + /** + * string val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The bytes for val. + */ + com.google.protobuf.ByteString + getValBytes(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/StringNotIP.java b/conformance/src/main/java/build/buf/validate/conformance/cases/StringNotIP.java new file mode 100644 index 00000000..95b19216 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/StringNotIP.java @@ -0,0 +1,501 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/strings.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.StringNotIP} + */ +public final class StringNotIP extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.StringNotIP) + StringNotIPOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 1, + /* suffix= */ "", + StringNotIP.class.getName()); + } + // Use StringNotIP.newBuilder() to construct. + private StringNotIP(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private StringNotIP() { + val_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.StringsProto.internal_static_buf_validate_conformance_cases_StringNotIP_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.StringsProto.internal_static_buf_validate_conformance_cases_StringNotIP_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.StringNotIP.class, build.buf.validate.conformance.cases.StringNotIP.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.StringNotIP)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.StringNotIP other = (build.buf.validate.conformance.cases.StringNotIP) 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.StringNotIP parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.StringNotIP 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.StringNotIP parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.StringNotIP 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.StringNotIP parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.StringNotIP 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.StringNotIP parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.StringNotIP 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.StringNotIP parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.StringNotIP 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.StringNotIP 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.StringNotIP 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.StringNotIP 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.StringNotIP} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.StringNotIP) + build.buf.validate.conformance.cases.StringNotIPOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.StringsProto.internal_static_buf_validate_conformance_cases_StringNotIP_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.StringsProto.internal_static_buf_validate_conformance_cases_StringNotIP_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.StringNotIP.class, build.buf.validate.conformance.cases.StringNotIP.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.StringNotIP.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.StringsProto.internal_static_buf_validate_conformance_cases_StringNotIP_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.StringNotIP getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.StringNotIP.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.StringNotIP build() { + build.buf.validate.conformance.cases.StringNotIP result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.StringNotIP buildPartial() { + build.buf.validate.conformance.cases.StringNotIP result = new build.buf.validate.conformance.cases.StringNotIP(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.StringNotIP 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.StringNotIP) { + return mergeFrom((build.buf.validate.conformance.cases.StringNotIP)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.StringNotIP other) { + if (other == build.buf.validate.conformance.cases.StringNotIP.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.StringNotIP) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.StringNotIP) + private static final build.buf.validate.conformance.cases.StringNotIP DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.StringNotIP(); + } + + public static build.buf.validate.conformance.cases.StringNotIP getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public StringNotIP 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.StringNotIP getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/StringNotIPOrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/StringNotIPOrBuilder.java new file mode 100644 index 00000000..4a80b90a --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/StringNotIPOrBuilder.java @@ -0,0 +1,23 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/strings.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +public interface StringNotIPOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.StringNotIP) + com.google.protobuf.MessageOrBuilder { + + /** + * string val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + java.lang.String getVal(); + /** + * string val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The bytes for val. + */ + com.google.protobuf.ByteString + getValBytes(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/StringNotIPPrefix.java b/conformance/src/main/java/build/buf/validate/conformance/cases/StringNotIPPrefix.java new file mode 100644 index 00000000..722f80a0 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/StringNotIPPrefix.java @@ -0,0 +1,501 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/strings.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.StringNotIPPrefix} + */ +public final class StringNotIPPrefix extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.StringNotIPPrefix) + StringNotIPPrefixOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 1, + /* suffix= */ "", + StringNotIPPrefix.class.getName()); + } + // Use StringNotIPPrefix.newBuilder() to construct. + private StringNotIPPrefix(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private StringNotIPPrefix() { + val_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.StringsProto.internal_static_buf_validate_conformance_cases_StringNotIPPrefix_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.StringsProto.internal_static_buf_validate_conformance_cases_StringNotIPPrefix_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.StringNotIPPrefix.class, build.buf.validate.conformance.cases.StringNotIPPrefix.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.StringNotIPPrefix)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.StringNotIPPrefix other = (build.buf.validate.conformance.cases.StringNotIPPrefix) 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.StringNotIPPrefix parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.StringNotIPPrefix 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.StringNotIPPrefix parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.StringNotIPPrefix 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.StringNotIPPrefix parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.StringNotIPPrefix 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.StringNotIPPrefix parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.StringNotIPPrefix 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.StringNotIPPrefix parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.StringNotIPPrefix 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.StringNotIPPrefix 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.StringNotIPPrefix 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.StringNotIPPrefix 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.StringNotIPPrefix} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.StringNotIPPrefix) + build.buf.validate.conformance.cases.StringNotIPPrefixOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.StringsProto.internal_static_buf_validate_conformance_cases_StringNotIPPrefix_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.StringsProto.internal_static_buf_validate_conformance_cases_StringNotIPPrefix_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.StringNotIPPrefix.class, build.buf.validate.conformance.cases.StringNotIPPrefix.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.StringNotIPPrefix.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.StringsProto.internal_static_buf_validate_conformance_cases_StringNotIPPrefix_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.StringNotIPPrefix getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.StringNotIPPrefix.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.StringNotIPPrefix build() { + build.buf.validate.conformance.cases.StringNotIPPrefix result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.StringNotIPPrefix buildPartial() { + build.buf.validate.conformance.cases.StringNotIPPrefix result = new build.buf.validate.conformance.cases.StringNotIPPrefix(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.StringNotIPPrefix 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.StringNotIPPrefix) { + return mergeFrom((build.buf.validate.conformance.cases.StringNotIPPrefix)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.StringNotIPPrefix other) { + if (other == build.buf.validate.conformance.cases.StringNotIPPrefix.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.StringNotIPPrefix) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.StringNotIPPrefix) + private static final build.buf.validate.conformance.cases.StringNotIPPrefix DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.StringNotIPPrefix(); + } + + public static build.buf.validate.conformance.cases.StringNotIPPrefix getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public StringNotIPPrefix 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.StringNotIPPrefix getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/StringNotIPPrefixOrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/StringNotIPPrefixOrBuilder.java new file mode 100644 index 00000000..9f47f911 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/StringNotIPPrefixOrBuilder.java @@ -0,0 +1,23 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/strings.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +public interface StringNotIPPrefixOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.StringNotIPPrefix) + com.google.protobuf.MessageOrBuilder { + + /** + * string val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + java.lang.String getVal(); + /** + * string val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The bytes for val. + */ + com.google.protobuf.ByteString + getValBytes(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/StringNotIPWithPrefixLen.java b/conformance/src/main/java/build/buf/validate/conformance/cases/StringNotIPWithPrefixLen.java new file mode 100644 index 00000000..5240e5d6 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/StringNotIPWithPrefixLen.java @@ -0,0 +1,501 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/strings.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.StringNotIPWithPrefixLen} + */ +public final class StringNotIPWithPrefixLen extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.StringNotIPWithPrefixLen) + StringNotIPWithPrefixLenOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 1, + /* suffix= */ "", + StringNotIPWithPrefixLen.class.getName()); + } + // Use StringNotIPWithPrefixLen.newBuilder() to construct. + private StringNotIPWithPrefixLen(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private StringNotIPWithPrefixLen() { + val_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.StringsProto.internal_static_buf_validate_conformance_cases_StringNotIPWithPrefixLen_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.StringsProto.internal_static_buf_validate_conformance_cases_StringNotIPWithPrefixLen_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.StringNotIPWithPrefixLen.class, build.buf.validate.conformance.cases.StringNotIPWithPrefixLen.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.StringNotIPWithPrefixLen)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.StringNotIPWithPrefixLen other = (build.buf.validate.conformance.cases.StringNotIPWithPrefixLen) 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.StringNotIPWithPrefixLen parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.StringNotIPWithPrefixLen 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.StringNotIPWithPrefixLen parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.StringNotIPWithPrefixLen 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.StringNotIPWithPrefixLen parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.StringNotIPWithPrefixLen 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.StringNotIPWithPrefixLen parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.StringNotIPWithPrefixLen 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.StringNotIPWithPrefixLen parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.StringNotIPWithPrefixLen 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.StringNotIPWithPrefixLen 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.StringNotIPWithPrefixLen 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.StringNotIPWithPrefixLen 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.StringNotIPWithPrefixLen} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.StringNotIPWithPrefixLen) + build.buf.validate.conformance.cases.StringNotIPWithPrefixLenOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.StringsProto.internal_static_buf_validate_conformance_cases_StringNotIPWithPrefixLen_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.StringsProto.internal_static_buf_validate_conformance_cases_StringNotIPWithPrefixLen_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.StringNotIPWithPrefixLen.class, build.buf.validate.conformance.cases.StringNotIPWithPrefixLen.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.StringNotIPWithPrefixLen.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.StringsProto.internal_static_buf_validate_conformance_cases_StringNotIPWithPrefixLen_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.StringNotIPWithPrefixLen getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.StringNotIPWithPrefixLen.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.StringNotIPWithPrefixLen build() { + build.buf.validate.conformance.cases.StringNotIPWithPrefixLen result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.StringNotIPWithPrefixLen buildPartial() { + build.buf.validate.conformance.cases.StringNotIPWithPrefixLen result = new build.buf.validate.conformance.cases.StringNotIPWithPrefixLen(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.StringNotIPWithPrefixLen 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.StringNotIPWithPrefixLen) { + return mergeFrom((build.buf.validate.conformance.cases.StringNotIPWithPrefixLen)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.StringNotIPWithPrefixLen other) { + if (other == build.buf.validate.conformance.cases.StringNotIPWithPrefixLen.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.StringNotIPWithPrefixLen) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.StringNotIPWithPrefixLen) + private static final build.buf.validate.conformance.cases.StringNotIPWithPrefixLen DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.StringNotIPWithPrefixLen(); + } + + public static build.buf.validate.conformance.cases.StringNotIPWithPrefixLen getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public StringNotIPWithPrefixLen 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.StringNotIPWithPrefixLen getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/StringNotIPWithPrefixLenOrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/StringNotIPWithPrefixLenOrBuilder.java new file mode 100644 index 00000000..2507aaad --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/StringNotIPWithPrefixLenOrBuilder.java @@ -0,0 +1,23 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/strings.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +public interface StringNotIPWithPrefixLenOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.StringNotIPWithPrefixLen) + com.google.protobuf.MessageOrBuilder { + + /** + * string val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + java.lang.String getVal(); + /** + * string val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The bytes for val. + */ + com.google.protobuf.ByteString + getValBytes(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/StringNotIPv4.java b/conformance/src/main/java/build/buf/validate/conformance/cases/StringNotIPv4.java new file mode 100644 index 00000000..512d9aab --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/StringNotIPv4.java @@ -0,0 +1,501 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/strings.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.StringNotIPv4} + */ +public final class StringNotIPv4 extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.StringNotIPv4) + StringNotIPv4OrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 1, + /* suffix= */ "", + StringNotIPv4.class.getName()); + } + // Use StringNotIPv4.newBuilder() to construct. + private StringNotIPv4(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private StringNotIPv4() { + val_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.StringsProto.internal_static_buf_validate_conformance_cases_StringNotIPv4_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.StringsProto.internal_static_buf_validate_conformance_cases_StringNotIPv4_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.StringNotIPv4.class, build.buf.validate.conformance.cases.StringNotIPv4.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.StringNotIPv4)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.StringNotIPv4 other = (build.buf.validate.conformance.cases.StringNotIPv4) 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.StringNotIPv4 parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.StringNotIPv4 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.StringNotIPv4 parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.StringNotIPv4 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.StringNotIPv4 parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.StringNotIPv4 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.StringNotIPv4 parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.StringNotIPv4 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.StringNotIPv4 parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.StringNotIPv4 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.StringNotIPv4 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.StringNotIPv4 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.StringNotIPv4 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.StringNotIPv4} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.StringNotIPv4) + build.buf.validate.conformance.cases.StringNotIPv4OrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.StringsProto.internal_static_buf_validate_conformance_cases_StringNotIPv4_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.StringsProto.internal_static_buf_validate_conformance_cases_StringNotIPv4_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.StringNotIPv4.class, build.buf.validate.conformance.cases.StringNotIPv4.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.StringNotIPv4.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.StringsProto.internal_static_buf_validate_conformance_cases_StringNotIPv4_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.StringNotIPv4 getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.StringNotIPv4.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.StringNotIPv4 build() { + build.buf.validate.conformance.cases.StringNotIPv4 result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.StringNotIPv4 buildPartial() { + build.buf.validate.conformance.cases.StringNotIPv4 result = new build.buf.validate.conformance.cases.StringNotIPv4(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.StringNotIPv4 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.StringNotIPv4) { + return mergeFrom((build.buf.validate.conformance.cases.StringNotIPv4)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.StringNotIPv4 other) { + if (other == build.buf.validate.conformance.cases.StringNotIPv4.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.StringNotIPv4) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.StringNotIPv4) + private static final build.buf.validate.conformance.cases.StringNotIPv4 DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.StringNotIPv4(); + } + + public static build.buf.validate.conformance.cases.StringNotIPv4 getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public StringNotIPv4 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.StringNotIPv4 getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/StringNotIPv4OrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/StringNotIPv4OrBuilder.java new file mode 100644 index 00000000..4b462023 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/StringNotIPv4OrBuilder.java @@ -0,0 +1,23 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/strings.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +public interface StringNotIPv4OrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.StringNotIPv4) + com.google.protobuf.MessageOrBuilder { + + /** + * string val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + java.lang.String getVal(); + /** + * string val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The bytes for val. + */ + com.google.protobuf.ByteString + getValBytes(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/StringNotIPv4Prefix.java b/conformance/src/main/java/build/buf/validate/conformance/cases/StringNotIPv4Prefix.java new file mode 100644 index 00000000..b955610a --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/StringNotIPv4Prefix.java @@ -0,0 +1,501 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/strings.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.StringNotIPv4Prefix} + */ +public final class StringNotIPv4Prefix extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.StringNotIPv4Prefix) + StringNotIPv4PrefixOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 1, + /* suffix= */ "", + StringNotIPv4Prefix.class.getName()); + } + // Use StringNotIPv4Prefix.newBuilder() to construct. + private StringNotIPv4Prefix(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private StringNotIPv4Prefix() { + val_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.StringsProto.internal_static_buf_validate_conformance_cases_StringNotIPv4Prefix_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.StringsProto.internal_static_buf_validate_conformance_cases_StringNotIPv4Prefix_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.StringNotIPv4Prefix.class, build.buf.validate.conformance.cases.StringNotIPv4Prefix.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.StringNotIPv4Prefix)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.StringNotIPv4Prefix other = (build.buf.validate.conformance.cases.StringNotIPv4Prefix) 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.StringNotIPv4Prefix parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.StringNotIPv4Prefix 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.StringNotIPv4Prefix parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.StringNotIPv4Prefix 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.StringNotIPv4Prefix parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.StringNotIPv4Prefix 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.StringNotIPv4Prefix parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.StringNotIPv4Prefix 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.StringNotIPv4Prefix parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.StringNotIPv4Prefix 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.StringNotIPv4Prefix 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.StringNotIPv4Prefix 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.StringNotIPv4Prefix 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.StringNotIPv4Prefix} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.StringNotIPv4Prefix) + build.buf.validate.conformance.cases.StringNotIPv4PrefixOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.StringsProto.internal_static_buf_validate_conformance_cases_StringNotIPv4Prefix_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.StringsProto.internal_static_buf_validate_conformance_cases_StringNotIPv4Prefix_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.StringNotIPv4Prefix.class, build.buf.validate.conformance.cases.StringNotIPv4Prefix.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.StringNotIPv4Prefix.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.StringsProto.internal_static_buf_validate_conformance_cases_StringNotIPv4Prefix_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.StringNotIPv4Prefix getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.StringNotIPv4Prefix.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.StringNotIPv4Prefix build() { + build.buf.validate.conformance.cases.StringNotIPv4Prefix result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.StringNotIPv4Prefix buildPartial() { + build.buf.validate.conformance.cases.StringNotIPv4Prefix result = new build.buf.validate.conformance.cases.StringNotIPv4Prefix(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.StringNotIPv4Prefix 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.StringNotIPv4Prefix) { + return mergeFrom((build.buf.validate.conformance.cases.StringNotIPv4Prefix)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.StringNotIPv4Prefix other) { + if (other == build.buf.validate.conformance.cases.StringNotIPv4Prefix.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.StringNotIPv4Prefix) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.StringNotIPv4Prefix) + private static final build.buf.validate.conformance.cases.StringNotIPv4Prefix DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.StringNotIPv4Prefix(); + } + + public static build.buf.validate.conformance.cases.StringNotIPv4Prefix getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public StringNotIPv4Prefix 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.StringNotIPv4Prefix getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/StringNotIPv4PrefixOrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/StringNotIPv4PrefixOrBuilder.java new file mode 100644 index 00000000..4b8798ea --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/StringNotIPv4PrefixOrBuilder.java @@ -0,0 +1,23 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/strings.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +public interface StringNotIPv4PrefixOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.StringNotIPv4Prefix) + com.google.protobuf.MessageOrBuilder { + + /** + * string val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + java.lang.String getVal(); + /** + * string val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The bytes for val. + */ + com.google.protobuf.ByteString + getValBytes(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/StringNotIPv4WithPrefixLen.java b/conformance/src/main/java/build/buf/validate/conformance/cases/StringNotIPv4WithPrefixLen.java new file mode 100644 index 00000000..d4be64ca --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/StringNotIPv4WithPrefixLen.java @@ -0,0 +1,501 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/strings.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.StringNotIPv4WithPrefixLen} + */ +public final class StringNotIPv4WithPrefixLen extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.StringNotIPv4WithPrefixLen) + StringNotIPv4WithPrefixLenOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 1, + /* suffix= */ "", + StringNotIPv4WithPrefixLen.class.getName()); + } + // Use StringNotIPv4WithPrefixLen.newBuilder() to construct. + private StringNotIPv4WithPrefixLen(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private StringNotIPv4WithPrefixLen() { + val_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.StringsProto.internal_static_buf_validate_conformance_cases_StringNotIPv4WithPrefixLen_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.StringsProto.internal_static_buf_validate_conformance_cases_StringNotIPv4WithPrefixLen_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.StringNotIPv4WithPrefixLen.class, build.buf.validate.conformance.cases.StringNotIPv4WithPrefixLen.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.StringNotIPv4WithPrefixLen)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.StringNotIPv4WithPrefixLen other = (build.buf.validate.conformance.cases.StringNotIPv4WithPrefixLen) 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.StringNotIPv4WithPrefixLen parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.StringNotIPv4WithPrefixLen 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.StringNotIPv4WithPrefixLen parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.StringNotIPv4WithPrefixLen 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.StringNotIPv4WithPrefixLen parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.StringNotIPv4WithPrefixLen 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.StringNotIPv4WithPrefixLen parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.StringNotIPv4WithPrefixLen 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.StringNotIPv4WithPrefixLen parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.StringNotIPv4WithPrefixLen 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.StringNotIPv4WithPrefixLen 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.StringNotIPv4WithPrefixLen 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.StringNotIPv4WithPrefixLen 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.StringNotIPv4WithPrefixLen} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.StringNotIPv4WithPrefixLen) + build.buf.validate.conformance.cases.StringNotIPv4WithPrefixLenOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.StringsProto.internal_static_buf_validate_conformance_cases_StringNotIPv4WithPrefixLen_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.StringsProto.internal_static_buf_validate_conformance_cases_StringNotIPv4WithPrefixLen_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.StringNotIPv4WithPrefixLen.class, build.buf.validate.conformance.cases.StringNotIPv4WithPrefixLen.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.StringNotIPv4WithPrefixLen.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.StringsProto.internal_static_buf_validate_conformance_cases_StringNotIPv4WithPrefixLen_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.StringNotIPv4WithPrefixLen getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.StringNotIPv4WithPrefixLen.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.StringNotIPv4WithPrefixLen build() { + build.buf.validate.conformance.cases.StringNotIPv4WithPrefixLen result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.StringNotIPv4WithPrefixLen buildPartial() { + build.buf.validate.conformance.cases.StringNotIPv4WithPrefixLen result = new build.buf.validate.conformance.cases.StringNotIPv4WithPrefixLen(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.StringNotIPv4WithPrefixLen 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.StringNotIPv4WithPrefixLen) { + return mergeFrom((build.buf.validate.conformance.cases.StringNotIPv4WithPrefixLen)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.StringNotIPv4WithPrefixLen other) { + if (other == build.buf.validate.conformance.cases.StringNotIPv4WithPrefixLen.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.StringNotIPv4WithPrefixLen) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.StringNotIPv4WithPrefixLen) + private static final build.buf.validate.conformance.cases.StringNotIPv4WithPrefixLen DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.StringNotIPv4WithPrefixLen(); + } + + public static build.buf.validate.conformance.cases.StringNotIPv4WithPrefixLen getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public StringNotIPv4WithPrefixLen 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.StringNotIPv4WithPrefixLen getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/StringNotIPv4WithPrefixLenOrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/StringNotIPv4WithPrefixLenOrBuilder.java new file mode 100644 index 00000000..d9904a56 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/StringNotIPv4WithPrefixLenOrBuilder.java @@ -0,0 +1,23 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/strings.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +public interface StringNotIPv4WithPrefixLenOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.StringNotIPv4WithPrefixLen) + com.google.protobuf.MessageOrBuilder { + + /** + * string val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + java.lang.String getVal(); + /** + * string val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The bytes for val. + */ + com.google.protobuf.ByteString + getValBytes(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/StringNotIPv6.java b/conformance/src/main/java/build/buf/validate/conformance/cases/StringNotIPv6.java new file mode 100644 index 00000000..8e4c34be --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/StringNotIPv6.java @@ -0,0 +1,501 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/strings.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.StringNotIPv6} + */ +public final class StringNotIPv6 extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.StringNotIPv6) + StringNotIPv6OrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 1, + /* suffix= */ "", + StringNotIPv6.class.getName()); + } + // Use StringNotIPv6.newBuilder() to construct. + private StringNotIPv6(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private StringNotIPv6() { + val_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.StringsProto.internal_static_buf_validate_conformance_cases_StringNotIPv6_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.StringsProto.internal_static_buf_validate_conformance_cases_StringNotIPv6_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.StringNotIPv6.class, build.buf.validate.conformance.cases.StringNotIPv6.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.StringNotIPv6)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.StringNotIPv6 other = (build.buf.validate.conformance.cases.StringNotIPv6) 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.StringNotIPv6 parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.StringNotIPv6 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.StringNotIPv6 parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.StringNotIPv6 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.StringNotIPv6 parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.StringNotIPv6 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.StringNotIPv6 parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.StringNotIPv6 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.StringNotIPv6 parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.StringNotIPv6 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.StringNotIPv6 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.StringNotIPv6 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.StringNotIPv6 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.StringNotIPv6} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.StringNotIPv6) + build.buf.validate.conformance.cases.StringNotIPv6OrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.StringsProto.internal_static_buf_validate_conformance_cases_StringNotIPv6_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.StringsProto.internal_static_buf_validate_conformance_cases_StringNotIPv6_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.StringNotIPv6.class, build.buf.validate.conformance.cases.StringNotIPv6.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.StringNotIPv6.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.StringsProto.internal_static_buf_validate_conformance_cases_StringNotIPv6_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.StringNotIPv6 getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.StringNotIPv6.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.StringNotIPv6 build() { + build.buf.validate.conformance.cases.StringNotIPv6 result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.StringNotIPv6 buildPartial() { + build.buf.validate.conformance.cases.StringNotIPv6 result = new build.buf.validate.conformance.cases.StringNotIPv6(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.StringNotIPv6 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.StringNotIPv6) { + return mergeFrom((build.buf.validate.conformance.cases.StringNotIPv6)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.StringNotIPv6 other) { + if (other == build.buf.validate.conformance.cases.StringNotIPv6.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.StringNotIPv6) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.StringNotIPv6) + private static final build.buf.validate.conformance.cases.StringNotIPv6 DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.StringNotIPv6(); + } + + public static build.buf.validate.conformance.cases.StringNotIPv6 getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public StringNotIPv6 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.StringNotIPv6 getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/StringNotIPv6OrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/StringNotIPv6OrBuilder.java new file mode 100644 index 00000000..526d1c78 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/StringNotIPv6OrBuilder.java @@ -0,0 +1,23 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/strings.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +public interface StringNotIPv6OrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.StringNotIPv6) + com.google.protobuf.MessageOrBuilder { + + /** + * string val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + java.lang.String getVal(); + /** + * string val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The bytes for val. + */ + com.google.protobuf.ByteString + getValBytes(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/StringNotIPv6Prefix.java b/conformance/src/main/java/build/buf/validate/conformance/cases/StringNotIPv6Prefix.java new file mode 100644 index 00000000..896ac0bc --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/StringNotIPv6Prefix.java @@ -0,0 +1,501 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/strings.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.StringNotIPv6Prefix} + */ +public final class StringNotIPv6Prefix extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.StringNotIPv6Prefix) + StringNotIPv6PrefixOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 1, + /* suffix= */ "", + StringNotIPv6Prefix.class.getName()); + } + // Use StringNotIPv6Prefix.newBuilder() to construct. + private StringNotIPv6Prefix(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private StringNotIPv6Prefix() { + val_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.StringsProto.internal_static_buf_validate_conformance_cases_StringNotIPv6Prefix_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.StringsProto.internal_static_buf_validate_conformance_cases_StringNotIPv6Prefix_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.StringNotIPv6Prefix.class, build.buf.validate.conformance.cases.StringNotIPv6Prefix.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.StringNotIPv6Prefix)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.StringNotIPv6Prefix other = (build.buf.validate.conformance.cases.StringNotIPv6Prefix) 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.StringNotIPv6Prefix parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.StringNotIPv6Prefix 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.StringNotIPv6Prefix parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.StringNotIPv6Prefix 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.StringNotIPv6Prefix parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.StringNotIPv6Prefix 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.StringNotIPv6Prefix parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.StringNotIPv6Prefix 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.StringNotIPv6Prefix parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.StringNotIPv6Prefix 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.StringNotIPv6Prefix 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.StringNotIPv6Prefix 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.StringNotIPv6Prefix 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.StringNotIPv6Prefix} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.StringNotIPv6Prefix) + build.buf.validate.conformance.cases.StringNotIPv6PrefixOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.StringsProto.internal_static_buf_validate_conformance_cases_StringNotIPv6Prefix_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.StringsProto.internal_static_buf_validate_conformance_cases_StringNotIPv6Prefix_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.StringNotIPv6Prefix.class, build.buf.validate.conformance.cases.StringNotIPv6Prefix.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.StringNotIPv6Prefix.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.StringsProto.internal_static_buf_validate_conformance_cases_StringNotIPv6Prefix_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.StringNotIPv6Prefix getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.StringNotIPv6Prefix.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.StringNotIPv6Prefix build() { + build.buf.validate.conformance.cases.StringNotIPv6Prefix result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.StringNotIPv6Prefix buildPartial() { + build.buf.validate.conformance.cases.StringNotIPv6Prefix result = new build.buf.validate.conformance.cases.StringNotIPv6Prefix(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.StringNotIPv6Prefix 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.StringNotIPv6Prefix) { + return mergeFrom((build.buf.validate.conformance.cases.StringNotIPv6Prefix)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.StringNotIPv6Prefix other) { + if (other == build.buf.validate.conformance.cases.StringNotIPv6Prefix.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.StringNotIPv6Prefix) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.StringNotIPv6Prefix) + private static final build.buf.validate.conformance.cases.StringNotIPv6Prefix DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.StringNotIPv6Prefix(); + } + + public static build.buf.validate.conformance.cases.StringNotIPv6Prefix getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public StringNotIPv6Prefix 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.StringNotIPv6Prefix getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/StringNotIPv6PrefixOrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/StringNotIPv6PrefixOrBuilder.java new file mode 100644 index 00000000..e71835e3 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/StringNotIPv6PrefixOrBuilder.java @@ -0,0 +1,23 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/strings.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +public interface StringNotIPv6PrefixOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.StringNotIPv6Prefix) + com.google.protobuf.MessageOrBuilder { + + /** + * string val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + java.lang.String getVal(); + /** + * string val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The bytes for val. + */ + com.google.protobuf.ByteString + getValBytes(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/StringNotIPv6WithPrefixLen.java b/conformance/src/main/java/build/buf/validate/conformance/cases/StringNotIPv6WithPrefixLen.java new file mode 100644 index 00000000..6a6f7210 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/StringNotIPv6WithPrefixLen.java @@ -0,0 +1,501 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/strings.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.StringNotIPv6WithPrefixLen} + */ +public final class StringNotIPv6WithPrefixLen extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.StringNotIPv6WithPrefixLen) + StringNotIPv6WithPrefixLenOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 1, + /* suffix= */ "", + StringNotIPv6WithPrefixLen.class.getName()); + } + // Use StringNotIPv6WithPrefixLen.newBuilder() to construct. + private StringNotIPv6WithPrefixLen(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private StringNotIPv6WithPrefixLen() { + val_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.StringsProto.internal_static_buf_validate_conformance_cases_StringNotIPv6WithPrefixLen_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.StringsProto.internal_static_buf_validate_conformance_cases_StringNotIPv6WithPrefixLen_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.StringNotIPv6WithPrefixLen.class, build.buf.validate.conformance.cases.StringNotIPv6WithPrefixLen.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.StringNotIPv6WithPrefixLen)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.StringNotIPv6WithPrefixLen other = (build.buf.validate.conformance.cases.StringNotIPv6WithPrefixLen) 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.StringNotIPv6WithPrefixLen parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.StringNotIPv6WithPrefixLen 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.StringNotIPv6WithPrefixLen parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.StringNotIPv6WithPrefixLen 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.StringNotIPv6WithPrefixLen parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.StringNotIPv6WithPrefixLen 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.StringNotIPv6WithPrefixLen parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.StringNotIPv6WithPrefixLen 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.StringNotIPv6WithPrefixLen parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.StringNotIPv6WithPrefixLen 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.StringNotIPv6WithPrefixLen 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.StringNotIPv6WithPrefixLen 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.StringNotIPv6WithPrefixLen 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.StringNotIPv6WithPrefixLen} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.StringNotIPv6WithPrefixLen) + build.buf.validate.conformance.cases.StringNotIPv6WithPrefixLenOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.StringsProto.internal_static_buf_validate_conformance_cases_StringNotIPv6WithPrefixLen_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.StringsProto.internal_static_buf_validate_conformance_cases_StringNotIPv6WithPrefixLen_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.StringNotIPv6WithPrefixLen.class, build.buf.validate.conformance.cases.StringNotIPv6WithPrefixLen.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.StringNotIPv6WithPrefixLen.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.StringsProto.internal_static_buf_validate_conformance_cases_StringNotIPv6WithPrefixLen_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.StringNotIPv6WithPrefixLen getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.StringNotIPv6WithPrefixLen.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.StringNotIPv6WithPrefixLen build() { + build.buf.validate.conformance.cases.StringNotIPv6WithPrefixLen result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.StringNotIPv6WithPrefixLen buildPartial() { + build.buf.validate.conformance.cases.StringNotIPv6WithPrefixLen result = new build.buf.validate.conformance.cases.StringNotIPv6WithPrefixLen(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.StringNotIPv6WithPrefixLen 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.StringNotIPv6WithPrefixLen) { + return mergeFrom((build.buf.validate.conformance.cases.StringNotIPv6WithPrefixLen)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.StringNotIPv6WithPrefixLen other) { + if (other == build.buf.validate.conformance.cases.StringNotIPv6WithPrefixLen.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.StringNotIPv6WithPrefixLen) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.StringNotIPv6WithPrefixLen) + private static final build.buf.validate.conformance.cases.StringNotIPv6WithPrefixLen DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.StringNotIPv6WithPrefixLen(); + } + + public static build.buf.validate.conformance.cases.StringNotIPv6WithPrefixLen getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public StringNotIPv6WithPrefixLen 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.StringNotIPv6WithPrefixLen getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/StringNotIPv6WithPrefixLenOrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/StringNotIPv6WithPrefixLenOrBuilder.java new file mode 100644 index 00000000..6b7bb7d1 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/StringNotIPv6WithPrefixLenOrBuilder.java @@ -0,0 +1,23 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/strings.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +public interface StringNotIPv6WithPrefixLenOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.StringNotIPv6WithPrefixLen) + com.google.protobuf.MessageOrBuilder { + + /** + * string val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + java.lang.String getVal(); + /** + * string val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The bytes for val. + */ + com.google.protobuf.ByteString + getValBytes(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/StringNotTUUID.java b/conformance/src/main/java/build/buf/validate/conformance/cases/StringNotTUUID.java new file mode 100644 index 00000000..9a9d2f71 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/StringNotTUUID.java @@ -0,0 +1,501 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/strings.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.StringNotTUUID} + */ +public final class StringNotTUUID extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.StringNotTUUID) + StringNotTUUIDOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 1, + /* suffix= */ "", + StringNotTUUID.class.getName()); + } + // Use StringNotTUUID.newBuilder() to construct. + private StringNotTUUID(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private StringNotTUUID() { + val_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.StringsProto.internal_static_buf_validate_conformance_cases_StringNotTUUID_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.StringsProto.internal_static_buf_validate_conformance_cases_StringNotTUUID_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.StringNotTUUID.class, build.buf.validate.conformance.cases.StringNotTUUID.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.StringNotTUUID)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.StringNotTUUID other = (build.buf.validate.conformance.cases.StringNotTUUID) 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.StringNotTUUID parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.StringNotTUUID 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.StringNotTUUID parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.StringNotTUUID 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.StringNotTUUID parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.StringNotTUUID 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.StringNotTUUID parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.StringNotTUUID 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.StringNotTUUID parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.StringNotTUUID 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.StringNotTUUID 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.StringNotTUUID 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.StringNotTUUID 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.StringNotTUUID} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.StringNotTUUID) + build.buf.validate.conformance.cases.StringNotTUUIDOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.StringsProto.internal_static_buf_validate_conformance_cases_StringNotTUUID_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.StringsProto.internal_static_buf_validate_conformance_cases_StringNotTUUID_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.StringNotTUUID.class, build.buf.validate.conformance.cases.StringNotTUUID.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.StringNotTUUID.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.StringsProto.internal_static_buf_validate_conformance_cases_StringNotTUUID_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.StringNotTUUID getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.StringNotTUUID.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.StringNotTUUID build() { + build.buf.validate.conformance.cases.StringNotTUUID result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.StringNotTUUID buildPartial() { + build.buf.validate.conformance.cases.StringNotTUUID result = new build.buf.validate.conformance.cases.StringNotTUUID(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.StringNotTUUID 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.StringNotTUUID) { + return mergeFrom((build.buf.validate.conformance.cases.StringNotTUUID)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.StringNotTUUID other) { + if (other == build.buf.validate.conformance.cases.StringNotTUUID.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.StringNotTUUID) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.StringNotTUUID) + private static final build.buf.validate.conformance.cases.StringNotTUUID DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.StringNotTUUID(); + } + + public static build.buf.validate.conformance.cases.StringNotTUUID getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public StringNotTUUID 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.StringNotTUUID getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/StringNotTUUIDOrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/StringNotTUUIDOrBuilder.java new file mode 100644 index 00000000..4bf18cac --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/StringNotTUUIDOrBuilder.java @@ -0,0 +1,23 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/strings.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +public interface StringNotTUUIDOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.StringNotTUUID) + com.google.protobuf.MessageOrBuilder { + + /** + * string val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + java.lang.String getVal(); + /** + * string val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The bytes for val. + */ + com.google.protobuf.ByteString + getValBytes(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/StringNotURI.java b/conformance/src/main/java/build/buf/validate/conformance/cases/StringNotURI.java new file mode 100644 index 00000000..e94165f9 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/StringNotURI.java @@ -0,0 +1,501 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/strings.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.StringNotURI} + */ +public final class StringNotURI extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.StringNotURI) + StringNotURIOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 1, + /* suffix= */ "", + StringNotURI.class.getName()); + } + // Use StringNotURI.newBuilder() to construct. + private StringNotURI(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private StringNotURI() { + val_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.StringsProto.internal_static_buf_validate_conformance_cases_StringNotURI_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.StringsProto.internal_static_buf_validate_conformance_cases_StringNotURI_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.StringNotURI.class, build.buf.validate.conformance.cases.StringNotURI.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.StringNotURI)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.StringNotURI other = (build.buf.validate.conformance.cases.StringNotURI) 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.StringNotURI parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.StringNotURI 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.StringNotURI parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.StringNotURI 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.StringNotURI parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.StringNotURI 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.StringNotURI parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.StringNotURI 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.StringNotURI parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.StringNotURI 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.StringNotURI 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.StringNotURI 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.StringNotURI 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.StringNotURI} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.StringNotURI) + build.buf.validate.conformance.cases.StringNotURIOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.StringsProto.internal_static_buf_validate_conformance_cases_StringNotURI_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.StringsProto.internal_static_buf_validate_conformance_cases_StringNotURI_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.StringNotURI.class, build.buf.validate.conformance.cases.StringNotURI.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.StringNotURI.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.StringsProto.internal_static_buf_validate_conformance_cases_StringNotURI_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.StringNotURI getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.StringNotURI.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.StringNotURI build() { + build.buf.validate.conformance.cases.StringNotURI result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.StringNotURI buildPartial() { + build.buf.validate.conformance.cases.StringNotURI result = new build.buf.validate.conformance.cases.StringNotURI(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.StringNotURI 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.StringNotURI) { + return mergeFrom((build.buf.validate.conformance.cases.StringNotURI)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.StringNotURI other) { + if (other == build.buf.validate.conformance.cases.StringNotURI.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.StringNotURI) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.StringNotURI) + private static final build.buf.validate.conformance.cases.StringNotURI DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.StringNotURI(); + } + + public static build.buf.validate.conformance.cases.StringNotURI getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public StringNotURI 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.StringNotURI getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/StringNotURIOrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/StringNotURIOrBuilder.java new file mode 100644 index 00000000..505d0ded --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/StringNotURIOrBuilder.java @@ -0,0 +1,23 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/strings.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +public interface StringNotURIOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.StringNotURI) + com.google.protobuf.MessageOrBuilder { + + /** + * string val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + java.lang.String getVal(); + /** + * string val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The bytes for val. + */ + com.google.protobuf.ByteString + getValBytes(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/StringNotURIRef.java b/conformance/src/main/java/build/buf/validate/conformance/cases/StringNotURIRef.java new file mode 100644 index 00000000..2b123da1 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/StringNotURIRef.java @@ -0,0 +1,501 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/strings.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.StringNotURIRef} + */ +public final class StringNotURIRef extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.StringNotURIRef) + StringNotURIRefOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 1, + /* suffix= */ "", + StringNotURIRef.class.getName()); + } + // Use StringNotURIRef.newBuilder() to construct. + private StringNotURIRef(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private StringNotURIRef() { + val_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.StringsProto.internal_static_buf_validate_conformance_cases_StringNotURIRef_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.StringsProto.internal_static_buf_validate_conformance_cases_StringNotURIRef_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.StringNotURIRef.class, build.buf.validate.conformance.cases.StringNotURIRef.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.StringNotURIRef)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.StringNotURIRef other = (build.buf.validate.conformance.cases.StringNotURIRef) 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.StringNotURIRef parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.StringNotURIRef 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.StringNotURIRef parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.StringNotURIRef 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.StringNotURIRef parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.StringNotURIRef 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.StringNotURIRef parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.StringNotURIRef 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.StringNotURIRef parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.StringNotURIRef 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.StringNotURIRef 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.StringNotURIRef 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.StringNotURIRef 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.StringNotURIRef} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.StringNotURIRef) + build.buf.validate.conformance.cases.StringNotURIRefOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.StringsProto.internal_static_buf_validate_conformance_cases_StringNotURIRef_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.StringsProto.internal_static_buf_validate_conformance_cases_StringNotURIRef_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.StringNotURIRef.class, build.buf.validate.conformance.cases.StringNotURIRef.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.StringNotURIRef.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.StringsProto.internal_static_buf_validate_conformance_cases_StringNotURIRef_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.StringNotURIRef getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.StringNotURIRef.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.StringNotURIRef build() { + build.buf.validate.conformance.cases.StringNotURIRef result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.StringNotURIRef buildPartial() { + build.buf.validate.conformance.cases.StringNotURIRef result = new build.buf.validate.conformance.cases.StringNotURIRef(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.StringNotURIRef 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.StringNotURIRef) { + return mergeFrom((build.buf.validate.conformance.cases.StringNotURIRef)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.StringNotURIRef other) { + if (other == build.buf.validate.conformance.cases.StringNotURIRef.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.StringNotURIRef) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.StringNotURIRef) + private static final build.buf.validate.conformance.cases.StringNotURIRef DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.StringNotURIRef(); + } + + public static build.buf.validate.conformance.cases.StringNotURIRef getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public StringNotURIRef 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.StringNotURIRef getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/StringNotURIRefOrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/StringNotURIRefOrBuilder.java new file mode 100644 index 00000000..712bb962 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/StringNotURIRefOrBuilder.java @@ -0,0 +1,23 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/strings.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +public interface StringNotURIRefOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.StringNotURIRef) + com.google.protobuf.MessageOrBuilder { + + /** + * string val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + java.lang.String getVal(); + /** + * string val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The bytes for val. + */ + com.google.protobuf.ByteString + getValBytes(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/StringNotUUID.java b/conformance/src/main/java/build/buf/validate/conformance/cases/StringNotUUID.java new file mode 100644 index 00000000..058dcd4d --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/StringNotUUID.java @@ -0,0 +1,501 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/strings.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.StringNotUUID} + */ +public final class StringNotUUID extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.StringNotUUID) + StringNotUUIDOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 1, + /* suffix= */ "", + StringNotUUID.class.getName()); + } + // Use StringNotUUID.newBuilder() to construct. + private StringNotUUID(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private StringNotUUID() { + val_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.StringsProto.internal_static_buf_validate_conformance_cases_StringNotUUID_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.StringsProto.internal_static_buf_validate_conformance_cases_StringNotUUID_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.StringNotUUID.class, build.buf.validate.conformance.cases.StringNotUUID.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.StringNotUUID)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.StringNotUUID other = (build.buf.validate.conformance.cases.StringNotUUID) 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.StringNotUUID parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.StringNotUUID 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.StringNotUUID parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.StringNotUUID 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.StringNotUUID parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.StringNotUUID 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.StringNotUUID parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.StringNotUUID 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.StringNotUUID parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.StringNotUUID 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.StringNotUUID 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.StringNotUUID 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.StringNotUUID 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.StringNotUUID} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.StringNotUUID) + build.buf.validate.conformance.cases.StringNotUUIDOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.StringsProto.internal_static_buf_validate_conformance_cases_StringNotUUID_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.StringsProto.internal_static_buf_validate_conformance_cases_StringNotUUID_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.StringNotUUID.class, build.buf.validate.conformance.cases.StringNotUUID.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.StringNotUUID.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.StringsProto.internal_static_buf_validate_conformance_cases_StringNotUUID_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.StringNotUUID getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.StringNotUUID.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.StringNotUUID build() { + build.buf.validate.conformance.cases.StringNotUUID result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.StringNotUUID buildPartial() { + build.buf.validate.conformance.cases.StringNotUUID result = new build.buf.validate.conformance.cases.StringNotUUID(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.StringNotUUID 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.StringNotUUID) { + return mergeFrom((build.buf.validate.conformance.cases.StringNotUUID)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.StringNotUUID other) { + if (other == build.buf.validate.conformance.cases.StringNotUUID.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.StringNotUUID) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.StringNotUUID) + private static final build.buf.validate.conformance.cases.StringNotUUID DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.StringNotUUID(); + } + + public static build.buf.validate.conformance.cases.StringNotUUID getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public StringNotUUID 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.StringNotUUID getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/StringNotUUIDOrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/StringNotUUIDOrBuilder.java new file mode 100644 index 00000000..64edafdf --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/StringNotUUIDOrBuilder.java @@ -0,0 +1,23 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/strings.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +public interface StringNotUUIDOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.StringNotUUID) + com.google.protobuf.MessageOrBuilder { + + /** + * string val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + java.lang.String getVal(); + /** + * string val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The bytes for val. + */ + com.google.protobuf.ByteString + getValBytes(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/StringsProto.java b/conformance/src/main/java/build/buf/validate/conformance/cases/StringsProto.java index 58f37290..eb79044f 100644 --- a/conformance/src/main/java/build/buf/validate/conformance/cases/StringsProto.java +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/StringsProto.java @@ -130,81 +130,161 @@ public static void registerAllExtensions( static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_buf_validate_conformance_cases_StringEmail_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_StringNotEmail_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_conformance_cases_StringNotEmail_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_buf_validate_conformance_cases_StringAddress_descriptor; static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_buf_validate_conformance_cases_StringAddress_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_StringNotAddress_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_conformance_cases_StringNotAddress_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_buf_validate_conformance_cases_StringHostname_descriptor; static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_buf_validate_conformance_cases_StringHostname_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_StringNotHostname_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_conformance_cases_StringNotHostname_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_buf_validate_conformance_cases_StringIP_descriptor; static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_buf_validate_conformance_cases_StringIP_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_StringNotIP_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_conformance_cases_StringNotIP_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_buf_validate_conformance_cases_StringIPv4_descriptor; static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_buf_validate_conformance_cases_StringIPv4_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_StringNotIPv4_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_conformance_cases_StringNotIPv4_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_buf_validate_conformance_cases_StringIPv6_descriptor; static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_buf_validate_conformance_cases_StringIPv6_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_StringNotIPv6_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_conformance_cases_StringNotIPv6_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_buf_validate_conformance_cases_StringIPWithPrefixLen_descriptor; static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_buf_validate_conformance_cases_StringIPWithPrefixLen_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_StringNotIPWithPrefixLen_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_conformance_cases_StringNotIPWithPrefixLen_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_buf_validate_conformance_cases_StringIPv4WithPrefixLen_descriptor; static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_buf_validate_conformance_cases_StringIPv4WithPrefixLen_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_StringNotIPv4WithPrefixLen_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_conformance_cases_StringNotIPv4WithPrefixLen_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_buf_validate_conformance_cases_StringIPv6WithPrefixLen_descriptor; static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_buf_validate_conformance_cases_StringIPv6WithPrefixLen_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_StringNotIPv6WithPrefixLen_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_conformance_cases_StringNotIPv6WithPrefixLen_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_buf_validate_conformance_cases_StringIPPrefix_descriptor; static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_buf_validate_conformance_cases_StringIPPrefix_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_StringNotIPPrefix_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_conformance_cases_StringNotIPPrefix_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_buf_validate_conformance_cases_StringIPv4Prefix_descriptor; static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_buf_validate_conformance_cases_StringIPv4Prefix_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_StringNotIPv4Prefix_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_conformance_cases_StringNotIPv4Prefix_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_buf_validate_conformance_cases_StringIPv6Prefix_descriptor; static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_buf_validate_conformance_cases_StringIPv6Prefix_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_StringNotIPv6Prefix_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_conformance_cases_StringNotIPv6Prefix_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_buf_validate_conformance_cases_StringURI_descriptor; static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_buf_validate_conformance_cases_StringURI_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_StringNotURI_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_conformance_cases_StringNotURI_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_buf_validate_conformance_cases_StringURIRef_descriptor; static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_buf_validate_conformance_cases_StringURIRef_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_StringNotURIRef_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_conformance_cases_StringNotURIRef_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_buf_validate_conformance_cases_StringUUID_descriptor; static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_buf_validate_conformance_cases_StringUUID_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_StringNotUUID_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_conformance_cases_StringNotUUID_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_buf_validate_conformance_cases_StringTUUID_descriptor; static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_buf_validate_conformance_cases_StringTUUID_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_StringNotTUUID_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_conformance_cases_StringNotTUUID_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_buf_validate_conformance_cases_StringHttpHeaderName_descriptor; static final @@ -245,6 +325,11 @@ public static void registerAllExtensions( static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_buf_validate_conformance_cases_StringHostAndOptionalPort_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_StringExample_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_conformance_cases_StringExample_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { @@ -281,43 +366,64 @@ public static void registerAllExtensions( "\003val\"2\n\021StringNotContains\022\035\n\003val\030\001 \001(\tB\013" + "\272H\010r\006\272\001\003barR\003val\",\n\014StringSuffix\022\034\n\003val\030" + "\001 \001(\tB\n\272H\007r\005B\003bazR\003val\"(\n\013StringEmail\022\031\n" + - "\003val\030\001 \001(\tB\007\272H\004r\002`\001R\003val\"+\n\rStringAddres" + - "s\022\032\n\003val\030\001 \001(\tB\010\272H\005r\003\250\001\001R\003val\"+\n\016StringH" + - "ostname\022\031\n\003val\030\001 \001(\tB\007\272H\004r\002h\001R\003val\"%\n\010St" + - "ringIP\022\031\n\003val\030\001 \001(\tB\007\272H\004r\002p\001R\003val\"\'\n\nStr" + - "ingIPv4\022\031\n\003val\030\001 \001(\tB\007\272H\004r\002x\001R\003val\"(\n\nSt" + - "ringIPv6\022\032\n\003val\030\001 \001(\tB\010\272H\005r\003\200\001\001R\003val\"3\n\025" + - "StringIPWithPrefixLen\022\032\n\003val\030\001 \001(\tB\010\272H\005r" + - "\003\320\001\001R\003val\"5\n\027StringIPv4WithPrefixLen\022\032\n\003" + - "val\030\001 \001(\tB\010\272H\005r\003\330\001\001R\003val\"5\n\027StringIPv6Wi" + - "thPrefixLen\022\032\n\003val\030\001 \001(\tB\010\272H\005r\003\340\001\001R\003val\"" + - ",\n\016StringIPPrefix\022\032\n\003val\030\001 \001(\tB\010\272H\005r\003\350\001\001" + - "R\003val\".\n\020StringIPv4Prefix\022\032\n\003val\030\001 \001(\tB\010" + - "\272H\005r\003\360\001\001R\003val\".\n\020StringIPv6Prefix\022\032\n\003val" + - "\030\001 \001(\tB\010\272H\005r\003\370\001\001R\003val\"\'\n\tStringURI\022\032\n\003va" + - "l\030\001 \001(\tB\010\272H\005r\003\210\001\001R\003val\"*\n\014StringURIRef\022\032" + - "\n\003val\030\001 \001(\tB\010\272H\005r\003\220\001\001R\003val\"(\n\nStringUUID" + - "\022\032\n\003val\030\001 \001(\tB\010\272H\005r\003\260\001\001R\003val\")\n\013StringTU" + - "UID\022\032\n\003val\030\001 \001(\tB\010\272H\005r\003\210\002\001R\003val\"2\n\024Strin" + - "gHttpHeaderName\022\032\n\003val\030\001 \001(\tB\010\272H\005r\003\300\001\001R\003" + - "val\"3\n\025StringHttpHeaderValue\022\032\n\003val\030\001 \001(" + - "\tB\010\272H\005r\003\300\001\002R\003val\":\n\031StringHttpHeaderName" + - "Loose\022\035\n\003val\030\001 \001(\tB\013\272H\010r\006\300\001\001\310\001\000R\003val\";\n\032" + - "StringHttpHeaderValueLoose\022\035\n\003val\030\001 \001(\tB" + - "\013\272H\010r\006\300\001\002\310\001\000R\003val\"1\n\020StringUUIDIgnore\022\035\n" + - "\003val\030\001 \001(\tB\013\272H\010r\003\260\001\001\320\001\001R\003val\"7\n\rStringIn" + - "Oneof\022\037\n\003bar\030\001 \001(\tB\013\272H\010r\006R\001aR\001bH\000R\003barB\005" + - "\n\003foo\"/\n\021StringHostAndPort\022\032\n\003val\030\001 \001(\tB" + - "\010\272H\005r\003\200\002\001R\003val\"\244\001\n\031StringHostAndOptional" + - "Port\022\206\001\n\003val\030\001 \001(\tBt\272Hq\272\001n\n\"string.host_" + - "and_port.optional_port\022-value must be a " + - "host and (optional) port pair\032\031this.isHo" + - "stAndPort(false)R\003valB\320\001\n$build.buf.vali" + - "date.conformance.casesB\014StringsProtoP\001\242\002" + - "\004BVCC\252\002\036Buf.Validate.Conformance.Cases\312\002" + - "\036Buf\\Validate\\Conformance\\Cases\342\002*Buf\\Va" + - "lidate\\Conformance\\Cases\\GPBMetadata\352\002!B" + - "uf::Validate::Conformance::Casesb\006proto3" + "\003val\030\001 \001(\tB\007\272H\004r\002`\001R\003val\"+\n\016StringNotEma" + + "il\022\031\n\003val\030\001 \001(\tB\007\272H\004r\002`\000R\003val\"+\n\rStringA" + + "ddress\022\032\n\003val\030\001 \001(\tB\010\272H\005r\003\250\001\001R\003val\".\n\020St" + + "ringNotAddress\022\032\n\003val\030\001 \001(\tB\010\272H\005r\003\250\001\000R\003v" + + "al\"+\n\016StringHostname\022\031\n\003val\030\001 \001(\tB\007\272H\004r\002" + + "h\001R\003val\".\n\021StringNotHostname\022\031\n\003val\030\001 \001(" + + "\tB\007\272H\004r\002h\000R\003val\"%\n\010StringIP\022\031\n\003val\030\001 \001(\t" + + "B\007\272H\004r\002p\001R\003val\"(\n\013StringNotIP\022\031\n\003val\030\001 \001" + + "(\tB\007\272H\004r\002p\000R\003val\"\'\n\nStringIPv4\022\031\n\003val\030\001 " + + "\001(\tB\007\272H\004r\002x\001R\003val\"*\n\rStringNotIPv4\022\031\n\003va" + + "l\030\001 \001(\tB\007\272H\004r\002x\000R\003val\"(\n\nStringIPv6\022\032\n\003v" + + "al\030\001 \001(\tB\010\272H\005r\003\200\001\001R\003val\"+\n\rStringNotIPv6" + + "\022\032\n\003val\030\001 \001(\tB\010\272H\005r\003\200\001\000R\003val\"3\n\025StringIP" + + "WithPrefixLen\022\032\n\003val\030\001 \001(\tB\010\272H\005r\003\320\001\001R\003va" + + "l\"6\n\030StringNotIPWithPrefixLen\022\032\n\003val\030\001 \001" + + "(\tB\010\272H\005r\003\320\001\000R\003val\"5\n\027StringIPv4WithPrefi" + + "xLen\022\032\n\003val\030\001 \001(\tB\010\272H\005r\003\330\001\001R\003val\"8\n\032Stri" + + "ngNotIPv4WithPrefixLen\022\032\n\003val\030\001 \001(\tB\010\272H\005" + + "r\003\330\001\000R\003val\"5\n\027StringIPv6WithPrefixLen\022\032\n" + + "\003val\030\001 \001(\tB\010\272H\005r\003\340\001\001R\003val\"8\n\032StringNotIP" + + "v6WithPrefixLen\022\032\n\003val\030\001 \001(\tB\010\272H\005r\003\340\001\000R\003" + + "val\",\n\016StringIPPrefix\022\032\n\003val\030\001 \001(\tB\010\272H\005r" + + "\003\350\001\001R\003val\"/\n\021StringNotIPPrefix\022\032\n\003val\030\001 " + + "\001(\tB\010\272H\005r\003\350\001\000R\003val\".\n\020StringIPv4Prefix\022\032" + + "\n\003val\030\001 \001(\tB\010\272H\005r\003\360\001\001R\003val\"1\n\023StringNotI" + + "Pv4Prefix\022\032\n\003val\030\001 \001(\tB\010\272H\005r\003\360\001\000R\003val\".\n" + + "\020StringIPv6Prefix\022\032\n\003val\030\001 \001(\tB\010\272H\005r\003\370\001\001" + + "R\003val\"1\n\023StringNotIPv6Prefix\022\032\n\003val\030\001 \001(" + + "\tB\010\272H\005r\003\370\001\000R\003val\"\'\n\tStringURI\022\032\n\003val\030\001 \001" + + "(\tB\010\272H\005r\003\210\001\001R\003val\"*\n\014StringNotURI\022\032\n\003val" + + "\030\001 \001(\tB\010\272H\005r\003\210\001\000R\003val\"*\n\014StringURIRef\022\032\n" + + "\003val\030\001 \001(\tB\010\272H\005r\003\220\001\001R\003val\"-\n\017StringNotUR" + + "IRef\022\032\n\003val\030\001 \001(\tB\010\272H\005r\003\220\001\000R\003val\"(\n\nStri" + + "ngUUID\022\032\n\003val\030\001 \001(\tB\010\272H\005r\003\260\001\001R\003val\"+\n\rSt" + + "ringNotUUID\022\032\n\003val\030\001 \001(\tB\010\272H\005r\003\260\001\000R\003val\"" + + ")\n\013StringTUUID\022\032\n\003val\030\001 \001(\tB\010\272H\005r\003\210\002\001R\003v" + + "al\",\n\016StringNotTUUID\022\032\n\003val\030\001 \001(\tB\010\272H\005r\003" + + "\210\002\000R\003val\"2\n\024StringHttpHeaderName\022\032\n\003val\030" + + "\001 \001(\tB\010\272H\005r\003\300\001\001R\003val\"3\n\025StringHttpHeader" + + "Value\022\032\n\003val\030\001 \001(\tB\010\272H\005r\003\300\001\002R\003val\":\n\031Str" + + "ingHttpHeaderNameLoose\022\035\n\003val\030\001 \001(\tB\013\272H\010" + + "r\006\300\001\001\310\001\000R\003val\";\n\032StringHttpHeaderValueLo" + + "ose\022\035\n\003val\030\001 \001(\tB\013\272H\010r\006\300\001\002\310\001\000R\003val\"1\n\020St" + + "ringUUIDIgnore\022\035\n\003val\030\001 \001(\tB\013\272H\010r\003\260\001\001\320\001\001" + + "R\003val\"7\n\rStringInOneof\022\037\n\003bar\030\001 \001(\tB\013\272H\010" + + "r\006R\001aR\001bH\000R\003barB\005\n\003foo\"/\n\021StringHostAndP" + + "ort\022\032\n\003val\030\001 \001(\tB\010\272H\005r\003\200\002\001R\003val\"\244\001\n\031Stri" + + "ngHostAndOptionalPort\022\206\001\n\003val\030\001 \001(\tBt\272Hq" + + "\272\001n\n\"string.host_and_port.optional_port\022" + + "-value must be a host and (optional) por" + + "t pair\032\031this.isHostAndPort(false)R\003val\"." + + "\n\rStringExample\022\035\n\003val\030\001 \001(\tB\013\272H\010r\006\222\002\003fo" + + "oR\003valB\320\001\n$build.buf.validate.conformanc" + + "e.casesB\014StringsProtoP\001\242\002\004BVCC\252\002\036Buf.Val" + + "idate.Conformance.Cases\312\002\036Buf\\Validate\\C" + + "onformance\\Cases\342\002*Buf\\Validate\\Conforma" + + "nce\\Cases\\GPBMetadata\352\002!Buf::Validate::C" + + "onformance::Casesb\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor .internalBuildGeneratedFileFrom(descriptorData, @@ -450,144 +556,246 @@ public static void registerAllExtensions( com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_StringEmail_descriptor, new java.lang.String[] { "Val", }); - internal_static_buf_validate_conformance_cases_StringAddress_descriptor = + internal_static_buf_validate_conformance_cases_StringNotEmail_descriptor = getDescriptor().getMessageTypes().get(21); + internal_static_buf_validate_conformance_cases_StringNotEmail_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_StringNotEmail_descriptor, + new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_StringAddress_descriptor = + getDescriptor().getMessageTypes().get(22); internal_static_buf_validate_conformance_cases_StringAddress_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_StringAddress_descriptor, new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_StringNotAddress_descriptor = + getDescriptor().getMessageTypes().get(23); + internal_static_buf_validate_conformance_cases_StringNotAddress_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_StringNotAddress_descriptor, + new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_StringHostname_descriptor = - getDescriptor().getMessageTypes().get(22); + getDescriptor().getMessageTypes().get(24); internal_static_buf_validate_conformance_cases_StringHostname_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_StringHostname_descriptor, new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_StringNotHostname_descriptor = + getDescriptor().getMessageTypes().get(25); + internal_static_buf_validate_conformance_cases_StringNotHostname_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_StringNotHostname_descriptor, + new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_StringIP_descriptor = - getDescriptor().getMessageTypes().get(23); + getDescriptor().getMessageTypes().get(26); internal_static_buf_validate_conformance_cases_StringIP_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_StringIP_descriptor, new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_StringNotIP_descriptor = + getDescriptor().getMessageTypes().get(27); + internal_static_buf_validate_conformance_cases_StringNotIP_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_StringNotIP_descriptor, + new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_StringIPv4_descriptor = - getDescriptor().getMessageTypes().get(24); + getDescriptor().getMessageTypes().get(28); internal_static_buf_validate_conformance_cases_StringIPv4_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_StringIPv4_descriptor, new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_StringNotIPv4_descriptor = + getDescriptor().getMessageTypes().get(29); + internal_static_buf_validate_conformance_cases_StringNotIPv4_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_StringNotIPv4_descriptor, + new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_StringIPv6_descriptor = - getDescriptor().getMessageTypes().get(25); + getDescriptor().getMessageTypes().get(30); internal_static_buf_validate_conformance_cases_StringIPv6_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_StringIPv6_descriptor, new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_StringNotIPv6_descriptor = + getDescriptor().getMessageTypes().get(31); + internal_static_buf_validate_conformance_cases_StringNotIPv6_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_StringNotIPv6_descriptor, + new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_StringIPWithPrefixLen_descriptor = - getDescriptor().getMessageTypes().get(26); + getDescriptor().getMessageTypes().get(32); internal_static_buf_validate_conformance_cases_StringIPWithPrefixLen_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_StringIPWithPrefixLen_descriptor, new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_StringNotIPWithPrefixLen_descriptor = + getDescriptor().getMessageTypes().get(33); + internal_static_buf_validate_conformance_cases_StringNotIPWithPrefixLen_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_StringNotIPWithPrefixLen_descriptor, + new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_StringIPv4WithPrefixLen_descriptor = - getDescriptor().getMessageTypes().get(27); + getDescriptor().getMessageTypes().get(34); internal_static_buf_validate_conformance_cases_StringIPv4WithPrefixLen_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_StringIPv4WithPrefixLen_descriptor, new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_StringNotIPv4WithPrefixLen_descriptor = + getDescriptor().getMessageTypes().get(35); + internal_static_buf_validate_conformance_cases_StringNotIPv4WithPrefixLen_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_StringNotIPv4WithPrefixLen_descriptor, + new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_StringIPv6WithPrefixLen_descriptor = - getDescriptor().getMessageTypes().get(28); + getDescriptor().getMessageTypes().get(36); internal_static_buf_validate_conformance_cases_StringIPv6WithPrefixLen_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_StringIPv6WithPrefixLen_descriptor, new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_StringNotIPv6WithPrefixLen_descriptor = + getDescriptor().getMessageTypes().get(37); + internal_static_buf_validate_conformance_cases_StringNotIPv6WithPrefixLen_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_StringNotIPv6WithPrefixLen_descriptor, + new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_StringIPPrefix_descriptor = - getDescriptor().getMessageTypes().get(29); + getDescriptor().getMessageTypes().get(38); internal_static_buf_validate_conformance_cases_StringIPPrefix_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_StringIPPrefix_descriptor, new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_StringNotIPPrefix_descriptor = + getDescriptor().getMessageTypes().get(39); + internal_static_buf_validate_conformance_cases_StringNotIPPrefix_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_StringNotIPPrefix_descriptor, + new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_StringIPv4Prefix_descriptor = - getDescriptor().getMessageTypes().get(30); + getDescriptor().getMessageTypes().get(40); internal_static_buf_validate_conformance_cases_StringIPv4Prefix_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_StringIPv4Prefix_descriptor, new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_StringNotIPv4Prefix_descriptor = + getDescriptor().getMessageTypes().get(41); + internal_static_buf_validate_conformance_cases_StringNotIPv4Prefix_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_StringNotIPv4Prefix_descriptor, + new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_StringIPv6Prefix_descriptor = - getDescriptor().getMessageTypes().get(31); + getDescriptor().getMessageTypes().get(42); internal_static_buf_validate_conformance_cases_StringIPv6Prefix_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_StringIPv6Prefix_descriptor, new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_StringNotIPv6Prefix_descriptor = + getDescriptor().getMessageTypes().get(43); + internal_static_buf_validate_conformance_cases_StringNotIPv6Prefix_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_StringNotIPv6Prefix_descriptor, + new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_StringURI_descriptor = - getDescriptor().getMessageTypes().get(32); + getDescriptor().getMessageTypes().get(44); internal_static_buf_validate_conformance_cases_StringURI_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_StringURI_descriptor, new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_StringNotURI_descriptor = + getDescriptor().getMessageTypes().get(45); + internal_static_buf_validate_conformance_cases_StringNotURI_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_StringNotURI_descriptor, + new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_StringURIRef_descriptor = - getDescriptor().getMessageTypes().get(33); + getDescriptor().getMessageTypes().get(46); internal_static_buf_validate_conformance_cases_StringURIRef_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_StringURIRef_descriptor, new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_StringNotURIRef_descriptor = + getDescriptor().getMessageTypes().get(47); + internal_static_buf_validate_conformance_cases_StringNotURIRef_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_StringNotURIRef_descriptor, + new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_StringUUID_descriptor = - getDescriptor().getMessageTypes().get(34); + getDescriptor().getMessageTypes().get(48); internal_static_buf_validate_conformance_cases_StringUUID_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_StringUUID_descriptor, new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_StringNotUUID_descriptor = + getDescriptor().getMessageTypes().get(49); + internal_static_buf_validate_conformance_cases_StringNotUUID_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_StringNotUUID_descriptor, + new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_StringTUUID_descriptor = - getDescriptor().getMessageTypes().get(35); + getDescriptor().getMessageTypes().get(50); internal_static_buf_validate_conformance_cases_StringTUUID_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_StringTUUID_descriptor, new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_StringNotTUUID_descriptor = + getDescriptor().getMessageTypes().get(51); + internal_static_buf_validate_conformance_cases_StringNotTUUID_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_StringNotTUUID_descriptor, + new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_StringHttpHeaderName_descriptor = - getDescriptor().getMessageTypes().get(36); + getDescriptor().getMessageTypes().get(52); internal_static_buf_validate_conformance_cases_StringHttpHeaderName_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_StringHttpHeaderName_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_StringHttpHeaderValue_descriptor = - getDescriptor().getMessageTypes().get(37); + getDescriptor().getMessageTypes().get(53); internal_static_buf_validate_conformance_cases_StringHttpHeaderValue_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_StringHttpHeaderValue_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_StringHttpHeaderNameLoose_descriptor = - getDescriptor().getMessageTypes().get(38); + getDescriptor().getMessageTypes().get(54); internal_static_buf_validate_conformance_cases_StringHttpHeaderNameLoose_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_StringHttpHeaderNameLoose_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_StringHttpHeaderValueLoose_descriptor = - getDescriptor().getMessageTypes().get(39); + getDescriptor().getMessageTypes().get(55); internal_static_buf_validate_conformance_cases_StringHttpHeaderValueLoose_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_StringHttpHeaderValueLoose_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_StringUUIDIgnore_descriptor = - getDescriptor().getMessageTypes().get(40); + getDescriptor().getMessageTypes().get(56); internal_static_buf_validate_conformance_cases_StringUUIDIgnore_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_StringUUIDIgnore_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_StringInOneof_descriptor = - getDescriptor().getMessageTypes().get(41); + getDescriptor().getMessageTypes().get(57); internal_static_buf_validate_conformance_cases_StringInOneof_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_StringInOneof_descriptor, new java.lang.String[] { "Bar", "Foo", }); internal_static_buf_validate_conformance_cases_StringHostAndPort_descriptor = - getDescriptor().getMessageTypes().get(42); + getDescriptor().getMessageTypes().get(58); internal_static_buf_validate_conformance_cases_StringHostAndPort_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_StringHostAndPort_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_StringHostAndOptionalPort_descriptor = - getDescriptor().getMessageTypes().get(43); + getDescriptor().getMessageTypes().get(59); internal_static_buf_validate_conformance_cases_StringHostAndOptionalPort_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_StringHostAndOptionalPort_descriptor, new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_StringExample_descriptor = + getDescriptor().getMessageTypes().get(60); + internal_static_buf_validate_conformance_cases_StringExample_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_StringExample_descriptor, + new java.lang.String[] { "Val", }); descriptor.resolveAllFeaturesImmutable(); build.buf.validate.ValidateProto.getDescriptor(); com.google.protobuf.ExtensionRegistry registry = diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/TimestampExample.java b/conformance/src/main/java/build/buf/validate/conformance/cases/TimestampExample.java new file mode 100644 index 00000000..c7e4aefb --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/TimestampExample.java @@ -0,0 +1,558 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/wkt_timestamp.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.TimestampExample} + */ +public final class TimestampExample extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.TimestampExample) + TimestampExampleOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 1, + /* suffix= */ "", + TimestampExample.class.getName()); + } + // Use TimestampExample.newBuilder() to construct. + private TimestampExample(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private TimestampExample() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.WktTimestampProto.internal_static_buf_validate_conformance_cases_TimestampExample_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.WktTimestampProto.internal_static_buf_validate_conformance_cases_TimestampExample_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.TimestampExample.class, build.buf.validate.conformance.cases.TimestampExample.Builder.class); + } + + private int bitField0_; + public static final int VAL_FIELD_NUMBER = 1; + private com.google.protobuf.Timestamp val_; + /** + * .google.protobuf.Timestamp 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); + } + /** + * .google.protobuf.Timestamp val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getVal() { + return val_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : val_; + } + /** + * .google.protobuf.Timestamp val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getValOrBuilder() { + return val_ == null ? com.google.protobuf.Timestamp.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.TimestampExample)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.TimestampExample other = (build.buf.validate.conformance.cases.TimestampExample) 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.TimestampExample parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.TimestampExample 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.TimestampExample parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.TimestampExample 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.TimestampExample parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.TimestampExample 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.TimestampExample parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.TimestampExample 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.TimestampExample parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.TimestampExample 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.TimestampExample 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.TimestampExample 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.TimestampExample 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.TimestampExample} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.TimestampExample) + build.buf.validate.conformance.cases.TimestampExampleOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.WktTimestampProto.internal_static_buf_validate_conformance_cases_TimestampExample_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.WktTimestampProto.internal_static_buf_validate_conformance_cases_TimestampExample_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.TimestampExample.class, build.buf.validate.conformance.cases.TimestampExample.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.TimestampExample.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage + .alwaysUseFieldBuilders) { + getValFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + val_ = null; + if (valBuilder_ != null) { + valBuilder_.dispose(); + valBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.WktTimestampProto.internal_static_buf_validate_conformance_cases_TimestampExample_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.TimestampExample getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.TimestampExample.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.TimestampExample build() { + build.buf.validate.conformance.cases.TimestampExample result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.TimestampExample buildPartial() { + build.buf.validate.conformance.cases.TimestampExample result = new build.buf.validate.conformance.cases.TimestampExample(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.TimestampExample 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.TimestampExample) { + return mergeFrom((build.buf.validate.conformance.cases.TimestampExample)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.TimestampExample other) { + if (other == build.buf.validate.conformance.cases.TimestampExample.getDefaultInstance()) return this; + if (other.hasVal()) { + mergeVal(other.getVal()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + input.readMessage( + getValFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private com.google.protobuf.Timestamp val_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> valBuilder_; + /** + * .google.protobuf.Timestamp val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + public boolean hasVal() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * .google.protobuf.Timestamp val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + public com.google.protobuf.Timestamp getVal() { + if (valBuilder_ == null) { + return val_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : val_; + } else { + return valBuilder_.getMessage(); + } + } + /** + * .google.protobuf.Timestamp val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder setVal(com.google.protobuf.Timestamp value) { + if (valBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + val_ = value; + } else { + valBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * .google.protobuf.Timestamp val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder setVal( + com.google.protobuf.Timestamp.Builder builderForValue) { + if (valBuilder_ == null) { + val_ = builderForValue.build(); + } else { + valBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * .google.protobuf.Timestamp val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder mergeVal(com.google.protobuf.Timestamp value) { + if (valBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) && + val_ != null && + val_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getValBuilder().mergeFrom(value); + } else { + val_ = value; + } + } else { + valBuilder_.mergeFrom(value); + } + if (val_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + /** + * .google.protobuf.Timestamp 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; + } + /** + * .google.protobuf.Timestamp val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public com.google.protobuf.Timestamp.Builder getValBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getValFieldBuilder().getBuilder(); + } + /** + * .google.protobuf.Timestamp val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public com.google.protobuf.TimestampOrBuilder getValOrBuilder() { + if (valBuilder_ != null) { + return valBuilder_.getMessageOrBuilder(); + } else { + return val_ == null ? + com.google.protobuf.Timestamp.getDefaultInstance() : val_; + } + } + /** + * .google.protobuf.Timestamp val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> + getValFieldBuilder() { + if (valBuilder_ == null) { + valBuilder_ = new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>( + getVal(), + getParentForChildren(), + isClean()); + val_ = null; + } + return valBuilder_; + } + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.TimestampExample) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.TimestampExample) + private static final build.buf.validate.conformance.cases.TimestampExample DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.TimestampExample(); + } + + public static build.buf.validate.conformance.cases.TimestampExample getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TimestampExample 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.TimestampExample getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/TimestampExampleOrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/TimestampExampleOrBuilder.java new file mode 100644 index 00000000..db122a1a --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/TimestampExampleOrBuilder.java @@ -0,0 +1,26 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/wkt_timestamp.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +public interface TimestampExampleOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.TimestampExample) + com.google.protobuf.MessageOrBuilder { + + /** + * .google.protobuf.Timestamp val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + boolean hasVal(); + /** + * .google.protobuf.Timestamp val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + com.google.protobuf.Timestamp getVal(); + /** + * .google.protobuf.Timestamp val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + com.google.protobuf.TimestampOrBuilder getValOrBuilder(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/TimestampNotGTNow.java b/conformance/src/main/java/build/buf/validate/conformance/cases/TimestampNotGTNow.java new file mode 100644 index 00000000..d0b910d5 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/TimestampNotGTNow.java @@ -0,0 +1,558 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/wkt_timestamp.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.TimestampNotGTNow} + */ +public final class TimestampNotGTNow extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.TimestampNotGTNow) + TimestampNotGTNowOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 1, + /* suffix= */ "", + TimestampNotGTNow.class.getName()); + } + // Use TimestampNotGTNow.newBuilder() to construct. + private TimestampNotGTNow(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private TimestampNotGTNow() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.WktTimestampProto.internal_static_buf_validate_conformance_cases_TimestampNotGTNow_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.WktTimestampProto.internal_static_buf_validate_conformance_cases_TimestampNotGTNow_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.TimestampNotGTNow.class, build.buf.validate.conformance.cases.TimestampNotGTNow.Builder.class); + } + + private int bitField0_; + public static final int VAL_FIELD_NUMBER = 1; + private com.google.protobuf.Timestamp val_; + /** + * .google.protobuf.Timestamp 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); + } + /** + * .google.protobuf.Timestamp val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getVal() { + return val_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : val_; + } + /** + * .google.protobuf.Timestamp val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getValOrBuilder() { + return val_ == null ? com.google.protobuf.Timestamp.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.TimestampNotGTNow)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.TimestampNotGTNow other = (build.buf.validate.conformance.cases.TimestampNotGTNow) 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.TimestampNotGTNow parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.TimestampNotGTNow 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.TimestampNotGTNow parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.TimestampNotGTNow 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.TimestampNotGTNow parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.TimestampNotGTNow 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.TimestampNotGTNow parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.TimestampNotGTNow 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.TimestampNotGTNow parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.TimestampNotGTNow 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.TimestampNotGTNow 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.TimestampNotGTNow 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.TimestampNotGTNow 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.TimestampNotGTNow} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.TimestampNotGTNow) + build.buf.validate.conformance.cases.TimestampNotGTNowOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.WktTimestampProto.internal_static_buf_validate_conformance_cases_TimestampNotGTNow_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.WktTimestampProto.internal_static_buf_validate_conformance_cases_TimestampNotGTNow_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.TimestampNotGTNow.class, build.buf.validate.conformance.cases.TimestampNotGTNow.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.TimestampNotGTNow.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage + .alwaysUseFieldBuilders) { + getValFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + val_ = null; + if (valBuilder_ != null) { + valBuilder_.dispose(); + valBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.WktTimestampProto.internal_static_buf_validate_conformance_cases_TimestampNotGTNow_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.TimestampNotGTNow getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.TimestampNotGTNow.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.TimestampNotGTNow build() { + build.buf.validate.conformance.cases.TimestampNotGTNow result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.TimestampNotGTNow buildPartial() { + build.buf.validate.conformance.cases.TimestampNotGTNow result = new build.buf.validate.conformance.cases.TimestampNotGTNow(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.TimestampNotGTNow 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.TimestampNotGTNow) { + return mergeFrom((build.buf.validate.conformance.cases.TimestampNotGTNow)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.TimestampNotGTNow other) { + if (other == build.buf.validate.conformance.cases.TimestampNotGTNow.getDefaultInstance()) return this; + if (other.hasVal()) { + mergeVal(other.getVal()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + input.readMessage( + getValFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private com.google.protobuf.Timestamp val_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> valBuilder_; + /** + * .google.protobuf.Timestamp val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + public boolean hasVal() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * .google.protobuf.Timestamp val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + public com.google.protobuf.Timestamp getVal() { + if (valBuilder_ == null) { + return val_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : val_; + } else { + return valBuilder_.getMessage(); + } + } + /** + * .google.protobuf.Timestamp val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder setVal(com.google.protobuf.Timestamp value) { + if (valBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + val_ = value; + } else { + valBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * .google.protobuf.Timestamp val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder setVal( + com.google.protobuf.Timestamp.Builder builderForValue) { + if (valBuilder_ == null) { + val_ = builderForValue.build(); + } else { + valBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * .google.protobuf.Timestamp val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder mergeVal(com.google.protobuf.Timestamp value) { + if (valBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) && + val_ != null && + val_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getValBuilder().mergeFrom(value); + } else { + val_ = value; + } + } else { + valBuilder_.mergeFrom(value); + } + if (val_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + /** + * .google.protobuf.Timestamp 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; + } + /** + * .google.protobuf.Timestamp val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public com.google.protobuf.Timestamp.Builder getValBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getValFieldBuilder().getBuilder(); + } + /** + * .google.protobuf.Timestamp val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public com.google.protobuf.TimestampOrBuilder getValOrBuilder() { + if (valBuilder_ != null) { + return valBuilder_.getMessageOrBuilder(); + } else { + return val_ == null ? + com.google.protobuf.Timestamp.getDefaultInstance() : val_; + } + } + /** + * .google.protobuf.Timestamp val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> + getValFieldBuilder() { + if (valBuilder_ == null) { + valBuilder_ = new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>( + getVal(), + getParentForChildren(), + isClean()); + val_ = null; + } + return valBuilder_; + } + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.TimestampNotGTNow) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.TimestampNotGTNow) + private static final build.buf.validate.conformance.cases.TimestampNotGTNow DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.TimestampNotGTNow(); + } + + public static build.buf.validate.conformance.cases.TimestampNotGTNow getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TimestampNotGTNow 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.TimestampNotGTNow getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/TimestampNotGTNowOrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/TimestampNotGTNowOrBuilder.java new file mode 100644 index 00000000..ed888be9 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/TimestampNotGTNowOrBuilder.java @@ -0,0 +1,26 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/wkt_timestamp.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +public interface TimestampNotGTNowOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.TimestampNotGTNow) + com.google.protobuf.MessageOrBuilder { + + /** + * .google.protobuf.Timestamp val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + boolean hasVal(); + /** + * .google.protobuf.Timestamp val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + com.google.protobuf.Timestamp getVal(); + /** + * .google.protobuf.Timestamp val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + com.google.protobuf.TimestampOrBuilder getValOrBuilder(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/TimestampNotLTNow.java b/conformance/src/main/java/build/buf/validate/conformance/cases/TimestampNotLTNow.java new file mode 100644 index 00000000..f4d687ef --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/TimestampNotLTNow.java @@ -0,0 +1,558 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/wkt_timestamp.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.TimestampNotLTNow} + */ +public final class TimestampNotLTNow extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.TimestampNotLTNow) + TimestampNotLTNowOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 1, + /* suffix= */ "", + TimestampNotLTNow.class.getName()); + } + // Use TimestampNotLTNow.newBuilder() to construct. + private TimestampNotLTNow(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private TimestampNotLTNow() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.WktTimestampProto.internal_static_buf_validate_conformance_cases_TimestampNotLTNow_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.WktTimestampProto.internal_static_buf_validate_conformance_cases_TimestampNotLTNow_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.TimestampNotLTNow.class, build.buf.validate.conformance.cases.TimestampNotLTNow.Builder.class); + } + + private int bitField0_; + public static final int VAL_FIELD_NUMBER = 1; + private com.google.protobuf.Timestamp val_; + /** + * .google.protobuf.Timestamp 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); + } + /** + * .google.protobuf.Timestamp val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getVal() { + return val_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : val_; + } + /** + * .google.protobuf.Timestamp val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getValOrBuilder() { + return val_ == null ? com.google.protobuf.Timestamp.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.TimestampNotLTNow)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.TimestampNotLTNow other = (build.buf.validate.conformance.cases.TimestampNotLTNow) 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.TimestampNotLTNow parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.TimestampNotLTNow 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.TimestampNotLTNow parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.TimestampNotLTNow 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.TimestampNotLTNow parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.TimestampNotLTNow 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.TimestampNotLTNow parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.TimestampNotLTNow 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.TimestampNotLTNow parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.TimestampNotLTNow 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.TimestampNotLTNow 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.TimestampNotLTNow 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.TimestampNotLTNow 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.TimestampNotLTNow} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.TimestampNotLTNow) + build.buf.validate.conformance.cases.TimestampNotLTNowOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.WktTimestampProto.internal_static_buf_validate_conformance_cases_TimestampNotLTNow_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.WktTimestampProto.internal_static_buf_validate_conformance_cases_TimestampNotLTNow_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.TimestampNotLTNow.class, build.buf.validate.conformance.cases.TimestampNotLTNow.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.TimestampNotLTNow.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage + .alwaysUseFieldBuilders) { + getValFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + val_ = null; + if (valBuilder_ != null) { + valBuilder_.dispose(); + valBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.WktTimestampProto.internal_static_buf_validate_conformance_cases_TimestampNotLTNow_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.TimestampNotLTNow getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.TimestampNotLTNow.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.TimestampNotLTNow build() { + build.buf.validate.conformance.cases.TimestampNotLTNow result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.TimestampNotLTNow buildPartial() { + build.buf.validate.conformance.cases.TimestampNotLTNow result = new build.buf.validate.conformance.cases.TimestampNotLTNow(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.TimestampNotLTNow 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.TimestampNotLTNow) { + return mergeFrom((build.buf.validate.conformance.cases.TimestampNotLTNow)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.TimestampNotLTNow other) { + if (other == build.buf.validate.conformance.cases.TimestampNotLTNow.getDefaultInstance()) return this; + if (other.hasVal()) { + mergeVal(other.getVal()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + input.readMessage( + getValFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private com.google.protobuf.Timestamp val_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> valBuilder_; + /** + * .google.protobuf.Timestamp val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + public boolean hasVal() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * .google.protobuf.Timestamp val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + public com.google.protobuf.Timestamp getVal() { + if (valBuilder_ == null) { + return val_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : val_; + } else { + return valBuilder_.getMessage(); + } + } + /** + * .google.protobuf.Timestamp val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder setVal(com.google.protobuf.Timestamp value) { + if (valBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + val_ = value; + } else { + valBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * .google.protobuf.Timestamp val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder setVal( + com.google.protobuf.Timestamp.Builder builderForValue) { + if (valBuilder_ == null) { + val_ = builderForValue.build(); + } else { + valBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * .google.protobuf.Timestamp val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder mergeVal(com.google.protobuf.Timestamp value) { + if (valBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) && + val_ != null && + val_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getValBuilder().mergeFrom(value); + } else { + val_ = value; + } + } else { + valBuilder_.mergeFrom(value); + } + if (val_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + /** + * .google.protobuf.Timestamp 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; + } + /** + * .google.protobuf.Timestamp val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public com.google.protobuf.Timestamp.Builder getValBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getValFieldBuilder().getBuilder(); + } + /** + * .google.protobuf.Timestamp val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public com.google.protobuf.TimestampOrBuilder getValOrBuilder() { + if (valBuilder_ != null) { + return valBuilder_.getMessageOrBuilder(); + } else { + return val_ == null ? + com.google.protobuf.Timestamp.getDefaultInstance() : val_; + } + } + /** + * .google.protobuf.Timestamp val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> + getValFieldBuilder() { + if (valBuilder_ == null) { + valBuilder_ = new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>( + getVal(), + getParentForChildren(), + isClean()); + val_ = null; + } + return valBuilder_; + } + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.TimestampNotLTNow) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.TimestampNotLTNow) + private static final build.buf.validate.conformance.cases.TimestampNotLTNow DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.TimestampNotLTNow(); + } + + public static build.buf.validate.conformance.cases.TimestampNotLTNow getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TimestampNotLTNow 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.TimestampNotLTNow getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/TimestampNotLTNowOrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/TimestampNotLTNowOrBuilder.java new file mode 100644 index 00000000..10d31c97 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/TimestampNotLTNowOrBuilder.java @@ -0,0 +1,26 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/wkt_timestamp.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +public interface TimestampNotLTNowOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.TimestampNotLTNow) + com.google.protobuf.MessageOrBuilder { + + /** + * .google.protobuf.Timestamp val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + boolean hasVal(); + /** + * .google.protobuf.Timestamp val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + com.google.protobuf.Timestamp getVal(); + /** + * .google.protobuf.Timestamp val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + com.google.protobuf.TimestampOrBuilder getValOrBuilder(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/UInt32Example.java b/conformance/src/main/java/build/buf/validate/conformance/cases/UInt32Example.java new file mode 100644 index 00000000..0def6f30 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/UInt32Example.java @@ -0,0 +1,431 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/numbers.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.UInt32Example} + */ +public final class UInt32Example extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.UInt32Example) + UInt32ExampleOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 1, + /* suffix= */ "", + UInt32Example.class.getName()); + } + // Use UInt32Example.newBuilder() to construct. + private UInt32Example(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private UInt32Example() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.NumbersProto.internal_static_buf_validate_conformance_cases_UInt32Example_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.NumbersProto.internal_static_buf_validate_conformance_cases_UInt32Example_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.UInt32Example.class, build.buf.validate.conformance.cases.UInt32Example.Builder.class); + } + + public static final int VAL_FIELD_NUMBER = 1; + private int val_ = 0; + /** + * uint32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public int getVal() { + return val_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (val_ != 0) { + output.writeUInt32(1, val_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (val_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(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.UInt32Example)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.UInt32Example other = (build.buf.validate.conformance.cases.UInt32Example) obj; + + if (getVal() + != other.getVal()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + VAL_FIELD_NUMBER; + hash = (53 * hash) + getVal(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.UInt32Example parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.UInt32Example 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.UInt32Example parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.UInt32Example 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.UInt32Example parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.UInt32Example 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.UInt32Example parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.UInt32Example 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.UInt32Example parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.UInt32Example 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.UInt32Example 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.UInt32Example 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.UInt32Example 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.UInt32Example} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.UInt32Example) + build.buf.validate.conformance.cases.UInt32ExampleOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.NumbersProto.internal_static_buf_validate_conformance_cases_UInt32Example_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.NumbersProto.internal_static_buf_validate_conformance_cases_UInt32Example_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.UInt32Example.class, build.buf.validate.conformance.cases.UInt32Example.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.UInt32Example.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + val_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.NumbersProto.internal_static_buf_validate_conformance_cases_UInt32Example_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.UInt32Example getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.UInt32Example.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.UInt32Example build() { + build.buf.validate.conformance.cases.UInt32Example result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.UInt32Example buildPartial() { + build.buf.validate.conformance.cases.UInt32Example result = new build.buf.validate.conformance.cases.UInt32Example(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.UInt32Example 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.UInt32Example) { + return mergeFrom((build.buf.validate.conformance.cases.UInt32Example)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.UInt32Example other) { + if (other == build.buf.validate.conformance.cases.UInt32Example.getDefaultInstance()) return this; + if (other.getVal() != 0) { + setVal(other.getVal()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + val_ = input.readUInt32(); + bitField0_ |= 0x00000001; + break; + } // case 8 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private int val_ ; + /** + * uint32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public int getVal() { + return val_; + } + /** + * uint32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param value The val to set. + * @return This builder for chaining. + */ + public Builder setVal(int value) { + + val_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * uint32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return This builder for chaining. + */ + public Builder clearVal() { + bitField0_ = (bitField0_ & ~0x00000001); + val_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.UInt32Example) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.UInt32Example) + private static final build.buf.validate.conformance.cases.UInt32Example DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.UInt32Example(); + } + + public static build.buf.validate.conformance.cases.UInt32Example getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UInt32Example 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.UInt32Example getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/UInt32ExampleOrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/UInt32ExampleOrBuilder.java new file mode 100644 index 00000000..1fd457e3 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/UInt32ExampleOrBuilder.java @@ -0,0 +1,17 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/numbers.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +public interface UInt32ExampleOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.UInt32Example) + com.google.protobuf.MessageOrBuilder { + + /** + * uint32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + int getVal(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/UInt64Example.java b/conformance/src/main/java/build/buf/validate/conformance/cases/UInt64Example.java new file mode 100644 index 00000000..953c5df8 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/UInt64Example.java @@ -0,0 +1,432 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/numbers.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.UInt64Example} + */ +public final class UInt64Example extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.UInt64Example) + UInt64ExampleOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 1, + /* suffix= */ "", + UInt64Example.class.getName()); + } + // Use UInt64Example.newBuilder() to construct. + private UInt64Example(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private UInt64Example() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.NumbersProto.internal_static_buf_validate_conformance_cases_UInt64Example_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.NumbersProto.internal_static_buf_validate_conformance_cases_UInt64Example_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.UInt64Example.class, build.buf.validate.conformance.cases.UInt64Example.Builder.class); + } + + public static final int VAL_FIELD_NUMBER = 1; + private long val_ = 0L; + /** + * uint64 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public long getVal() { + return val_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (val_ != 0L) { + output.writeUInt64(1, val_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (val_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(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.UInt64Example)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.UInt64Example other = (build.buf.validate.conformance.cases.UInt64Example) obj; + + if (getVal() + != other.getVal()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + VAL_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getVal()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.UInt64Example parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.UInt64Example 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.UInt64Example parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.UInt64Example 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.UInt64Example parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.UInt64Example 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.UInt64Example parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.UInt64Example 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.UInt64Example parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.UInt64Example 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.UInt64Example 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.UInt64Example 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.UInt64Example 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.UInt64Example} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.UInt64Example) + build.buf.validate.conformance.cases.UInt64ExampleOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.NumbersProto.internal_static_buf_validate_conformance_cases_UInt64Example_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.NumbersProto.internal_static_buf_validate_conformance_cases_UInt64Example_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.UInt64Example.class, build.buf.validate.conformance.cases.UInt64Example.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.UInt64Example.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + val_ = 0L; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.NumbersProto.internal_static_buf_validate_conformance_cases_UInt64Example_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.UInt64Example getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.UInt64Example.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.UInt64Example build() { + build.buf.validate.conformance.cases.UInt64Example result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.UInt64Example buildPartial() { + build.buf.validate.conformance.cases.UInt64Example result = new build.buf.validate.conformance.cases.UInt64Example(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.UInt64Example 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.UInt64Example) { + return mergeFrom((build.buf.validate.conformance.cases.UInt64Example)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.UInt64Example other) { + if (other == build.buf.validate.conformance.cases.UInt64Example.getDefaultInstance()) return this; + if (other.getVal() != 0L) { + setVal(other.getVal()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + val_ = input.readUInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private long val_ ; + /** + * uint64 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public long getVal() { + return val_; + } + /** + * uint64 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param value The val to set. + * @return This builder for chaining. + */ + public Builder setVal(long value) { + + val_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * uint64 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return This builder for chaining. + */ + public Builder clearVal() { + bitField0_ = (bitField0_ & ~0x00000001); + val_ = 0L; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.UInt64Example) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.UInt64Example) + private static final build.buf.validate.conformance.cases.UInt64Example DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.UInt64Example(); + } + + public static build.buf.validate.conformance.cases.UInt64Example getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UInt64Example 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.UInt64Example getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/UInt64ExampleOrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/UInt64ExampleOrBuilder.java new file mode 100644 index 00000000..a93ca619 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/UInt64ExampleOrBuilder.java @@ -0,0 +1,17 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/numbers.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate.conformance.cases; + +public interface UInt64ExampleOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.UInt64Example) + com.google.protobuf.MessageOrBuilder { + + /** + * uint64 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + long getVal(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/WktDurationProto.java b/conformance/src/main/java/build/buf/validate/conformance/cases/WktDurationProto.java index 0c97448c..0cb96a45 100644 --- a/conformance/src/main/java/build/buf/validate/conformance/cases/WktDurationProto.java +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/WktDurationProto.java @@ -95,6 +95,11 @@ public static void registerAllExtensions( static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_buf_validate_conformance_cases_DurationFieldWithOtherFields_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_DurationExample_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_conformance_cases_DurationExample_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { @@ -135,12 +140,14 @@ public static void registerAllExtensions( "ithOtherFields\022H\n\014duration_val\030\001 \001(\0132\031.g" + "oogle.protobuf.DurationB\n\272H\007\252\001\004\"\002\010\001R\013dur" + "ationVal\022 \n\007int_val\030\002 \001(\005B\007\272H\004\032\002 \020R\006intV" + - "alB\324\001\n$build.buf.validate.conformance.ca" + - "sesB\020WktDurationProtoP\001\242\002\004BVCC\252\002\036Buf.Val" + - "idate.Conformance.Cases\312\002\036Buf\\Validate\\C" + - "onformance\\Cases\342\002*Buf\\Validate\\Conforma" + - "nce\\Cases\\GPBMetadata\352\002!Buf::Validate::C" + - "onformance::Casesb\006proto3" + "al\"J\n\017DurationExample\0227\n\003val\030\001 \001(\0132\031.goo" + + "gle.protobuf.DurationB\n\272H\007\252\001\004J\002\010\003R\003valB\324" + + "\001\n$build.buf.validate.conformance.casesB" + + "\020WktDurationProtoP\001\242\002\004BVCC\252\002\036Buf.Validat" + + "e.Conformance.Cases\312\002\036Buf\\Validate\\Confo" + + "rmance\\Cases\342\002*Buf\\Validate\\Conformance\\" + + "Cases\\GPBMetadata\352\002!Buf::Validate::Confo" + + "rmance::Casesb\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor .internalBuildGeneratedFileFrom(descriptorData, @@ -232,6 +239,12 @@ public static void registerAllExtensions( com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_DurationFieldWithOtherFields_descriptor, new java.lang.String[] { "DurationVal", "IntVal", }); + internal_static_buf_validate_conformance_cases_DurationExample_descriptor = + getDescriptor().getMessageTypes().get(14); + internal_static_buf_validate_conformance_cases_DurationExample_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_DurationExample_descriptor, + new java.lang.String[] { "Val", }); descriptor.resolveAllFeaturesImmutable(); build.buf.validate.ValidateProto.getDescriptor(); com.google.protobuf.DurationProto.getDescriptor(); diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/WktTimestampProto.java b/conformance/src/main/java/build/buf/validate/conformance/cases/WktTimestampProto.java index 6a75e67b..1d332643 100644 --- a/conformance/src/main/java/build/buf/validate/conformance/cases/WktTimestampProto.java +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/WktTimestampProto.java @@ -85,11 +85,21 @@ public static void registerAllExtensions( static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_buf_validate_conformance_cases_TimestampLTNow_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_TimestampNotLTNow_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_conformance_cases_TimestampNotLTNow_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_buf_validate_conformance_cases_TimestampGTNow_descriptor; static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_buf_validate_conformance_cases_TimestampGTNow_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_TimestampNotGTNow_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_conformance_cases_TimestampNotGTNow_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_buf_validate_conformance_cases_TimestampWithin_descriptor; static final @@ -105,6 +115,11 @@ public static void registerAllExtensions( static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_buf_validate_conformance_cases_TimestampGTNowWithin_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_TimestampExample_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_conformance_cases_TimestampExample_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { @@ -140,20 +155,26 @@ public static void registerAllExtensions( "l\030\001 \001(\0132\032.google.protobuf.TimestampB\017\272H\014" + "\262\001\t\"\002\010<2\003\010\220\034R\003val\"H\n\016TimestampLTNow\0226\n\003v" + "al\030\001 \001(\0132\032.google.protobuf.TimestampB\010\272H" + - "\005\262\001\0028\001R\003val\"H\n\016TimestampGTNow\0226\n\003val\030\001 \001" + - "(\0132\032.google.protobuf.TimestampB\010\272H\005\262\001\002@\001" + - "R\003val\"L\n\017TimestampWithin\0229\n\003val\030\001 \001(\0132\032." + - "google.protobuf.TimestampB\013\272H\010\262\001\005J\003\010\220\034R\003" + - "val\"S\n\024TimestampLTNowWithin\022;\n\003val\030\001 \001(\013" + - "2\032.google.protobuf.TimestampB\r\272H\n\262\001\0078\001J\003" + - "\010\220\034R\003val\"S\n\024TimestampGTNowWithin\022;\n\003val\030" + - "\001 \001(\0132\032.google.protobuf.TimestampB\r\272H\n\262\001" + - "\007@\001J\003\010\220\034R\003valB\325\001\n$build.buf.validate.con" + - "formance.casesB\021WktTimestampProtoP\001\242\002\004BV" + - "CC\252\002\036Buf.Validate.Conformance.Cases\312\002\036Bu" + - "f\\Validate\\Conformance\\Cases\342\002*Buf\\Valid" + - "ate\\Conformance\\Cases\\GPBMetadata\352\002!Buf:" + - ":Validate::Conformance::Casesb\006proto3" + "\005\262\001\0028\001R\003val\"K\n\021TimestampNotLTNow\0226\n\003val\030" + + "\001 \001(\0132\032.google.protobuf.TimestampB\010\272H\005\262\001" + + "\0028\000R\003val\"H\n\016TimestampGTNow\0226\n\003val\030\001 \001(\0132" + + "\032.google.protobuf.TimestampB\010\272H\005\262\001\002@\001R\003v" + + "al\"K\n\021TimestampNotGTNow\0226\n\003val\030\001 \001(\0132\032.g" + + "oogle.protobuf.TimestampB\010\272H\005\262\001\002@\000R\003val\"" + + "L\n\017TimestampWithin\0229\n\003val\030\001 \001(\0132\032.google" + + ".protobuf.TimestampB\013\272H\010\262\001\005J\003\010\220\034R\003val\"S\n" + + "\024TimestampLTNowWithin\022;\n\003val\030\001 \001(\0132\032.goo" + + "gle.protobuf.TimestampB\r\272H\n\262\001\0078\001J\003\010\220\034R\003v" + + "al\"S\n\024TimestampGTNowWithin\022;\n\003val\030\001 \001(\0132" + + "\032.google.protobuf.TimestampB\r\272H\n\262\001\007@\001J\003\010" + + "\220\034R\003val\"L\n\020TimestampExample\0228\n\003val\030\001 \001(\013" + + "2\032.google.protobuf.TimestampB\n\272H\007\262\001\004R\002\010\003" + + "R\003valB\325\001\n$build.buf.validate.conformance" + + ".casesB\021WktTimestampProtoP\001\242\002\004BVCC\252\002\036Buf" + + ".Validate.Conformance.Cases\312\002\036Buf\\Valida" + + "te\\Conformance\\Cases\342\002*Buf\\Validate\\Conf" + + "ormance\\Cases\\GPBMetadata\352\002!Buf::Validat" + + "e::Conformance::Casesb\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor .internalBuildGeneratedFileFrom(descriptorData, @@ -233,30 +254,48 @@ public static void registerAllExtensions( com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_TimestampLTNow_descriptor, new java.lang.String[] { "Val", }); - internal_static_buf_validate_conformance_cases_TimestampGTNow_descriptor = + internal_static_buf_validate_conformance_cases_TimestampNotLTNow_descriptor = getDescriptor().getMessageTypes().get(12); + internal_static_buf_validate_conformance_cases_TimestampNotLTNow_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_TimestampNotLTNow_descriptor, + new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_TimestampGTNow_descriptor = + getDescriptor().getMessageTypes().get(13); internal_static_buf_validate_conformance_cases_TimestampGTNow_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_TimestampGTNow_descriptor, new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_TimestampNotGTNow_descriptor = + getDescriptor().getMessageTypes().get(14); + internal_static_buf_validate_conformance_cases_TimestampNotGTNow_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_TimestampNotGTNow_descriptor, + new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_TimestampWithin_descriptor = - getDescriptor().getMessageTypes().get(13); + getDescriptor().getMessageTypes().get(15); internal_static_buf_validate_conformance_cases_TimestampWithin_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_TimestampWithin_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_TimestampLTNowWithin_descriptor = - getDescriptor().getMessageTypes().get(14); + getDescriptor().getMessageTypes().get(16); internal_static_buf_validate_conformance_cases_TimestampLTNowWithin_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_TimestampLTNowWithin_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_TimestampGTNowWithin_descriptor = - getDescriptor().getMessageTypes().get(15); + getDescriptor().getMessageTypes().get(17); internal_static_buf_validate_conformance_cases_TimestampGTNowWithin_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_TimestampGTNowWithin_descriptor, new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_TimestampExample_descriptor = + getDescriptor().getMessageTypes().get(18); + internal_static_buf_validate_conformance_cases_TimestampExample_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_TimestampExample_descriptor, + new java.lang.String[] { "Val", }); descriptor.resolveAllFeaturesImmutable(); build.buf.validate.ValidateProto.getDescriptor(); com.google.protobuf.TimestampProto.getDescriptor(); diff --git a/conformance/src/main/java/build/buf/validate/conformance/harness/HarnessProto.java b/conformance/src/main/java/build/buf/validate/conformance/harness/HarnessProto.java index 0e05a8a8..69eaa566 100644 --- a/conformance/src/main/java/build/buf/validate/conformance/harness/HarnessProto.java +++ b/conformance/src/main/java/build/buf/validate/conformance/harness/HarnessProto.java @@ -61,38 +61,38 @@ public static void registerAllExtensions( java.lang.String[] descriptorData = { "\n.buf/validate/conformance/harness/harne" + "ss.proto\022 buf.validate.conformance.harne" + - "ss\032\035buf/validate/expression.proto\032\031googl" + - "e/protobuf/any.proto\032 google/protobuf/de" + - "scriptor.proto\"\375\001\n\026TestConformanceReques" + - "t\0228\n\005fdset\030\002 \001(\0132\".google.protobuf.FileD" + - "escriptorSetR\005fdset\022Y\n\005cases\030\003 \003(\0132C.buf" + - ".validate.conformance.harness.TestConfor" + - "manceRequest.CasesEntryR\005cases\032N\n\nCasesE" + - "ntry\022\020\n\003key\030\001 \001(\tR\003key\022*\n\005value\030\002 \001(\0132\024." + - "google.protobuf.AnyR\005value:\0028\001\"\345\001\n\027TestC" + - "onformanceResponse\022`\n\007results\030\001 \003(\0132F.bu" + - "f.validate.conformance.harness.TestConfo" + - "rmanceResponse.ResultsEntryR\007results\032h\n\014" + - "ResultsEntry\022\020\n\003key\030\001 \001(\tR\003key\022B\n\005value\030" + - "\002 \001(\0132,.buf.validate.conformance.harness" + - ".TestResultR\005value:\0028\001\"\374\001\n\nTestResult\022\032\n" + - "\007success\030\001 \001(\010H\000R\007success\022E\n\020validation_" + - "error\030\002 \001(\0132\030.buf.validate.ViolationsH\000R" + - "\017validationError\022-\n\021compilation_error\030\003 " + - "\001(\tH\000R\020compilationError\022%\n\rruntime_error" + - "\030\004 \001(\tH\000R\014runtimeError\022+\n\020unexpected_err" + - "or\030\005 \001(\tH\000R\017unexpectedErrorB\010\n\006resultB\332\001" + - "\n&build.buf.validate.conformance.harness" + - "B\014HarnessProtoP\001\242\002\004BVCH\252\002 Buf.Validate.C" + - "onformance.Harness\312\002 Buf\\Validate\\Confor" + - "mance\\Harness\342\002,Buf\\Validate\\Conformance" + - "\\Harness\\GPBMetadata\352\002#Buf::Validate::Co" + - "nformance::Harnessb\006proto3" + "ss\032\033buf/validate/validate.proto\032\031google/" + + "protobuf/any.proto\032 google/protobuf/desc" + + "riptor.proto\"\375\001\n\026TestConformanceRequest\022" + + "8\n\005fdset\030\002 \001(\0132\".google.protobuf.FileDes" + + "criptorSetR\005fdset\022Y\n\005cases\030\003 \003(\0132C.buf.v" + + "alidate.conformance.harness.TestConforma" + + "nceRequest.CasesEntryR\005cases\032N\n\nCasesEnt" + + "ry\022\020\n\003key\030\001 \001(\tR\003key\022*\n\005value\030\002 \001(\0132\024.go" + + "ogle.protobuf.AnyR\005value:\0028\001\"\345\001\n\027TestCon" + + "formanceResponse\022`\n\007results\030\001 \003(\0132F.buf." + + "validate.conformance.harness.TestConform" + + "anceResponse.ResultsEntryR\007results\032h\n\014Re" + + "sultsEntry\022\020\n\003key\030\001 \001(\tR\003key\022B\n\005value\030\002 " + + "\001(\0132,.buf.validate.conformance.harness.T" + + "estResultR\005value:\0028\001\"\374\001\n\nTestResult\022\032\n\007s" + + "uccess\030\001 \001(\010H\000R\007success\022E\n\020validation_er" + + "ror\030\002 \001(\0132\030.buf.validate.ViolationsH\000R\017v" + + "alidationError\022-\n\021compilation_error\030\003 \001(" + + "\tH\000R\020compilationError\022%\n\rruntime_error\030\004" + + " \001(\tH\000R\014runtimeError\022+\n\020unexpected_error" + + "\030\005 \001(\tH\000R\017unexpectedErrorB\010\n\006resultB\332\001\n&" + + "build.buf.validate.conformance.harnessB\014" + + "HarnessProtoP\001\242\002\004BVCH\252\002 Buf.Validate.Con" + + "formance.Harness\312\002 Buf\\Validate\\Conforma" + + "nce\\Harness\342\002,Buf\\Validate\\Conformance\\H" + + "arness\\GPBMetadata\352\002#Buf::Validate::Conf" + + "ormance::Harnessb\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor .internalBuildGeneratedFileFrom(descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] { - build.buf.validate.ExpressionProto.getDescriptor(), + build.buf.validate.ValidateProto.getDescriptor(), com.google.protobuf.AnyProto.getDescriptor(), com.google.protobuf.DescriptorProtos.getDescriptor(), }); @@ -127,7 +127,7 @@ public static void registerAllExtensions( internal_static_buf_validate_conformance_harness_TestResult_descriptor, new java.lang.String[] { "Success", "ValidationError", "CompilationError", "RuntimeError", "UnexpectedError", "Result", }); descriptor.resolveAllFeaturesImmutable(); - build.buf.validate.ExpressionProto.getDescriptor(); + build.buf.validate.ValidateProto.getDescriptor(); com.google.protobuf.AnyProto.getDescriptor(); com.google.protobuf.DescriptorProtos.getDescriptor(); } diff --git a/gradle.properties b/gradle.properties index ea9eade8..55d6e2f0 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,5 @@ # Version of buf.build/bufbuild/protovalidate to use. -protovalidate.version = v0.7.1 +protovalidate.version = v0.8.1 # Arguments to the protovalidate-conformance CLI protovalidate.conformance.args = --strict_message --strict_error diff --git a/src/main/java/build/buf/protovalidate/Config.java b/src/main/java/build/buf/protovalidate/Config.java index b4fa1aeb..559b5b80 100644 --- a/src/main/java/build/buf/protovalidate/Config.java +++ b/src/main/java/build/buf/protovalidate/Config.java @@ -14,14 +14,32 @@ package build.buf.protovalidate; +import com.google.protobuf.ExtensionRegistry; +import com.google.protobuf.TypeRegistry; + /** Config is the configuration for a Validator. */ public final class Config { + private static final TypeRegistry DEFAULT_TYPE_REGISTRY = TypeRegistry.getEmptyTypeRegistry(); + private static final ExtensionRegistry DEFAULT_EXTENSION_REGISTRY = + ExtensionRegistry.getEmptyRegistry(); + private final boolean failFast; private final boolean disableLazy; + private final TypeRegistry typeRegistry; + private final ExtensionRegistry extensionRegistry; + private final boolean allowUnknownFields; - private Config(boolean failFast, boolean disableLazy) { + private Config( + boolean failFast, + boolean disableLazy, + TypeRegistry typeRegistry, + ExtensionRegistry extensionRegistry, + boolean allowUnknownFields) { this.failFast = failFast; this.disableLazy = disableLazy; + this.typeRegistry = typeRegistry; + this.extensionRegistry = extensionRegistry; + this.allowUnknownFields = allowUnknownFields; } /** @@ -51,10 +69,40 @@ public boolean isDisableLazy() { return disableLazy; } + /** + * Gets the type registry used for reparsing protobuf messages. + * + * @return a type registry + */ + public TypeRegistry getTypeRegistry() { + return typeRegistry; + } + + /** + * Gets the extension registry used for resolving unknown protobuf extensions. + * + * @return an extension registry + */ + public ExtensionRegistry getExtensionRegistry() { + return extensionRegistry; + } + + /** + * Checks if the configuration for allowing unknown constraint fields is enabled. + * + * @return if allowing unknown constraint fields is enabled + */ + public boolean isAllowingUnknownFields() { + return allowUnknownFields; + } + /** Builder for configuration. Provides a forward compatible API for users. */ public static final class Builder { private boolean failFast; private boolean disableLazy; + private TypeRegistry typeRegistry = DEFAULT_TYPE_REGISTRY; + private ExtensionRegistry extensionRegistry = DEFAULT_EXTENSION_REGISTRY; + private boolean allowUnknownFields; private Builder() {} @@ -80,13 +128,67 @@ public Builder setDisableLazy(boolean disableLazy) { return this; } + /** + * Set the type registry for reparsing protobuf messages. This option should be set alongside + * setExtensionRegistry to allow dynamic resolution of predefined rule extensions. It should be + * set to a TypeRegistry with all the message types from your file descriptor set registered. By + * default, if any unknown field constraints are found, compilation of the constraints will + * fail; use setAllowUnknownFields to control this behavior. + * + *

Note that the message types for any extensions in setExtensionRegistry must be present in + * the typeRegistry, and have an exactly-equal Descriptor. If the type registry is not set, the + * extension types in the extension registry must have exactly-equal Descriptor types to the + * protovalidate built-in messages. If these conditions are not met, extensions will not be + * resolved as expected. These conditions will be met when constructing a TypeRegistry and + * ExtensionRegistry using information from the same file descriptor sets. + * + * @param typeRegistry the type registry to use + * @return this builder + */ + public Builder setTypeRegistry(TypeRegistry typeRegistry) { + this.typeRegistry = typeRegistry; + return this; + } + + /** + * Set the extension registry for resolving unknown extensions. This option should be set + * alongside setTypeRegistry to allow dynamic resolution of predefined rule extensions. It + * should be set to an ExtensionRegistry with all the extension types from your file descriptor + * set registered. By default, if any unknown field constraints are found, compilation of the + * constraints will fail; use setAllowUnknownFields to control this behavior. + * + * @param extensionRegistry the extension registry to use + * @return this builder + */ + public Builder setExtensionRegistry(ExtensionRegistry extensionRegistry) { + this.extensionRegistry = extensionRegistry; + return this; + } + + /** + * Set whether unknown constraint fields are allowed. If this setting is set to true, unknown + * standard predefined field constraints and predefined field constraint extensions will be + * ignored. This setting defaults to false, which will result in a CompilationException being + * thrown whenever an unknown field constraint is encountered. Setting this to true will cause + * some field constraints to be ignored; if the descriptor is dynamic, you can instead use + * setExtensionRegistry to provide dynamic type information that protovalidate can use to + * resolve the unknown fields. + * + * @param allowUnknownFields setting to apply + * @return this builder + */ + public Builder setAllowUnknownFields(boolean allowUnknownFields) { + this.allowUnknownFields = allowUnknownFields; + return this; + } + /** * Build the corresponding {@link Config}. * * @return the configuration. */ public Config build() { - return new Config(failFast, disableLazy); + return new Config(failFast, disableLazy, typeRegistry, extensionRegistry, allowUnknownFields); } } } diff --git a/src/main/java/build/buf/protovalidate/Validator.java b/src/main/java/build/buf/protovalidate/Validator.java index 979d686f..61d43adb 100644 --- a/src/main/java/build/buf/protovalidate/Validator.java +++ b/src/main/java/build/buf/protovalidate/Validator.java @@ -43,7 +43,7 @@ public class Validator { */ public Validator(Config config) { Env env = Env.newEnv(Library.Lib(new ValidateLibrary())); - this.evaluatorBuilder = new EvaluatorBuilder(env, config.isDisableLazy()); + this.evaluatorBuilder = new EvaluatorBuilder(env, config); this.failFast = config.isFailFast(); } @@ -51,7 +51,7 @@ public Validator(Config config) { public Validator() { Config config = Config.newBuilder().build(); Env env = Env.newEnv(Library.Lib(new ValidateLibrary())); - this.evaluatorBuilder = new EvaluatorBuilder(env, config.isDisableLazy()); + this.evaluatorBuilder = new EvaluatorBuilder(env, config); this.failFast = config.isFailFast(); } diff --git a/src/main/java/build/buf/protovalidate/internal/constraints/ConstraintCache.java b/src/main/java/build/buf/protovalidate/internal/constraints/ConstraintCache.java index 40fa96bd..1881a882 100644 --- a/src/main/java/build/buf/protovalidate/internal/constraints/ConstraintCache.java +++ b/src/main/java/build/buf/protovalidate/internal/constraints/ConstraintCache.java @@ -14,15 +14,23 @@ package build.buf.protovalidate.internal.constraints; +import build.buf.protovalidate.Config; import build.buf.protovalidate.exceptions.CompilationException; import build.buf.protovalidate.internal.expression.AstExpression; import build.buf.protovalidate.internal.expression.CompiledProgram; import build.buf.protovalidate.internal.expression.Expression; import build.buf.protovalidate.internal.expression.Variable; import build.buf.validate.FieldConstraints; -import build.buf.validate.priv.PrivateProto; +import build.buf.validate.ValidateProto; +import com.google.protobuf.DescriptorProtos; +import com.google.protobuf.Descriptors; import com.google.protobuf.Descriptors.FieldDescriptor; +import com.google.protobuf.DynamicMessage; +import com.google.protobuf.ExtensionRegistry; +import com.google.protobuf.InvalidProtocolBufferException; import com.google.protobuf.Message; +import com.google.protobuf.MessageLite; +import com.google.protobuf.TypeRegistry; import java.util.ArrayList; import java.util.Collections; import java.util.List; @@ -41,6 +49,22 @@ /** A build-through cache for computed standard constraints. */ public class ConstraintCache { + private static class CelRule { + public final AstExpression astExpression; + public final FieldDescriptor field; + + public CelRule(AstExpression astExpression, FieldDescriptor field) { + this.astExpression = astExpression; + this.field = field; + } + } + + private static final ExtensionRegistry EXTENSION_REGISTRY = ExtensionRegistry.newInstance(); + + static { + EXTENSION_REGISTRY.add(ValidateProto.predefined); + } + /** Partial eval options for evaluating the constraint's expression. */ private static final ProgramOption PARTIAL_EVAL_OPTIONS = ProgramOption.evalOptions( @@ -53,19 +77,33 @@ public class ConstraintCache { * Concurrent map for caching {@link FieldDescriptor} and their associated List of {@link * AstExpression}. */ - private static final Map> descriptorMap = + private static final Map> descriptorMap = new ConcurrentHashMap<>(); /** The environment to use for evaluation. */ private final Env env; + /** Registry used to resolve dynamic messages. */ + private final TypeRegistry typeRegistry; + + /** Registry used to resolve dynamic extensions. */ + private final ExtensionRegistry extensionRegistry; + + /** Whether to allow unknown constraint fields or not. */ + private final boolean allowUnknownFields; + /** - * Constructs a new build-through cache for the standard constraints. + * Constructs a new build-through cache for the standard constraints, with a provided registry to + * resolve dynamic extensions. * * @param env The CEL environment for evaluation. + * @param config The configuration to use for the constraint cache. */ - public ConstraintCache(Env env) { + public ConstraintCache(Env env, Config config) { this.env = env; + this.typeRegistry = config.getTypeRegistry(); + this.extensionRegistry = config.getExtensionRegistry(); + this.allowUnknownFields = config.isAllowingUnknownFields(); } /** @@ -86,36 +124,21 @@ public List compile( // Message null means there were no constraints resolved. return Collections.emptyList(); } - Env finalEnv = - env.extend( - EnvOption.types(message.getDefaultInstanceForType()), - EnvOption.declarations( - Decls.newVar( - Variable.THIS_NAME, DescriptorMappings.getCELType(fieldDescriptor, forItems)), - Decls.newVar( - Variable.RULES_NAME, - Decls.newObjectType(message.getDescriptorForType().getFullName())))); - ProgramOption rulesOption = ProgramOption.globals(Variable.newRulesVariable(message)); - List completeProgramList = new ArrayList<>(); + List completeProgramList = new ArrayList<>(); for (Map.Entry entry : message.getAllFields().entrySet()) { FieldDescriptor constraintFieldDesc = entry.getKey(); - if (!descriptorMap.containsKey(constraintFieldDesc)) { - build.buf.validate.priv.FieldConstraints constraints = - constraintFieldDesc.getOptions().getExtension(PrivateProto.field); - List expressions = Expression.fromPrivConstraints(constraints.getCelList()); - List astExpressions = new ArrayList<>(); - for (Expression expression : expressions) { - astExpressions.add(AstExpression.newAstExpression(finalEnv, expression)); - } - descriptorMap.put(constraintFieldDesc, astExpressions); - } - List programList = descriptorMap.get(constraintFieldDesc); + List programList = + compileRule(fieldDescriptor, forItems, constraintFieldDesc, message); + if (programList == null) continue; completeProgramList.addAll(programList); } List programs = new ArrayList<>(); - for (AstExpression astExpression : completeProgramList) { + for (CelRule rule : completeProgramList) { + Env ruleEnv = getRuleEnv(fieldDescriptor, message, rule.field, forItems); + Variable ruleVar = Variable.newRuleVariable(message, message.getField(rule.field)); + ProgramOption globals = ProgramOption.globals(ruleVar); try { - Program program = finalEnv.program(astExpression.ast, rulesOption, PARTIAL_EVAL_OPTIONS); + Program program = ruleEnv.program(rule.astExpression.ast, globals, PARTIAL_EVAL_OPTIONS); Program.EvalResult evalResult = program.eval(Activation.emptyActivation()); Val value = evalResult.getVal(); if (value != null) { @@ -127,18 +150,102 @@ public List compile( continue; } } - Ast residual = finalEnv.residualAst(astExpression.ast, evalResult.getEvalDetails()); + Ast residual = ruleEnv.residualAst(rule.astExpression.ast, evalResult.getEvalDetails()); programs.add( - new CompiledProgram(finalEnv.program(residual, rulesOption), astExpression.source)); + new CompiledProgram(ruleEnv.program(residual, globals), rule.astExpression.source)); } catch (Exception e) { programs.add( new CompiledProgram( - finalEnv.program(astExpression.ast, rulesOption), astExpression.source)); + ruleEnv.program(rule.astExpression.ast, globals), rule.astExpression.source)); } } return Collections.unmodifiableList(programs); } + private @Nullable List compileRule( + FieldDescriptor fieldDescriptor, + boolean forItems, + FieldDescriptor constraintFieldDesc, + Message message) + throws CompilationException { + List celRules = descriptorMap.get(fieldDescriptor); + if (celRules != null) { + return celRules; + } + build.buf.validate.PredefinedConstraints constraints = getFieldConstraints(constraintFieldDesc); + if (constraints == null) return null; + List expressions = Expression.fromConstraints(constraints.getCelList()); + celRules = new ArrayList<>(expressions.size()); + Env ruleEnv = getRuleEnv(fieldDescriptor, message, constraintFieldDesc, forItems); + for (Expression expression : expressions) { + celRules.add( + new CelRule(AstExpression.newAstExpression(ruleEnv, expression), constraintFieldDesc)); + } + descriptorMap.put(constraintFieldDesc, celRules); + return celRules; + } + + private @Nullable build.buf.validate.PredefinedConstraints getFieldConstraints( + FieldDescriptor constraintFieldDesc) throws CompilationException { + DescriptorProtos.FieldOptions options = constraintFieldDesc.getOptions(); + // If the protovalidate field option is unknown, reparse options using our extension registry. + if (options.getUnknownFields().hasField(ValidateProto.predefined.getNumber())) { + try { + options = + DescriptorProtos.FieldOptions.parseFrom(options.toByteString(), EXTENSION_REGISTRY); + } catch (InvalidProtocolBufferException e) { + throw new CompilationException("Failed to parse field options", e); + } + } + if (!options.hasExtension(ValidateProto.predefined)) { + return null; + } + Object extensionValue = options.getField(ValidateProto.predefined.getDescriptor()); + build.buf.validate.PredefinedConstraints constraints; + if (extensionValue instanceof build.buf.validate.PredefinedConstraints) { + constraints = (build.buf.validate.PredefinedConstraints) extensionValue; + } else if (extensionValue instanceof MessageLite) { + // Extension is parsed but with different gencode. We need to reparse it. + try { + constraints = + build.buf.validate.PredefinedConstraints.parseFrom( + ((MessageLite) extensionValue).toByteString()); + } catch (InvalidProtocolBufferException e) { + throw new CompilationException("Failed to parse field constraints", e); + } + } else { + // Extension was not a message, just discard it. + return null; + } + return constraints; + } + + /** + * Calculates the environment for a specific rule invocation. + * + * @param fieldDescriptor The field descriptor of the field with the constraint. + * @param constraintMessage The message of the standard constraints. + * @param constraintFieldDesc The field descriptor of the constraint. + * @param forItems Whether the field is a list type or not. + * @return An environment with requisite declarations and types added. + */ + private Env getRuleEnv( + FieldDescriptor fieldDescriptor, + Message constraintMessage, + FieldDescriptor constraintFieldDesc, + boolean forItems) { + return env.extend( + EnvOption.types(constraintMessage.getDefaultInstanceForType()), + EnvOption.declarations( + Decls.newVar( + Variable.THIS_NAME, DescriptorMappings.getCELType(fieldDescriptor, forItems)), + Decls.newVar( + Variable.RULES_NAME, + Decls.newObjectType(constraintMessage.getDescriptorForType().getFullName())), + Decls.newVar( + Variable.RULE_NAME, DescriptorMappings.getCELType(constraintFieldDesc, forItems)))); + } + /** * Extracts the standard constraints for the specified field. An exception is thrown if the wrong * constraints are applied to a field (typically if there is a type-mismatch). Null is returned if @@ -179,8 +286,33 @@ private Message resolveConstraints( return null; } - // Return the field from the field constraints identified by the oneof field descriptor, casted + // Get the field from the field constraints identified by the oneof field descriptor, casted // as a Message. - return (Message) fieldConstraints.getField(oneofFieldDescriptor); + Message typeConstraints = (Message) fieldConstraints.getField(oneofFieldDescriptor); + if (!typeConstraints.getUnknownFields().isEmpty()) { + // If there are unknown fields, try to resolve them using the provided registries. Note that + // we use the type registry to resolve the message descriptor. This is because Java protobuf + // extension resolution relies on descriptor identity. The user's provided type registry can + // provide matching message descriptors for the user's provided extension registry. See the + // documentation for Options.setTypeRegistry for more information. + Descriptors.Descriptor expectedConstraintMessageDescriptor = + typeRegistry.find(expectedConstraintDescriptor.getMessageType().getFullName()); + if (expectedConstraintMessageDescriptor == null) { + expectedConstraintMessageDescriptor = expectedConstraintDescriptor.getMessageType(); + } + try { + typeConstraints = + DynamicMessage.parseFrom( + expectedConstraintMessageDescriptor, + typeConstraints.toByteString(), + extensionRegistry); + } catch (InvalidProtocolBufferException e) { + throw new RuntimeException(e); + } + } + if (!allowUnknownFields && !typeConstraints.getUnknownFields().isEmpty()) { + throw new CompilationException("unrecognized field constraints"); + } + return typeConstraints; } } diff --git a/src/main/java/build/buf/protovalidate/internal/evaluator/ConstraintResolver.java b/src/main/java/build/buf/protovalidate/internal/evaluator/ConstraintResolver.java index 282e065a..b94cfb8e 100644 --- a/src/main/java/build/buf/protovalidate/internal/evaluator/ConstraintResolver.java +++ b/src/main/java/build/buf/protovalidate/internal/evaluator/ConstraintResolver.java @@ -29,6 +29,13 @@ /** Manages the resolution of protovalidate constraints. */ class ConstraintResolver { + private static final ExtensionRegistry EXTENSION_REGISTRY = ExtensionRegistry.newInstance(); + + static { + EXTENSION_REGISTRY.add(ValidateProto.message); + EXTENSION_REGISTRY.add(ValidateProto.oneof); + EXTENSION_REGISTRY.add(ValidateProto.field); + } /** * Resolves the constraints for a message descriptor. @@ -36,12 +43,13 @@ class ConstraintResolver { * @param desc the message descriptor. * @return the resolved {@link MessageConstraints}. */ - MessageConstraints resolveMessageConstraints(Descriptor desc, ExtensionRegistry registry) + MessageConstraints resolveMessageConstraints(Descriptor desc) throws InvalidProtocolBufferException, CompilationException { DescriptorProtos.MessageOptions options = desc.getOptions(); // If the protovalidate message extension is unknown, reparse using extension registry. if (options.getUnknownFields().hasField(ValidateProto.message.getNumber())) { - options = DescriptorProtos.MessageOptions.parseFrom(options.toByteString(), registry); + options = + DescriptorProtos.MessageOptions.parseFrom(options.toByteString(), EXTENSION_REGISTRY); } if (!options.hasExtension(ValidateProto.message)) { return MessageConstraints.getDefaultInstance(); @@ -66,12 +74,12 @@ MessageConstraints resolveMessageConstraints(Descriptor desc, ExtensionRegistry * @param desc the oneof descriptor. * @return the resolved {@link OneofConstraints}. */ - OneofConstraints resolveOneofConstraints(OneofDescriptor desc, ExtensionRegistry registry) + OneofConstraints resolveOneofConstraints(OneofDescriptor desc) throws InvalidProtocolBufferException, CompilationException { DescriptorProtos.OneofOptions options = desc.getOptions(); // If the protovalidate oneof extension is unknown, reparse using extension registry. if (options.getUnknownFields().hasField(ValidateProto.oneof.getNumber())) { - options = DescriptorProtos.OneofOptions.parseFrom(options.toByteString(), registry); + options = DescriptorProtos.OneofOptions.parseFrom(options.toByteString(), EXTENSION_REGISTRY); } if (!options.hasExtension(ValidateProto.oneof)) { return OneofConstraints.getDefaultInstance(); @@ -96,12 +104,12 @@ OneofConstraints resolveOneofConstraints(OneofDescriptor desc, ExtensionRegistry * @param desc the field descriptor. * @return the resolved {@link FieldConstraints}. */ - FieldConstraints resolveFieldConstraints(FieldDescriptor desc, ExtensionRegistry registry) + FieldConstraints resolveFieldConstraints(FieldDescriptor desc) throws InvalidProtocolBufferException, CompilationException { DescriptorProtos.FieldOptions options = desc.getOptions(); // If the protovalidate field option is unknown, reparse using extension registry. if (options.getUnknownFields().hasField(ValidateProto.field.getNumber())) { - options = DescriptorProtos.FieldOptions.parseFrom(options.toByteString(), registry); + options = DescriptorProtos.FieldOptions.parseFrom(options.toByteString(), EXTENSION_REGISTRY); } if (!options.hasExtension(ValidateProto.field)) { return FieldConstraints.getDefaultInstance(); diff --git a/src/main/java/build/buf/protovalidate/internal/evaluator/EvaluatorBuilder.java b/src/main/java/build/buf/protovalidate/internal/evaluator/EvaluatorBuilder.java index 30da6527..9cc74185 100644 --- a/src/main/java/build/buf/protovalidate/internal/evaluator/EvaluatorBuilder.java +++ b/src/main/java/build/buf/protovalidate/internal/evaluator/EvaluatorBuilder.java @@ -14,6 +14,7 @@ package build.buf.protovalidate.internal.evaluator; +import build.buf.protovalidate.Config; import build.buf.protovalidate.exceptions.CompilationException; import build.buf.protovalidate.internal.constraints.ConstraintCache; import build.buf.protovalidate.internal.constraints.DescriptorMappings; @@ -27,14 +28,12 @@ import build.buf.validate.Ignore; import build.buf.validate.MessageConstraints; import build.buf.validate.OneofConstraints; -import build.buf.validate.ValidateProto; import com.google.common.collect.ImmutableMap; import com.google.protobuf.ByteString; import com.google.protobuf.Descriptors; import com.google.protobuf.Descriptors.Descriptor; import com.google.protobuf.Descriptors.FieldDescriptor; import com.google.protobuf.DynamicMessage; -import com.google.protobuf.ExtensionRegistry; import com.google.protobuf.InvalidProtocolBufferException; import com.google.protobuf.Message; import java.util.ArrayList; @@ -49,14 +48,6 @@ /** A build-through cache of message evaluators keyed off the provided descriptor. */ public class EvaluatorBuilder { - private static final ExtensionRegistry EXTENSION_REGISTRY = ExtensionRegistry.newInstance(); - - static { - EXTENSION_REGISTRY.add(ValidateProto.message); - EXTENSION_REGISTRY.add(ValidateProto.field); - EXTENSION_REGISTRY.add(ValidateProto.oneof); - } - private volatile ImmutableMap evaluatorCache = ImmutableMap.of(); private final Env env; @@ -67,12 +58,12 @@ public class EvaluatorBuilder { * Constructs a new {@link EvaluatorBuilder}. * * @param env The CEL environment for evaluation. - * @param disableLazy Determines whether lazy loading of evaluators is disabled. + * @param config The configuration to use for the evaluation. */ - public EvaluatorBuilder(Env env, boolean disableLazy) { + public EvaluatorBuilder(Env env, Config config) { this.env = env; - this.disableLazy = disableLazy; - this.constraints = new ConstraintCache(env); + this.disableLazy = config.isDisableLazy(); + this.constraints = new ConstraintCache(env, config); } /** @@ -163,13 +154,9 @@ private Evaluator createMessageEvaluator(Descriptor desc) throws CompilationExce private void buildMessage(Descriptor desc, MessageEvaluator msgEval) throws CompilationException { try { - DynamicMessage defaultInstance = - DynamicMessage.newBuilder(desc) - .mergeFrom(new byte[0], EXTENSION_REGISTRY) - .buildPartial(); + DynamicMessage defaultInstance = DynamicMessage.newBuilder(desc).buildPartial(); Descriptor descriptor = defaultInstance.getDescriptorForType(); - MessageConstraints msgConstraints = - resolver.resolveMessageConstraints(descriptor, EXTENSION_REGISTRY); + MessageConstraints msgConstraints = resolver.resolveMessageConstraints(descriptor); if (msgConstraints.getDisabled()) { return; } @@ -208,8 +195,7 @@ private void processOneofConstraints(Descriptor desc, MessageEvaluator msgEval) throws InvalidProtocolBufferException, CompilationException { List oneofs = desc.getOneofs(); for (Descriptors.OneofDescriptor oneofDesc : oneofs) { - OneofConstraints oneofConstraints = - resolver.resolveOneofConstraints(oneofDesc, EXTENSION_REGISTRY); + OneofConstraints oneofConstraints = resolver.resolveOneofConstraints(oneofDesc); OneofEvaluator oneofEvaluatorEval = new OneofEvaluator(oneofDesc, oneofConstraints.getRequired()); msgEval.append(oneofEvaluatorEval); @@ -221,8 +207,7 @@ private void processFields(Descriptor desc, MessageEvaluator msgEval) List fields = desc.getFields(); for (FieldDescriptor fieldDescriptor : fields) { FieldDescriptor descriptor = desc.findFieldByName(fieldDescriptor.getName()); - FieldConstraints fieldConstraints = - resolver.resolveFieldConstraints(descriptor, EXTENSION_REGISTRY); + FieldConstraints fieldConstraints = resolver.resolveFieldConstraints(descriptor); FieldEvaluator fldEval = buildField(descriptor, fieldConstraints); msgEval.append(fldEval); } @@ -341,7 +326,7 @@ private Object zeroValue(FieldDescriptor fieldDescriptor, boolean forItems) private Message createMessageForType(Descriptor messageType) throws CompilationException { try { - return DynamicMessage.parseFrom(messageType, new byte[0], EXTENSION_REGISTRY); + return DynamicMessage.parseFrom(messageType, new byte[0]); } catch (InvalidProtocolBufferException e) { throw new CompilationException("field descriptor type is invalid " + e.getMessage(), e); } @@ -360,8 +345,7 @@ private void processFieldExpressions( if (fieldDescriptor.getJavaType() == FieldDescriptor.JavaType.MESSAGE) { try { DynamicMessage defaultInstance = - DynamicMessage.parseFrom( - fieldDescriptor.getMessageType(), new byte[0], EXTENSION_REGISTRY); + DynamicMessage.parseFrom(fieldDescriptor.getMessageType(), new byte[0]); opts = Arrays.asList( EnvOption.types(defaultInstance), diff --git a/src/main/java/build/buf/protovalidate/internal/expression/Expression.java b/src/main/java/build/buf/protovalidate/internal/expression/Expression.java index fbfff070..e4af662e 100644 --- a/src/main/java/build/buf/protovalidate/internal/expression/Expression.java +++ b/src/main/java/build/buf/protovalidate/internal/expression/Expression.java @@ -14,7 +14,7 @@ package build.buf.protovalidate.internal.expression; -import build.buf.validate.priv.Constraint; +import build.buf.validate.Constraint; import java.util.ArrayList; import java.util.List; @@ -47,34 +47,10 @@ private Expression(String id, String message, String expression) { * * @param constraint The constraint to create the expression from. */ - private Expression(build.buf.validate.Constraint constraint) { + private Expression(Constraint constraint) { this(constraint.getId(), constraint.getMessage(), constraint.getExpression()); } - /** - * Constructs a new Expression from the given private constraint. - * - * @param constraint The private constraint to create the expression from. - */ - private Expression(build.buf.validate.priv.Constraint constraint) { - this(constraint.getId(), constraint.getMessage(), constraint.getExpression()); - } - - /** - * Constructs a new list of {@link Expression} from the given list of private constraints. - * - * @param constraints The list of private constraints. - * @return The list of expressions. - */ - public static List fromPrivConstraints( - List constraints) { - List expressions = new ArrayList<>(); - for (Constraint constraint : constraints) { - expressions.add(new Expression(constraint)); - } - return expressions; - } - /** * Constructs a new list of {@link Expression} from the given list of constraints. * diff --git a/src/main/java/build/buf/protovalidate/internal/expression/Variable.java b/src/main/java/build/buf/protovalidate/internal/expression/Variable.java index bb743199..53ca6051 100644 --- a/src/main/java/build/buf/protovalidate/internal/expression/Variable.java +++ b/src/main/java/build/buf/protovalidate/internal/expression/Variable.java @@ -29,6 +29,9 @@ public class Variable implements Activation { /** The {@value} variable in CEL. */ public static final String RULES_NAME = "rules"; + /** The {@value} variable in CEL. */ + public static final String RULE_NAME = "rule"; + /** The parent activation */ private final Activation next; @@ -65,6 +68,17 @@ public static Variable newRulesVariable(Object val) { return new Variable(new NowVariable(), RULES_NAME, val); } + /** + * Creates a "rule" variable. + * + * @param rules the value of the "rules" variable. + * @param val the value of the "rule" variable. + * @return {@link Variable}. + */ + public static Variable newRuleVariable(Object rules, Object val) { + return new Variable(newRulesVariable(rules), RULE_NAME, val); + } + @Override public ResolvedValue resolveName(String name) { if (this.name.equals(name)) { diff --git a/src/main/java/build/buf/validate/AnyRules.java b/src/main/java/build/buf/validate/AnyRules.java index 5ec977b2..347073b0 100644 --- a/src/main/java/build/buf/validate/AnyRules.java +++ b/src/main/java/build/buf/validate/AnyRules.java @@ -544,15 +544,15 @@ public Builder mergeFrom( done = true; break; case 18: { - java.lang.String s = input.readStringRequireUtf8(); + com.google.protobuf.ByteString bs = input.readBytes(); ensureInIsMutable(); - in_.add(s); + in_.add(bs); break; } // case 18 case 26: { - java.lang.String s = input.readStringRequireUtf8(); + com.google.protobuf.ByteString bs = input.readBytes(); ensureNotInIsMutable(); - notIn_.add(s); + notIn_.add(bs); break; } // case 26 default: { @@ -792,7 +792,6 @@ public Builder clearIn() { public Builder addInBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } - checkByteStringIsUtf8(value); ensureInIsMutable(); in_.add(value); bitField0_ |= 0x00000001; @@ -1002,7 +1001,6 @@ public Builder clearNotIn() { public Builder addNotInBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } - checkByteStringIsUtf8(value); ensureNotInIsMutable(); notIn_.add(value); bitField0_ |= 0x00000002; diff --git a/src/main/java/build/buf/validate/BoolRules.java b/src/main/java/build/buf/validate/BoolRules.java index 98d93ff1..7bf7c8c3 100644 --- a/src/main/java/build/buf/validate/BoolRules.java +++ b/src/main/java/build/buf/validate/BoolRules.java @@ -14,7 +14,8 @@ * Protobuf type {@code buf.validate.BoolRules} */ public final class BoolRules extends - com.google.protobuf.GeneratedMessage implements + com.google.protobuf.GeneratedMessage.ExtendableMessage< + BoolRules> implements // @@protoc_insertion_point(message_implements:buf.validate.BoolRules) BoolRulesOrBuilder { private static final long serialVersionUID = 0L; @@ -28,10 +29,11 @@ public final class BoolRules extends BoolRules.class.getName()); } // Use BoolRules.newBuilder() to construct. - private BoolRules(com.google.protobuf.GeneratedMessage.Builder builder) { + private BoolRules(com.google.protobuf.GeneratedMessage.ExtendableBuilder builder) { super(builder); } private BoolRules() { + example_ = emptyBooleanList(); } public static final com.google.protobuf.Descriptors.Descriptor @@ -63,7 +65,7 @@ private BoolRules() { * ``` * * - * optional bool const = 1 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional bool const = 1 [json_name = "const", (.buf.validate.predefined) = { ... } * @return Whether the const field is set. */ @java.lang.Override @@ -83,7 +85,7 @@ public boolean hasConst() { * ``` * * - * optional bool const = 1 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional bool const = 1 [json_name = "const", (.buf.validate.predefined) = { ... } * @return The const. */ @java.lang.Override @@ -91,6 +93,80 @@ public boolean getConst() { return const_; } + public static final int EXAMPLE_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private com.google.protobuf.Internal.BooleanList example_ = + emptyBooleanList(); + /** + *

+   * `example` specifies values that the field may have. These values SHOULD
+   * conform to other constraints. `example` values will not impact validation
+   * but may be used as helpful guidance on how to populate the given field.
+   *
+   * ```proto
+   * message MyBool {
+   * bool value = 1 [
+   * (buf.validate.field).bool.example = 1,
+   * (buf.validate.field).bool.example = 2
+   * ];
+   * }
+   * ```
+   * 
+ * + * repeated bool example = 2 [json_name = "example", (.buf.validate.predefined) = { ... } + * @return A list containing the example. + */ + @java.lang.Override + public java.util.List + getExampleList() { + return example_; + } + /** + *
+   * `example` specifies values that the field may have. These values SHOULD
+   * conform to other constraints. `example` values will not impact validation
+   * but may be used as helpful guidance on how to populate the given field.
+   *
+   * ```proto
+   * message MyBool {
+   * bool value = 1 [
+   * (buf.validate.field).bool.example = 1,
+   * (buf.validate.field).bool.example = 2
+   * ];
+   * }
+   * ```
+   * 
+ * + * repeated bool example = 2 [json_name = "example", (.buf.validate.predefined) = { ... } + * @return The count of example. + */ + public int getExampleCount() { + return example_.size(); + } + /** + *
+   * `example` specifies values that the field may have. These values SHOULD
+   * conform to other constraints. `example` values will not impact validation
+   * but may be used as helpful guidance on how to populate the given field.
+   *
+   * ```proto
+   * message MyBool {
+   * bool value = 1 [
+   * (buf.validate.field).bool.example = 1,
+   * (buf.validate.field).bool.example = 2
+   * ];
+   * }
+   * ```
+   * 
+ * + * repeated bool example = 2 [json_name = "example", (.buf.validate.predefined) = { ... } + * @param index The index of the element to return. + * @return The example at the given index. + */ + public boolean getExample(int index) { + return example_.getBoolean(index); + } + private byte memoizedIsInitialized = -1; @java.lang.Override public final boolean isInitialized() { @@ -98,6 +174,10 @@ public final boolean isInitialized() { if (isInitialized == 1) return true; if (isInitialized == 0) return false; + if (!extensionsAreInitialized()) { + memoizedIsInitialized = 0; + return false; + } memoizedIsInitialized = 1; return true; } @@ -105,9 +185,16 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + com.google.protobuf.GeneratedMessage + .ExtendableMessage.ExtensionSerializer + extensionWriter = newExtensionSerializer(); if (((bitField0_ & 0x00000001) != 0)) { output.writeBool(1, const_); } + for (int i = 0; i < example_.size(); i++) { + output.writeBool(2, example_.getBoolean(i)); + } + extensionWriter.writeUntil(536870912, output); getUnknownFields().writeTo(output); } @@ -121,6 +208,13 @@ public int getSerializedSize() { size += com.google.protobuf.CodedOutputStream .computeBoolSize(1, const_); } + { + int dataSize = 0; + dataSize = 1 * getExampleList().size(); + size += dataSize; + size += 1 * getExampleList().size(); + } + size += extensionsSerializedSize(); size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -141,7 +235,11 @@ public boolean equals(final java.lang.Object obj) { if (getConst() != other.getConst()) return false; } + if (!getExampleList() + .equals(other.getExampleList())) return false; if (!getUnknownFields().equals(other.getUnknownFields())) return false; + if (!getExtensionFields().equals(other.getExtensionFields())) + return false; return true; } @@ -157,6 +255,11 @@ public int hashCode() { hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( getConst()); } + if (getExampleCount() > 0) { + hash = (37 * hash) + EXAMPLE_FIELD_NUMBER; + hash = (53 * hash) + getExampleList().hashCode(); + } + hash = hashFields(hash, getExtensionFields()); hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -263,7 +366,8 @@ protected Builder newBuilderForType( * Protobuf type {@code buf.validate.BoolRules} */ public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder implements + com.google.protobuf.GeneratedMessage.ExtendableBuilder< + build.buf.validate.BoolRules, Builder> implements // @@protoc_insertion_point(builder_implements:buf.validate.BoolRules) build.buf.validate.BoolRulesOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor @@ -294,6 +398,7 @@ public Builder clear() { super.clear(); bitField0_ = 0; const_ = false; + example_ = emptyBooleanList(); return this; } @@ -332,6 +437,10 @@ private void buildPartial0(build.buf.validate.BoolRules result) { result.const_ = const_; to_bitField0_ |= 0x00000001; } + if (((from_bitField0_ & 0x00000002) != 0)) { + example_.makeImmutable(); + result.example_ = example_; + } result.bitField0_ |= to_bitField0_; } @@ -350,6 +459,18 @@ public Builder mergeFrom(build.buf.validate.BoolRules other) { if (other.hasConst()) { setConst(other.getConst()); } + if (!other.example_.isEmpty()) { + if (example_.isEmpty()) { + example_ = other.example_; + example_.makeImmutable(); + bitField0_ |= 0x00000002; + } else { + ensureExampleIsMutable(); + example_.addAll(other.example_); + } + onChanged(); + } + this.mergeExtensionFields(other); this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -357,6 +478,9 @@ public Builder mergeFrom(build.buf.validate.BoolRules other) { @java.lang.Override public final boolean isInitialized() { + if (!extensionsAreInitialized()) { + return false; + } return true; } @@ -381,6 +505,23 @@ public Builder mergeFrom( bitField0_ |= 0x00000001; break; } // case 8 + case 16: { + boolean v = input.readBool(); + ensureExampleIsMutable(); + example_.addBoolean(v); + break; + } // case 16 + case 18: { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + int alloc = length > 4096 ? 4096 : length; + ensureExampleIsMutable(alloc / 1); + while (input.getBytesUntilLimit() > 0) { + example_.addBoolean(input.readBool()); + } + input.popLimit(limit); + break; + } // case 18 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { done = true; // was an endgroup tag @@ -412,7 +553,7 @@ public Builder mergeFrom( * ``` * * - * optional bool const = 1 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional bool const = 1 [json_name = "const", (.buf.validate.predefined) = { ... } * @return Whether the const field is set. */ @java.lang.Override @@ -432,7 +573,7 @@ public boolean hasConst() { * ``` * * - * optional bool const = 1 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional bool const = 1 [json_name = "const", (.buf.validate.predefined) = { ... } * @return The const. */ @java.lang.Override @@ -452,7 +593,7 @@ public boolean getConst() { * ``` * * - * optional bool const = 1 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional bool const = 1 [json_name = "const", (.buf.validate.predefined) = { ... } * @param value The const to set. * @return This builder for chaining. */ @@ -476,7 +617,7 @@ public Builder setConst(boolean value) { * ``` * * - * optional bool const = 1 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional bool const = 1 [json_name = "const", (.buf.validate.predefined) = { ... } * @return This builder for chaining. */ public Builder clearConst() { @@ -486,6 +627,201 @@ public Builder clearConst() { return this; } + private com.google.protobuf.Internal.BooleanList example_ = emptyBooleanList(); + private void ensureExampleIsMutable() { + if (!example_.isModifiable()) { + example_ = makeMutableCopy(example_); + } + bitField0_ |= 0x00000002; + } + private void ensureExampleIsMutable(int capacity) { + if (!example_.isModifiable()) { + example_ = makeMutableCopy(example_, capacity); + } + bitField0_ |= 0x00000002; + } + /** + *
+     * `example` specifies values that the field may have. These values SHOULD
+     * conform to other constraints. `example` values will not impact validation
+     * but may be used as helpful guidance on how to populate the given field.
+     *
+     * ```proto
+     * message MyBool {
+     * bool value = 1 [
+     * (buf.validate.field).bool.example = 1,
+     * (buf.validate.field).bool.example = 2
+     * ];
+     * }
+     * ```
+     * 
+ * + * repeated bool example = 2 [json_name = "example", (.buf.validate.predefined) = { ... } + * @return A list containing the example. + */ + public java.util.List + getExampleList() { + example_.makeImmutable(); + return example_; + } + /** + *
+     * `example` specifies values that the field may have. These values SHOULD
+     * conform to other constraints. `example` values will not impact validation
+     * but may be used as helpful guidance on how to populate the given field.
+     *
+     * ```proto
+     * message MyBool {
+     * bool value = 1 [
+     * (buf.validate.field).bool.example = 1,
+     * (buf.validate.field).bool.example = 2
+     * ];
+     * }
+     * ```
+     * 
+ * + * repeated bool example = 2 [json_name = "example", (.buf.validate.predefined) = { ... } + * @return The count of example. + */ + public int getExampleCount() { + return example_.size(); + } + /** + *
+     * `example` specifies values that the field may have. These values SHOULD
+     * conform to other constraints. `example` values will not impact validation
+     * but may be used as helpful guidance on how to populate the given field.
+     *
+     * ```proto
+     * message MyBool {
+     * bool value = 1 [
+     * (buf.validate.field).bool.example = 1,
+     * (buf.validate.field).bool.example = 2
+     * ];
+     * }
+     * ```
+     * 
+ * + * repeated bool example = 2 [json_name = "example", (.buf.validate.predefined) = { ... } + * @param index The index of the element to return. + * @return The example at the given index. + */ + public boolean getExample(int index) { + return example_.getBoolean(index); + } + /** + *
+     * `example` specifies values that the field may have. These values SHOULD
+     * conform to other constraints. `example` values will not impact validation
+     * but may be used as helpful guidance on how to populate the given field.
+     *
+     * ```proto
+     * message MyBool {
+     * bool value = 1 [
+     * (buf.validate.field).bool.example = 1,
+     * (buf.validate.field).bool.example = 2
+     * ];
+     * }
+     * ```
+     * 
+ * + * repeated bool example = 2 [json_name = "example", (.buf.validate.predefined) = { ... } + * @param index The index to set the value at. + * @param value The example to set. + * @return This builder for chaining. + */ + public Builder setExample( + int index, boolean value) { + + ensureExampleIsMutable(); + example_.setBoolean(index, value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
+     * `example` specifies values that the field may have. These values SHOULD
+     * conform to other constraints. `example` values will not impact validation
+     * but may be used as helpful guidance on how to populate the given field.
+     *
+     * ```proto
+     * message MyBool {
+     * bool value = 1 [
+     * (buf.validate.field).bool.example = 1,
+     * (buf.validate.field).bool.example = 2
+     * ];
+     * }
+     * ```
+     * 
+ * + * repeated bool example = 2 [json_name = "example", (.buf.validate.predefined) = { ... } + * @param value The example to add. + * @return This builder for chaining. + */ + public Builder addExample(boolean value) { + + ensureExampleIsMutable(); + example_.addBoolean(value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
+     * `example` specifies values that the field may have. These values SHOULD
+     * conform to other constraints. `example` values will not impact validation
+     * but may be used as helpful guidance on how to populate the given field.
+     *
+     * ```proto
+     * message MyBool {
+     * bool value = 1 [
+     * (buf.validate.field).bool.example = 1,
+     * (buf.validate.field).bool.example = 2
+     * ];
+     * }
+     * ```
+     * 
+ * + * repeated bool example = 2 [json_name = "example", (.buf.validate.predefined) = { ... } + * @param values The example to add. + * @return This builder for chaining. + */ + public Builder addAllExample( + java.lang.Iterable values) { + ensureExampleIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, example_); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
+     * `example` specifies values that the field may have. These values SHOULD
+     * conform to other constraints. `example` values will not impact validation
+     * but may be used as helpful guidance on how to populate the given field.
+     *
+     * ```proto
+     * message MyBool {
+     * bool value = 1 [
+     * (buf.validate.field).bool.example = 1,
+     * (buf.validate.field).bool.example = 2
+     * ];
+     * }
+     * ```
+     * 
+ * + * repeated bool example = 2 [json_name = "example", (.buf.validate.predefined) = { ... } + * @return This builder for chaining. + */ + public Builder clearExample() { + example_ = emptyBooleanList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + // @@protoc_insertion_point(builder_scope:buf.validate.BoolRules) } diff --git a/src/main/java/build/buf/validate/BoolRulesOrBuilder.java b/src/main/java/build/buf/validate/BoolRulesOrBuilder.java index ff2fe99f..2cc9c2b8 100644 --- a/src/main/java/build/buf/validate/BoolRulesOrBuilder.java +++ b/src/main/java/build/buf/validate/BoolRulesOrBuilder.java @@ -7,7 +7,8 @@ public interface BoolRulesOrBuilder extends // @@protoc_insertion_point(interface_extends:buf.validate.BoolRules) - com.google.protobuf.MessageOrBuilder { + com.google.protobuf.GeneratedMessage. + ExtendableMessageOrBuilder { /** *
@@ -22,7 +23,7 @@ public interface BoolRulesOrBuilder extends
    * ```
    * 
* - * optional bool const = 1 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional bool const = 1 [json_name = "const", (.buf.validate.predefined) = { ... } * @return Whether the const field is set. */ boolean hasConst(); @@ -39,8 +40,70 @@ public interface BoolRulesOrBuilder extends * ``` * * - * optional bool const = 1 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional bool const = 1 [json_name = "const", (.buf.validate.predefined) = { ... } * @return The const. */ boolean getConst(); + + /** + *
+   * `example` specifies values that the field may have. These values SHOULD
+   * conform to other constraints. `example` values will not impact validation
+   * but may be used as helpful guidance on how to populate the given field.
+   *
+   * ```proto
+   * message MyBool {
+   * bool value = 1 [
+   * (buf.validate.field).bool.example = 1,
+   * (buf.validate.field).bool.example = 2
+   * ];
+   * }
+   * ```
+   * 
+ * + * repeated bool example = 2 [json_name = "example", (.buf.validate.predefined) = { ... } + * @return A list containing the example. + */ + java.util.List getExampleList(); + /** + *
+   * `example` specifies values that the field may have. These values SHOULD
+   * conform to other constraints. `example` values will not impact validation
+   * but may be used as helpful guidance on how to populate the given field.
+   *
+   * ```proto
+   * message MyBool {
+   * bool value = 1 [
+   * (buf.validate.field).bool.example = 1,
+   * (buf.validate.field).bool.example = 2
+   * ];
+   * }
+   * ```
+   * 
+ * + * repeated bool example = 2 [json_name = "example", (.buf.validate.predefined) = { ... } + * @return The count of example. + */ + int getExampleCount(); + /** + *
+   * `example` specifies values that the field may have. These values SHOULD
+   * conform to other constraints. `example` values will not impact validation
+   * but may be used as helpful guidance on how to populate the given field.
+   *
+   * ```proto
+   * message MyBool {
+   * bool value = 1 [
+   * (buf.validate.field).bool.example = 1,
+   * (buf.validate.field).bool.example = 2
+   * ];
+   * }
+   * ```
+   * 
+ * + * repeated bool example = 2 [json_name = "example", (.buf.validate.predefined) = { ... } + * @param index The index of the element to return. + * @return The example at the given index. + */ + boolean getExample(int index); } diff --git a/src/main/java/build/buf/validate/BytesRules.java b/src/main/java/build/buf/validate/BytesRules.java index 238c7c4d..404e375d 100644 --- a/src/main/java/build/buf/validate/BytesRules.java +++ b/src/main/java/build/buf/validate/BytesRules.java @@ -14,7 +14,8 @@ * Protobuf type {@code buf.validate.BytesRules} */ public final class BytesRules extends - com.google.protobuf.GeneratedMessage implements + com.google.protobuf.GeneratedMessage.ExtendableMessage< + BytesRules> implements // @@protoc_insertion_point(message_implements:buf.validate.BytesRules) BytesRulesOrBuilder { private static final long serialVersionUID = 0L; @@ -28,7 +29,7 @@ public final class BytesRules extends BytesRules.class.getName()); } // Use BytesRules.newBuilder() to construct. - private BytesRules(com.google.protobuf.GeneratedMessage.Builder builder) { + private BytesRules(com.google.protobuf.GeneratedMessage.ExtendableBuilder builder) { super(builder); } private BytesRules() { @@ -39,6 +40,7 @@ private BytesRules() { contains_ = com.google.protobuf.ByteString.EMPTY; in_ = emptyList(com.google.protobuf.ByteString.class); notIn_ = emptyList(com.google.protobuf.ByteString.class); + example_ = emptyList(com.google.protobuf.ByteString.class); } public static final com.google.protobuf.Descriptors.Descriptor @@ -114,7 +116,7 @@ public int getNumber() { * ``` * * - * optional bytes const = 1 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional bytes const = 1 [json_name = "const", (.buf.validate.predefined) = { ... } * @return Whether the const field is set. */ @java.lang.Override @@ -134,7 +136,7 @@ public boolean hasConst() { * ``` * * - * optional bytes const = 1 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional bytes const = 1 [json_name = "const", (.buf.validate.predefined) = { ... } * @return The const. */ @java.lang.Override @@ -157,7 +159,7 @@ public com.google.protobuf.ByteString getConst() { * ``` * * - * optional uint64 len = 13 [json_name = "len", (.buf.validate.priv.field) = { ... } + * optional uint64 len = 13 [json_name = "len", (.buf.validate.predefined) = { ... } * @return Whether the len field is set. */ @java.lang.Override @@ -177,7 +179,7 @@ public boolean hasLen() { * ``` * * - * optional uint64 len = 13 [json_name = "len", (.buf.validate.priv.field) = { ... } + * optional uint64 len = 13 [json_name = "len", (.buf.validate.predefined) = { ... } * @return The len. */ @java.lang.Override @@ -201,7 +203,7 @@ public long getLen() { * ``` * * - * optional uint64 min_len = 2 [json_name = "minLen", (.buf.validate.priv.field) = { ... } + * optional uint64 min_len = 2 [json_name = "minLen", (.buf.validate.predefined) = { ... } * @return Whether the minLen field is set. */ @java.lang.Override @@ -222,7 +224,7 @@ public boolean hasMinLen() { * ``` * * - * optional uint64 min_len = 2 [json_name = "minLen", (.buf.validate.priv.field) = { ... } + * optional uint64 min_len = 2 [json_name = "minLen", (.buf.validate.predefined) = { ... } * @return The minLen. */ @java.lang.Override @@ -246,7 +248,7 @@ public long getMinLen() { * ``` * * - * optional uint64 max_len = 3 [json_name = "maxLen", (.buf.validate.priv.field) = { ... } + * optional uint64 max_len = 3 [json_name = "maxLen", (.buf.validate.predefined) = { ... } * @return Whether the maxLen field is set. */ @java.lang.Override @@ -267,7 +269,7 @@ public boolean hasMaxLen() { * ``` * * - * optional uint64 max_len = 3 [json_name = "maxLen", (.buf.validate.priv.field) = { ... } + * optional uint64 max_len = 3 [json_name = "maxLen", (.buf.validate.predefined) = { ... } * @return The maxLen. */ @java.lang.Override @@ -294,7 +296,7 @@ public long getMaxLen() { * ``` * * - * optional string pattern = 4 [json_name = "pattern", (.buf.validate.priv.field) = { ... } + * optional string pattern = 4 [json_name = "pattern", (.buf.validate.predefined) = { ... } * @return Whether the pattern field is set. */ @java.lang.Override @@ -317,7 +319,7 @@ public boolean hasPattern() { * ``` * * - * optional string pattern = 4 [json_name = "pattern", (.buf.validate.priv.field) = { ... } + * optional string pattern = 4 [json_name = "pattern", (.buf.validate.predefined) = { ... } * @return The pattern. */ @java.lang.Override @@ -329,7 +331,9 @@ public java.lang.String getPattern() { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); - pattern_ = s; + if (bs.isValidUtf8()) { + pattern_ = s; + } return s; } } @@ -349,7 +353,7 @@ public java.lang.String getPattern() { * ``` * * - * optional string pattern = 4 [json_name = "pattern", (.buf.validate.priv.field) = { ... } + * optional string pattern = 4 [json_name = "pattern", (.buf.validate.predefined) = { ... } * @return The bytes for pattern. */ @java.lang.Override @@ -383,7 +387,7 @@ public java.lang.String getPattern() { * ``` * * - * optional bytes prefix = 5 [json_name = "prefix", (.buf.validate.priv.field) = { ... } + * optional bytes prefix = 5 [json_name = "prefix", (.buf.validate.predefined) = { ... } * @return Whether the prefix field is set. */ @java.lang.Override @@ -404,7 +408,7 @@ public boolean hasPrefix() { * ``` * * - * optional bytes prefix = 5 [json_name = "prefix", (.buf.validate.priv.field) = { ... } + * optional bytes prefix = 5 [json_name = "prefix", (.buf.validate.predefined) = { ... } * @return The prefix. */ @java.lang.Override @@ -428,7 +432,7 @@ public com.google.protobuf.ByteString getPrefix() { * ``` * * - * optional bytes suffix = 6 [json_name = "suffix", (.buf.validate.priv.field) = { ... } + * optional bytes suffix = 6 [json_name = "suffix", (.buf.validate.predefined) = { ... } * @return Whether the suffix field is set. */ @java.lang.Override @@ -449,7 +453,7 @@ public boolean hasSuffix() { * ``` * * - * optional bytes suffix = 6 [json_name = "suffix", (.buf.validate.priv.field) = { ... } + * optional bytes suffix = 6 [json_name = "suffix", (.buf.validate.predefined) = { ... } * @return The suffix. */ @java.lang.Override @@ -473,7 +477,7 @@ public com.google.protobuf.ByteString getSuffix() { * ``` * * - * optional bytes contains = 7 [json_name = "contains", (.buf.validate.priv.field) = { ... } + * optional bytes contains = 7 [json_name = "contains", (.buf.validate.predefined) = { ... } * @return Whether the contains field is set. */ @java.lang.Override @@ -494,7 +498,7 @@ public boolean hasContains() { * ``` * * - * optional bytes contains = 7 [json_name = "contains", (.buf.validate.priv.field) = { ... } + * optional bytes contains = 7 [json_name = "contains", (.buf.validate.predefined) = { ... } * @return The contains. */ @java.lang.Override @@ -520,7 +524,7 @@ public com.google.protobuf.ByteString getContains() { * ``` * * - * repeated bytes in = 8 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated bytes in = 8 [json_name = "in", (.buf.validate.predefined) = { ... } * @return A list containing the in. */ @java.lang.Override @@ -542,7 +546,7 @@ public com.google.protobuf.ByteString getContains() { * ``` * * - * repeated bytes in = 8 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated bytes in = 8 [json_name = "in", (.buf.validate.predefined) = { ... } * @return The count of in. */ public int getInCount() { @@ -562,7 +566,7 @@ public int getInCount() { * ``` * * - * repeated bytes in = 8 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated bytes in = 8 [json_name = "in", (.buf.validate.predefined) = { ... } * @param index The index of the element to return. * @return The in at the given index. */ @@ -589,7 +593,7 @@ public com.google.protobuf.ByteString getIn(int index) { * ``` * * - * repeated bytes not_in = 9 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated bytes not_in = 9 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @return A list containing the notIn. */ @java.lang.Override @@ -612,7 +616,7 @@ public com.google.protobuf.ByteString getIn(int index) { * ``` * * - * repeated bytes not_in = 9 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated bytes not_in = 9 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @return The count of notIn. */ public int getNotInCount() { @@ -633,7 +637,7 @@ public int getNotInCount() { * ``` * * - * repeated bytes not_in = 9 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated bytes not_in = 9 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @param index The index of the element to return. * @return The notIn at the given index. */ @@ -655,7 +659,7 @@ public com.google.protobuf.ByteString getNotIn(int index) { * ``` * * - * bool ip = 10 [json_name = "ip", (.buf.validate.priv.field) = { ... } + * bool ip = 10 [json_name = "ip", (.buf.validate.predefined) = { ... } * @return Whether the ip field is set. */ @java.lang.Override @@ -675,7 +679,7 @@ public boolean hasIp() { * ``` * * - * bool ip = 10 [json_name = "ip", (.buf.validate.priv.field) = { ... } + * bool ip = 10 [json_name = "ip", (.buf.validate.predefined) = { ... } * @return The ip. */ @java.lang.Override @@ -700,7 +704,7 @@ public boolean getIp() { * ``` * * - * bool ipv4 = 11 [json_name = "ipv4", (.buf.validate.priv.field) = { ... } + * bool ipv4 = 11 [json_name = "ipv4", (.buf.validate.predefined) = { ... } * @return Whether the ipv4 field is set. */ @java.lang.Override @@ -720,7 +724,7 @@ public boolean hasIpv4() { * ``` * * - * bool ipv4 = 11 [json_name = "ipv4", (.buf.validate.priv.field) = { ... } + * bool ipv4 = 11 [json_name = "ipv4", (.buf.validate.predefined) = { ... } * @return The ipv4. */ @java.lang.Override @@ -744,7 +748,7 @@ public boolean getIpv4() { * ``` * * - * bool ipv6 = 12 [json_name = "ipv6", (.buf.validate.priv.field) = { ... } + * bool ipv6 = 12 [json_name = "ipv6", (.buf.validate.predefined) = { ... } * @return Whether the ipv6 field is set. */ @java.lang.Override @@ -763,7 +767,7 @@ public boolean hasIpv6() { * ``` * * - * bool ipv6 = 12 [json_name = "ipv6", (.buf.validate.priv.field) = { ... } + * bool ipv6 = 12 [json_name = "ipv6", (.buf.validate.predefined) = { ... } * @return The ipv6. */ @java.lang.Override @@ -774,6 +778,80 @@ public boolean getIpv6() { return false; } + public static final int EXAMPLE_FIELD_NUMBER = 14; + @SuppressWarnings("serial") + private com.google.protobuf.Internal.ProtobufList example_ = + emptyList(com.google.protobuf.ByteString.class); + /** + *
+   * `example` specifies values that the field may have. These values SHOULD
+   * conform to other constraints. `example` values will not impact validation
+   * but may be used as helpful guidance on how to populate the given field.
+   *
+   * ```proto
+   * message MyBytes {
+   * bytes value = 1 [
+   * (buf.validate.field).bytes.example = "\x01\x02",
+   * (buf.validate.field).bytes.example = "\x02\x03"
+   * ];
+   * }
+   * ```
+   * 
+ * + * repeated bytes example = 14 [json_name = "example", (.buf.validate.predefined) = { ... } + * @return A list containing the example. + */ + @java.lang.Override + public java.util.List + getExampleList() { + return example_; + } + /** + *
+   * `example` specifies values that the field may have. These values SHOULD
+   * conform to other constraints. `example` values will not impact validation
+   * but may be used as helpful guidance on how to populate the given field.
+   *
+   * ```proto
+   * message MyBytes {
+   * bytes value = 1 [
+   * (buf.validate.field).bytes.example = "\x01\x02",
+   * (buf.validate.field).bytes.example = "\x02\x03"
+   * ];
+   * }
+   * ```
+   * 
+ * + * repeated bytes example = 14 [json_name = "example", (.buf.validate.predefined) = { ... } + * @return The count of example. + */ + public int getExampleCount() { + return example_.size(); + } + /** + *
+   * `example` specifies values that the field may have. These values SHOULD
+   * conform to other constraints. `example` values will not impact validation
+   * but may be used as helpful guidance on how to populate the given field.
+   *
+   * ```proto
+   * message MyBytes {
+   * bytes value = 1 [
+   * (buf.validate.field).bytes.example = "\x01\x02",
+   * (buf.validate.field).bytes.example = "\x02\x03"
+   * ];
+   * }
+   * ```
+   * 
+ * + * repeated bytes example = 14 [json_name = "example", (.buf.validate.predefined) = { ... } + * @param index The index of the element to return. + * @return The example at the given index. + */ + public com.google.protobuf.ByteString getExample(int index) { + return example_.get(index); + } + private byte memoizedIsInitialized = -1; @java.lang.Override public final boolean isInitialized() { @@ -781,6 +859,10 @@ public final boolean isInitialized() { if (isInitialized == 1) return true; if (isInitialized == 0) return false; + if (!extensionsAreInitialized()) { + memoizedIsInitialized = 0; + return false; + } memoizedIsInitialized = 1; return true; } @@ -788,6 +870,9 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + com.google.protobuf.GeneratedMessage + .ExtendableMessage.ExtensionSerializer + extensionWriter = newExtensionSerializer(); if (((bitField0_ & 0x00000001) != 0)) { output.writeBytes(1, const_); } @@ -830,6 +915,10 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) if (((bitField0_ & 0x00000002) != 0)) { output.writeUInt64(13, len_); } + for (int i = 0; i < example_.size(); i++) { + output.writeBytes(14, example_.get(i)); + } + extensionWriter.writeUntil(536870912, output); getUnknownFields().writeTo(output); } @@ -903,6 +992,16 @@ public int getSerializedSize() { size += com.google.protobuf.CodedOutputStream .computeUInt64Size(13, len_); } + { + int dataSize = 0; + for (int i = 0; i < example_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream + .computeBytesSizeNoTag(example_.get(i)); + } + size += dataSize; + size += 1 * getExampleList().size(); + } + size += extensionsSerializedSize(); size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -962,6 +1061,8 @@ public boolean equals(final java.lang.Object obj) { .equals(other.getInList())) return false; if (!getNotInList() .equals(other.getNotInList())) return false; + if (!getExampleList() + .equals(other.getExampleList())) return false; if (!getWellKnownCase().equals(other.getWellKnownCase())) return false; switch (wellKnownCase_) { case 10: @@ -980,6 +1081,8 @@ public boolean equals(final java.lang.Object obj) { default: } if (!getUnknownFields().equals(other.getUnknownFields())) return false; + if (!getExtensionFields().equals(other.getExtensionFields())) + return false; return true; } @@ -1033,6 +1136,10 @@ public int hashCode() { hash = (37 * hash) + NOT_IN_FIELD_NUMBER; hash = (53 * hash) + getNotInList().hashCode(); } + if (getExampleCount() > 0) { + hash = (37 * hash) + EXAMPLE_FIELD_NUMBER; + hash = (53 * hash) + getExampleList().hashCode(); + } switch (wellKnownCase_) { case 10: hash = (37 * hash) + IP_FIELD_NUMBER; @@ -1052,6 +1159,7 @@ public int hashCode() { case 0: default: } + hash = hashFields(hash, getExtensionFields()); hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -1158,7 +1266,8 @@ protected Builder newBuilderForType( * Protobuf type {@code buf.validate.BytesRules} */ public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder implements + com.google.protobuf.GeneratedMessage.ExtendableBuilder< + build.buf.validate.BytesRules, Builder> implements // @@protoc_insertion_point(builder_implements:buf.validate.BytesRules) build.buf.validate.BytesRulesOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor @@ -1198,6 +1307,7 @@ public Builder clear() { contains_ = com.google.protobuf.ByteString.EMPTY; in_ = emptyList(com.google.protobuf.ByteString.class); notIn_ = emptyList(com.google.protobuf.ByteString.class); + example_ = emptyList(com.google.protobuf.ByteString.class); wellKnownCase_ = 0; wellKnown_ = null; return this; @@ -1275,6 +1385,10 @@ private void buildPartial0(build.buf.validate.BytesRules result) { notIn_.makeImmutable(); result.notIn_ = notIn_; } + if (((from_bitField0_ & 0x00002000) != 0)) { + example_.makeImmutable(); + result.example_ = example_; + } result.bitField0_ |= to_bitField0_; } @@ -1343,6 +1457,17 @@ public Builder mergeFrom(build.buf.validate.BytesRules other) { } onChanged(); } + if (!other.example_.isEmpty()) { + if (example_.isEmpty()) { + example_ = other.example_; + example_.makeImmutable(); + bitField0_ |= 0x00002000; + } else { + ensureExampleIsMutable(); + example_.addAll(other.example_); + } + onChanged(); + } switch (other.getWellKnownCase()) { case IP: { setIp(other.getIp()); @@ -1360,6 +1485,7 @@ public Builder mergeFrom(build.buf.validate.BytesRules other) { break; } } + this.mergeExtensionFields(other); this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -1367,6 +1493,9 @@ public Builder mergeFrom(build.buf.validate.BytesRules other) { @java.lang.Override public final boolean isInitialized() { + if (!extensionsAreInitialized()) { + return false; + } return true; } @@ -1402,7 +1531,7 @@ public Builder mergeFrom( break; } // case 24 case 34: { - pattern_ = input.readStringRequireUtf8(); + pattern_ = input.readBytes(); bitField0_ |= 0x00000010; break; } // case 34 @@ -1453,6 +1582,12 @@ public Builder mergeFrom( bitField0_ |= 0x00000002; break; } // case 104 + case 114: { + com.google.protobuf.ByteString v = input.readBytes(); + ensureExampleIsMutable(); + example_.add(v); + break; + } // case 114 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { done = true; // was an endgroup tag @@ -1499,7 +1634,7 @@ public Builder clearWellKnown() { * ``` * * - * optional bytes const = 1 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional bytes const = 1 [json_name = "const", (.buf.validate.predefined) = { ... } * @return Whether the const field is set. */ @java.lang.Override @@ -1519,7 +1654,7 @@ public boolean hasConst() { * ``` * * - * optional bytes const = 1 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional bytes const = 1 [json_name = "const", (.buf.validate.predefined) = { ... } * @return The const. */ @java.lang.Override @@ -1539,7 +1674,7 @@ public com.google.protobuf.ByteString getConst() { * ``` * * - * optional bytes const = 1 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional bytes const = 1 [json_name = "const", (.buf.validate.predefined) = { ... } * @param value The const to set. * @return This builder for chaining. */ @@ -1563,7 +1698,7 @@ public Builder setConst(com.google.protobuf.ByteString value) { * ``` * * - * optional bytes const = 1 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional bytes const = 1 [json_name = "const", (.buf.validate.predefined) = { ... } * @return This builder for chaining. */ public Builder clearConst() { @@ -1587,7 +1722,7 @@ public Builder clearConst() { * ``` * * - * optional uint64 len = 13 [json_name = "len", (.buf.validate.priv.field) = { ... } + * optional uint64 len = 13 [json_name = "len", (.buf.validate.predefined) = { ... } * @return Whether the len field is set. */ @java.lang.Override @@ -1607,7 +1742,7 @@ public boolean hasLen() { * ``` * * - * optional uint64 len = 13 [json_name = "len", (.buf.validate.priv.field) = { ... } + * optional uint64 len = 13 [json_name = "len", (.buf.validate.predefined) = { ... } * @return The len. */ @java.lang.Override @@ -1627,7 +1762,7 @@ public long getLen() { * ``` * * - * optional uint64 len = 13 [json_name = "len", (.buf.validate.priv.field) = { ... } + * optional uint64 len = 13 [json_name = "len", (.buf.validate.predefined) = { ... } * @param value The len to set. * @return This builder for chaining. */ @@ -1651,7 +1786,7 @@ public Builder setLen(long value) { * ``` * * - * optional uint64 len = 13 [json_name = "len", (.buf.validate.priv.field) = { ... } + * optional uint64 len = 13 [json_name = "len", (.buf.validate.predefined) = { ... } * @return This builder for chaining. */ public Builder clearLen() { @@ -1676,7 +1811,7 @@ public Builder clearLen() { * ``` * * - * optional uint64 min_len = 2 [json_name = "minLen", (.buf.validate.priv.field) = { ... } + * optional uint64 min_len = 2 [json_name = "minLen", (.buf.validate.predefined) = { ... } * @return Whether the minLen field is set. */ @java.lang.Override @@ -1697,7 +1832,7 @@ public boolean hasMinLen() { * ``` * * - * optional uint64 min_len = 2 [json_name = "minLen", (.buf.validate.priv.field) = { ... } + * optional uint64 min_len = 2 [json_name = "minLen", (.buf.validate.predefined) = { ... } * @return The minLen. */ @java.lang.Override @@ -1718,7 +1853,7 @@ public long getMinLen() { * ``` * * - * optional uint64 min_len = 2 [json_name = "minLen", (.buf.validate.priv.field) = { ... } + * optional uint64 min_len = 2 [json_name = "minLen", (.buf.validate.predefined) = { ... } * @param value The minLen to set. * @return This builder for chaining. */ @@ -1743,7 +1878,7 @@ public Builder setMinLen(long value) { * ``` * * - * optional uint64 min_len = 2 [json_name = "minLen", (.buf.validate.priv.field) = { ... } + * optional uint64 min_len = 2 [json_name = "minLen", (.buf.validate.predefined) = { ... } * @return This builder for chaining. */ public Builder clearMinLen() { @@ -1768,7 +1903,7 @@ public Builder clearMinLen() { * ``` * * - * optional uint64 max_len = 3 [json_name = "maxLen", (.buf.validate.priv.field) = { ... } + * optional uint64 max_len = 3 [json_name = "maxLen", (.buf.validate.predefined) = { ... } * @return Whether the maxLen field is set. */ @java.lang.Override @@ -1789,7 +1924,7 @@ public boolean hasMaxLen() { * ``` * * - * optional uint64 max_len = 3 [json_name = "maxLen", (.buf.validate.priv.field) = { ... } + * optional uint64 max_len = 3 [json_name = "maxLen", (.buf.validate.predefined) = { ... } * @return The maxLen. */ @java.lang.Override @@ -1810,7 +1945,7 @@ public long getMaxLen() { * ``` * * - * optional uint64 max_len = 3 [json_name = "maxLen", (.buf.validate.priv.field) = { ... } + * optional uint64 max_len = 3 [json_name = "maxLen", (.buf.validate.predefined) = { ... } * @param value The maxLen to set. * @return This builder for chaining. */ @@ -1835,7 +1970,7 @@ public Builder setMaxLen(long value) { * ``` * * - * optional uint64 max_len = 3 [json_name = "maxLen", (.buf.validate.priv.field) = { ... } + * optional uint64 max_len = 3 [json_name = "maxLen", (.buf.validate.predefined) = { ... } * @return This builder for chaining. */ public Builder clearMaxLen() { @@ -1862,7 +1997,7 @@ public Builder clearMaxLen() { * ``` * * - * optional string pattern = 4 [json_name = "pattern", (.buf.validate.priv.field) = { ... } + * optional string pattern = 4 [json_name = "pattern", (.buf.validate.predefined) = { ... } * @return Whether the pattern field is set. */ public boolean hasPattern() { @@ -1884,7 +2019,7 @@ public boolean hasPattern() { * ``` * * - * optional string pattern = 4 [json_name = "pattern", (.buf.validate.priv.field) = { ... } + * optional string pattern = 4 [json_name = "pattern", (.buf.validate.predefined) = { ... } * @return The pattern. */ public java.lang.String getPattern() { @@ -1893,7 +2028,9 @@ public java.lang.String getPattern() { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); - pattern_ = s; + if (bs.isValidUtf8()) { + pattern_ = s; + } return s; } else { return (java.lang.String) ref; @@ -1915,7 +2052,7 @@ public java.lang.String getPattern() { * ``` * * - * optional string pattern = 4 [json_name = "pattern", (.buf.validate.priv.field) = { ... } + * optional string pattern = 4 [json_name = "pattern", (.buf.validate.predefined) = { ... } * @return The bytes for pattern. */ public com.google.protobuf.ByteString @@ -1947,7 +2084,7 @@ public java.lang.String getPattern() { * ``` * * - * optional string pattern = 4 [json_name = "pattern", (.buf.validate.priv.field) = { ... } + * optional string pattern = 4 [json_name = "pattern", (.buf.validate.predefined) = { ... } * @param value The pattern to set. * @return This builder for chaining. */ @@ -1975,7 +2112,7 @@ public Builder setPattern( * ``` * * - * optional string pattern = 4 [json_name = "pattern", (.buf.validate.priv.field) = { ... } + * optional string pattern = 4 [json_name = "pattern", (.buf.validate.predefined) = { ... } * @return This builder for chaining. */ public Builder clearPattern() { @@ -2000,14 +2137,13 @@ public Builder clearPattern() { * ``` * * - * optional string pattern = 4 [json_name = "pattern", (.buf.validate.priv.field) = { ... } + * optional string pattern = 4 [json_name = "pattern", (.buf.validate.predefined) = { ... } * @param value The bytes for pattern to set. * @return This builder for chaining. */ public Builder setPatternBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } - checkByteStringIsUtf8(value); pattern_ = value; bitField0_ |= 0x00000010; onChanged(); @@ -2029,7 +2165,7 @@ public Builder setPatternBytes( * ``` * * - * optional bytes prefix = 5 [json_name = "prefix", (.buf.validate.priv.field) = { ... } + * optional bytes prefix = 5 [json_name = "prefix", (.buf.validate.predefined) = { ... } * @return Whether the prefix field is set. */ @java.lang.Override @@ -2050,7 +2186,7 @@ public boolean hasPrefix() { * ``` * * - * optional bytes prefix = 5 [json_name = "prefix", (.buf.validate.priv.field) = { ... } + * optional bytes prefix = 5 [json_name = "prefix", (.buf.validate.predefined) = { ... } * @return The prefix. */ @java.lang.Override @@ -2071,7 +2207,7 @@ public com.google.protobuf.ByteString getPrefix() { * ``` * * - * optional bytes prefix = 5 [json_name = "prefix", (.buf.validate.priv.field) = { ... } + * optional bytes prefix = 5 [json_name = "prefix", (.buf.validate.predefined) = { ... } * @param value The prefix to set. * @return This builder for chaining. */ @@ -2096,7 +2232,7 @@ public Builder setPrefix(com.google.protobuf.ByteString value) { * ``` * * - * optional bytes prefix = 5 [json_name = "prefix", (.buf.validate.priv.field) = { ... } + * optional bytes prefix = 5 [json_name = "prefix", (.buf.validate.predefined) = { ... } * @return This builder for chaining. */ public Builder clearPrefix() { @@ -2121,7 +2257,7 @@ public Builder clearPrefix() { * ``` * * - * optional bytes suffix = 6 [json_name = "suffix", (.buf.validate.priv.field) = { ... } + * optional bytes suffix = 6 [json_name = "suffix", (.buf.validate.predefined) = { ... } * @return Whether the suffix field is set. */ @java.lang.Override @@ -2142,7 +2278,7 @@ public boolean hasSuffix() { * ``` * * - * optional bytes suffix = 6 [json_name = "suffix", (.buf.validate.priv.field) = { ... } + * optional bytes suffix = 6 [json_name = "suffix", (.buf.validate.predefined) = { ... } * @return The suffix. */ @java.lang.Override @@ -2163,7 +2299,7 @@ public com.google.protobuf.ByteString getSuffix() { * ``` * * - * optional bytes suffix = 6 [json_name = "suffix", (.buf.validate.priv.field) = { ... } + * optional bytes suffix = 6 [json_name = "suffix", (.buf.validate.predefined) = { ... } * @param value The suffix to set. * @return This builder for chaining. */ @@ -2188,7 +2324,7 @@ public Builder setSuffix(com.google.protobuf.ByteString value) { * ``` * * - * optional bytes suffix = 6 [json_name = "suffix", (.buf.validate.priv.field) = { ... } + * optional bytes suffix = 6 [json_name = "suffix", (.buf.validate.predefined) = { ... } * @return This builder for chaining. */ public Builder clearSuffix() { @@ -2213,7 +2349,7 @@ public Builder clearSuffix() { * ``` * * - * optional bytes contains = 7 [json_name = "contains", (.buf.validate.priv.field) = { ... } + * optional bytes contains = 7 [json_name = "contains", (.buf.validate.predefined) = { ... } * @return Whether the contains field is set. */ @java.lang.Override @@ -2234,7 +2370,7 @@ public boolean hasContains() { * ``` * * - * optional bytes contains = 7 [json_name = "contains", (.buf.validate.priv.field) = { ... } + * optional bytes contains = 7 [json_name = "contains", (.buf.validate.predefined) = { ... } * @return The contains. */ @java.lang.Override @@ -2255,7 +2391,7 @@ public com.google.protobuf.ByteString getContains() { * ``` * * - * optional bytes contains = 7 [json_name = "contains", (.buf.validate.priv.field) = { ... } + * optional bytes contains = 7 [json_name = "contains", (.buf.validate.predefined) = { ... } * @param value The contains to set. * @return This builder for chaining. */ @@ -2280,7 +2416,7 @@ public Builder setContains(com.google.protobuf.ByteString value) { * ``` * * - * optional bytes contains = 7 [json_name = "contains", (.buf.validate.priv.field) = { ... } + * optional bytes contains = 7 [json_name = "contains", (.buf.validate.predefined) = { ... } * @return This builder for chaining. */ public Builder clearContains() { @@ -2311,7 +2447,7 @@ private void ensureInIsMutable() { * ``` * * - * repeated bytes in = 8 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated bytes in = 8 [json_name = "in", (.buf.validate.predefined) = { ... } * @return A list containing the in. */ public java.util.List @@ -2333,7 +2469,7 @@ private void ensureInIsMutable() { * ``` * * - * repeated bytes in = 8 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated bytes in = 8 [json_name = "in", (.buf.validate.predefined) = { ... } * @return The count of in. */ public int getInCount() { @@ -2353,7 +2489,7 @@ public int getInCount() { * ``` * * - * repeated bytes in = 8 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated bytes in = 8 [json_name = "in", (.buf.validate.predefined) = { ... } * @param index The index of the element to return. * @return The in at the given index. */ @@ -2374,7 +2510,7 @@ public com.google.protobuf.ByteString getIn(int index) { * ``` * * - * repeated bytes in = 8 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated bytes in = 8 [json_name = "in", (.buf.validate.predefined) = { ... } * @param index The index to set the value at. * @param value The in to set. * @return This builder for chaining. @@ -2402,7 +2538,7 @@ public Builder setIn( * ``` * * - * repeated bytes in = 8 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated bytes in = 8 [json_name = "in", (.buf.validate.predefined) = { ... } * @param value The in to add. * @return This builder for chaining. */ @@ -2428,7 +2564,7 @@ public Builder addIn(com.google.protobuf.ByteString value) { * ``` * * - * repeated bytes in = 8 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated bytes in = 8 [json_name = "in", (.buf.validate.predefined) = { ... } * @param values The in to add. * @return This builder for chaining. */ @@ -2455,7 +2591,7 @@ public Builder addAllIn( * ``` * * - * repeated bytes in = 8 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated bytes in = 8 [json_name = "in", (.buf.validate.predefined) = { ... } * @return This builder for chaining. */ public Builder clearIn() { @@ -2487,7 +2623,7 @@ private void ensureNotInIsMutable() { * ``` * * - * repeated bytes not_in = 9 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated bytes not_in = 9 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @return A list containing the notIn. */ public java.util.List @@ -2510,7 +2646,7 @@ private void ensureNotInIsMutable() { * ``` * * - * repeated bytes not_in = 9 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated bytes not_in = 9 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @return The count of notIn. */ public int getNotInCount() { @@ -2531,7 +2667,7 @@ public int getNotInCount() { * ``` * * - * repeated bytes not_in = 9 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated bytes not_in = 9 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @param index The index of the element to return. * @return The notIn at the given index. */ @@ -2553,7 +2689,7 @@ public com.google.protobuf.ByteString getNotIn(int index) { * ``` * * - * repeated bytes not_in = 9 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated bytes not_in = 9 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @param index The index to set the value at. * @param value The notIn to set. * @return This builder for chaining. @@ -2582,7 +2718,7 @@ public Builder setNotIn( * ``` * * - * repeated bytes not_in = 9 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated bytes not_in = 9 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @param value The notIn to add. * @return This builder for chaining. */ @@ -2609,7 +2745,7 @@ public Builder addNotIn(com.google.protobuf.ByteString value) { * ``` * * - * repeated bytes not_in = 9 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated bytes not_in = 9 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @param values The notIn to add. * @return This builder for chaining. */ @@ -2637,7 +2773,7 @@ public Builder addAllNotIn( * ``` * * - * repeated bytes not_in = 9 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated bytes not_in = 9 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @return This builder for chaining. */ public Builder clearNotIn() { @@ -2660,7 +2796,7 @@ public Builder clearNotIn() { * ``` * * - * bool ip = 10 [json_name = "ip", (.buf.validate.priv.field) = { ... } + * bool ip = 10 [json_name = "ip", (.buf.validate.predefined) = { ... } * @return Whether the ip field is set. */ public boolean hasIp() { @@ -2679,7 +2815,7 @@ public boolean hasIp() { * ``` * * - * bool ip = 10 [json_name = "ip", (.buf.validate.priv.field) = { ... } + * bool ip = 10 [json_name = "ip", (.buf.validate.predefined) = { ... } * @return The ip. */ public boolean getIp() { @@ -2701,7 +2837,7 @@ public boolean getIp() { * ``` * * - * bool ip = 10 [json_name = "ip", (.buf.validate.priv.field) = { ... } + * bool ip = 10 [json_name = "ip", (.buf.validate.predefined) = { ... } * @param value The ip to set. * @return This builder for chaining. */ @@ -2725,7 +2861,7 @@ public Builder setIp(boolean value) { * ``` * * - * bool ip = 10 [json_name = "ip", (.buf.validate.priv.field) = { ... } + * bool ip = 10 [json_name = "ip", (.buf.validate.predefined) = { ... } * @return This builder for chaining. */ public Builder clearIp() { @@ -2750,7 +2886,7 @@ public Builder clearIp() { * ``` * * - * bool ipv4 = 11 [json_name = "ipv4", (.buf.validate.priv.field) = { ... } + * bool ipv4 = 11 [json_name = "ipv4", (.buf.validate.predefined) = { ... } * @return Whether the ipv4 field is set. */ public boolean hasIpv4() { @@ -2769,7 +2905,7 @@ public boolean hasIpv4() { * ``` * * - * bool ipv4 = 11 [json_name = "ipv4", (.buf.validate.priv.field) = { ... } + * bool ipv4 = 11 [json_name = "ipv4", (.buf.validate.predefined) = { ... } * @return The ipv4. */ public boolean getIpv4() { @@ -2791,7 +2927,7 @@ public boolean getIpv4() { * ``` * * - * bool ipv4 = 11 [json_name = "ipv4", (.buf.validate.priv.field) = { ... } + * bool ipv4 = 11 [json_name = "ipv4", (.buf.validate.predefined) = { ... } * @param value The ipv4 to set. * @return This builder for chaining. */ @@ -2815,7 +2951,7 @@ public Builder setIpv4(boolean value) { * ``` * * - * bool ipv4 = 11 [json_name = "ipv4", (.buf.validate.priv.field) = { ... } + * bool ipv4 = 11 [json_name = "ipv4", (.buf.validate.predefined) = { ... } * @return This builder for chaining. */ public Builder clearIpv4() { @@ -2839,7 +2975,7 @@ public Builder clearIpv4() { * ``` * * - * bool ipv6 = 12 [json_name = "ipv6", (.buf.validate.priv.field) = { ... } + * bool ipv6 = 12 [json_name = "ipv6", (.buf.validate.predefined) = { ... } * @return Whether the ipv6 field is set. */ public boolean hasIpv6() { @@ -2857,7 +2993,7 @@ public boolean hasIpv6() { * ``` * * - * bool ipv6 = 12 [json_name = "ipv6", (.buf.validate.priv.field) = { ... } + * bool ipv6 = 12 [json_name = "ipv6", (.buf.validate.predefined) = { ... } * @return The ipv6. */ public boolean getIpv6() { @@ -2878,7 +3014,7 @@ public boolean getIpv6() { * ``` * * - * bool ipv6 = 12 [json_name = "ipv6", (.buf.validate.priv.field) = { ... } + * bool ipv6 = 12 [json_name = "ipv6", (.buf.validate.predefined) = { ... } * @param value The ipv6 to set. * @return This builder for chaining. */ @@ -2901,7 +3037,7 @@ public Builder setIpv6(boolean value) { * ``` * * - * bool ipv6 = 12 [json_name = "ipv6", (.buf.validate.priv.field) = { ... } + * bool ipv6 = 12 [json_name = "ipv6", (.buf.validate.predefined) = { ... } * @return This builder for chaining. */ public Builder clearIpv6() { @@ -2913,6 +3049,195 @@ public Builder clearIpv6() { return this; } + private com.google.protobuf.Internal.ProtobufList example_ = emptyList(com.google.protobuf.ByteString.class); + private void ensureExampleIsMutable() { + if (!example_.isModifiable()) { + example_ = makeMutableCopy(example_); + } + bitField0_ |= 0x00002000; + } + /** + *
+     * `example` specifies values that the field may have. These values SHOULD
+     * conform to other constraints. `example` values will not impact validation
+     * but may be used as helpful guidance on how to populate the given field.
+     *
+     * ```proto
+     * message MyBytes {
+     * bytes value = 1 [
+     * (buf.validate.field).bytes.example = "\x01\x02",
+     * (buf.validate.field).bytes.example = "\x02\x03"
+     * ];
+     * }
+     * ```
+     * 
+ * + * repeated bytes example = 14 [json_name = "example", (.buf.validate.predefined) = { ... } + * @return A list containing the example. + */ + public java.util.List + getExampleList() { + example_.makeImmutable(); + return example_; + } + /** + *
+     * `example` specifies values that the field may have. These values SHOULD
+     * conform to other constraints. `example` values will not impact validation
+     * but may be used as helpful guidance on how to populate the given field.
+     *
+     * ```proto
+     * message MyBytes {
+     * bytes value = 1 [
+     * (buf.validate.field).bytes.example = "\x01\x02",
+     * (buf.validate.field).bytes.example = "\x02\x03"
+     * ];
+     * }
+     * ```
+     * 
+ * + * repeated bytes example = 14 [json_name = "example", (.buf.validate.predefined) = { ... } + * @return The count of example. + */ + public int getExampleCount() { + return example_.size(); + } + /** + *
+     * `example` specifies values that the field may have. These values SHOULD
+     * conform to other constraints. `example` values will not impact validation
+     * but may be used as helpful guidance on how to populate the given field.
+     *
+     * ```proto
+     * message MyBytes {
+     * bytes value = 1 [
+     * (buf.validate.field).bytes.example = "\x01\x02",
+     * (buf.validate.field).bytes.example = "\x02\x03"
+     * ];
+     * }
+     * ```
+     * 
+ * + * repeated bytes example = 14 [json_name = "example", (.buf.validate.predefined) = { ... } + * @param index The index of the element to return. + * @return The example at the given index. + */ + public com.google.protobuf.ByteString getExample(int index) { + return example_.get(index); + } + /** + *
+     * `example` specifies values that the field may have. These values SHOULD
+     * conform to other constraints. `example` values will not impact validation
+     * but may be used as helpful guidance on how to populate the given field.
+     *
+     * ```proto
+     * message MyBytes {
+     * bytes value = 1 [
+     * (buf.validate.field).bytes.example = "\x01\x02",
+     * (buf.validate.field).bytes.example = "\x02\x03"
+     * ];
+     * }
+     * ```
+     * 
+ * + * repeated bytes example = 14 [json_name = "example", (.buf.validate.predefined) = { ... } + * @param index The index to set the value at. + * @param value The example to set. + * @return This builder for chaining. + */ + public Builder setExample( + int index, com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + ensureExampleIsMutable(); + example_.set(index, value); + bitField0_ |= 0x00002000; + onChanged(); + return this; + } + /** + *
+     * `example` specifies values that the field may have. These values SHOULD
+     * conform to other constraints. `example` values will not impact validation
+     * but may be used as helpful guidance on how to populate the given field.
+     *
+     * ```proto
+     * message MyBytes {
+     * bytes value = 1 [
+     * (buf.validate.field).bytes.example = "\x01\x02",
+     * (buf.validate.field).bytes.example = "\x02\x03"
+     * ];
+     * }
+     * ```
+     * 
+ * + * repeated bytes example = 14 [json_name = "example", (.buf.validate.predefined) = { ... } + * @param value The example to add. + * @return This builder for chaining. + */ + public Builder addExample(com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + ensureExampleIsMutable(); + example_.add(value); + bitField0_ |= 0x00002000; + onChanged(); + return this; + } + /** + *
+     * `example` specifies values that the field may have. These values SHOULD
+     * conform to other constraints. `example` values will not impact validation
+     * but may be used as helpful guidance on how to populate the given field.
+     *
+     * ```proto
+     * message MyBytes {
+     * bytes value = 1 [
+     * (buf.validate.field).bytes.example = "\x01\x02",
+     * (buf.validate.field).bytes.example = "\x02\x03"
+     * ];
+     * }
+     * ```
+     * 
+ * + * repeated bytes example = 14 [json_name = "example", (.buf.validate.predefined) = { ... } + * @param values The example to add. + * @return This builder for chaining. + */ + public Builder addAllExample( + java.lang.Iterable values) { + ensureExampleIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, example_); + bitField0_ |= 0x00002000; + onChanged(); + return this; + } + /** + *
+     * `example` specifies values that the field may have. These values SHOULD
+     * conform to other constraints. `example` values will not impact validation
+     * but may be used as helpful guidance on how to populate the given field.
+     *
+     * ```proto
+     * message MyBytes {
+     * bytes value = 1 [
+     * (buf.validate.field).bytes.example = "\x01\x02",
+     * (buf.validate.field).bytes.example = "\x02\x03"
+     * ];
+     * }
+     * ```
+     * 
+ * + * repeated bytes example = 14 [json_name = "example", (.buf.validate.predefined) = { ... } + * @return This builder for chaining. + */ + public Builder clearExample() { + example_ = emptyList(com.google.protobuf.ByteString.class); + bitField0_ = (bitField0_ & ~0x00002000); + onChanged(); + return this; + } + // @@protoc_insertion_point(builder_scope:buf.validate.BytesRules) } diff --git a/src/main/java/build/buf/validate/BytesRulesOrBuilder.java b/src/main/java/build/buf/validate/BytesRulesOrBuilder.java index 85df84cc..538cb4ff 100644 --- a/src/main/java/build/buf/validate/BytesRulesOrBuilder.java +++ b/src/main/java/build/buf/validate/BytesRulesOrBuilder.java @@ -7,7 +7,8 @@ public interface BytesRulesOrBuilder extends // @@protoc_insertion_point(interface_extends:buf.validate.BytesRules) - com.google.protobuf.MessageOrBuilder { + com.google.protobuf.GeneratedMessage. + ExtendableMessageOrBuilder { /** *
@@ -22,7 +23,7 @@ public interface BytesRulesOrBuilder extends
    * ```
    * 
* - * optional bytes const = 1 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional bytes const = 1 [json_name = "const", (.buf.validate.predefined) = { ... } * @return Whether the const field is set. */ boolean hasConst(); @@ -39,7 +40,7 @@ public interface BytesRulesOrBuilder extends * ``` * * - * optional bytes const = 1 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional bytes const = 1 [json_name = "const", (.buf.validate.predefined) = { ... } * @return The const. */ com.google.protobuf.ByteString getConst(); @@ -57,7 +58,7 @@ public interface BytesRulesOrBuilder extends * ``` * * - * optional uint64 len = 13 [json_name = "len", (.buf.validate.priv.field) = { ... } + * optional uint64 len = 13 [json_name = "len", (.buf.validate.predefined) = { ... } * @return Whether the len field is set. */ boolean hasLen(); @@ -74,7 +75,7 @@ public interface BytesRulesOrBuilder extends * ``` * * - * optional uint64 len = 13 [json_name = "len", (.buf.validate.priv.field) = { ... } + * optional uint64 len = 13 [json_name = "len", (.buf.validate.predefined) = { ... } * @return The len. */ long getLen(); @@ -93,7 +94,7 @@ public interface BytesRulesOrBuilder extends * ``` * * - * optional uint64 min_len = 2 [json_name = "minLen", (.buf.validate.priv.field) = { ... } + * optional uint64 min_len = 2 [json_name = "minLen", (.buf.validate.predefined) = { ... } * @return Whether the minLen field is set. */ boolean hasMinLen(); @@ -111,7 +112,7 @@ public interface BytesRulesOrBuilder extends * ``` * * - * optional uint64 min_len = 2 [json_name = "minLen", (.buf.validate.priv.field) = { ... } + * optional uint64 min_len = 2 [json_name = "minLen", (.buf.validate.predefined) = { ... } * @return The minLen. */ long getMinLen(); @@ -130,7 +131,7 @@ public interface BytesRulesOrBuilder extends * ``` * * - * optional uint64 max_len = 3 [json_name = "maxLen", (.buf.validate.priv.field) = { ... } + * optional uint64 max_len = 3 [json_name = "maxLen", (.buf.validate.predefined) = { ... } * @return Whether the maxLen field is set. */ boolean hasMaxLen(); @@ -148,7 +149,7 @@ public interface BytesRulesOrBuilder extends * ``` * * - * optional uint64 max_len = 3 [json_name = "maxLen", (.buf.validate.priv.field) = { ... } + * optional uint64 max_len = 3 [json_name = "maxLen", (.buf.validate.predefined) = { ... } * @return The maxLen. */ long getMaxLen(); @@ -169,7 +170,7 @@ public interface BytesRulesOrBuilder extends * ``` * * - * optional string pattern = 4 [json_name = "pattern", (.buf.validate.priv.field) = { ... } + * optional string pattern = 4 [json_name = "pattern", (.buf.validate.predefined) = { ... } * @return Whether the pattern field is set. */ boolean hasPattern(); @@ -189,7 +190,7 @@ public interface BytesRulesOrBuilder extends * ``` * * - * optional string pattern = 4 [json_name = "pattern", (.buf.validate.priv.field) = { ... } + * optional string pattern = 4 [json_name = "pattern", (.buf.validate.predefined) = { ... } * @return The pattern. */ java.lang.String getPattern(); @@ -209,7 +210,7 @@ public interface BytesRulesOrBuilder extends * ``` * * - * optional string pattern = 4 [json_name = "pattern", (.buf.validate.priv.field) = { ... } + * optional string pattern = 4 [json_name = "pattern", (.buf.validate.predefined) = { ... } * @return The bytes for pattern. */ com.google.protobuf.ByteString @@ -229,7 +230,7 @@ public interface BytesRulesOrBuilder extends * ``` * * - * optional bytes prefix = 5 [json_name = "prefix", (.buf.validate.priv.field) = { ... } + * optional bytes prefix = 5 [json_name = "prefix", (.buf.validate.predefined) = { ... } * @return Whether the prefix field is set. */ boolean hasPrefix(); @@ -247,7 +248,7 @@ public interface BytesRulesOrBuilder extends * ``` * * - * optional bytes prefix = 5 [json_name = "prefix", (.buf.validate.priv.field) = { ... } + * optional bytes prefix = 5 [json_name = "prefix", (.buf.validate.predefined) = { ... } * @return The prefix. */ com.google.protobuf.ByteString getPrefix(); @@ -266,7 +267,7 @@ public interface BytesRulesOrBuilder extends * ``` * * - * optional bytes suffix = 6 [json_name = "suffix", (.buf.validate.priv.field) = { ... } + * optional bytes suffix = 6 [json_name = "suffix", (.buf.validate.predefined) = { ... } * @return Whether the suffix field is set. */ boolean hasSuffix(); @@ -284,7 +285,7 @@ public interface BytesRulesOrBuilder extends * ``` * * - * optional bytes suffix = 6 [json_name = "suffix", (.buf.validate.priv.field) = { ... } + * optional bytes suffix = 6 [json_name = "suffix", (.buf.validate.predefined) = { ... } * @return The suffix. */ com.google.protobuf.ByteString getSuffix(); @@ -303,7 +304,7 @@ public interface BytesRulesOrBuilder extends * ``` * * - * optional bytes contains = 7 [json_name = "contains", (.buf.validate.priv.field) = { ... } + * optional bytes contains = 7 [json_name = "contains", (.buf.validate.predefined) = { ... } * @return Whether the contains field is set. */ boolean hasContains(); @@ -321,7 +322,7 @@ public interface BytesRulesOrBuilder extends * ``` * * - * optional bytes contains = 7 [json_name = "contains", (.buf.validate.priv.field) = { ... } + * optional bytes contains = 7 [json_name = "contains", (.buf.validate.predefined) = { ... } * @return The contains. */ com.google.protobuf.ByteString getContains(); @@ -340,7 +341,7 @@ public interface BytesRulesOrBuilder extends * ``` * * - * repeated bytes in = 8 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated bytes in = 8 [json_name = "in", (.buf.validate.predefined) = { ... } * @return A list containing the in. */ java.util.List getInList(); @@ -358,7 +359,7 @@ public interface BytesRulesOrBuilder extends * ``` * * - * repeated bytes in = 8 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated bytes in = 8 [json_name = "in", (.buf.validate.predefined) = { ... } * @return The count of in. */ int getInCount(); @@ -376,7 +377,7 @@ public interface BytesRulesOrBuilder extends * ``` * * - * repeated bytes in = 8 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated bytes in = 8 [json_name = "in", (.buf.validate.predefined) = { ... } * @param index The index of the element to return. * @return The in at the given index. */ @@ -397,7 +398,7 @@ public interface BytesRulesOrBuilder extends * ``` * * - * repeated bytes not_in = 9 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated bytes not_in = 9 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @return A list containing the notIn. */ java.util.List getNotInList(); @@ -416,7 +417,7 @@ public interface BytesRulesOrBuilder extends * ``` * * - * repeated bytes not_in = 9 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated bytes not_in = 9 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @return The count of notIn. */ int getNotInCount(); @@ -435,7 +436,7 @@ public interface BytesRulesOrBuilder extends * ``` * * - * repeated bytes not_in = 9 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated bytes not_in = 9 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @param index The index of the element to return. * @return The notIn at the given index. */ @@ -454,7 +455,7 @@ public interface BytesRulesOrBuilder extends * ``` * * - * bool ip = 10 [json_name = "ip", (.buf.validate.priv.field) = { ... } + * bool ip = 10 [json_name = "ip", (.buf.validate.predefined) = { ... } * @return Whether the ip field is set. */ boolean hasIp(); @@ -471,7 +472,7 @@ public interface BytesRulesOrBuilder extends * ``` * * - * bool ip = 10 [json_name = "ip", (.buf.validate.priv.field) = { ... } + * bool ip = 10 [json_name = "ip", (.buf.validate.predefined) = { ... } * @return The ip. */ boolean getIp(); @@ -489,7 +490,7 @@ public interface BytesRulesOrBuilder extends * ``` * * - * bool ipv4 = 11 [json_name = "ipv4", (.buf.validate.priv.field) = { ... } + * bool ipv4 = 11 [json_name = "ipv4", (.buf.validate.predefined) = { ... } * @return Whether the ipv4 field is set. */ boolean hasIpv4(); @@ -506,7 +507,7 @@ public interface BytesRulesOrBuilder extends * ``` * * - * bool ipv4 = 11 [json_name = "ipv4", (.buf.validate.priv.field) = { ... } + * bool ipv4 = 11 [json_name = "ipv4", (.buf.validate.predefined) = { ... } * @return The ipv4. */ boolean getIpv4(); @@ -523,7 +524,7 @@ public interface BytesRulesOrBuilder extends * ``` * * - * bool ipv6 = 12 [json_name = "ipv6", (.buf.validate.priv.field) = { ... } + * bool ipv6 = 12 [json_name = "ipv6", (.buf.validate.predefined) = { ... } * @return Whether the ipv6 field is set. */ boolean hasIpv6(); @@ -539,10 +540,72 @@ public interface BytesRulesOrBuilder extends * ``` * * - * bool ipv6 = 12 [json_name = "ipv6", (.buf.validate.priv.field) = { ... } + * bool ipv6 = 12 [json_name = "ipv6", (.buf.validate.predefined) = { ... } * @return The ipv6. */ boolean getIpv6(); + /** + *
+   * `example` specifies values that the field may have. These values SHOULD
+   * conform to other constraints. `example` values will not impact validation
+   * but may be used as helpful guidance on how to populate the given field.
+   *
+   * ```proto
+   * message MyBytes {
+   * bytes value = 1 [
+   * (buf.validate.field).bytes.example = "\x01\x02",
+   * (buf.validate.field).bytes.example = "\x02\x03"
+   * ];
+   * }
+   * ```
+   * 
+ * + * repeated bytes example = 14 [json_name = "example", (.buf.validate.predefined) = { ... } + * @return A list containing the example. + */ + java.util.List getExampleList(); + /** + *
+   * `example` specifies values that the field may have. These values SHOULD
+   * conform to other constraints. `example` values will not impact validation
+   * but may be used as helpful guidance on how to populate the given field.
+   *
+   * ```proto
+   * message MyBytes {
+   * bytes value = 1 [
+   * (buf.validate.field).bytes.example = "\x01\x02",
+   * (buf.validate.field).bytes.example = "\x02\x03"
+   * ];
+   * }
+   * ```
+   * 
+ * + * repeated bytes example = 14 [json_name = "example", (.buf.validate.predefined) = { ... } + * @return The count of example. + */ + int getExampleCount(); + /** + *
+   * `example` specifies values that the field may have. These values SHOULD
+   * conform to other constraints. `example` values will not impact validation
+   * but may be used as helpful guidance on how to populate the given field.
+   *
+   * ```proto
+   * message MyBytes {
+   * bytes value = 1 [
+   * (buf.validate.field).bytes.example = "\x01\x02",
+   * (buf.validate.field).bytes.example = "\x02\x03"
+   * ];
+   * }
+   * ```
+   * 
+ * + * repeated bytes example = 14 [json_name = "example", (.buf.validate.predefined) = { ... } + * @param index The index of the element to return. + * @return The example at the given index. + */ + com.google.protobuf.ByteString getExample(int index); + build.buf.validate.BytesRules.WellKnownCase getWellKnownCase(); } diff --git a/src/main/java/build/buf/validate/Constraint.java b/src/main/java/build/buf/validate/Constraint.java index e475af72..84517402 100644 --- a/src/main/java/build/buf/validate/Constraint.java +++ b/src/main/java/build/buf/validate/Constraint.java @@ -1,6 +1,6 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // NO CHECKED-IN PROTOBUF GENCODE -// source: buf/validate/expression.proto +// source: buf/validate/validate.proto // Protobuf Java Version: 4.28.1 package build.buf.validate; @@ -52,17 +52,18 @@ private Constraint() { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return build.buf.validate.ExpressionProto.internal_static_buf_validate_Constraint_descriptor; + return build.buf.validate.ValidateProto.internal_static_buf_validate_Constraint_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return build.buf.validate.ExpressionProto.internal_static_buf_validate_Constraint_fieldAccessorTable + return build.buf.validate.ValidateProto.internal_static_buf_validate_Constraint_fieldAccessorTable .ensureFieldAccessorsInitialized( build.buf.validate.Constraint.class, build.buf.validate.Constraint.Builder.class); } + private int bitField0_; public static final int ID_FIELD_NUMBER = 1; @SuppressWarnings("serial") private volatile java.lang.Object id_ = ""; @@ -72,7 +73,20 @@ private Constraint() { * It should be unique within its scope, which could be either a message or a field. * * - * string id = 1 [json_name = "id"]; + * optional string id = 1 [json_name = "id"]; + * @return Whether the id field is set. + */ + @java.lang.Override + public boolean hasId() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + *
+   * `id` is a string that serves as a machine-readable name for this Constraint.
+   * It should be unique within its scope, which could be either a message or a field.
+   * 
+ * + * optional string id = 1 [json_name = "id"]; * @return The id. */ @java.lang.Override @@ -84,7 +98,9 @@ public java.lang.String getId() { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); - id_ = s; + if (bs.isValidUtf8()) { + id_ = s; + } return s; } } @@ -94,7 +110,7 @@ public java.lang.String getId() { * It should be unique within its scope, which could be either a message or a field. * * - * string id = 1 [json_name = "id"]; + * optional string id = 1 [json_name = "id"]; * @return The bytes for id. */ @java.lang.Override @@ -123,7 +139,22 @@ public java.lang.String getId() { * expression evaluation are ignored. * * - * string message = 2 [json_name = "message"]; + * optional string message = 2 [json_name = "message"]; + * @return Whether the message field is set. + */ + @java.lang.Override + public boolean hasMessage() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + *
+   * `message` is an optional field that provides a human-readable error message
+   * for this Constraint when the CEL expression evaluates to false. If a
+   * non-empty message is provided, any strings resulting from the CEL
+   * expression evaluation are ignored.
+   * 
+ * + * optional string message = 2 [json_name = "message"]; * @return The message. */ @java.lang.Override @@ -135,7 +166,9 @@ public java.lang.String getMessage() { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); - message_ = s; + if (bs.isValidUtf8()) { + message_ = s; + } return s; } } @@ -147,7 +180,7 @@ public java.lang.String getMessage() { * expression evaluation are ignored. * * - * string message = 2 [json_name = "message"]; + * optional string message = 2 [json_name = "message"]; * @return The bytes for message. */ @java.lang.Override @@ -176,7 +209,22 @@ public java.lang.String getMessage() { * validation is considered failed, and the message is rejected. * * - * string expression = 3 [json_name = "expression"]; + * optional string expression = 3 [json_name = "expression"]; + * @return Whether the expression field is set. + */ + @java.lang.Override + public boolean hasExpression() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + *
+   * `expression` is the actual CEL expression that will be evaluated for
+   * validation. This string must resolve to either a boolean or a string
+   * value. If the expression evaluates to false or a non-empty string, the
+   * validation is considered failed, and the message is rejected.
+   * 
+ * + * optional string expression = 3 [json_name = "expression"]; * @return The expression. */ @java.lang.Override @@ -188,7 +236,9 @@ public java.lang.String getExpression() { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); - expression_ = s; + if (bs.isValidUtf8()) { + expression_ = s; + } return s; } } @@ -200,7 +250,7 @@ public java.lang.String getExpression() { * validation is considered failed, and the message is rejected. * * - * string expression = 3 [json_name = "expression"]; + * optional string expression = 3 [json_name = "expression"]; * @return The bytes for expression. */ @java.lang.Override @@ -232,13 +282,13 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessage.isStringEmpty(id_)) { + if (((bitField0_ & 0x00000001) != 0)) { com.google.protobuf.GeneratedMessage.writeString(output, 1, id_); } - if (!com.google.protobuf.GeneratedMessage.isStringEmpty(message_)) { + if (((bitField0_ & 0x00000002) != 0)) { com.google.protobuf.GeneratedMessage.writeString(output, 2, message_); } - if (!com.google.protobuf.GeneratedMessage.isStringEmpty(expression_)) { + if (((bitField0_ & 0x00000004) != 0)) { com.google.protobuf.GeneratedMessage.writeString(output, 3, expression_); } getUnknownFields().writeTo(output); @@ -250,13 +300,13 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (!com.google.protobuf.GeneratedMessage.isStringEmpty(id_)) { + if (((bitField0_ & 0x00000001) != 0)) { size += com.google.protobuf.GeneratedMessage.computeStringSize(1, id_); } - if (!com.google.protobuf.GeneratedMessage.isStringEmpty(message_)) { + if (((bitField0_ & 0x00000002) != 0)) { size += com.google.protobuf.GeneratedMessage.computeStringSize(2, message_); } - if (!com.google.protobuf.GeneratedMessage.isStringEmpty(expression_)) { + if (((bitField0_ & 0x00000004) != 0)) { size += com.google.protobuf.GeneratedMessage.computeStringSize(3, expression_); } size += getUnknownFields().getSerializedSize(); @@ -274,12 +324,21 @@ public boolean equals(final java.lang.Object obj) { } build.buf.validate.Constraint other = (build.buf.validate.Constraint) obj; - if (!getId() - .equals(other.getId())) return false; - if (!getMessage() - .equals(other.getMessage())) return false; - if (!getExpression() - .equals(other.getExpression())) return false; + if (hasId() != other.hasId()) return false; + if (hasId()) { + if (!getId() + .equals(other.getId())) return false; + } + if (hasMessage() != other.hasMessage()) return false; + if (hasMessage()) { + if (!getMessage() + .equals(other.getMessage())) return false; + } + if (hasExpression() != other.hasExpression()) return false; + if (hasExpression()) { + if (!getExpression() + .equals(other.getExpression())) return false; + } if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -291,12 +350,18 @@ public int hashCode() { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + ID_FIELD_NUMBER; - hash = (53 * hash) + getId().hashCode(); - hash = (37 * hash) + MESSAGE_FIELD_NUMBER; - hash = (53 * hash) + getMessage().hashCode(); - hash = (37 * hash) + EXPRESSION_FIELD_NUMBER; - hash = (53 * hash) + getExpression().hashCode(); + if (hasId()) { + hash = (37 * hash) + ID_FIELD_NUMBER; + hash = (53 * hash) + getId().hashCode(); + } + if (hasMessage()) { + hash = (37 * hash) + MESSAGE_FIELD_NUMBER; + hash = (53 * hash) + getMessage().hashCode(); + } + if (hasExpression()) { + hash = (37 * hash) + EXPRESSION_FIELD_NUMBER; + hash = (53 * hash) + getExpression().hashCode(); + } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -421,13 +486,13 @@ public static final class Builder extends build.buf.validate.ConstraintOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return build.buf.validate.ExpressionProto.internal_static_buf_validate_Constraint_descriptor; + return build.buf.validate.ValidateProto.internal_static_buf_validate_Constraint_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return build.buf.validate.ExpressionProto.internal_static_buf_validate_Constraint_fieldAccessorTable + return build.buf.validate.ValidateProto.internal_static_buf_validate_Constraint_fieldAccessorTable .ensureFieldAccessorsInitialized( build.buf.validate.Constraint.class, build.buf.validate.Constraint.Builder.class); } @@ -455,7 +520,7 @@ public Builder clear() { @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return build.buf.validate.ExpressionProto.internal_static_buf_validate_Constraint_descriptor; + return build.buf.validate.ValidateProto.internal_static_buf_validate_Constraint_descriptor; } @java.lang.Override @@ -482,15 +547,20 @@ public build.buf.validate.Constraint buildPartial() { private void buildPartial0(build.buf.validate.Constraint result) { int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; if (((from_bitField0_ & 0x00000001) != 0)) { result.id_ = id_; + to_bitField0_ |= 0x00000001; } if (((from_bitField0_ & 0x00000002) != 0)) { result.message_ = message_; + to_bitField0_ |= 0x00000002; } if (((from_bitField0_ & 0x00000004) != 0)) { result.expression_ = expression_; + to_bitField0_ |= 0x00000004; } + result.bitField0_ |= to_bitField0_; } @java.lang.Override @@ -505,17 +575,17 @@ public Builder mergeFrom(com.google.protobuf.Message other) { public Builder mergeFrom(build.buf.validate.Constraint other) { if (other == build.buf.validate.Constraint.getDefaultInstance()) return this; - if (!other.getId().isEmpty()) { + if (other.hasId()) { id_ = other.id_; bitField0_ |= 0x00000001; onChanged(); } - if (!other.getMessage().isEmpty()) { + if (other.hasMessage()) { message_ = other.message_; bitField0_ |= 0x00000002; onChanged(); } - if (!other.getExpression().isEmpty()) { + if (other.hasExpression()) { expression_ = other.expression_; bitField0_ |= 0x00000004; onChanged(); @@ -547,17 +617,17 @@ public Builder mergeFrom( done = true; break; case 10: { - id_ = input.readStringRequireUtf8(); + id_ = input.readBytes(); bitField0_ |= 0x00000001; break; } // case 10 case 18: { - message_ = input.readStringRequireUtf8(); + message_ = input.readBytes(); bitField0_ |= 0x00000002; break; } // case 18 case 26: { - expression_ = input.readStringRequireUtf8(); + expression_ = input.readBytes(); bitField0_ |= 0x00000004; break; } // case 26 @@ -585,7 +655,19 @@ public Builder mergeFrom( * It should be unique within its scope, which could be either a message or a field. * * - * string id = 1 [json_name = "id"]; + * optional string id = 1 [json_name = "id"]; + * @return Whether the id field is set. + */ + public boolean hasId() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + *
+     * `id` is a string that serves as a machine-readable name for this Constraint.
+     * It should be unique within its scope, which could be either a message or a field.
+     * 
+ * + * optional string id = 1 [json_name = "id"]; * @return The id. */ public java.lang.String getId() { @@ -594,7 +676,9 @@ public java.lang.String getId() { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); - id_ = s; + if (bs.isValidUtf8()) { + id_ = s; + } return s; } else { return (java.lang.String) ref; @@ -606,7 +690,7 @@ public java.lang.String getId() { * It should be unique within its scope, which could be either a message or a field. * * - * string id = 1 [json_name = "id"]; + * optional string id = 1 [json_name = "id"]; * @return The bytes for id. */ public com.google.protobuf.ByteString @@ -628,7 +712,7 @@ public java.lang.String getId() { * It should be unique within its scope, which could be either a message or a field. * * - * string id = 1 [json_name = "id"]; + * optional string id = 1 [json_name = "id"]; * @param value The id to set. * @return This builder for chaining. */ @@ -646,7 +730,7 @@ public Builder setId( * It should be unique within its scope, which could be either a message or a field. * * - * string id = 1 [json_name = "id"]; + * optional string id = 1 [json_name = "id"]; * @return This builder for chaining. */ public Builder clearId() { @@ -661,14 +745,13 @@ public Builder clearId() { * It should be unique within its scope, which could be either a message or a field. * * - * string id = 1 [json_name = "id"]; + * optional string id = 1 [json_name = "id"]; * @param value The bytes for id to set. * @return This builder for chaining. */ public Builder setIdBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } - checkByteStringIsUtf8(value); id_ = value; bitField0_ |= 0x00000001; onChanged(); @@ -684,7 +767,21 @@ public Builder setIdBytes( * expression evaluation are ignored. * * - * string message = 2 [json_name = "message"]; + * optional string message = 2 [json_name = "message"]; + * @return Whether the message field is set. + */ + public boolean hasMessage() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + *
+     * `message` is an optional field that provides a human-readable error message
+     * for this Constraint when the CEL expression evaluates to false. If a
+     * non-empty message is provided, any strings resulting from the CEL
+     * expression evaluation are ignored.
+     * 
+ * + * optional string message = 2 [json_name = "message"]; * @return The message. */ public java.lang.String getMessage() { @@ -693,7 +790,9 @@ public java.lang.String getMessage() { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); - message_ = s; + if (bs.isValidUtf8()) { + message_ = s; + } return s; } else { return (java.lang.String) ref; @@ -707,7 +806,7 @@ public java.lang.String getMessage() { * expression evaluation are ignored. * * - * string message = 2 [json_name = "message"]; + * optional string message = 2 [json_name = "message"]; * @return The bytes for message. */ public com.google.protobuf.ByteString @@ -731,7 +830,7 @@ public java.lang.String getMessage() { * expression evaluation are ignored. * * - * string message = 2 [json_name = "message"]; + * optional string message = 2 [json_name = "message"]; * @param value The message to set. * @return This builder for chaining. */ @@ -751,7 +850,7 @@ public Builder setMessage( * expression evaluation are ignored. * * - * string message = 2 [json_name = "message"]; + * optional string message = 2 [json_name = "message"]; * @return This builder for chaining. */ public Builder clearMessage() { @@ -768,14 +867,13 @@ public Builder clearMessage() { * expression evaluation are ignored. * * - * string message = 2 [json_name = "message"]; + * optional string message = 2 [json_name = "message"]; * @param value The bytes for message to set. * @return This builder for chaining. */ public Builder setMessageBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } - checkByteStringIsUtf8(value); message_ = value; bitField0_ |= 0x00000002; onChanged(); @@ -791,7 +889,21 @@ public Builder setMessageBytes( * validation is considered failed, and the message is rejected. * * - * string expression = 3 [json_name = "expression"]; + * optional string expression = 3 [json_name = "expression"]; + * @return Whether the expression field is set. + */ + public boolean hasExpression() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + *
+     * `expression` is the actual CEL expression that will be evaluated for
+     * validation. This string must resolve to either a boolean or a string
+     * value. If the expression evaluates to false or a non-empty string, the
+     * validation is considered failed, and the message is rejected.
+     * 
+ * + * optional string expression = 3 [json_name = "expression"]; * @return The expression. */ public java.lang.String getExpression() { @@ -800,7 +912,9 @@ public java.lang.String getExpression() { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); - expression_ = s; + if (bs.isValidUtf8()) { + expression_ = s; + } return s; } else { return (java.lang.String) ref; @@ -814,7 +928,7 @@ public java.lang.String getExpression() { * validation is considered failed, and the message is rejected. * * - * string expression = 3 [json_name = "expression"]; + * optional string expression = 3 [json_name = "expression"]; * @return The bytes for expression. */ public com.google.protobuf.ByteString @@ -838,7 +952,7 @@ public java.lang.String getExpression() { * validation is considered failed, and the message is rejected. * * - * string expression = 3 [json_name = "expression"]; + * optional string expression = 3 [json_name = "expression"]; * @param value The expression to set. * @return This builder for chaining. */ @@ -858,7 +972,7 @@ public Builder setExpression( * validation is considered failed, and the message is rejected. * * - * string expression = 3 [json_name = "expression"]; + * optional string expression = 3 [json_name = "expression"]; * @return This builder for chaining. */ public Builder clearExpression() { @@ -875,14 +989,13 @@ public Builder clearExpression() { * validation is considered failed, and the message is rejected. * * - * string expression = 3 [json_name = "expression"]; + * optional string expression = 3 [json_name = "expression"]; * @param value The bytes for expression to set. * @return This builder for chaining. */ public Builder setExpressionBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } - checkByteStringIsUtf8(value); expression_ = value; bitField0_ |= 0x00000004; onChanged(); diff --git a/src/main/java/build/buf/validate/ConstraintOrBuilder.java b/src/main/java/build/buf/validate/ConstraintOrBuilder.java index 4ed0aae7..a78b457b 100644 --- a/src/main/java/build/buf/validate/ConstraintOrBuilder.java +++ b/src/main/java/build/buf/validate/ConstraintOrBuilder.java @@ -1,6 +1,6 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // NO CHECKED-IN PROTOBUF GENCODE -// source: buf/validate/expression.proto +// source: buf/validate/validate.proto // Protobuf Java Version: 4.28.1 package build.buf.validate; @@ -15,7 +15,17 @@ public interface ConstraintOrBuilder extends * It should be unique within its scope, which could be either a message or a field. * * - * string id = 1 [json_name = "id"]; + * optional string id = 1 [json_name = "id"]; + * @return Whether the id field is set. + */ + boolean hasId(); + /** + *
+   * `id` is a string that serves as a machine-readable name for this Constraint.
+   * It should be unique within its scope, which could be either a message or a field.
+   * 
+ * + * optional string id = 1 [json_name = "id"]; * @return The id. */ java.lang.String getId(); @@ -25,7 +35,7 @@ public interface ConstraintOrBuilder extends * It should be unique within its scope, which could be either a message or a field. * * - * string id = 1 [json_name = "id"]; + * optional string id = 1 [json_name = "id"]; * @return The bytes for id. */ com.google.protobuf.ByteString @@ -39,7 +49,19 @@ public interface ConstraintOrBuilder extends * expression evaluation are ignored. * * - * string message = 2 [json_name = "message"]; + * optional string message = 2 [json_name = "message"]; + * @return Whether the message field is set. + */ + boolean hasMessage(); + /** + *
+   * `message` is an optional field that provides a human-readable error message
+   * for this Constraint when the CEL expression evaluates to false. If a
+   * non-empty message is provided, any strings resulting from the CEL
+   * expression evaluation are ignored.
+   * 
+ * + * optional string message = 2 [json_name = "message"]; * @return The message. */ java.lang.String getMessage(); @@ -51,7 +73,7 @@ public interface ConstraintOrBuilder extends * expression evaluation are ignored. * * - * string message = 2 [json_name = "message"]; + * optional string message = 2 [json_name = "message"]; * @return The bytes for message. */ com.google.protobuf.ByteString @@ -65,7 +87,19 @@ public interface ConstraintOrBuilder extends * validation is considered failed, and the message is rejected. * * - * string expression = 3 [json_name = "expression"]; + * optional string expression = 3 [json_name = "expression"]; + * @return Whether the expression field is set. + */ + boolean hasExpression(); + /** + *
+   * `expression` is the actual CEL expression that will be evaluated for
+   * validation. This string must resolve to either a boolean or a string
+   * value. If the expression evaluates to false or a non-empty string, the
+   * validation is considered failed, and the message is rejected.
+   * 
+ * + * optional string expression = 3 [json_name = "expression"]; * @return The expression. */ java.lang.String getExpression(); @@ -77,7 +111,7 @@ public interface ConstraintOrBuilder extends * validation is considered failed, and the message is rejected. * * - * string expression = 3 [json_name = "expression"]; + * optional string expression = 3 [json_name = "expression"]; * @return The bytes for expression. */ com.google.protobuf.ByteString diff --git a/src/main/java/build/buf/validate/DoubleRules.java b/src/main/java/build/buf/validate/DoubleRules.java index 581a6147..2173b5f9 100644 --- a/src/main/java/build/buf/validate/DoubleRules.java +++ b/src/main/java/build/buf/validate/DoubleRules.java @@ -14,7 +14,8 @@ * Protobuf type {@code buf.validate.DoubleRules} */ public final class DoubleRules extends - com.google.protobuf.GeneratedMessage implements + com.google.protobuf.GeneratedMessage.ExtendableMessage< + DoubleRules> implements // @@protoc_insertion_point(message_implements:buf.validate.DoubleRules) DoubleRulesOrBuilder { private static final long serialVersionUID = 0L; @@ -28,12 +29,13 @@ public final class DoubleRules extends DoubleRules.class.getName()); } // Use DoubleRules.newBuilder() to construct. - private DoubleRules(com.google.protobuf.GeneratedMessage.Builder builder) { + private DoubleRules(com.google.protobuf.GeneratedMessage.ExtendableBuilder builder) { super(builder); } private DoubleRules() { in_ = emptyDoubleList(); notIn_ = emptyDoubleList(); + example_ = emptyDoubleList(); } public static final com.google.protobuf.Descriptors.Descriptor @@ -149,7 +151,7 @@ public int getNumber() { * ``` * * - * optional double const = 1 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional double const = 1 [json_name = "const", (.buf.validate.predefined) = { ... } * @return Whether the const field is set. */ @java.lang.Override @@ -169,7 +171,7 @@ public boolean hasConst() { * ``` * * - * optional double const = 1 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional double const = 1 [json_name = "const", (.buf.validate.predefined) = { ... } * @return The const. */ @java.lang.Override @@ -192,7 +194,7 @@ public double getConst() { * ``` * * - * double lt = 2 [json_name = "lt", (.buf.validate.priv.field) = { ... } + * double lt = 2 [json_name = "lt", (.buf.validate.predefined) = { ... } * @return Whether the lt field is set. */ @java.lang.Override @@ -213,7 +215,7 @@ public boolean hasLt() { * ``` * * - * double lt = 2 [json_name = "lt", (.buf.validate.priv.field) = { ... } + * double lt = 2 [json_name = "lt", (.buf.validate.predefined) = { ... } * @return The lt. */ @java.lang.Override @@ -239,7 +241,7 @@ public double getLt() { * ``` * * - * double lte = 3 [json_name = "lte", (.buf.validate.priv.field) = { ... } + * double lte = 3 [json_name = "lte", (.buf.validate.predefined) = { ... } * @return Whether the lte field is set. */ @java.lang.Override @@ -260,7 +262,7 @@ public boolean hasLte() { * ``` * * - * double lte = 3 [json_name = "lte", (.buf.validate.priv.field) = { ... } + * double lte = 3 [json_name = "lte", (.buf.validate.predefined) = { ... } * @return The lte. */ @java.lang.Override @@ -294,7 +296,7 @@ public double getLte() { * ``` * * - * double gt = 4 [json_name = "gt", (.buf.validate.priv.field) = { ... } + * double gt = 4 [json_name = "gt", (.buf.validate.predefined) = { ... } * @return Whether the gt field is set. */ @java.lang.Override @@ -323,7 +325,7 @@ public boolean hasGt() { * ``` * * - * double gt = 4 [json_name = "gt", (.buf.validate.priv.field) = { ... } + * double gt = 4 [json_name = "gt", (.buf.validate.predefined) = { ... } * @return The gt. */ @java.lang.Override @@ -357,7 +359,7 @@ public double getGt() { * ``` * * - * double gte = 5 [json_name = "gte", (.buf.validate.priv.field) = { ... } + * double gte = 5 [json_name = "gte", (.buf.validate.predefined) = { ... } * @return Whether the gte field is set. */ @java.lang.Override @@ -386,7 +388,7 @@ public boolean hasGte() { * ``` * * - * double gte = 5 [json_name = "gte", (.buf.validate.priv.field) = { ... } + * double gte = 5 [json_name = "gte", (.buf.validate.predefined) = { ... } * @return The gte. */ @java.lang.Override @@ -415,7 +417,7 @@ public double getGte() { * ``` * * - * repeated double in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated double in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @return A list containing the in. */ @java.lang.Override @@ -437,7 +439,7 @@ public double getGte() { * ``` * * - * repeated double in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated double in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @return The count of in. */ public int getInCount() { @@ -457,14 +459,13 @@ public int getInCount() { * ``` * * - * repeated double in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated double in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @param index The index of the element to return. * @return The in at the given index. */ public double getIn(int index) { return in_.getDouble(index); } - private int inMemoizedSerializedSize = -1; public static final int NOT_IN_FIELD_NUMBER = 7; @SuppressWarnings("serial") @@ -484,7 +485,7 @@ public double getIn(int index) { * ``` * * - * repeated double not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated double not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @return A list containing the notIn. */ @java.lang.Override @@ -506,7 +507,7 @@ public double getIn(int index) { * ``` * * - * repeated double not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated double not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @return The count of notIn. */ public int getNotInCount() { @@ -526,14 +527,13 @@ public int getNotInCount() { * ``` * * - * repeated double not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated double not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @param index The index of the element to return. * @return The notIn at the given index. */ public double getNotIn(int index) { return notIn_.getDouble(index); } - private int notInMemoizedSerializedSize = -1; public static final int FINITE_FIELD_NUMBER = 8; private boolean finite_ = false; @@ -543,7 +543,20 @@ public double getNotIn(int index) { * infinite or NaN, an error message is generated. * * - * bool finite = 8 [json_name = "finite", (.buf.validate.priv.field) = { ... } + * optional bool finite = 8 [json_name = "finite", (.buf.validate.predefined) = { ... } + * @return Whether the finite field is set. + */ + @java.lang.Override + public boolean hasFinite() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + *
+   * `finite` requires the field value to be finite. If the field value is
+   * infinite or NaN, an error message is generated.
+   * 
+ * + * optional bool finite = 8 [json_name = "finite", (.buf.validate.predefined) = { ... } * @return The finite. */ @java.lang.Override @@ -551,6 +564,80 @@ public boolean getFinite() { return finite_; } + public static final int EXAMPLE_FIELD_NUMBER = 9; + @SuppressWarnings("serial") + private com.google.protobuf.Internal.DoubleList example_ = + emptyDoubleList(); + /** + *
+   * `example` specifies values that the field may have. These values SHOULD
+   * conform to other constraints. `example` values will not impact validation
+   * but may be used as helpful guidance on how to populate the given field.
+   *
+   * ```proto
+   * message MyDouble {
+   * double value = 1 [
+   * (buf.validate.field).double.example = 1.0,
+   * (buf.validate.field).double.example = "Infinity"
+   * ];
+   * }
+   * ```
+   * 
+ * + * repeated double example = 9 [json_name = "example", (.buf.validate.predefined) = { ... } + * @return A list containing the example. + */ + @java.lang.Override + public java.util.List + getExampleList() { + return example_; + } + /** + *
+   * `example` specifies values that the field may have. These values SHOULD
+   * conform to other constraints. `example` values will not impact validation
+   * but may be used as helpful guidance on how to populate the given field.
+   *
+   * ```proto
+   * message MyDouble {
+   * double value = 1 [
+   * (buf.validate.field).double.example = 1.0,
+   * (buf.validate.field).double.example = "Infinity"
+   * ];
+   * }
+   * ```
+   * 
+ * + * repeated double example = 9 [json_name = "example", (.buf.validate.predefined) = { ... } + * @return The count of example. + */ + public int getExampleCount() { + return example_.size(); + } + /** + *
+   * `example` specifies values that the field may have. These values SHOULD
+   * conform to other constraints. `example` values will not impact validation
+   * but may be used as helpful guidance on how to populate the given field.
+   *
+   * ```proto
+   * message MyDouble {
+   * double value = 1 [
+   * (buf.validate.field).double.example = 1.0,
+   * (buf.validate.field).double.example = "Infinity"
+   * ];
+   * }
+   * ```
+   * 
+ * + * repeated double example = 9 [json_name = "example", (.buf.validate.predefined) = { ... } + * @param index The index of the element to return. + * @return The example at the given index. + */ + public double getExample(int index) { + return example_.getDouble(index); + } + private byte memoizedIsInitialized = -1; @java.lang.Override public final boolean isInitialized() { @@ -558,6 +645,10 @@ public final boolean isInitialized() { if (isInitialized == 1) return true; if (isInitialized == 0) return false; + if (!extensionsAreInitialized()) { + memoizedIsInitialized = 0; + return false; + } memoizedIsInitialized = 1; return true; } @@ -565,7 +656,9 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - getSerializedSize(); + com.google.protobuf.GeneratedMessage + .ExtendableMessage.ExtensionSerializer + extensionWriter = newExtensionSerializer(); if (((bitField0_ & 0x00000001) != 0)) { output.writeDouble(1, const_); } @@ -585,23 +678,19 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) output.writeDouble( 5, (double)((java.lang.Double) greaterThan_)); } - if (getInList().size() > 0) { - output.writeUInt32NoTag(50); - output.writeUInt32NoTag(inMemoizedSerializedSize); - } for (int i = 0; i < in_.size(); i++) { - output.writeDoubleNoTag(in_.getDouble(i)); - } - if (getNotInList().size() > 0) { - output.writeUInt32NoTag(58); - output.writeUInt32NoTag(notInMemoizedSerializedSize); + output.writeDouble(6, in_.getDouble(i)); } for (int i = 0; i < notIn_.size(); i++) { - output.writeDoubleNoTag(notIn_.getDouble(i)); + output.writeDouble(7, notIn_.getDouble(i)); } - if (finite_ != false) { + if (((bitField0_ & 0x00000002) != 0)) { output.writeBool(8, finite_); } + for (int i = 0; i < example_.size(); i++) { + output.writeDouble(9, example_.getDouble(i)); + } + extensionWriter.writeUntil(536870912, output); getUnknownFields().writeTo(output); } @@ -639,28 +728,25 @@ public int getSerializedSize() { int dataSize = 0; dataSize = 8 * getInList().size(); size += dataSize; - if (!getInList().isEmpty()) { - size += 1; - size += com.google.protobuf.CodedOutputStream - .computeInt32SizeNoTag(dataSize); - } - inMemoizedSerializedSize = dataSize; + size += 1 * getInList().size(); } { int dataSize = 0; dataSize = 8 * getNotInList().size(); size += dataSize; - if (!getNotInList().isEmpty()) { - size += 1; - size += com.google.protobuf.CodedOutputStream - .computeInt32SizeNoTag(dataSize); - } - notInMemoizedSerializedSize = dataSize; + size += 1 * getNotInList().size(); } - if (finite_ != false) { + if (((bitField0_ & 0x00000002) != 0)) { size += com.google.protobuf.CodedOutputStream .computeBoolSize(8, finite_); } + { + int dataSize = 0; + dataSize = 8 * getExampleList().size(); + size += dataSize; + size += 1 * getExampleList().size(); + } + size += extensionsSerializedSize(); size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -686,8 +772,13 @@ public boolean equals(final java.lang.Object obj) { .equals(other.getInList())) return false; if (!getNotInList() .equals(other.getNotInList())) return false; - if (getFinite() - != other.getFinite()) return false; + if (hasFinite() != other.hasFinite()) return false; + if (hasFinite()) { + if (getFinite() + != other.getFinite()) return false; + } + if (!getExampleList() + .equals(other.getExampleList())) return false; if (!getLessThanCase().equals(other.getLessThanCase())) return false; switch (lessThanCase_) { case 2: @@ -719,6 +810,8 @@ public boolean equals(final java.lang.Object obj) { default: } if (!getUnknownFields().equals(other.getUnknownFields())) return false; + if (!getExtensionFields().equals(other.getExtensionFields())) + return false; return true; } @@ -742,9 +835,15 @@ public int hashCode() { hash = (37 * hash) + NOT_IN_FIELD_NUMBER; hash = (53 * hash) + getNotInList().hashCode(); } - hash = (37 * hash) + FINITE_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getFinite()); + if (hasFinite()) { + hash = (37 * hash) + FINITE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getFinite()); + } + if (getExampleCount() > 0) { + hash = (37 * hash) + EXAMPLE_FIELD_NUMBER; + hash = (53 * hash) + getExampleList().hashCode(); + } switch (lessThanCase_) { case 2: hash = (37 * hash) + LT_FIELD_NUMBER; @@ -773,6 +872,7 @@ public int hashCode() { case 0: default: } + hash = hashFields(hash, getExtensionFields()); hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -879,7 +979,8 @@ protected Builder newBuilderForType( * Protobuf type {@code buf.validate.DoubleRules} */ public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder implements + com.google.protobuf.GeneratedMessage.ExtendableBuilder< + build.buf.validate.DoubleRules, Builder> implements // @@protoc_insertion_point(builder_implements:buf.validate.DoubleRules) build.buf.validate.DoubleRulesOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor @@ -913,6 +1014,7 @@ public Builder clear() { in_ = emptyDoubleList(); notIn_ = emptyDoubleList(); finite_ = false; + example_ = emptyDoubleList(); lessThanCase_ = 0; lessThan_ = null; greaterThanCase_ = 0; @@ -966,6 +1068,11 @@ private void buildPartial0(build.buf.validate.DoubleRules result) { } if (((from_bitField0_ & 0x00000080) != 0)) { result.finite_ = finite_; + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + example_.makeImmutable(); + result.example_ = example_; } result.bitField0_ |= to_bitField0_; } @@ -1014,9 +1121,20 @@ public Builder mergeFrom(build.buf.validate.DoubleRules other) { } onChanged(); } - if (other.getFinite() != false) { + if (other.hasFinite()) { setFinite(other.getFinite()); } + if (!other.example_.isEmpty()) { + if (example_.isEmpty()) { + example_ = other.example_; + example_.makeImmutable(); + bitField0_ |= 0x00000100; + } else { + ensureExampleIsMutable(); + example_.addAll(other.example_); + } + onChanged(); + } switch (other.getLessThanCase()) { case LT: { setLt(other.getLt()); @@ -1043,6 +1161,7 @@ public Builder mergeFrom(build.buf.validate.DoubleRules other) { break; } } + this.mergeExtensionFields(other); this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -1050,6 +1169,9 @@ public Builder mergeFrom(build.buf.validate.DoubleRules other) { @java.lang.Override public final boolean isInitialized() { + if (!extensionsAreInitialized()) { + return false; + } return true; } @@ -1133,6 +1255,23 @@ public Builder mergeFrom( bitField0_ |= 0x00000080; break; } // case 64 + case 73: { + double v = input.readDouble(); + ensureExampleIsMutable(); + example_.addDouble(v); + break; + } // case 73 + case 74: { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + int alloc = length > 4096 ? 4096 : length; + ensureExampleIsMutable(alloc / 8); + while (input.getBytesUntilLimit() > 0) { + example_.addDouble(input.readDouble()); + } + input.popLimit(limit); + break; + } // case 74 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { done = true; // was an endgroup tag @@ -1194,7 +1333,7 @@ public Builder clearGreaterThan() { * ``` * * - * optional double const = 1 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional double const = 1 [json_name = "const", (.buf.validate.predefined) = { ... } * @return Whether the const field is set. */ @java.lang.Override @@ -1214,7 +1353,7 @@ public boolean hasConst() { * ``` * * - * optional double const = 1 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional double const = 1 [json_name = "const", (.buf.validate.predefined) = { ... } * @return The const. */ @java.lang.Override @@ -1234,7 +1373,7 @@ public double getConst() { * ``` * * - * optional double const = 1 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional double const = 1 [json_name = "const", (.buf.validate.predefined) = { ... } * @param value The const to set. * @return This builder for chaining. */ @@ -1258,7 +1397,7 @@ public Builder setConst(double value) { * ``` * * - * optional double const = 1 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional double const = 1 [json_name = "const", (.buf.validate.predefined) = { ... } * @return This builder for chaining. */ public Builder clearConst() { @@ -1282,7 +1421,7 @@ public Builder clearConst() { * ``` * * - * double lt = 2 [json_name = "lt", (.buf.validate.priv.field) = { ... } + * double lt = 2 [json_name = "lt", (.buf.validate.predefined) = { ... } * @return Whether the lt field is set. */ public boolean hasLt() { @@ -1302,7 +1441,7 @@ public boolean hasLt() { * ``` * * - * double lt = 2 [json_name = "lt", (.buf.validate.priv.field) = { ... } + * double lt = 2 [json_name = "lt", (.buf.validate.predefined) = { ... } * @return The lt. */ public double getLt() { @@ -1325,7 +1464,7 @@ public double getLt() { * ``` * * - * double lt = 2 [json_name = "lt", (.buf.validate.priv.field) = { ... } + * double lt = 2 [json_name = "lt", (.buf.validate.predefined) = { ... } * @param value The lt to set. * @return This builder for chaining. */ @@ -1350,7 +1489,7 @@ public Builder setLt(double value) { * ``` * * - * double lt = 2 [json_name = "lt", (.buf.validate.priv.field) = { ... } + * double lt = 2 [json_name = "lt", (.buf.validate.predefined) = { ... } * @return This builder for chaining. */ public Builder clearLt() { @@ -1376,7 +1515,7 @@ public Builder clearLt() { * ``` * * - * double lte = 3 [json_name = "lte", (.buf.validate.priv.field) = { ... } + * double lte = 3 [json_name = "lte", (.buf.validate.predefined) = { ... } * @return Whether the lte field is set. */ public boolean hasLte() { @@ -1396,7 +1535,7 @@ public boolean hasLte() { * ``` * * - * double lte = 3 [json_name = "lte", (.buf.validate.priv.field) = { ... } + * double lte = 3 [json_name = "lte", (.buf.validate.predefined) = { ... } * @return The lte. */ public double getLte() { @@ -1419,7 +1558,7 @@ public double getLte() { * ``` * * - * double lte = 3 [json_name = "lte", (.buf.validate.priv.field) = { ... } + * double lte = 3 [json_name = "lte", (.buf.validate.predefined) = { ... } * @param value The lte to set. * @return This builder for chaining. */ @@ -1444,7 +1583,7 @@ public Builder setLte(double value) { * ``` * * - * double lte = 3 [json_name = "lte", (.buf.validate.priv.field) = { ... } + * double lte = 3 [json_name = "lte", (.buf.validate.predefined) = { ... } * @return This builder for chaining. */ public Builder clearLte() { @@ -1478,7 +1617,7 @@ public Builder clearLte() { * ``` * * - * double gt = 4 [json_name = "gt", (.buf.validate.priv.field) = { ... } + * double gt = 4 [json_name = "gt", (.buf.validate.predefined) = { ... } * @return Whether the gt field is set. */ public boolean hasGt() { @@ -1506,7 +1645,7 @@ public boolean hasGt() { * ``` * * - * double gt = 4 [json_name = "gt", (.buf.validate.priv.field) = { ... } + * double gt = 4 [json_name = "gt", (.buf.validate.predefined) = { ... } * @return The gt. */ public double getGt() { @@ -1537,7 +1676,7 @@ public double getGt() { * ``` * * - * double gt = 4 [json_name = "gt", (.buf.validate.priv.field) = { ... } + * double gt = 4 [json_name = "gt", (.buf.validate.predefined) = { ... } * @param value The gt to set. * @return This builder for chaining. */ @@ -1570,7 +1709,7 @@ public Builder setGt(double value) { * ``` * * - * double gt = 4 [json_name = "gt", (.buf.validate.priv.field) = { ... } + * double gt = 4 [json_name = "gt", (.buf.validate.predefined) = { ... } * @return This builder for chaining. */ public Builder clearGt() { @@ -1604,7 +1743,7 @@ public Builder clearGt() { * ``` * * - * double gte = 5 [json_name = "gte", (.buf.validate.priv.field) = { ... } + * double gte = 5 [json_name = "gte", (.buf.validate.predefined) = { ... } * @return Whether the gte field is set. */ public boolean hasGte() { @@ -1632,7 +1771,7 @@ public boolean hasGte() { * ``` * * - * double gte = 5 [json_name = "gte", (.buf.validate.priv.field) = { ... } + * double gte = 5 [json_name = "gte", (.buf.validate.predefined) = { ... } * @return The gte. */ public double getGte() { @@ -1663,7 +1802,7 @@ public double getGte() { * ``` * * - * double gte = 5 [json_name = "gte", (.buf.validate.priv.field) = { ... } + * double gte = 5 [json_name = "gte", (.buf.validate.predefined) = { ... } * @param value The gte to set. * @return This builder for chaining. */ @@ -1696,7 +1835,7 @@ public Builder setGte(double value) { * ``` * * - * double gte = 5 [json_name = "gte", (.buf.validate.priv.field) = { ... } + * double gte = 5 [json_name = "gte", (.buf.validate.predefined) = { ... } * @return This builder for chaining. */ public Builder clearGte() { @@ -1735,7 +1874,7 @@ private void ensureInIsMutable(int capacity) { * ``` * * - * repeated double in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated double in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @return A list containing the in. */ public java.util.List @@ -1757,7 +1896,7 @@ private void ensureInIsMutable(int capacity) { * ``` * * - * repeated double in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated double in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @return The count of in. */ public int getInCount() { @@ -1777,7 +1916,7 @@ public int getInCount() { * ``` * * - * repeated double in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated double in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @param index The index of the element to return. * @return The in at the given index. */ @@ -1798,7 +1937,7 @@ public double getIn(int index) { * ``` * * - * repeated double in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated double in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @param index The index to set the value at. * @param value The in to set. * @return This builder for chaining. @@ -1826,7 +1965,7 @@ public Builder setIn( * ``` * * - * repeated double in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated double in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @param value The in to add. * @return This builder for chaining. */ @@ -1852,7 +1991,7 @@ public Builder addIn(double value) { * ``` * * - * repeated double in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated double in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @param values The in to add. * @return This builder for chaining. */ @@ -1879,7 +2018,7 @@ public Builder addAllIn( * ``` * * - * repeated double in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated double in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @return This builder for chaining. */ public Builder clearIn() { @@ -1916,7 +2055,7 @@ private void ensureNotInIsMutable(int capacity) { * ``` * * - * repeated double not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated double not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @return A list containing the notIn. */ public java.util.List @@ -1938,7 +2077,7 @@ private void ensureNotInIsMutable(int capacity) { * ``` * * - * repeated double not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated double not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @return The count of notIn. */ public int getNotInCount() { @@ -1958,7 +2097,7 @@ public int getNotInCount() { * ``` * * - * repeated double not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated double not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @param index The index of the element to return. * @return The notIn at the given index. */ @@ -1979,7 +2118,7 @@ public double getNotIn(int index) { * ``` * * - * repeated double not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated double not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @param index The index to set the value at. * @param value The notIn to set. * @return This builder for chaining. @@ -2007,7 +2146,7 @@ public Builder setNotIn( * ``` * * - * repeated double not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated double not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @param value The notIn to add. * @return This builder for chaining. */ @@ -2033,7 +2172,7 @@ public Builder addNotIn(double value) { * ``` * * - * repeated double not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated double not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @param values The notIn to add. * @return This builder for chaining. */ @@ -2060,7 +2199,7 @@ public Builder addAllNotIn( * ``` * * - * repeated double not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated double not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @return This builder for chaining. */ public Builder clearNotIn() { @@ -2077,7 +2216,20 @@ public Builder clearNotIn() { * infinite or NaN, an error message is generated. * * - * bool finite = 8 [json_name = "finite", (.buf.validate.priv.field) = { ... } + * optional bool finite = 8 [json_name = "finite", (.buf.validate.predefined) = { ... } + * @return Whether the finite field is set. + */ + @java.lang.Override + public boolean hasFinite() { + return ((bitField0_ & 0x00000080) != 0); + } + /** + *
+     * `finite` requires the field value to be finite. If the field value is
+     * infinite or NaN, an error message is generated.
+     * 
+ * + * optional bool finite = 8 [json_name = "finite", (.buf.validate.predefined) = { ... } * @return The finite. */ @java.lang.Override @@ -2090,7 +2242,7 @@ public boolean getFinite() { * infinite or NaN, an error message is generated. * * - * bool finite = 8 [json_name = "finite", (.buf.validate.priv.field) = { ... } + * optional bool finite = 8 [json_name = "finite", (.buf.validate.predefined) = { ... } * @param value The finite to set. * @return This builder for chaining. */ @@ -2107,7 +2259,7 @@ public Builder setFinite(boolean value) { * infinite or NaN, an error message is generated. * * - * bool finite = 8 [json_name = "finite", (.buf.validate.priv.field) = { ... } + * optional bool finite = 8 [json_name = "finite", (.buf.validate.predefined) = { ... } * @return This builder for chaining. */ public Builder clearFinite() { @@ -2117,6 +2269,201 @@ public Builder clearFinite() { return this; } + private com.google.protobuf.Internal.DoubleList example_ = emptyDoubleList(); + private void ensureExampleIsMutable() { + if (!example_.isModifiable()) { + example_ = makeMutableCopy(example_); + } + bitField0_ |= 0x00000100; + } + private void ensureExampleIsMutable(int capacity) { + if (!example_.isModifiable()) { + example_ = makeMutableCopy(example_, capacity); + } + bitField0_ |= 0x00000100; + } + /** + *
+     * `example` specifies values that the field may have. These values SHOULD
+     * conform to other constraints. `example` values will not impact validation
+     * but may be used as helpful guidance on how to populate the given field.
+     *
+     * ```proto
+     * message MyDouble {
+     * double value = 1 [
+     * (buf.validate.field).double.example = 1.0,
+     * (buf.validate.field).double.example = "Infinity"
+     * ];
+     * }
+     * ```
+     * 
+ * + * repeated double example = 9 [json_name = "example", (.buf.validate.predefined) = { ... } + * @return A list containing the example. + */ + public java.util.List + getExampleList() { + example_.makeImmutable(); + return example_; + } + /** + *
+     * `example` specifies values that the field may have. These values SHOULD
+     * conform to other constraints. `example` values will not impact validation
+     * but may be used as helpful guidance on how to populate the given field.
+     *
+     * ```proto
+     * message MyDouble {
+     * double value = 1 [
+     * (buf.validate.field).double.example = 1.0,
+     * (buf.validate.field).double.example = "Infinity"
+     * ];
+     * }
+     * ```
+     * 
+ * + * repeated double example = 9 [json_name = "example", (.buf.validate.predefined) = { ... } + * @return The count of example. + */ + public int getExampleCount() { + return example_.size(); + } + /** + *
+     * `example` specifies values that the field may have. These values SHOULD
+     * conform to other constraints. `example` values will not impact validation
+     * but may be used as helpful guidance on how to populate the given field.
+     *
+     * ```proto
+     * message MyDouble {
+     * double value = 1 [
+     * (buf.validate.field).double.example = 1.0,
+     * (buf.validate.field).double.example = "Infinity"
+     * ];
+     * }
+     * ```
+     * 
+ * + * repeated double example = 9 [json_name = "example", (.buf.validate.predefined) = { ... } + * @param index The index of the element to return. + * @return The example at the given index. + */ + public double getExample(int index) { + return example_.getDouble(index); + } + /** + *
+     * `example` specifies values that the field may have. These values SHOULD
+     * conform to other constraints. `example` values will not impact validation
+     * but may be used as helpful guidance on how to populate the given field.
+     *
+     * ```proto
+     * message MyDouble {
+     * double value = 1 [
+     * (buf.validate.field).double.example = 1.0,
+     * (buf.validate.field).double.example = "Infinity"
+     * ];
+     * }
+     * ```
+     * 
+ * + * repeated double example = 9 [json_name = "example", (.buf.validate.predefined) = { ... } + * @param index The index to set the value at. + * @param value The example to set. + * @return This builder for chaining. + */ + public Builder setExample( + int index, double value) { + + ensureExampleIsMutable(); + example_.setDouble(index, value); + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + *
+     * `example` specifies values that the field may have. These values SHOULD
+     * conform to other constraints. `example` values will not impact validation
+     * but may be used as helpful guidance on how to populate the given field.
+     *
+     * ```proto
+     * message MyDouble {
+     * double value = 1 [
+     * (buf.validate.field).double.example = 1.0,
+     * (buf.validate.field).double.example = "Infinity"
+     * ];
+     * }
+     * ```
+     * 
+ * + * repeated double example = 9 [json_name = "example", (.buf.validate.predefined) = { ... } + * @param value The example to add. + * @return This builder for chaining. + */ + public Builder addExample(double value) { + + ensureExampleIsMutable(); + example_.addDouble(value); + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + *
+     * `example` specifies values that the field may have. These values SHOULD
+     * conform to other constraints. `example` values will not impact validation
+     * but may be used as helpful guidance on how to populate the given field.
+     *
+     * ```proto
+     * message MyDouble {
+     * double value = 1 [
+     * (buf.validate.field).double.example = 1.0,
+     * (buf.validate.field).double.example = "Infinity"
+     * ];
+     * }
+     * ```
+     * 
+ * + * repeated double example = 9 [json_name = "example", (.buf.validate.predefined) = { ... } + * @param values The example to add. + * @return This builder for chaining. + */ + public Builder addAllExample( + java.lang.Iterable values) { + ensureExampleIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, example_); + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + *
+     * `example` specifies values that the field may have. These values SHOULD
+     * conform to other constraints. `example` values will not impact validation
+     * but may be used as helpful guidance on how to populate the given field.
+     *
+     * ```proto
+     * message MyDouble {
+     * double value = 1 [
+     * (buf.validate.field).double.example = 1.0,
+     * (buf.validate.field).double.example = "Infinity"
+     * ];
+     * }
+     * ```
+     * 
+ * + * repeated double example = 9 [json_name = "example", (.buf.validate.predefined) = { ... } + * @return This builder for chaining. + */ + public Builder clearExample() { + example_ = emptyDoubleList(); + bitField0_ = (bitField0_ & ~0x00000100); + onChanged(); + return this; + } + // @@protoc_insertion_point(builder_scope:buf.validate.DoubleRules) } diff --git a/src/main/java/build/buf/validate/DoubleRulesOrBuilder.java b/src/main/java/build/buf/validate/DoubleRulesOrBuilder.java index 8df57492..6dd469ba 100644 --- a/src/main/java/build/buf/validate/DoubleRulesOrBuilder.java +++ b/src/main/java/build/buf/validate/DoubleRulesOrBuilder.java @@ -7,7 +7,8 @@ public interface DoubleRulesOrBuilder extends // @@protoc_insertion_point(interface_extends:buf.validate.DoubleRules) - com.google.protobuf.MessageOrBuilder { + com.google.protobuf.GeneratedMessage. + ExtendableMessageOrBuilder { /** *
@@ -22,7 +23,7 @@ public interface DoubleRulesOrBuilder extends
    * ```
    * 
* - * optional double const = 1 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional double const = 1 [json_name = "const", (.buf.validate.predefined) = { ... } * @return Whether the const field is set. */ boolean hasConst(); @@ -39,7 +40,7 @@ public interface DoubleRulesOrBuilder extends * ``` * * - * optional double const = 1 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional double const = 1 [json_name = "const", (.buf.validate.predefined) = { ... } * @return The const. */ double getConst(); @@ -58,7 +59,7 @@ public interface DoubleRulesOrBuilder extends * ``` * * - * double lt = 2 [json_name = "lt", (.buf.validate.priv.field) = { ... } + * double lt = 2 [json_name = "lt", (.buf.validate.predefined) = { ... } * @return Whether the lt field is set. */ boolean hasLt(); @@ -76,7 +77,7 @@ public interface DoubleRulesOrBuilder extends * ``` * * - * double lt = 2 [json_name = "lt", (.buf.validate.priv.field) = { ... } + * double lt = 2 [json_name = "lt", (.buf.validate.predefined) = { ... } * @return The lt. */ double getLt(); @@ -95,7 +96,7 @@ public interface DoubleRulesOrBuilder extends * ``` * * - * double lte = 3 [json_name = "lte", (.buf.validate.priv.field) = { ... } + * double lte = 3 [json_name = "lte", (.buf.validate.predefined) = { ... } * @return Whether the lte field is set. */ boolean hasLte(); @@ -113,7 +114,7 @@ public interface DoubleRulesOrBuilder extends * ``` * * - * double lte = 3 [json_name = "lte", (.buf.validate.priv.field) = { ... } + * double lte = 3 [json_name = "lte", (.buf.validate.predefined) = { ... } * @return The lte. */ double getLte(); @@ -140,7 +141,7 @@ public interface DoubleRulesOrBuilder extends * ``` * * - * double gt = 4 [json_name = "gt", (.buf.validate.priv.field) = { ... } + * double gt = 4 [json_name = "gt", (.buf.validate.predefined) = { ... } * @return Whether the gt field is set. */ boolean hasGt(); @@ -166,7 +167,7 @@ public interface DoubleRulesOrBuilder extends * ``` * * - * double gt = 4 [json_name = "gt", (.buf.validate.priv.field) = { ... } + * double gt = 4 [json_name = "gt", (.buf.validate.predefined) = { ... } * @return The gt. */ double getGt(); @@ -193,7 +194,7 @@ public interface DoubleRulesOrBuilder extends * ``` * * - * double gte = 5 [json_name = "gte", (.buf.validate.priv.field) = { ... } + * double gte = 5 [json_name = "gte", (.buf.validate.predefined) = { ... } * @return Whether the gte field is set. */ boolean hasGte(); @@ -219,7 +220,7 @@ public interface DoubleRulesOrBuilder extends * ``` * * - * double gte = 5 [json_name = "gte", (.buf.validate.priv.field) = { ... } + * double gte = 5 [json_name = "gte", (.buf.validate.predefined) = { ... } * @return The gte. */ double getGte(); @@ -238,7 +239,7 @@ public interface DoubleRulesOrBuilder extends * ``` * * - * repeated double in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated double in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @return A list containing the in. */ java.util.List getInList(); @@ -256,7 +257,7 @@ public interface DoubleRulesOrBuilder extends * ``` * * - * repeated double in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated double in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @return The count of in. */ int getInCount(); @@ -274,7 +275,7 @@ public interface DoubleRulesOrBuilder extends * ``` * * - * repeated double in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated double in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @param index The index of the element to return. * @return The in at the given index. */ @@ -294,7 +295,7 @@ public interface DoubleRulesOrBuilder extends * ``` * * - * repeated double not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated double not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @return A list containing the notIn. */ java.util.List getNotInList(); @@ -312,7 +313,7 @@ public interface DoubleRulesOrBuilder extends * ``` * * - * repeated double not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated double not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @return The count of notIn. */ int getNotInCount(); @@ -330,7 +331,7 @@ public interface DoubleRulesOrBuilder extends * ``` * * - * repeated double not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated double not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @param index The index of the element to return. * @return The notIn at the given index. */ @@ -342,11 +343,83 @@ public interface DoubleRulesOrBuilder extends * infinite or NaN, an error message is generated. * * - * bool finite = 8 [json_name = "finite", (.buf.validate.priv.field) = { ... } + * optional bool finite = 8 [json_name = "finite", (.buf.validate.predefined) = { ... } + * @return Whether the finite field is set. + */ + boolean hasFinite(); + /** + *
+   * `finite` requires the field value to be finite. If the field value is
+   * infinite or NaN, an error message is generated.
+   * 
+ * + * optional bool finite = 8 [json_name = "finite", (.buf.validate.predefined) = { ... } * @return The finite. */ boolean getFinite(); + /** + *
+   * `example` specifies values that the field may have. These values SHOULD
+   * conform to other constraints. `example` values will not impact validation
+   * but may be used as helpful guidance on how to populate the given field.
+   *
+   * ```proto
+   * message MyDouble {
+   * double value = 1 [
+   * (buf.validate.field).double.example = 1.0,
+   * (buf.validate.field).double.example = "Infinity"
+   * ];
+   * }
+   * ```
+   * 
+ * + * repeated double example = 9 [json_name = "example", (.buf.validate.predefined) = { ... } + * @return A list containing the example. + */ + java.util.List getExampleList(); + /** + *
+   * `example` specifies values that the field may have. These values SHOULD
+   * conform to other constraints. `example` values will not impact validation
+   * but may be used as helpful guidance on how to populate the given field.
+   *
+   * ```proto
+   * message MyDouble {
+   * double value = 1 [
+   * (buf.validate.field).double.example = 1.0,
+   * (buf.validate.field).double.example = "Infinity"
+   * ];
+   * }
+   * ```
+   * 
+ * + * repeated double example = 9 [json_name = "example", (.buf.validate.predefined) = { ... } + * @return The count of example. + */ + int getExampleCount(); + /** + *
+   * `example` specifies values that the field may have. These values SHOULD
+   * conform to other constraints. `example` values will not impact validation
+   * but may be used as helpful guidance on how to populate the given field.
+   *
+   * ```proto
+   * message MyDouble {
+   * double value = 1 [
+   * (buf.validate.field).double.example = 1.0,
+   * (buf.validate.field).double.example = "Infinity"
+   * ];
+   * }
+   * ```
+   * 
+ * + * repeated double example = 9 [json_name = "example", (.buf.validate.predefined) = { ... } + * @param index The index of the element to return. + * @return The example at the given index. + */ + double getExample(int index); + build.buf.validate.DoubleRules.LessThanCase getLessThanCase(); build.buf.validate.DoubleRules.GreaterThanCase getGreaterThanCase(); diff --git a/src/main/java/build/buf/validate/DurationRules.java b/src/main/java/build/buf/validate/DurationRules.java index 91d84b43..929f8435 100644 --- a/src/main/java/build/buf/validate/DurationRules.java +++ b/src/main/java/build/buf/validate/DurationRules.java @@ -13,7 +13,8 @@ * Protobuf type {@code buf.validate.DurationRules} */ public final class DurationRules extends - com.google.protobuf.GeneratedMessage implements + com.google.protobuf.GeneratedMessage.ExtendableMessage< + DurationRules> implements // @@protoc_insertion_point(message_implements:buf.validate.DurationRules) DurationRulesOrBuilder { private static final long serialVersionUID = 0L; @@ -27,12 +28,13 @@ public final class DurationRules extends DurationRules.class.getName()); } // Use DurationRules.newBuilder() to construct. - private DurationRules(com.google.protobuf.GeneratedMessage.Builder builder) { + private DurationRules(com.google.protobuf.GeneratedMessage.ExtendableBuilder builder) { super(builder); } private DurationRules() { in_ = java.util.Collections.emptyList(); notIn_ = java.util.Collections.emptyList(); + example_ = java.util.Collections.emptyList(); } public static final com.google.protobuf.Descriptors.Descriptor @@ -149,7 +151,7 @@ public int getNumber() { * ``` * * - * optional .google.protobuf.Duration const = 2 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional .google.protobuf.Duration const = 2 [json_name = "const", (.buf.validate.predefined) = { ... } * @return Whether the const field is set. */ @java.lang.Override @@ -170,7 +172,7 @@ public boolean hasConst() { * ``` * * - * optional .google.protobuf.Duration const = 2 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional .google.protobuf.Duration const = 2 [json_name = "const", (.buf.validate.predefined) = { ... } * @return The const. */ @java.lang.Override @@ -191,7 +193,7 @@ public com.google.protobuf.Duration getConst() { * ``` * * - * optional .google.protobuf.Duration const = 2 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional .google.protobuf.Duration const = 2 [json_name = "const", (.buf.validate.predefined) = { ... } */ @java.lang.Override public com.google.protobuf.DurationOrBuilder getConstOrBuilder() { @@ -213,7 +215,7 @@ public com.google.protobuf.DurationOrBuilder getConstOrBuilder() { * ``` * * - * .google.protobuf.Duration lt = 3 [json_name = "lt", (.buf.validate.priv.field) = { ... } + * .google.protobuf.Duration lt = 3 [json_name = "lt", (.buf.validate.predefined) = { ... } * @return Whether the lt field is set. */ @java.lang.Override @@ -234,7 +236,7 @@ public boolean hasLt() { * ``` * * - * .google.protobuf.Duration lt = 3 [json_name = "lt", (.buf.validate.priv.field) = { ... } + * .google.protobuf.Duration lt = 3 [json_name = "lt", (.buf.validate.predefined) = { ... } * @return The lt. */ @java.lang.Override @@ -258,7 +260,7 @@ public com.google.protobuf.Duration getLt() { * ``` * * - * .google.protobuf.Duration lt = 3 [json_name = "lt", (.buf.validate.priv.field) = { ... } + * .google.protobuf.Duration lt = 3 [json_name = "lt", (.buf.validate.predefined) = { ... } */ @java.lang.Override public com.google.protobuf.DurationOrBuilder getLtOrBuilder() { @@ -283,7 +285,7 @@ public com.google.protobuf.DurationOrBuilder getLtOrBuilder() { * ``` * * - * .google.protobuf.Duration lte = 4 [json_name = "lte", (.buf.validate.priv.field) = { ... } + * .google.protobuf.Duration lte = 4 [json_name = "lte", (.buf.validate.predefined) = { ... } * @return Whether the lte field is set. */ @java.lang.Override @@ -304,7 +306,7 @@ public boolean hasLte() { * ``` * * - * .google.protobuf.Duration lte = 4 [json_name = "lte", (.buf.validate.priv.field) = { ... } + * .google.protobuf.Duration lte = 4 [json_name = "lte", (.buf.validate.predefined) = { ... } * @return The lte. */ @java.lang.Override @@ -328,7 +330,7 @@ public com.google.protobuf.Duration getLte() { * ``` * * - * .google.protobuf.Duration lte = 4 [json_name = "lte", (.buf.validate.priv.field) = { ... } + * .google.protobuf.Duration lte = 4 [json_name = "lte", (.buf.validate.predefined) = { ... } */ @java.lang.Override public com.google.protobuf.DurationOrBuilder getLteOrBuilder() { @@ -361,7 +363,7 @@ public com.google.protobuf.DurationOrBuilder getLteOrBuilder() { * ``` * * - * .google.protobuf.Duration gt = 5 [json_name = "gt", (.buf.validate.priv.field) = { ... } + * .google.protobuf.Duration gt = 5 [json_name = "gt", (.buf.validate.predefined) = { ... } * @return Whether the gt field is set. */ @java.lang.Override @@ -390,7 +392,7 @@ public boolean hasGt() { * ``` * * - * .google.protobuf.Duration gt = 5 [json_name = "gt", (.buf.validate.priv.field) = { ... } + * .google.protobuf.Duration gt = 5 [json_name = "gt", (.buf.validate.predefined) = { ... } * @return The gt. */ @java.lang.Override @@ -422,7 +424,7 @@ public com.google.protobuf.Duration getGt() { * ``` * * - * .google.protobuf.Duration gt = 5 [json_name = "gt", (.buf.validate.priv.field) = { ... } + * .google.protobuf.Duration gt = 5 [json_name = "gt", (.buf.validate.predefined) = { ... } */ @java.lang.Override public com.google.protobuf.DurationOrBuilder getGtOrBuilder() { @@ -455,7 +457,7 @@ public com.google.protobuf.DurationOrBuilder getGtOrBuilder() { * ``` * * - * .google.protobuf.Duration gte = 6 [json_name = "gte", (.buf.validate.priv.field) = { ... } + * .google.protobuf.Duration gte = 6 [json_name = "gte", (.buf.validate.predefined) = { ... } * @return Whether the gte field is set. */ @java.lang.Override @@ -484,7 +486,7 @@ public boolean hasGte() { * ``` * * - * .google.protobuf.Duration gte = 6 [json_name = "gte", (.buf.validate.priv.field) = { ... } + * .google.protobuf.Duration gte = 6 [json_name = "gte", (.buf.validate.predefined) = { ... } * @return The gte. */ @java.lang.Override @@ -516,7 +518,7 @@ public com.google.protobuf.Duration getGte() { * ``` * * - * .google.protobuf.Duration gte = 6 [json_name = "gte", (.buf.validate.priv.field) = { ... } + * .google.protobuf.Duration gte = 6 [json_name = "gte", (.buf.validate.predefined) = { ... } */ @java.lang.Override public com.google.protobuf.DurationOrBuilder getGteOrBuilder() { @@ -543,7 +545,7 @@ public com.google.protobuf.DurationOrBuilder getGteOrBuilder() { * ``` * * - * repeated .google.protobuf.Duration in = 7 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated .google.protobuf.Duration in = 7 [json_name = "in", (.buf.validate.predefined) = { ... } */ @java.lang.Override public java.util.List getInList() { @@ -563,7 +565,7 @@ public java.util.List getInList() { * ``` * * - * repeated .google.protobuf.Duration in = 7 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated .google.protobuf.Duration in = 7 [json_name = "in", (.buf.validate.predefined) = { ... } */ @java.lang.Override public java.util.List @@ -584,7 +586,7 @@ public java.util.List getInList() { * ``` * * - * repeated .google.protobuf.Duration in = 7 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated .google.protobuf.Duration in = 7 [json_name = "in", (.buf.validate.predefined) = { ... } */ @java.lang.Override public int getInCount() { @@ -604,7 +606,7 @@ public int getInCount() { * ``` * * - * repeated .google.protobuf.Duration in = 7 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated .google.protobuf.Duration in = 7 [json_name = "in", (.buf.validate.predefined) = { ... } */ @java.lang.Override public com.google.protobuf.Duration getIn(int index) { @@ -624,7 +626,7 @@ public com.google.protobuf.Duration getIn(int index) { * ``` * * - * repeated .google.protobuf.Duration in = 7 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated .google.protobuf.Duration in = 7 [json_name = "in", (.buf.validate.predefined) = { ... } */ @java.lang.Override public com.google.protobuf.DurationOrBuilder getInOrBuilder( @@ -650,7 +652,7 @@ public com.google.protobuf.DurationOrBuilder getInOrBuilder( * ``` * * - * repeated .google.protobuf.Duration not_in = 8 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated .google.protobuf.Duration not_in = 8 [json_name = "notIn", (.buf.validate.predefined) = { ... } */ @java.lang.Override public java.util.List getNotInList() { @@ -671,7 +673,7 @@ public java.util.List getNotInList() { * ``` * * - * repeated .google.protobuf.Duration not_in = 8 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated .google.protobuf.Duration not_in = 8 [json_name = "notIn", (.buf.validate.predefined) = { ... } */ @java.lang.Override public java.util.List @@ -693,7 +695,7 @@ public java.util.List getNotInList() { * ``` * * - * repeated .google.protobuf.Duration not_in = 8 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated .google.protobuf.Duration not_in = 8 [json_name = "notIn", (.buf.validate.predefined) = { ... } */ @java.lang.Override public int getNotInCount() { @@ -714,7 +716,7 @@ public int getNotInCount() { * ``` * * - * repeated .google.protobuf.Duration not_in = 8 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated .google.protobuf.Duration not_in = 8 [json_name = "notIn", (.buf.validate.predefined) = { ... } */ @java.lang.Override public com.google.protobuf.Duration getNotIn(int index) { @@ -735,7 +737,7 @@ public com.google.protobuf.Duration getNotIn(int index) { * ``` * * - * repeated .google.protobuf.Duration not_in = 8 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated .google.protobuf.Duration not_in = 8 [json_name = "notIn", (.buf.validate.predefined) = { ... } */ @java.lang.Override public com.google.protobuf.DurationOrBuilder getNotInOrBuilder( @@ -743,6 +745,122 @@ public com.google.protobuf.DurationOrBuilder getNotInOrBuilder( return notIn_.get(index); } + public static final int EXAMPLE_FIELD_NUMBER = 9; + @SuppressWarnings("serial") + private java.util.List example_; + /** + *
+   * `example` specifies values that the field may have. These values SHOULD
+   * conform to other constraints. `example` values will not impact validation
+   * but may be used as helpful guidance on how to populate the given field.
+   *
+   * ```proto
+   * message MyDuration {
+   * google.protobuf.Duration value = 1 [
+   * (buf.validate.field).duration.example = { seconds: 1 },
+   * (buf.validate.field).duration.example = { seconds: 2 },
+   * ];
+   * }
+   * ```
+   * 
+ * + * repeated .google.protobuf.Duration example = 9 [json_name = "example", (.buf.validate.predefined) = { ... } + */ + @java.lang.Override + public java.util.List getExampleList() { + return example_; + } + /** + *
+   * `example` specifies values that the field may have. These values SHOULD
+   * conform to other constraints. `example` values will not impact validation
+   * but may be used as helpful guidance on how to populate the given field.
+   *
+   * ```proto
+   * message MyDuration {
+   * google.protobuf.Duration value = 1 [
+   * (buf.validate.field).duration.example = { seconds: 1 },
+   * (buf.validate.field).duration.example = { seconds: 2 },
+   * ];
+   * }
+   * ```
+   * 
+ * + * repeated .google.protobuf.Duration example = 9 [json_name = "example", (.buf.validate.predefined) = { ... } + */ + @java.lang.Override + public java.util.List + getExampleOrBuilderList() { + return example_; + } + /** + *
+   * `example` specifies values that the field may have. These values SHOULD
+   * conform to other constraints. `example` values will not impact validation
+   * but may be used as helpful guidance on how to populate the given field.
+   *
+   * ```proto
+   * message MyDuration {
+   * google.protobuf.Duration value = 1 [
+   * (buf.validate.field).duration.example = { seconds: 1 },
+   * (buf.validate.field).duration.example = { seconds: 2 },
+   * ];
+   * }
+   * ```
+   * 
+ * + * repeated .google.protobuf.Duration example = 9 [json_name = "example", (.buf.validate.predefined) = { ... } + */ + @java.lang.Override + public int getExampleCount() { + return example_.size(); + } + /** + *
+   * `example` specifies values that the field may have. These values SHOULD
+   * conform to other constraints. `example` values will not impact validation
+   * but may be used as helpful guidance on how to populate the given field.
+   *
+   * ```proto
+   * message MyDuration {
+   * google.protobuf.Duration value = 1 [
+   * (buf.validate.field).duration.example = { seconds: 1 },
+   * (buf.validate.field).duration.example = { seconds: 2 },
+   * ];
+   * }
+   * ```
+   * 
+ * + * repeated .google.protobuf.Duration example = 9 [json_name = "example", (.buf.validate.predefined) = { ... } + */ + @java.lang.Override + public com.google.protobuf.Duration getExample(int index) { + return example_.get(index); + } + /** + *
+   * `example` specifies values that the field may have. These values SHOULD
+   * conform to other constraints. `example` values will not impact validation
+   * but may be used as helpful guidance on how to populate the given field.
+   *
+   * ```proto
+   * message MyDuration {
+   * google.protobuf.Duration value = 1 [
+   * (buf.validate.field).duration.example = { seconds: 1 },
+   * (buf.validate.field).duration.example = { seconds: 2 },
+   * ];
+   * }
+   * ```
+   * 
+ * + * repeated .google.protobuf.Duration example = 9 [json_name = "example", (.buf.validate.predefined) = { ... } + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getExampleOrBuilder( + int index) { + return example_.get(index); + } + private byte memoizedIsInitialized = -1; @java.lang.Override public final boolean isInitialized() { @@ -750,6 +868,10 @@ public final boolean isInitialized() { if (isInitialized == 1) return true; if (isInitialized == 0) return false; + if (!extensionsAreInitialized()) { + memoizedIsInitialized = 0; + return false; + } memoizedIsInitialized = 1; return true; } @@ -757,6 +879,9 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + com.google.protobuf.GeneratedMessage + .ExtendableMessage.ExtensionSerializer + extensionWriter = newExtensionSerializer(); if (((bitField0_ & 0x00000001) != 0)) { output.writeMessage(2, getConst()); } @@ -778,6 +903,10 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) for (int i = 0; i < notIn_.size(); i++) { output.writeMessage(8, notIn_.get(i)); } + for (int i = 0; i < example_.size(); i++) { + output.writeMessage(9, example_.get(i)); + } + extensionWriter.writeUntil(536870912, output); getUnknownFields().writeTo(output); } @@ -815,6 +944,11 @@ public int getSerializedSize() { size += com.google.protobuf.CodedOutputStream .computeMessageSize(8, notIn_.get(i)); } + for (int i = 0; i < example_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(9, example_.get(i)); + } + size += extensionsSerializedSize(); size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -839,6 +973,8 @@ public boolean equals(final java.lang.Object obj) { .equals(other.getInList())) return false; if (!getNotInList() .equals(other.getNotInList())) return false; + if (!getExampleList() + .equals(other.getExampleList())) return false; if (!getLessThanCase().equals(other.getLessThanCase())) return false; switch (lessThanCase_) { case 3: @@ -866,6 +1002,8 @@ public boolean equals(final java.lang.Object obj) { default: } if (!getUnknownFields().equals(other.getUnknownFields())) return false; + if (!getExtensionFields().equals(other.getExtensionFields())) + return false; return true; } @@ -888,6 +1026,10 @@ public int hashCode() { hash = (37 * hash) + NOT_IN_FIELD_NUMBER; hash = (53 * hash) + getNotInList().hashCode(); } + if (getExampleCount() > 0) { + hash = (37 * hash) + EXAMPLE_FIELD_NUMBER; + hash = (53 * hash) + getExampleList().hashCode(); + } switch (lessThanCase_) { case 3: hash = (37 * hash) + LT_FIELD_NUMBER; @@ -912,6 +1054,7 @@ public int hashCode() { case 0: default: } + hash = hashFields(hash, getExtensionFields()); hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -1017,7 +1160,8 @@ protected Builder newBuilderForType( * Protobuf type {@code buf.validate.DurationRules} */ public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder implements + com.google.protobuf.GeneratedMessage.ExtendableBuilder< + build.buf.validate.DurationRules, Builder> implements // @@protoc_insertion_point(builder_implements:buf.validate.DurationRules) build.buf.validate.DurationRulesOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor @@ -1049,6 +1193,7 @@ private void maybeForceBuilderInitialization() { getConstFieldBuilder(); getInFieldBuilder(); getNotInFieldBuilder(); + getExampleFieldBuilder(); } } @java.lang.Override @@ -1086,6 +1231,13 @@ public Builder clear() { notInBuilder_.clear(); } bitField0_ = (bitField0_ & ~0x00000040); + if (exampleBuilder_ == null) { + example_ = java.util.Collections.emptyList(); + } else { + example_ = null; + exampleBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000080); lessThanCase_ = 0; lessThan_ = null; greaterThanCase_ = 0; @@ -1142,6 +1294,15 @@ private void buildPartialRepeatedFields(build.buf.validate.DurationRules result) } else { result.notIn_ = notInBuilder_.build(); } + if (exampleBuilder_ == null) { + if (((bitField0_ & 0x00000080) != 0)) { + example_ = java.util.Collections.unmodifiableList(example_); + bitField0_ = (bitField0_ & ~0x00000080); + } + result.example_ = example_; + } else { + result.example_ = exampleBuilder_.build(); + } } private void buildPartial0(build.buf.validate.DurationRules result) { @@ -1246,6 +1407,32 @@ public Builder mergeFrom(build.buf.validate.DurationRules other) { } } } + if (exampleBuilder_ == null) { + if (!other.example_.isEmpty()) { + if (example_.isEmpty()) { + example_ = other.example_; + bitField0_ = (bitField0_ & ~0x00000080); + } else { + ensureExampleIsMutable(); + example_.addAll(other.example_); + } + onChanged(); + } + } else { + if (!other.example_.isEmpty()) { + if (exampleBuilder_.isEmpty()) { + exampleBuilder_.dispose(); + exampleBuilder_ = null; + example_ = other.example_; + bitField0_ = (bitField0_ & ~0x00000080); + exampleBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getExampleFieldBuilder() : null; + } else { + exampleBuilder_.addAllMessages(other.example_); + } + } + } switch (other.getLessThanCase()) { case LT: { mergeLt(other.getLt()); @@ -1272,6 +1459,7 @@ public Builder mergeFrom(build.buf.validate.DurationRules other) { break; } } + this.mergeExtensionFields(other); this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -1279,6 +1467,9 @@ public Builder mergeFrom(build.buf.validate.DurationRules other) { @java.lang.Override public final boolean isInitialized() { + if (!extensionsAreInitialized()) { + return false; + } return true; } @@ -1359,6 +1550,19 @@ public Builder mergeFrom( } break; } // case 66 + case 74: { + com.google.protobuf.Duration m = + input.readMessage( + com.google.protobuf.Duration.parser(), + extensionRegistry); + if (exampleBuilder_ == null) { + ensureExampleIsMutable(); + example_.add(m); + } else { + exampleBuilder_.addMessage(m); + } + break; + } // case 74 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { done = true; // was an endgroup tag @@ -1423,7 +1627,7 @@ public Builder clearGreaterThan() { * ``` * * - * optional .google.protobuf.Duration const = 2 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional .google.protobuf.Duration const = 2 [json_name = "const", (.buf.validate.predefined) = { ... } * @return Whether the const field is set. */ public boolean hasConst() { @@ -1443,7 +1647,7 @@ public boolean hasConst() { * ``` * * - * optional .google.protobuf.Duration const = 2 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional .google.protobuf.Duration const = 2 [json_name = "const", (.buf.validate.predefined) = { ... } * @return The const. */ public com.google.protobuf.Duration getConst() { @@ -1467,7 +1671,7 @@ public com.google.protobuf.Duration getConst() { * ``` * * - * optional .google.protobuf.Duration const = 2 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional .google.protobuf.Duration const = 2 [json_name = "const", (.buf.validate.predefined) = { ... } */ public Builder setConst(com.google.protobuf.Duration value) { if (constBuilder_ == null) { @@ -1496,7 +1700,7 @@ public Builder setConst(com.google.protobuf.Duration value) { * ``` * * - * optional .google.protobuf.Duration const = 2 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional .google.protobuf.Duration const = 2 [json_name = "const", (.buf.validate.predefined) = { ... } */ public Builder setConst( com.google.protobuf.Duration.Builder builderForValue) { @@ -1523,7 +1727,7 @@ public Builder setConst( * ``` * * - * optional .google.protobuf.Duration const = 2 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional .google.protobuf.Duration const = 2 [json_name = "const", (.buf.validate.predefined) = { ... } */ public Builder mergeConst(com.google.protobuf.Duration value) { if (constBuilder_ == null) { @@ -1557,7 +1761,7 @@ public Builder mergeConst(com.google.protobuf.Duration value) { * ``` * * - * optional .google.protobuf.Duration const = 2 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional .google.protobuf.Duration const = 2 [json_name = "const", (.buf.validate.predefined) = { ... } */ public Builder clearConst() { bitField0_ = (bitField0_ & ~0x00000001); @@ -1583,7 +1787,7 @@ public Builder clearConst() { * ``` * * - * optional .google.protobuf.Duration const = 2 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional .google.protobuf.Duration const = 2 [json_name = "const", (.buf.validate.predefined) = { ... } */ public com.google.protobuf.Duration.Builder getConstBuilder() { bitField0_ |= 0x00000001; @@ -1604,7 +1808,7 @@ public com.google.protobuf.Duration.Builder getConstBuilder() { * ``` * * - * optional .google.protobuf.Duration const = 2 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional .google.protobuf.Duration const = 2 [json_name = "const", (.buf.validate.predefined) = { ... } */ public com.google.protobuf.DurationOrBuilder getConstOrBuilder() { if (constBuilder_ != null) { @@ -1628,7 +1832,7 @@ public com.google.protobuf.DurationOrBuilder getConstOrBuilder() { * ``` * * - * optional .google.protobuf.Duration const = 2 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional .google.protobuf.Duration const = 2 [json_name = "const", (.buf.validate.predefined) = { ... } */ private com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> @@ -1660,7 +1864,7 @@ public com.google.protobuf.DurationOrBuilder getConstOrBuilder() { * ``` * * - * .google.protobuf.Duration lt = 3 [json_name = "lt", (.buf.validate.priv.field) = { ... } + * .google.protobuf.Duration lt = 3 [json_name = "lt", (.buf.validate.predefined) = { ... } * @return Whether the lt field is set. */ @java.lang.Override @@ -1681,7 +1885,7 @@ public boolean hasLt() { * ``` * * - * .google.protobuf.Duration lt = 3 [json_name = "lt", (.buf.validate.priv.field) = { ... } + * .google.protobuf.Duration lt = 3 [json_name = "lt", (.buf.validate.predefined) = { ... } * @return The lt. */ @java.lang.Override @@ -1712,7 +1916,7 @@ public com.google.protobuf.Duration getLt() { * ``` * * - * .google.protobuf.Duration lt = 3 [json_name = "lt", (.buf.validate.priv.field) = { ... } + * .google.protobuf.Duration lt = 3 [json_name = "lt", (.buf.validate.predefined) = { ... } */ public Builder setLt(com.google.protobuf.Duration value) { if (ltBuilder_ == null) { @@ -1741,7 +1945,7 @@ public Builder setLt(com.google.protobuf.Duration value) { * ``` * * - * .google.protobuf.Duration lt = 3 [json_name = "lt", (.buf.validate.priv.field) = { ... } + * .google.protobuf.Duration lt = 3 [json_name = "lt", (.buf.validate.predefined) = { ... } */ public Builder setLt( com.google.protobuf.Duration.Builder builderForValue) { @@ -1768,7 +1972,7 @@ public Builder setLt( * ``` * * - * .google.protobuf.Duration lt = 3 [json_name = "lt", (.buf.validate.priv.field) = { ... } + * .google.protobuf.Duration lt = 3 [json_name = "lt", (.buf.validate.predefined) = { ... } */ public Builder mergeLt(com.google.protobuf.Duration value) { if (ltBuilder_ == null) { @@ -1804,7 +2008,7 @@ public Builder mergeLt(com.google.protobuf.Duration value) { * ``` * * - * .google.protobuf.Duration lt = 3 [json_name = "lt", (.buf.validate.priv.field) = { ... } + * .google.protobuf.Duration lt = 3 [json_name = "lt", (.buf.validate.predefined) = { ... } */ public Builder clearLt() { if (ltBuilder_ == null) { @@ -1836,7 +2040,7 @@ public Builder clearLt() { * ``` * * - * .google.protobuf.Duration lt = 3 [json_name = "lt", (.buf.validate.priv.field) = { ... } + * .google.protobuf.Duration lt = 3 [json_name = "lt", (.buf.validate.predefined) = { ... } */ public com.google.protobuf.Duration.Builder getLtBuilder() { return getLtFieldBuilder().getBuilder(); @@ -1855,7 +2059,7 @@ public com.google.protobuf.Duration.Builder getLtBuilder() { * ``` * * - * .google.protobuf.Duration lt = 3 [json_name = "lt", (.buf.validate.priv.field) = { ... } + * .google.protobuf.Duration lt = 3 [json_name = "lt", (.buf.validate.predefined) = { ... } */ @java.lang.Override public com.google.protobuf.DurationOrBuilder getLtOrBuilder() { @@ -1882,7 +2086,7 @@ public com.google.protobuf.DurationOrBuilder getLtOrBuilder() { * ``` * * - * .google.protobuf.Duration lt = 3 [json_name = "lt", (.buf.validate.priv.field) = { ... } + * .google.protobuf.Duration lt = 3 [json_name = "lt", (.buf.validate.predefined) = { ... } */ private com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> @@ -1919,7 +2123,7 @@ public com.google.protobuf.DurationOrBuilder getLtOrBuilder() { * ``` * * - * .google.protobuf.Duration lte = 4 [json_name = "lte", (.buf.validate.priv.field) = { ... } + * .google.protobuf.Duration lte = 4 [json_name = "lte", (.buf.validate.predefined) = { ... } * @return Whether the lte field is set. */ @java.lang.Override @@ -1940,7 +2144,7 @@ public boolean hasLte() { * ``` * * - * .google.protobuf.Duration lte = 4 [json_name = "lte", (.buf.validate.priv.field) = { ... } + * .google.protobuf.Duration lte = 4 [json_name = "lte", (.buf.validate.predefined) = { ... } * @return The lte. */ @java.lang.Override @@ -1971,7 +2175,7 @@ public com.google.protobuf.Duration getLte() { * ``` * * - * .google.protobuf.Duration lte = 4 [json_name = "lte", (.buf.validate.priv.field) = { ... } + * .google.protobuf.Duration lte = 4 [json_name = "lte", (.buf.validate.predefined) = { ... } */ public Builder setLte(com.google.protobuf.Duration value) { if (lteBuilder_ == null) { @@ -2000,7 +2204,7 @@ public Builder setLte(com.google.protobuf.Duration value) { * ``` * * - * .google.protobuf.Duration lte = 4 [json_name = "lte", (.buf.validate.priv.field) = { ... } + * .google.protobuf.Duration lte = 4 [json_name = "lte", (.buf.validate.predefined) = { ... } */ public Builder setLte( com.google.protobuf.Duration.Builder builderForValue) { @@ -2027,7 +2231,7 @@ public Builder setLte( * ``` * * - * .google.protobuf.Duration lte = 4 [json_name = "lte", (.buf.validate.priv.field) = { ... } + * .google.protobuf.Duration lte = 4 [json_name = "lte", (.buf.validate.predefined) = { ... } */ public Builder mergeLte(com.google.protobuf.Duration value) { if (lteBuilder_ == null) { @@ -2063,7 +2267,7 @@ public Builder mergeLte(com.google.protobuf.Duration value) { * ``` * * - * .google.protobuf.Duration lte = 4 [json_name = "lte", (.buf.validate.priv.field) = { ... } + * .google.protobuf.Duration lte = 4 [json_name = "lte", (.buf.validate.predefined) = { ... } */ public Builder clearLte() { if (lteBuilder_ == null) { @@ -2095,7 +2299,7 @@ public Builder clearLte() { * ``` * * - * .google.protobuf.Duration lte = 4 [json_name = "lte", (.buf.validate.priv.field) = { ... } + * .google.protobuf.Duration lte = 4 [json_name = "lte", (.buf.validate.predefined) = { ... } */ public com.google.protobuf.Duration.Builder getLteBuilder() { return getLteFieldBuilder().getBuilder(); @@ -2114,7 +2318,7 @@ public com.google.protobuf.Duration.Builder getLteBuilder() { * ``` * * - * .google.protobuf.Duration lte = 4 [json_name = "lte", (.buf.validate.priv.field) = { ... } + * .google.protobuf.Duration lte = 4 [json_name = "lte", (.buf.validate.predefined) = { ... } */ @java.lang.Override public com.google.protobuf.DurationOrBuilder getLteOrBuilder() { @@ -2141,7 +2345,7 @@ public com.google.protobuf.DurationOrBuilder getLteOrBuilder() { * ``` * * - * .google.protobuf.Duration lte = 4 [json_name = "lte", (.buf.validate.priv.field) = { ... } + * .google.protobuf.Duration lte = 4 [json_name = "lte", (.buf.validate.predefined) = { ... } */ private com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> @@ -2186,7 +2390,7 @@ public com.google.protobuf.DurationOrBuilder getLteOrBuilder() { * ``` * * - * .google.protobuf.Duration gt = 5 [json_name = "gt", (.buf.validate.priv.field) = { ... } + * .google.protobuf.Duration gt = 5 [json_name = "gt", (.buf.validate.predefined) = { ... } * @return Whether the gt field is set. */ @java.lang.Override @@ -2215,7 +2419,7 @@ public boolean hasGt() { * ``` * * - * .google.protobuf.Duration gt = 5 [json_name = "gt", (.buf.validate.priv.field) = { ... } + * .google.protobuf.Duration gt = 5 [json_name = "gt", (.buf.validate.predefined) = { ... } * @return The gt. */ @java.lang.Override @@ -2254,7 +2458,7 @@ public com.google.protobuf.Duration getGt() { * ``` * * - * .google.protobuf.Duration gt = 5 [json_name = "gt", (.buf.validate.priv.field) = { ... } + * .google.protobuf.Duration gt = 5 [json_name = "gt", (.buf.validate.predefined) = { ... } */ public Builder setGt(com.google.protobuf.Duration value) { if (gtBuilder_ == null) { @@ -2291,7 +2495,7 @@ public Builder setGt(com.google.protobuf.Duration value) { * ``` * * - * .google.protobuf.Duration gt = 5 [json_name = "gt", (.buf.validate.priv.field) = { ... } + * .google.protobuf.Duration gt = 5 [json_name = "gt", (.buf.validate.predefined) = { ... } */ public Builder setGt( com.google.protobuf.Duration.Builder builderForValue) { @@ -2326,7 +2530,7 @@ public Builder setGt( * ``` * * - * .google.protobuf.Duration gt = 5 [json_name = "gt", (.buf.validate.priv.field) = { ... } + * .google.protobuf.Duration gt = 5 [json_name = "gt", (.buf.validate.predefined) = { ... } */ public Builder mergeGt(com.google.protobuf.Duration value) { if (gtBuilder_ == null) { @@ -2370,7 +2574,7 @@ public Builder mergeGt(com.google.protobuf.Duration value) { * ``` * * - * .google.protobuf.Duration gt = 5 [json_name = "gt", (.buf.validate.priv.field) = { ... } + * .google.protobuf.Duration gt = 5 [json_name = "gt", (.buf.validate.predefined) = { ... } */ public Builder clearGt() { if (gtBuilder_ == null) { @@ -2410,7 +2614,7 @@ public Builder clearGt() { * ``` * * - * .google.protobuf.Duration gt = 5 [json_name = "gt", (.buf.validate.priv.field) = { ... } + * .google.protobuf.Duration gt = 5 [json_name = "gt", (.buf.validate.predefined) = { ... } */ public com.google.protobuf.Duration.Builder getGtBuilder() { return getGtFieldBuilder().getBuilder(); @@ -2437,7 +2641,7 @@ public com.google.protobuf.Duration.Builder getGtBuilder() { * ``` * * - * .google.protobuf.Duration gt = 5 [json_name = "gt", (.buf.validate.priv.field) = { ... } + * .google.protobuf.Duration gt = 5 [json_name = "gt", (.buf.validate.predefined) = { ... } */ @java.lang.Override public com.google.protobuf.DurationOrBuilder getGtOrBuilder() { @@ -2472,7 +2676,7 @@ public com.google.protobuf.DurationOrBuilder getGtOrBuilder() { * ``` * * - * .google.protobuf.Duration gt = 5 [json_name = "gt", (.buf.validate.priv.field) = { ... } + * .google.protobuf.Duration gt = 5 [json_name = "gt", (.buf.validate.predefined) = { ... } */ private com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> @@ -2517,7 +2721,7 @@ public com.google.protobuf.DurationOrBuilder getGtOrBuilder() { * ``` * * - * .google.protobuf.Duration gte = 6 [json_name = "gte", (.buf.validate.priv.field) = { ... } + * .google.protobuf.Duration gte = 6 [json_name = "gte", (.buf.validate.predefined) = { ... } * @return Whether the gte field is set. */ @java.lang.Override @@ -2546,7 +2750,7 @@ public boolean hasGte() { * ``` * * - * .google.protobuf.Duration gte = 6 [json_name = "gte", (.buf.validate.priv.field) = { ... } + * .google.protobuf.Duration gte = 6 [json_name = "gte", (.buf.validate.predefined) = { ... } * @return The gte. */ @java.lang.Override @@ -2585,7 +2789,7 @@ public com.google.protobuf.Duration getGte() { * ``` * * - * .google.protobuf.Duration gte = 6 [json_name = "gte", (.buf.validate.priv.field) = { ... } + * .google.protobuf.Duration gte = 6 [json_name = "gte", (.buf.validate.predefined) = { ... } */ public Builder setGte(com.google.protobuf.Duration value) { if (gteBuilder_ == null) { @@ -2622,7 +2826,7 @@ public Builder setGte(com.google.protobuf.Duration value) { * ``` * * - * .google.protobuf.Duration gte = 6 [json_name = "gte", (.buf.validate.priv.field) = { ... } + * .google.protobuf.Duration gte = 6 [json_name = "gte", (.buf.validate.predefined) = { ... } */ public Builder setGte( com.google.protobuf.Duration.Builder builderForValue) { @@ -2657,7 +2861,7 @@ public Builder setGte( * ``` * * - * .google.protobuf.Duration gte = 6 [json_name = "gte", (.buf.validate.priv.field) = { ... } + * .google.protobuf.Duration gte = 6 [json_name = "gte", (.buf.validate.predefined) = { ... } */ public Builder mergeGte(com.google.protobuf.Duration value) { if (gteBuilder_ == null) { @@ -2701,7 +2905,7 @@ public Builder mergeGte(com.google.protobuf.Duration value) { * ``` * * - * .google.protobuf.Duration gte = 6 [json_name = "gte", (.buf.validate.priv.field) = { ... } + * .google.protobuf.Duration gte = 6 [json_name = "gte", (.buf.validate.predefined) = { ... } */ public Builder clearGte() { if (gteBuilder_ == null) { @@ -2741,7 +2945,7 @@ public Builder clearGte() { * ``` * * - * .google.protobuf.Duration gte = 6 [json_name = "gte", (.buf.validate.priv.field) = { ... } + * .google.protobuf.Duration gte = 6 [json_name = "gte", (.buf.validate.predefined) = { ... } */ public com.google.protobuf.Duration.Builder getGteBuilder() { return getGteFieldBuilder().getBuilder(); @@ -2768,7 +2972,7 @@ public com.google.protobuf.Duration.Builder getGteBuilder() { * ``` * * - * .google.protobuf.Duration gte = 6 [json_name = "gte", (.buf.validate.priv.field) = { ... } + * .google.protobuf.Duration gte = 6 [json_name = "gte", (.buf.validate.predefined) = { ... } */ @java.lang.Override public com.google.protobuf.DurationOrBuilder getGteOrBuilder() { @@ -2803,7 +3007,7 @@ public com.google.protobuf.DurationOrBuilder getGteOrBuilder() { * ``` * * - * .google.protobuf.Duration gte = 6 [json_name = "gte", (.buf.validate.priv.field) = { ... } + * .google.protobuf.Duration gte = 6 [json_name = "gte", (.buf.validate.predefined) = { ... } */ private com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> @@ -2850,7 +3054,7 @@ private void ensureInIsMutable() { * ``` * * - * repeated .google.protobuf.Duration in = 7 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated .google.protobuf.Duration in = 7 [json_name = "in", (.buf.validate.predefined) = { ... } */ public java.util.List getInList() { if (inBuilder_ == null) { @@ -2873,7 +3077,7 @@ public java.util.List getInList() { * ``` * * - * repeated .google.protobuf.Duration in = 7 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated .google.protobuf.Duration in = 7 [json_name = "in", (.buf.validate.predefined) = { ... } */ public int getInCount() { if (inBuilder_ == null) { @@ -2896,7 +3100,7 @@ public int getInCount() { * ``` * * - * repeated .google.protobuf.Duration in = 7 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated .google.protobuf.Duration in = 7 [json_name = "in", (.buf.validate.predefined) = { ... } */ public com.google.protobuf.Duration getIn(int index) { if (inBuilder_ == null) { @@ -2919,7 +3123,7 @@ public com.google.protobuf.Duration getIn(int index) { * ``` * * - * repeated .google.protobuf.Duration in = 7 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated .google.protobuf.Duration in = 7 [json_name = "in", (.buf.validate.predefined) = { ... } */ public Builder setIn( int index, com.google.protobuf.Duration value) { @@ -2949,7 +3153,7 @@ public Builder setIn( * ``` * * - * repeated .google.protobuf.Duration in = 7 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated .google.protobuf.Duration in = 7 [json_name = "in", (.buf.validate.predefined) = { ... } */ public Builder setIn( int index, com.google.protobuf.Duration.Builder builderForValue) { @@ -2976,7 +3180,7 @@ public Builder setIn( * ``` * * - * repeated .google.protobuf.Duration in = 7 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated .google.protobuf.Duration in = 7 [json_name = "in", (.buf.validate.predefined) = { ... } */ public Builder addIn(com.google.protobuf.Duration value) { if (inBuilder_ == null) { @@ -3005,7 +3209,7 @@ public Builder addIn(com.google.protobuf.Duration value) { * ``` * * - * repeated .google.protobuf.Duration in = 7 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated .google.protobuf.Duration in = 7 [json_name = "in", (.buf.validate.predefined) = { ... } */ public Builder addIn( int index, com.google.protobuf.Duration value) { @@ -3035,7 +3239,7 @@ public Builder addIn( * ``` * * - * repeated .google.protobuf.Duration in = 7 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated .google.protobuf.Duration in = 7 [json_name = "in", (.buf.validate.predefined) = { ... } */ public Builder addIn( com.google.protobuf.Duration.Builder builderForValue) { @@ -3062,7 +3266,7 @@ public Builder addIn( * ``` * * - * repeated .google.protobuf.Duration in = 7 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated .google.protobuf.Duration in = 7 [json_name = "in", (.buf.validate.predefined) = { ... } */ public Builder addIn( int index, com.google.protobuf.Duration.Builder builderForValue) { @@ -3089,7 +3293,7 @@ public Builder addIn( * ``` * * - * repeated .google.protobuf.Duration in = 7 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated .google.protobuf.Duration in = 7 [json_name = "in", (.buf.validate.predefined) = { ... } */ public Builder addAllIn( java.lang.Iterable values) { @@ -3117,7 +3321,7 @@ public Builder addAllIn( * ``` * * - * repeated .google.protobuf.Duration in = 7 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated .google.protobuf.Duration in = 7 [json_name = "in", (.buf.validate.predefined) = { ... } */ public Builder clearIn() { if (inBuilder_ == null) { @@ -3143,7 +3347,7 @@ public Builder clearIn() { * ``` * * - * repeated .google.protobuf.Duration in = 7 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated .google.protobuf.Duration in = 7 [json_name = "in", (.buf.validate.predefined) = { ... } */ public Builder removeIn(int index) { if (inBuilder_ == null) { @@ -3169,7 +3373,7 @@ public Builder removeIn(int index) { * ``` * * - * repeated .google.protobuf.Duration in = 7 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated .google.protobuf.Duration in = 7 [json_name = "in", (.buf.validate.predefined) = { ... } */ public com.google.protobuf.Duration.Builder getInBuilder( int index) { @@ -3189,7 +3393,7 @@ public com.google.protobuf.Duration.Builder getInBuilder( * ``` * * - * repeated .google.protobuf.Duration in = 7 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated .google.protobuf.Duration in = 7 [json_name = "in", (.buf.validate.predefined) = { ... } */ public com.google.protobuf.DurationOrBuilder getInOrBuilder( int index) { @@ -3212,7 +3416,7 @@ public com.google.protobuf.DurationOrBuilder getInOrBuilder( * ``` * * - * repeated .google.protobuf.Duration in = 7 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated .google.protobuf.Duration in = 7 [json_name = "in", (.buf.validate.predefined) = { ... } */ public java.util.List getInOrBuilderList() { @@ -3236,7 +3440,7 @@ public com.google.protobuf.DurationOrBuilder getInOrBuilder( * ``` * * - * repeated .google.protobuf.Duration in = 7 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated .google.protobuf.Duration in = 7 [json_name = "in", (.buf.validate.predefined) = { ... } */ public com.google.protobuf.Duration.Builder addInBuilder() { return getInFieldBuilder().addBuilder( @@ -3256,7 +3460,7 @@ public com.google.protobuf.Duration.Builder addInBuilder() { * ``` * * - * repeated .google.protobuf.Duration in = 7 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated .google.protobuf.Duration in = 7 [json_name = "in", (.buf.validate.predefined) = { ... } */ public com.google.protobuf.Duration.Builder addInBuilder( int index) { @@ -3277,7 +3481,7 @@ public com.google.protobuf.Duration.Builder addInBuilder( * ``` * * - * repeated .google.protobuf.Duration in = 7 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated .google.protobuf.Duration in = 7 [json_name = "in", (.buf.validate.predefined) = { ... } */ public java.util.List getInBuilderList() { @@ -3325,7 +3529,7 @@ private void ensureNotInIsMutable() { * ``` * * - * repeated .google.protobuf.Duration not_in = 8 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated .google.protobuf.Duration not_in = 8 [json_name = "notIn", (.buf.validate.predefined) = { ... } */ public java.util.List getNotInList() { if (notInBuilder_ == null) { @@ -3349,7 +3553,7 @@ public java.util.List getNotInList() { * ``` * * - * repeated .google.protobuf.Duration not_in = 8 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated .google.protobuf.Duration not_in = 8 [json_name = "notIn", (.buf.validate.predefined) = { ... } */ public int getNotInCount() { if (notInBuilder_ == null) { @@ -3373,7 +3577,7 @@ public int getNotInCount() { * ``` * * - * repeated .google.protobuf.Duration not_in = 8 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated .google.protobuf.Duration not_in = 8 [json_name = "notIn", (.buf.validate.predefined) = { ... } */ public com.google.protobuf.Duration getNotIn(int index) { if (notInBuilder_ == null) { @@ -3397,7 +3601,7 @@ public com.google.protobuf.Duration getNotIn(int index) { * ``` * * - * repeated .google.protobuf.Duration not_in = 8 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated .google.protobuf.Duration not_in = 8 [json_name = "notIn", (.buf.validate.predefined) = { ... } */ public Builder setNotIn( int index, com.google.protobuf.Duration value) { @@ -3428,7 +3632,7 @@ public Builder setNotIn( * ``` * * - * repeated .google.protobuf.Duration not_in = 8 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated .google.protobuf.Duration not_in = 8 [json_name = "notIn", (.buf.validate.predefined) = { ... } */ public Builder setNotIn( int index, com.google.protobuf.Duration.Builder builderForValue) { @@ -3456,7 +3660,7 @@ public Builder setNotIn( * ``` * * - * repeated .google.protobuf.Duration not_in = 8 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated .google.protobuf.Duration not_in = 8 [json_name = "notIn", (.buf.validate.predefined) = { ... } */ public Builder addNotIn(com.google.protobuf.Duration value) { if (notInBuilder_ == null) { @@ -3486,7 +3690,7 @@ public Builder addNotIn(com.google.protobuf.Duration value) { * ``` * * - * repeated .google.protobuf.Duration not_in = 8 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated .google.protobuf.Duration not_in = 8 [json_name = "notIn", (.buf.validate.predefined) = { ... } */ public Builder addNotIn( int index, com.google.protobuf.Duration value) { @@ -3517,7 +3721,7 @@ public Builder addNotIn( * ``` * * - * repeated .google.protobuf.Duration not_in = 8 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated .google.protobuf.Duration not_in = 8 [json_name = "notIn", (.buf.validate.predefined) = { ... } */ public Builder addNotIn( com.google.protobuf.Duration.Builder builderForValue) { @@ -3545,7 +3749,7 @@ public Builder addNotIn( * ``` * * - * repeated .google.protobuf.Duration not_in = 8 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated .google.protobuf.Duration not_in = 8 [json_name = "notIn", (.buf.validate.predefined) = { ... } */ public Builder addNotIn( int index, com.google.protobuf.Duration.Builder builderForValue) { @@ -3573,7 +3777,7 @@ public Builder addNotIn( * ``` * * - * repeated .google.protobuf.Duration not_in = 8 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated .google.protobuf.Duration not_in = 8 [json_name = "notIn", (.buf.validate.predefined) = { ... } */ public Builder addAllNotIn( java.lang.Iterable values) { @@ -3602,7 +3806,7 @@ public Builder addAllNotIn( * ``` * * - * repeated .google.protobuf.Duration not_in = 8 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated .google.protobuf.Duration not_in = 8 [json_name = "notIn", (.buf.validate.predefined) = { ... } */ public Builder clearNotIn() { if (notInBuilder_ == null) { @@ -3629,7 +3833,7 @@ public Builder clearNotIn() { * ``` * * - * repeated .google.protobuf.Duration not_in = 8 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated .google.protobuf.Duration not_in = 8 [json_name = "notIn", (.buf.validate.predefined) = { ... } */ public Builder removeNotIn(int index) { if (notInBuilder_ == null) { @@ -3656,7 +3860,7 @@ public Builder removeNotIn(int index) { * ``` * * - * repeated .google.protobuf.Duration not_in = 8 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated .google.protobuf.Duration not_in = 8 [json_name = "notIn", (.buf.validate.predefined) = { ... } */ public com.google.protobuf.Duration.Builder getNotInBuilder( int index) { @@ -3677,7 +3881,7 @@ public com.google.protobuf.Duration.Builder getNotInBuilder( * ``` * * - * repeated .google.protobuf.Duration not_in = 8 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated .google.protobuf.Duration not_in = 8 [json_name = "notIn", (.buf.validate.predefined) = { ... } */ public com.google.protobuf.DurationOrBuilder getNotInOrBuilder( int index) { @@ -3701,7 +3905,7 @@ public com.google.protobuf.DurationOrBuilder getNotInOrBuilder( * ``` * * - * repeated .google.protobuf.Duration not_in = 8 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated .google.protobuf.Duration not_in = 8 [json_name = "notIn", (.buf.validate.predefined) = { ... } */ public java.util.List getNotInOrBuilderList() { @@ -3726,7 +3930,7 @@ public com.google.protobuf.DurationOrBuilder getNotInOrBuilder( * ``` * * - * repeated .google.protobuf.Duration not_in = 8 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated .google.protobuf.Duration not_in = 8 [json_name = "notIn", (.buf.validate.predefined) = { ... } */ public com.google.protobuf.Duration.Builder addNotInBuilder() { return getNotInFieldBuilder().addBuilder( @@ -3747,7 +3951,7 @@ public com.google.protobuf.Duration.Builder addNotInBuilder() { * ``` * * - * repeated .google.protobuf.Duration not_in = 8 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated .google.protobuf.Duration not_in = 8 [json_name = "notIn", (.buf.validate.predefined) = { ... } */ public com.google.protobuf.Duration.Builder addNotInBuilder( int index) { @@ -3769,7 +3973,7 @@ public com.google.protobuf.Duration.Builder addNotInBuilder( * ``` * * - * repeated .google.protobuf.Duration not_in = 8 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated .google.protobuf.Duration not_in = 8 [json_name = "notIn", (.buf.validate.predefined) = { ... } */ public java.util.List getNotInBuilderList() { @@ -3790,6 +3994,516 @@ public com.google.protobuf.Duration.Builder addNotInBuilder( return notInBuilder_; } + private java.util.List example_ = + java.util.Collections.emptyList(); + private void ensureExampleIsMutable() { + if (!((bitField0_ & 0x00000080) != 0)) { + example_ = new java.util.ArrayList(example_); + bitField0_ |= 0x00000080; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> exampleBuilder_; + + /** + *
+     * `example` specifies values that the field may have. These values SHOULD
+     * conform to other constraints. `example` values will not impact validation
+     * but may be used as helpful guidance on how to populate the given field.
+     *
+     * ```proto
+     * message MyDuration {
+     * google.protobuf.Duration value = 1 [
+     * (buf.validate.field).duration.example = { seconds: 1 },
+     * (buf.validate.field).duration.example = { seconds: 2 },
+     * ];
+     * }
+     * ```
+     * 
+ * + * repeated .google.protobuf.Duration example = 9 [json_name = "example", (.buf.validate.predefined) = { ... } + */ + public java.util.List getExampleList() { + if (exampleBuilder_ == null) { + return java.util.Collections.unmodifiableList(example_); + } else { + return exampleBuilder_.getMessageList(); + } + } + /** + *
+     * `example` specifies values that the field may have. These values SHOULD
+     * conform to other constraints. `example` values will not impact validation
+     * but may be used as helpful guidance on how to populate the given field.
+     *
+     * ```proto
+     * message MyDuration {
+     * google.protobuf.Duration value = 1 [
+     * (buf.validate.field).duration.example = { seconds: 1 },
+     * (buf.validate.field).duration.example = { seconds: 2 },
+     * ];
+     * }
+     * ```
+     * 
+ * + * repeated .google.protobuf.Duration example = 9 [json_name = "example", (.buf.validate.predefined) = { ... } + */ + public int getExampleCount() { + if (exampleBuilder_ == null) { + return example_.size(); + } else { + return exampleBuilder_.getCount(); + } + } + /** + *
+     * `example` specifies values that the field may have. These values SHOULD
+     * conform to other constraints. `example` values will not impact validation
+     * but may be used as helpful guidance on how to populate the given field.
+     *
+     * ```proto
+     * message MyDuration {
+     * google.protobuf.Duration value = 1 [
+     * (buf.validate.field).duration.example = { seconds: 1 },
+     * (buf.validate.field).duration.example = { seconds: 2 },
+     * ];
+     * }
+     * ```
+     * 
+ * + * repeated .google.protobuf.Duration example = 9 [json_name = "example", (.buf.validate.predefined) = { ... } + */ + public com.google.protobuf.Duration getExample(int index) { + if (exampleBuilder_ == null) { + return example_.get(index); + } else { + return exampleBuilder_.getMessage(index); + } + } + /** + *
+     * `example` specifies values that the field may have. These values SHOULD
+     * conform to other constraints. `example` values will not impact validation
+     * but may be used as helpful guidance on how to populate the given field.
+     *
+     * ```proto
+     * message MyDuration {
+     * google.protobuf.Duration value = 1 [
+     * (buf.validate.field).duration.example = { seconds: 1 },
+     * (buf.validate.field).duration.example = { seconds: 2 },
+     * ];
+     * }
+     * ```
+     * 
+ * + * repeated .google.protobuf.Duration example = 9 [json_name = "example", (.buf.validate.predefined) = { ... } + */ + public Builder setExample( + int index, com.google.protobuf.Duration value) { + if (exampleBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureExampleIsMutable(); + example_.set(index, value); + onChanged(); + } else { + exampleBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * `example` specifies values that the field may have. These values SHOULD
+     * conform to other constraints. `example` values will not impact validation
+     * but may be used as helpful guidance on how to populate the given field.
+     *
+     * ```proto
+     * message MyDuration {
+     * google.protobuf.Duration value = 1 [
+     * (buf.validate.field).duration.example = { seconds: 1 },
+     * (buf.validate.field).duration.example = { seconds: 2 },
+     * ];
+     * }
+     * ```
+     * 
+ * + * repeated .google.protobuf.Duration example = 9 [json_name = "example", (.buf.validate.predefined) = { ... } + */ + public Builder setExample( + int index, com.google.protobuf.Duration.Builder builderForValue) { + if (exampleBuilder_ == null) { + ensureExampleIsMutable(); + example_.set(index, builderForValue.build()); + onChanged(); + } else { + exampleBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * `example` specifies values that the field may have. These values SHOULD
+     * conform to other constraints. `example` values will not impact validation
+     * but may be used as helpful guidance on how to populate the given field.
+     *
+     * ```proto
+     * message MyDuration {
+     * google.protobuf.Duration value = 1 [
+     * (buf.validate.field).duration.example = { seconds: 1 },
+     * (buf.validate.field).duration.example = { seconds: 2 },
+     * ];
+     * }
+     * ```
+     * 
+ * + * repeated .google.protobuf.Duration example = 9 [json_name = "example", (.buf.validate.predefined) = { ... } + */ + public Builder addExample(com.google.protobuf.Duration value) { + if (exampleBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureExampleIsMutable(); + example_.add(value); + onChanged(); + } else { + exampleBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * `example` specifies values that the field may have. These values SHOULD
+     * conform to other constraints. `example` values will not impact validation
+     * but may be used as helpful guidance on how to populate the given field.
+     *
+     * ```proto
+     * message MyDuration {
+     * google.protobuf.Duration value = 1 [
+     * (buf.validate.field).duration.example = { seconds: 1 },
+     * (buf.validate.field).duration.example = { seconds: 2 },
+     * ];
+     * }
+     * ```
+     * 
+ * + * repeated .google.protobuf.Duration example = 9 [json_name = "example", (.buf.validate.predefined) = { ... } + */ + public Builder addExample( + int index, com.google.protobuf.Duration value) { + if (exampleBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureExampleIsMutable(); + example_.add(index, value); + onChanged(); + } else { + exampleBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * `example` specifies values that the field may have. These values SHOULD
+     * conform to other constraints. `example` values will not impact validation
+     * but may be used as helpful guidance on how to populate the given field.
+     *
+     * ```proto
+     * message MyDuration {
+     * google.protobuf.Duration value = 1 [
+     * (buf.validate.field).duration.example = { seconds: 1 },
+     * (buf.validate.field).duration.example = { seconds: 2 },
+     * ];
+     * }
+     * ```
+     * 
+ * + * repeated .google.protobuf.Duration example = 9 [json_name = "example", (.buf.validate.predefined) = { ... } + */ + public Builder addExample( + com.google.protobuf.Duration.Builder builderForValue) { + if (exampleBuilder_ == null) { + ensureExampleIsMutable(); + example_.add(builderForValue.build()); + onChanged(); + } else { + exampleBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * `example` specifies values that the field may have. These values SHOULD
+     * conform to other constraints. `example` values will not impact validation
+     * but may be used as helpful guidance on how to populate the given field.
+     *
+     * ```proto
+     * message MyDuration {
+     * google.protobuf.Duration value = 1 [
+     * (buf.validate.field).duration.example = { seconds: 1 },
+     * (buf.validate.field).duration.example = { seconds: 2 },
+     * ];
+     * }
+     * ```
+     * 
+ * + * repeated .google.protobuf.Duration example = 9 [json_name = "example", (.buf.validate.predefined) = { ... } + */ + public Builder addExample( + int index, com.google.protobuf.Duration.Builder builderForValue) { + if (exampleBuilder_ == null) { + ensureExampleIsMutable(); + example_.add(index, builderForValue.build()); + onChanged(); + } else { + exampleBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * `example` specifies values that the field may have. These values SHOULD
+     * conform to other constraints. `example` values will not impact validation
+     * but may be used as helpful guidance on how to populate the given field.
+     *
+     * ```proto
+     * message MyDuration {
+     * google.protobuf.Duration value = 1 [
+     * (buf.validate.field).duration.example = { seconds: 1 },
+     * (buf.validate.field).duration.example = { seconds: 2 },
+     * ];
+     * }
+     * ```
+     * 
+ * + * repeated .google.protobuf.Duration example = 9 [json_name = "example", (.buf.validate.predefined) = { ... } + */ + public Builder addAllExample( + java.lang.Iterable values) { + if (exampleBuilder_ == null) { + ensureExampleIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, example_); + onChanged(); + } else { + exampleBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * `example` specifies values that the field may have. These values SHOULD
+     * conform to other constraints. `example` values will not impact validation
+     * but may be used as helpful guidance on how to populate the given field.
+     *
+     * ```proto
+     * message MyDuration {
+     * google.protobuf.Duration value = 1 [
+     * (buf.validate.field).duration.example = { seconds: 1 },
+     * (buf.validate.field).duration.example = { seconds: 2 },
+     * ];
+     * }
+     * ```
+     * 
+ * + * repeated .google.protobuf.Duration example = 9 [json_name = "example", (.buf.validate.predefined) = { ... } + */ + public Builder clearExample() { + if (exampleBuilder_ == null) { + example_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000080); + onChanged(); + } else { + exampleBuilder_.clear(); + } + return this; + } + /** + *
+     * `example` specifies values that the field may have. These values SHOULD
+     * conform to other constraints. `example` values will not impact validation
+     * but may be used as helpful guidance on how to populate the given field.
+     *
+     * ```proto
+     * message MyDuration {
+     * google.protobuf.Duration value = 1 [
+     * (buf.validate.field).duration.example = { seconds: 1 },
+     * (buf.validate.field).duration.example = { seconds: 2 },
+     * ];
+     * }
+     * ```
+     * 
+ * + * repeated .google.protobuf.Duration example = 9 [json_name = "example", (.buf.validate.predefined) = { ... } + */ + public Builder removeExample(int index) { + if (exampleBuilder_ == null) { + ensureExampleIsMutable(); + example_.remove(index); + onChanged(); + } else { + exampleBuilder_.remove(index); + } + return this; + } + /** + *
+     * `example` specifies values that the field may have. These values SHOULD
+     * conform to other constraints. `example` values will not impact validation
+     * but may be used as helpful guidance on how to populate the given field.
+     *
+     * ```proto
+     * message MyDuration {
+     * google.protobuf.Duration value = 1 [
+     * (buf.validate.field).duration.example = { seconds: 1 },
+     * (buf.validate.field).duration.example = { seconds: 2 },
+     * ];
+     * }
+     * ```
+     * 
+ * + * repeated .google.protobuf.Duration example = 9 [json_name = "example", (.buf.validate.predefined) = { ... } + */ + public com.google.protobuf.Duration.Builder getExampleBuilder( + int index) { + return getExampleFieldBuilder().getBuilder(index); + } + /** + *
+     * `example` specifies values that the field may have. These values SHOULD
+     * conform to other constraints. `example` values will not impact validation
+     * but may be used as helpful guidance on how to populate the given field.
+     *
+     * ```proto
+     * message MyDuration {
+     * google.protobuf.Duration value = 1 [
+     * (buf.validate.field).duration.example = { seconds: 1 },
+     * (buf.validate.field).duration.example = { seconds: 2 },
+     * ];
+     * }
+     * ```
+     * 
+ * + * repeated .google.protobuf.Duration example = 9 [json_name = "example", (.buf.validate.predefined) = { ... } + */ + public com.google.protobuf.DurationOrBuilder getExampleOrBuilder( + int index) { + if (exampleBuilder_ == null) { + return example_.get(index); } else { + return exampleBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * `example` specifies values that the field may have. These values SHOULD
+     * conform to other constraints. `example` values will not impact validation
+     * but may be used as helpful guidance on how to populate the given field.
+     *
+     * ```proto
+     * message MyDuration {
+     * google.protobuf.Duration value = 1 [
+     * (buf.validate.field).duration.example = { seconds: 1 },
+     * (buf.validate.field).duration.example = { seconds: 2 },
+     * ];
+     * }
+     * ```
+     * 
+ * + * repeated .google.protobuf.Duration example = 9 [json_name = "example", (.buf.validate.predefined) = { ... } + */ + public java.util.List + getExampleOrBuilderList() { + if (exampleBuilder_ != null) { + return exampleBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(example_); + } + } + /** + *
+     * `example` specifies values that the field may have. These values SHOULD
+     * conform to other constraints. `example` values will not impact validation
+     * but may be used as helpful guidance on how to populate the given field.
+     *
+     * ```proto
+     * message MyDuration {
+     * google.protobuf.Duration value = 1 [
+     * (buf.validate.field).duration.example = { seconds: 1 },
+     * (buf.validate.field).duration.example = { seconds: 2 },
+     * ];
+     * }
+     * ```
+     * 
+ * + * repeated .google.protobuf.Duration example = 9 [json_name = "example", (.buf.validate.predefined) = { ... } + */ + public com.google.protobuf.Duration.Builder addExampleBuilder() { + return getExampleFieldBuilder().addBuilder( + com.google.protobuf.Duration.getDefaultInstance()); + } + /** + *
+     * `example` specifies values that the field may have. These values SHOULD
+     * conform to other constraints. `example` values will not impact validation
+     * but may be used as helpful guidance on how to populate the given field.
+     *
+     * ```proto
+     * message MyDuration {
+     * google.protobuf.Duration value = 1 [
+     * (buf.validate.field).duration.example = { seconds: 1 },
+     * (buf.validate.field).duration.example = { seconds: 2 },
+     * ];
+     * }
+     * ```
+     * 
+ * + * repeated .google.protobuf.Duration example = 9 [json_name = "example", (.buf.validate.predefined) = { ... } + */ + public com.google.protobuf.Duration.Builder addExampleBuilder( + int index) { + return getExampleFieldBuilder().addBuilder( + index, com.google.protobuf.Duration.getDefaultInstance()); + } + /** + *
+     * `example` specifies values that the field may have. These values SHOULD
+     * conform to other constraints. `example` values will not impact validation
+     * but may be used as helpful guidance on how to populate the given field.
+     *
+     * ```proto
+     * message MyDuration {
+     * google.protobuf.Duration value = 1 [
+     * (buf.validate.field).duration.example = { seconds: 1 },
+     * (buf.validate.field).duration.example = { seconds: 2 },
+     * ];
+     * }
+     * ```
+     * 
+ * + * repeated .google.protobuf.Duration example = 9 [json_name = "example", (.buf.validate.predefined) = { ... } + */ + public java.util.List + getExampleBuilderList() { + return getExampleFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> + getExampleFieldBuilder() { + if (exampleBuilder_ == null) { + exampleBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder>( + example_, + ((bitField0_ & 0x00000080) != 0), + getParentForChildren(), + isClean()); + example_ = null; + } + return exampleBuilder_; + } + // @@protoc_insertion_point(builder_scope:buf.validate.DurationRules) } diff --git a/src/main/java/build/buf/validate/DurationRulesOrBuilder.java b/src/main/java/build/buf/validate/DurationRulesOrBuilder.java index 0e93451f..6b908b37 100644 --- a/src/main/java/build/buf/validate/DurationRulesOrBuilder.java +++ b/src/main/java/build/buf/validate/DurationRulesOrBuilder.java @@ -7,7 +7,8 @@ public interface DurationRulesOrBuilder extends // @@protoc_insertion_point(interface_extends:buf.validate.DurationRules) - com.google.protobuf.MessageOrBuilder { + com.google.protobuf.GeneratedMessage. + ExtendableMessageOrBuilder { /** *
@@ -23,7 +24,7 @@ public interface DurationRulesOrBuilder extends
    * ```
    * 
* - * optional .google.protobuf.Duration const = 2 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional .google.protobuf.Duration const = 2 [json_name = "const", (.buf.validate.predefined) = { ... } * @return Whether the const field is set. */ boolean hasConst(); @@ -41,7 +42,7 @@ public interface DurationRulesOrBuilder extends * ``` * * - * optional .google.protobuf.Duration const = 2 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional .google.protobuf.Duration const = 2 [json_name = "const", (.buf.validate.predefined) = { ... } * @return The const. */ com.google.protobuf.Duration getConst(); @@ -59,7 +60,7 @@ public interface DurationRulesOrBuilder extends * ``` * * - * optional .google.protobuf.Duration const = 2 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional .google.protobuf.Duration const = 2 [json_name = "const", (.buf.validate.predefined) = { ... } */ com.google.protobuf.DurationOrBuilder getConstOrBuilder(); @@ -77,7 +78,7 @@ public interface DurationRulesOrBuilder extends * ``` * * - * .google.protobuf.Duration lt = 3 [json_name = "lt", (.buf.validate.priv.field) = { ... } + * .google.protobuf.Duration lt = 3 [json_name = "lt", (.buf.validate.predefined) = { ... } * @return Whether the lt field is set. */ boolean hasLt(); @@ -95,7 +96,7 @@ public interface DurationRulesOrBuilder extends * ``` * * - * .google.protobuf.Duration lt = 3 [json_name = "lt", (.buf.validate.priv.field) = { ... } + * .google.protobuf.Duration lt = 3 [json_name = "lt", (.buf.validate.predefined) = { ... } * @return The lt. */ com.google.protobuf.Duration getLt(); @@ -113,7 +114,7 @@ public interface DurationRulesOrBuilder extends * ``` * * - * .google.protobuf.Duration lt = 3 [json_name = "lt", (.buf.validate.priv.field) = { ... } + * .google.protobuf.Duration lt = 3 [json_name = "lt", (.buf.validate.predefined) = { ... } */ com.google.protobuf.DurationOrBuilder getLtOrBuilder(); @@ -131,7 +132,7 @@ public interface DurationRulesOrBuilder extends * ``` * * - * .google.protobuf.Duration lte = 4 [json_name = "lte", (.buf.validate.priv.field) = { ... } + * .google.protobuf.Duration lte = 4 [json_name = "lte", (.buf.validate.predefined) = { ... } * @return Whether the lte field is set. */ boolean hasLte(); @@ -149,7 +150,7 @@ public interface DurationRulesOrBuilder extends * ``` * * - * .google.protobuf.Duration lte = 4 [json_name = "lte", (.buf.validate.priv.field) = { ... } + * .google.protobuf.Duration lte = 4 [json_name = "lte", (.buf.validate.predefined) = { ... } * @return The lte. */ com.google.protobuf.Duration getLte(); @@ -167,7 +168,7 @@ public interface DurationRulesOrBuilder extends * ``` * * - * .google.protobuf.Duration lte = 4 [json_name = "lte", (.buf.validate.priv.field) = { ... } + * .google.protobuf.Duration lte = 4 [json_name = "lte", (.buf.validate.predefined) = { ... } */ com.google.protobuf.DurationOrBuilder getLteOrBuilder(); @@ -193,7 +194,7 @@ public interface DurationRulesOrBuilder extends * ``` * * - * .google.protobuf.Duration gt = 5 [json_name = "gt", (.buf.validate.priv.field) = { ... } + * .google.protobuf.Duration gt = 5 [json_name = "gt", (.buf.validate.predefined) = { ... } * @return Whether the gt field is set. */ boolean hasGt(); @@ -219,7 +220,7 @@ public interface DurationRulesOrBuilder extends * ``` * * - * .google.protobuf.Duration gt = 5 [json_name = "gt", (.buf.validate.priv.field) = { ... } + * .google.protobuf.Duration gt = 5 [json_name = "gt", (.buf.validate.predefined) = { ... } * @return The gt. */ com.google.protobuf.Duration getGt(); @@ -245,7 +246,7 @@ public interface DurationRulesOrBuilder extends * ``` * * - * .google.protobuf.Duration gt = 5 [json_name = "gt", (.buf.validate.priv.field) = { ... } + * .google.protobuf.Duration gt = 5 [json_name = "gt", (.buf.validate.predefined) = { ... } */ com.google.protobuf.DurationOrBuilder getGtOrBuilder(); @@ -271,7 +272,7 @@ public interface DurationRulesOrBuilder extends * ``` * * - * .google.protobuf.Duration gte = 6 [json_name = "gte", (.buf.validate.priv.field) = { ... } + * .google.protobuf.Duration gte = 6 [json_name = "gte", (.buf.validate.predefined) = { ... } * @return Whether the gte field is set. */ boolean hasGte(); @@ -297,7 +298,7 @@ public interface DurationRulesOrBuilder extends * ``` * * - * .google.protobuf.Duration gte = 6 [json_name = "gte", (.buf.validate.priv.field) = { ... } + * .google.protobuf.Duration gte = 6 [json_name = "gte", (.buf.validate.predefined) = { ... } * @return The gte. */ com.google.protobuf.Duration getGte(); @@ -323,7 +324,7 @@ public interface DurationRulesOrBuilder extends * ``` * * - * .google.protobuf.Duration gte = 6 [json_name = "gte", (.buf.validate.priv.field) = { ... } + * .google.protobuf.Duration gte = 6 [json_name = "gte", (.buf.validate.predefined) = { ... } */ com.google.protobuf.DurationOrBuilder getGteOrBuilder(); @@ -341,7 +342,7 @@ public interface DurationRulesOrBuilder extends * ``` * * - * repeated .google.protobuf.Duration in = 7 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated .google.protobuf.Duration in = 7 [json_name = "in", (.buf.validate.predefined) = { ... } */ java.util.List getInList(); @@ -359,7 +360,7 @@ public interface DurationRulesOrBuilder extends * ``` * * - * repeated .google.protobuf.Duration in = 7 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated .google.protobuf.Duration in = 7 [json_name = "in", (.buf.validate.predefined) = { ... } */ com.google.protobuf.Duration getIn(int index); /** @@ -376,7 +377,7 @@ public interface DurationRulesOrBuilder extends * ``` * * - * repeated .google.protobuf.Duration in = 7 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated .google.protobuf.Duration in = 7 [json_name = "in", (.buf.validate.predefined) = { ... } */ int getInCount(); /** @@ -393,7 +394,7 @@ public interface DurationRulesOrBuilder extends * ``` * * - * repeated .google.protobuf.Duration in = 7 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated .google.protobuf.Duration in = 7 [json_name = "in", (.buf.validate.predefined) = { ... } */ java.util.List getInOrBuilderList(); @@ -411,7 +412,7 @@ public interface DurationRulesOrBuilder extends * ``` * * - * repeated .google.protobuf.Duration in = 7 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated .google.protobuf.Duration in = 7 [json_name = "in", (.buf.validate.predefined) = { ... } */ com.google.protobuf.DurationOrBuilder getInOrBuilder( int index); @@ -431,7 +432,7 @@ com.google.protobuf.DurationOrBuilder getInOrBuilder( * ``` * * - * repeated .google.protobuf.Duration not_in = 8 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated .google.protobuf.Duration not_in = 8 [json_name = "notIn", (.buf.validate.predefined) = { ... } */ java.util.List getNotInList(); @@ -450,7 +451,7 @@ com.google.protobuf.DurationOrBuilder getInOrBuilder( * ``` * * - * repeated .google.protobuf.Duration not_in = 8 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated .google.protobuf.Duration not_in = 8 [json_name = "notIn", (.buf.validate.predefined) = { ... } */ com.google.protobuf.Duration getNotIn(int index); /** @@ -468,7 +469,7 @@ com.google.protobuf.DurationOrBuilder getInOrBuilder( * ``` * * - * repeated .google.protobuf.Duration not_in = 8 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated .google.protobuf.Duration not_in = 8 [json_name = "notIn", (.buf.validate.predefined) = { ... } */ int getNotInCount(); /** @@ -486,7 +487,7 @@ com.google.protobuf.DurationOrBuilder getInOrBuilder( * ``` * * - * repeated .google.protobuf.Duration not_in = 8 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated .google.protobuf.Duration not_in = 8 [json_name = "notIn", (.buf.validate.predefined) = { ... } */ java.util.List getNotInOrBuilderList(); @@ -505,11 +506,110 @@ com.google.protobuf.DurationOrBuilder getInOrBuilder( * ``` * * - * repeated .google.protobuf.Duration not_in = 8 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated .google.protobuf.Duration not_in = 8 [json_name = "notIn", (.buf.validate.predefined) = { ... } */ com.google.protobuf.DurationOrBuilder getNotInOrBuilder( int index); + /** + *
+   * `example` specifies values that the field may have. These values SHOULD
+   * conform to other constraints. `example` values will not impact validation
+   * but may be used as helpful guidance on how to populate the given field.
+   *
+   * ```proto
+   * message MyDuration {
+   * google.protobuf.Duration value = 1 [
+   * (buf.validate.field).duration.example = { seconds: 1 },
+   * (buf.validate.field).duration.example = { seconds: 2 },
+   * ];
+   * }
+   * ```
+   * 
+ * + * repeated .google.protobuf.Duration example = 9 [json_name = "example", (.buf.validate.predefined) = { ... } + */ + java.util.List + getExampleList(); + /** + *
+   * `example` specifies values that the field may have. These values SHOULD
+   * conform to other constraints. `example` values will not impact validation
+   * but may be used as helpful guidance on how to populate the given field.
+   *
+   * ```proto
+   * message MyDuration {
+   * google.protobuf.Duration value = 1 [
+   * (buf.validate.field).duration.example = { seconds: 1 },
+   * (buf.validate.field).duration.example = { seconds: 2 },
+   * ];
+   * }
+   * ```
+   * 
+ * + * repeated .google.protobuf.Duration example = 9 [json_name = "example", (.buf.validate.predefined) = { ... } + */ + com.google.protobuf.Duration getExample(int index); + /** + *
+   * `example` specifies values that the field may have. These values SHOULD
+   * conform to other constraints. `example` values will not impact validation
+   * but may be used as helpful guidance on how to populate the given field.
+   *
+   * ```proto
+   * message MyDuration {
+   * google.protobuf.Duration value = 1 [
+   * (buf.validate.field).duration.example = { seconds: 1 },
+   * (buf.validate.field).duration.example = { seconds: 2 },
+   * ];
+   * }
+   * ```
+   * 
+ * + * repeated .google.protobuf.Duration example = 9 [json_name = "example", (.buf.validate.predefined) = { ... } + */ + int getExampleCount(); + /** + *
+   * `example` specifies values that the field may have. These values SHOULD
+   * conform to other constraints. `example` values will not impact validation
+   * but may be used as helpful guidance on how to populate the given field.
+   *
+   * ```proto
+   * message MyDuration {
+   * google.protobuf.Duration value = 1 [
+   * (buf.validate.field).duration.example = { seconds: 1 },
+   * (buf.validate.field).duration.example = { seconds: 2 },
+   * ];
+   * }
+   * ```
+   * 
+ * + * repeated .google.protobuf.Duration example = 9 [json_name = "example", (.buf.validate.predefined) = { ... } + */ + java.util.List + getExampleOrBuilderList(); + /** + *
+   * `example` specifies values that the field may have. These values SHOULD
+   * conform to other constraints. `example` values will not impact validation
+   * but may be used as helpful guidance on how to populate the given field.
+   *
+   * ```proto
+   * message MyDuration {
+   * google.protobuf.Duration value = 1 [
+   * (buf.validate.field).duration.example = { seconds: 1 },
+   * (buf.validate.field).duration.example = { seconds: 2 },
+   * ];
+   * }
+   * ```
+   * 
+ * + * repeated .google.protobuf.Duration example = 9 [json_name = "example", (.buf.validate.predefined) = { ... } + */ + com.google.protobuf.DurationOrBuilder getExampleOrBuilder( + int index); + build.buf.validate.DurationRules.LessThanCase getLessThanCase(); build.buf.validate.DurationRules.GreaterThanCase getGreaterThanCase(); diff --git a/src/main/java/build/buf/validate/EnumRules.java b/src/main/java/build/buf/validate/EnumRules.java index 46dcc470..51fd9b71 100644 --- a/src/main/java/build/buf/validate/EnumRules.java +++ b/src/main/java/build/buf/validate/EnumRules.java @@ -13,7 +13,8 @@ * Protobuf type {@code buf.validate.EnumRules} */ public final class EnumRules extends - com.google.protobuf.GeneratedMessage implements + com.google.protobuf.GeneratedMessage.ExtendableMessage< + EnumRules> implements // @@protoc_insertion_point(message_implements:buf.validate.EnumRules) EnumRulesOrBuilder { private static final long serialVersionUID = 0L; @@ -27,12 +28,13 @@ public final class EnumRules extends EnumRules.class.getName()); } // Use EnumRules.newBuilder() to construct. - private EnumRules(com.google.protobuf.GeneratedMessage.Builder builder) { + private EnumRules(com.google.protobuf.GeneratedMessage.ExtendableBuilder builder) { super(builder); } private EnumRules() { in_ = emptyIntList(); notIn_ = emptyIntList(); + example_ = emptyIntList(); } public static final com.google.protobuf.Descriptors.Descriptor @@ -70,7 +72,7 @@ private EnumRules() { * ``` * * - * optional int32 const = 1 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional int32 const = 1 [json_name = "const", (.buf.validate.predefined) = { ... } * @return Whether the const field is set. */ @java.lang.Override @@ -96,7 +98,7 @@ public boolean hasConst() { * ``` * * - * optional int32 const = 1 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional int32 const = 1 [json_name = "const", (.buf.validate.predefined) = { ... } * @return The const. */ @java.lang.Override @@ -183,7 +185,7 @@ public boolean getDefinedOnly() { * ``` * * - * repeated int32 in = 3 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated int32 in = 3 [json_name = "in", (.buf.validate.predefined) = { ... } * @return A list containing the in. */ @java.lang.Override @@ -211,7 +213,7 @@ public boolean getDefinedOnly() { * ``` * * - * repeated int32 in = 3 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated int32 in = 3 [json_name = "in", (.buf.validate.predefined) = { ... } * @return The count of in. */ public int getInCount() { @@ -237,14 +239,13 @@ public int getInCount() { * ``` * * - * repeated int32 in = 3 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated int32 in = 3 [json_name = "in", (.buf.validate.predefined) = { ... } * @param index The index of the element to return. * @return The in at the given index. */ public int getIn(int index) { return in_.getInt(index); } - private int inMemoizedSerializedSize = -1; public static final int NOT_IN_FIELD_NUMBER = 4; @SuppressWarnings("serial") @@ -270,7 +271,7 @@ public int getIn(int index) { * ``` * * - * repeated int32 not_in = 4 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated int32 not_in = 4 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @return A list containing the notIn. */ @java.lang.Override @@ -298,7 +299,7 @@ public int getIn(int index) { * ``` * * - * repeated int32 not_in = 4 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated int32 not_in = 4 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @return The count of notIn. */ public int getNotInCount() { @@ -324,14 +325,99 @@ public int getNotInCount() { * ``` * * - * repeated int32 not_in = 4 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated int32 not_in = 4 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @param index The index of the element to return. * @return The notIn at the given index. */ public int getNotIn(int index) { return notIn_.getInt(index); } - private int notInMemoizedSerializedSize = -1; + + public static final int EXAMPLE_FIELD_NUMBER = 5; + @SuppressWarnings("serial") + private com.google.protobuf.Internal.IntList example_ = + emptyIntList(); + /** + *
+   * `example` specifies values that the field may have. These values SHOULD
+   * conform to other constraints. `example` values will not impact validation
+   * but may be used as helpful guidance on how to populate the given field.
+   *
+   * ```proto
+   * enum MyEnum {
+   * MY_ENUM_UNSPECIFIED = 0;
+   * MY_ENUM_VALUE1 = 1;
+   * MY_ENUM_VALUE2 = 2;
+   * }
+   *
+   * message MyMessage {
+   * (buf.validate.field).enum.example = 1,
+   * (buf.validate.field).enum.example = 2
+   * }
+   * ```
+   * 
+ * + * repeated int32 example = 5 [json_name = "example", (.buf.validate.predefined) = { ... } + * @return A list containing the example. + */ + @java.lang.Override + public java.util.List + getExampleList() { + return example_; + } + /** + *
+   * `example` specifies values that the field may have. These values SHOULD
+   * conform to other constraints. `example` values will not impact validation
+   * but may be used as helpful guidance on how to populate the given field.
+   *
+   * ```proto
+   * enum MyEnum {
+   * MY_ENUM_UNSPECIFIED = 0;
+   * MY_ENUM_VALUE1 = 1;
+   * MY_ENUM_VALUE2 = 2;
+   * }
+   *
+   * message MyMessage {
+   * (buf.validate.field).enum.example = 1,
+   * (buf.validate.field).enum.example = 2
+   * }
+   * ```
+   * 
+ * + * repeated int32 example = 5 [json_name = "example", (.buf.validate.predefined) = { ... } + * @return The count of example. + */ + public int getExampleCount() { + return example_.size(); + } + /** + *
+   * `example` specifies values that the field may have. These values SHOULD
+   * conform to other constraints. `example` values will not impact validation
+   * but may be used as helpful guidance on how to populate the given field.
+   *
+   * ```proto
+   * enum MyEnum {
+   * MY_ENUM_UNSPECIFIED = 0;
+   * MY_ENUM_VALUE1 = 1;
+   * MY_ENUM_VALUE2 = 2;
+   * }
+   *
+   * message MyMessage {
+   * (buf.validate.field).enum.example = 1,
+   * (buf.validate.field).enum.example = 2
+   * }
+   * ```
+   * 
+ * + * repeated int32 example = 5 [json_name = "example", (.buf.validate.predefined) = { ... } + * @param index The index of the element to return. + * @return The example at the given index. + */ + public int getExample(int index) { + return example_.getInt(index); + } private byte memoizedIsInitialized = -1; @java.lang.Override @@ -340,6 +426,10 @@ public final boolean isInitialized() { if (isInitialized == 1) return true; if (isInitialized == 0) return false; + if (!extensionsAreInitialized()) { + memoizedIsInitialized = 0; + return false; + } memoizedIsInitialized = 1; return true; } @@ -347,27 +437,25 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - getSerializedSize(); + com.google.protobuf.GeneratedMessage + .ExtendableMessage.ExtensionSerializer + extensionWriter = newExtensionSerializer(); if (((bitField0_ & 0x00000001) != 0)) { output.writeInt32(1, const_); } if (((bitField0_ & 0x00000002) != 0)) { output.writeBool(2, definedOnly_); } - if (getInList().size() > 0) { - output.writeUInt32NoTag(26); - output.writeUInt32NoTag(inMemoizedSerializedSize); - } for (int i = 0; i < in_.size(); i++) { - output.writeInt32NoTag(in_.getInt(i)); - } - if (getNotInList().size() > 0) { - output.writeUInt32NoTag(34); - output.writeUInt32NoTag(notInMemoizedSerializedSize); + output.writeInt32(3, in_.getInt(i)); } for (int i = 0; i < notIn_.size(); i++) { - output.writeInt32NoTag(notIn_.getInt(i)); + output.writeInt32(4, notIn_.getInt(i)); } + for (int i = 0; i < example_.size(); i++) { + output.writeInt32(5, example_.getInt(i)); + } + extensionWriter.writeUntil(536870912, output); getUnknownFields().writeTo(output); } @@ -392,12 +480,7 @@ public int getSerializedSize() { .computeInt32SizeNoTag(in_.getInt(i)); } size += dataSize; - if (!getInList().isEmpty()) { - size += 1; - size += com.google.protobuf.CodedOutputStream - .computeInt32SizeNoTag(dataSize); - } - inMemoizedSerializedSize = dataSize; + size += 1 * getInList().size(); } { int dataSize = 0; @@ -406,13 +489,18 @@ public int getSerializedSize() { .computeInt32SizeNoTag(notIn_.getInt(i)); } size += dataSize; - if (!getNotInList().isEmpty()) { - size += 1; - size += com.google.protobuf.CodedOutputStream - .computeInt32SizeNoTag(dataSize); + size += 1 * getNotInList().size(); + } + { + int dataSize = 0; + for (int i = 0; i < example_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream + .computeInt32SizeNoTag(example_.getInt(i)); } - notInMemoizedSerializedSize = dataSize; + size += dataSize; + size += 1 * getExampleList().size(); } + size += extensionsSerializedSize(); size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -442,7 +530,11 @@ public boolean equals(final java.lang.Object obj) { .equals(other.getInList())) return false; if (!getNotInList() .equals(other.getNotInList())) return false; + if (!getExampleList() + .equals(other.getExampleList())) return false; if (!getUnknownFields().equals(other.getUnknownFields())) return false; + if (!getExtensionFields().equals(other.getExtensionFields())) + return false; return true; } @@ -470,6 +562,11 @@ public int hashCode() { hash = (37 * hash) + NOT_IN_FIELD_NUMBER; hash = (53 * hash) + getNotInList().hashCode(); } + if (getExampleCount() > 0) { + hash = (37 * hash) + EXAMPLE_FIELD_NUMBER; + hash = (53 * hash) + getExampleList().hashCode(); + } + hash = hashFields(hash, getExtensionFields()); hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -575,7 +672,8 @@ protected Builder newBuilderForType( * Protobuf type {@code buf.validate.EnumRules} */ public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder implements + com.google.protobuf.GeneratedMessage.ExtendableBuilder< + build.buf.validate.EnumRules, Builder> implements // @@protoc_insertion_point(builder_implements:buf.validate.EnumRules) build.buf.validate.EnumRulesOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor @@ -609,6 +707,7 @@ public Builder clear() { definedOnly_ = false; in_ = emptyIntList(); notIn_ = emptyIntList(); + example_ = emptyIntList(); return this; } @@ -659,6 +758,10 @@ private void buildPartial0(build.buf.validate.EnumRules result) { notIn_.makeImmutable(); result.notIn_ = notIn_; } + if (((from_bitField0_ & 0x00000010) != 0)) { + example_.makeImmutable(); + result.example_ = example_; + } result.bitField0_ |= to_bitField0_; } @@ -702,6 +805,18 @@ public Builder mergeFrom(build.buf.validate.EnumRules other) { } onChanged(); } + if (!other.example_.isEmpty()) { + if (example_.isEmpty()) { + example_ = other.example_; + example_.makeImmutable(); + bitField0_ |= 0x00000010; + } else { + ensureExampleIsMutable(); + example_.addAll(other.example_); + } + onChanged(); + } + this.mergeExtensionFields(other); this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -709,6 +824,9 @@ public Builder mergeFrom(build.buf.validate.EnumRules other) { @java.lang.Override public final boolean isInitialized() { + if (!extensionsAreInitialized()) { + return false; + } return true; } @@ -770,6 +888,22 @@ public Builder mergeFrom( input.popLimit(limit); break; } // case 34 + case 40: { + int v = input.readInt32(); + ensureExampleIsMutable(); + example_.addInt(v); + break; + } // case 40 + case 42: { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + ensureExampleIsMutable(); + while (input.getBytesUntilLimit() > 0) { + example_.addInt(input.readInt32()); + } + input.popLimit(limit); + break; + } // case 42 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { done = true; // was an endgroup tag @@ -807,7 +941,7 @@ public Builder mergeFrom( * ``` * * - * optional int32 const = 1 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional int32 const = 1 [json_name = "const", (.buf.validate.predefined) = { ... } * @return Whether the const field is set. */ @java.lang.Override @@ -833,7 +967,7 @@ public boolean hasConst() { * ``` * * - * optional int32 const = 1 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional int32 const = 1 [json_name = "const", (.buf.validate.predefined) = { ... } * @return The const. */ @java.lang.Override @@ -859,7 +993,7 @@ public int getConst() { * ``` * * - * optional int32 const = 1 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional int32 const = 1 [json_name = "const", (.buf.validate.predefined) = { ... } * @param value The const to set. * @return This builder for chaining. */ @@ -889,7 +1023,7 @@ public Builder setConst(int value) { * ``` * * - * optional int32 const = 1 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional int32 const = 1 [json_name = "const", (.buf.validate.predefined) = { ... } * @return This builder for chaining. */ public Builder clearConst() { @@ -1038,7 +1172,7 @@ private void ensureInIsMutable() { * ``` * * - * repeated int32 in = 3 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated int32 in = 3 [json_name = "in", (.buf.validate.predefined) = { ... } * @return A list containing the in. */ public java.util.List @@ -1066,7 +1200,7 @@ private void ensureInIsMutable() { * ``` * * - * repeated int32 in = 3 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated int32 in = 3 [json_name = "in", (.buf.validate.predefined) = { ... } * @return The count of in. */ public int getInCount() { @@ -1092,7 +1226,7 @@ public int getInCount() { * ``` * * - * repeated int32 in = 3 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated int32 in = 3 [json_name = "in", (.buf.validate.predefined) = { ... } * @param index The index of the element to return. * @return The in at the given index. */ @@ -1119,7 +1253,7 @@ public int getIn(int index) { * ``` * * - * repeated int32 in = 3 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated int32 in = 3 [json_name = "in", (.buf.validate.predefined) = { ... } * @param index The index to set the value at. * @param value The in to set. * @return This builder for chaining. @@ -1153,7 +1287,7 @@ public Builder setIn( * ``` * * - * repeated int32 in = 3 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated int32 in = 3 [json_name = "in", (.buf.validate.predefined) = { ... } * @param value The in to add. * @return This builder for chaining. */ @@ -1185,7 +1319,7 @@ public Builder addIn(int value) { * ``` * * - * repeated int32 in = 3 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated int32 in = 3 [json_name = "in", (.buf.validate.predefined) = { ... } * @param values The in to add. * @return This builder for chaining. */ @@ -1218,7 +1352,7 @@ public Builder addAllIn( * ``` * * - * repeated int32 in = 3 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated int32 in = 3 [json_name = "in", (.buf.validate.predefined) = { ... } * @return This builder for chaining. */ public Builder clearIn() { @@ -1255,7 +1389,7 @@ private void ensureNotInIsMutable() { * ``` * * - * repeated int32 not_in = 4 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated int32 not_in = 4 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @return A list containing the notIn. */ public java.util.List @@ -1283,7 +1417,7 @@ private void ensureNotInIsMutable() { * ``` * * - * repeated int32 not_in = 4 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated int32 not_in = 4 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @return The count of notIn. */ public int getNotInCount() { @@ -1309,7 +1443,7 @@ public int getNotInCount() { * ``` * * - * repeated int32 not_in = 4 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated int32 not_in = 4 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @param index The index of the element to return. * @return The notIn at the given index. */ @@ -1336,7 +1470,7 @@ public int getNotIn(int index) { * ``` * * - * repeated int32 not_in = 4 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated int32 not_in = 4 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @param index The index to set the value at. * @param value The notIn to set. * @return This builder for chaining. @@ -1370,7 +1504,7 @@ public Builder setNotIn( * ``` * * - * repeated int32 not_in = 4 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated int32 not_in = 4 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @param value The notIn to add. * @return This builder for chaining. */ @@ -1402,7 +1536,7 @@ public Builder addNotIn(int value) { * ``` * * - * repeated int32 not_in = 4 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated int32 not_in = 4 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @param values The notIn to add. * @return This builder for chaining. */ @@ -1435,7 +1569,7 @@ public Builder addAllNotIn( * ``` * * - * repeated int32 not_in = 4 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated int32 not_in = 4 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @return This builder for chaining. */ public Builder clearNotIn() { @@ -1445,6 +1579,223 @@ public Builder clearNotIn() { return this; } + private com.google.protobuf.Internal.IntList example_ = emptyIntList(); + private void ensureExampleIsMutable() { + if (!example_.isModifiable()) { + example_ = makeMutableCopy(example_); + } + bitField0_ |= 0x00000010; + } + /** + *
+     * `example` specifies values that the field may have. These values SHOULD
+     * conform to other constraints. `example` values will not impact validation
+     * but may be used as helpful guidance on how to populate the given field.
+     *
+     * ```proto
+     * enum MyEnum {
+     * MY_ENUM_UNSPECIFIED = 0;
+     * MY_ENUM_VALUE1 = 1;
+     * MY_ENUM_VALUE2 = 2;
+     * }
+     *
+     * message MyMessage {
+     * (buf.validate.field).enum.example = 1,
+     * (buf.validate.field).enum.example = 2
+     * }
+     * ```
+     * 
+ * + * repeated int32 example = 5 [json_name = "example", (.buf.validate.predefined) = { ... } + * @return A list containing the example. + */ + public java.util.List + getExampleList() { + example_.makeImmutable(); + return example_; + } + /** + *
+     * `example` specifies values that the field may have. These values SHOULD
+     * conform to other constraints. `example` values will not impact validation
+     * but may be used as helpful guidance on how to populate the given field.
+     *
+     * ```proto
+     * enum MyEnum {
+     * MY_ENUM_UNSPECIFIED = 0;
+     * MY_ENUM_VALUE1 = 1;
+     * MY_ENUM_VALUE2 = 2;
+     * }
+     *
+     * message MyMessage {
+     * (buf.validate.field).enum.example = 1,
+     * (buf.validate.field).enum.example = 2
+     * }
+     * ```
+     * 
+ * + * repeated int32 example = 5 [json_name = "example", (.buf.validate.predefined) = { ... } + * @return The count of example. + */ + public int getExampleCount() { + return example_.size(); + } + /** + *
+     * `example` specifies values that the field may have. These values SHOULD
+     * conform to other constraints. `example` values will not impact validation
+     * but may be used as helpful guidance on how to populate the given field.
+     *
+     * ```proto
+     * enum MyEnum {
+     * MY_ENUM_UNSPECIFIED = 0;
+     * MY_ENUM_VALUE1 = 1;
+     * MY_ENUM_VALUE2 = 2;
+     * }
+     *
+     * message MyMessage {
+     * (buf.validate.field).enum.example = 1,
+     * (buf.validate.field).enum.example = 2
+     * }
+     * ```
+     * 
+ * + * repeated int32 example = 5 [json_name = "example", (.buf.validate.predefined) = { ... } + * @param index The index of the element to return. + * @return The example at the given index. + */ + public int getExample(int index) { + return example_.getInt(index); + } + /** + *
+     * `example` specifies values that the field may have. These values SHOULD
+     * conform to other constraints. `example` values will not impact validation
+     * but may be used as helpful guidance on how to populate the given field.
+     *
+     * ```proto
+     * enum MyEnum {
+     * MY_ENUM_UNSPECIFIED = 0;
+     * MY_ENUM_VALUE1 = 1;
+     * MY_ENUM_VALUE2 = 2;
+     * }
+     *
+     * message MyMessage {
+     * (buf.validate.field).enum.example = 1,
+     * (buf.validate.field).enum.example = 2
+     * }
+     * ```
+     * 
+ * + * repeated int32 example = 5 [json_name = "example", (.buf.validate.predefined) = { ... } + * @param index The index to set the value at. + * @param value The example to set. + * @return This builder for chaining. + */ + public Builder setExample( + int index, int value) { + + ensureExampleIsMutable(); + example_.setInt(index, value); + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + *
+     * `example` specifies values that the field may have. These values SHOULD
+     * conform to other constraints. `example` values will not impact validation
+     * but may be used as helpful guidance on how to populate the given field.
+     *
+     * ```proto
+     * enum MyEnum {
+     * MY_ENUM_UNSPECIFIED = 0;
+     * MY_ENUM_VALUE1 = 1;
+     * MY_ENUM_VALUE2 = 2;
+     * }
+     *
+     * message MyMessage {
+     * (buf.validate.field).enum.example = 1,
+     * (buf.validate.field).enum.example = 2
+     * }
+     * ```
+     * 
+ * + * repeated int32 example = 5 [json_name = "example", (.buf.validate.predefined) = { ... } + * @param value The example to add. + * @return This builder for chaining. + */ + public Builder addExample(int value) { + + ensureExampleIsMutable(); + example_.addInt(value); + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + *
+     * `example` specifies values that the field may have. These values SHOULD
+     * conform to other constraints. `example` values will not impact validation
+     * but may be used as helpful guidance on how to populate the given field.
+     *
+     * ```proto
+     * enum MyEnum {
+     * MY_ENUM_UNSPECIFIED = 0;
+     * MY_ENUM_VALUE1 = 1;
+     * MY_ENUM_VALUE2 = 2;
+     * }
+     *
+     * message MyMessage {
+     * (buf.validate.field).enum.example = 1,
+     * (buf.validate.field).enum.example = 2
+     * }
+     * ```
+     * 
+ * + * repeated int32 example = 5 [json_name = "example", (.buf.validate.predefined) = { ... } + * @param values The example to add. + * @return This builder for chaining. + */ + public Builder addAllExample( + java.lang.Iterable values) { + ensureExampleIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, example_); + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + *
+     * `example` specifies values that the field may have. These values SHOULD
+     * conform to other constraints. `example` values will not impact validation
+     * but may be used as helpful guidance on how to populate the given field.
+     *
+     * ```proto
+     * enum MyEnum {
+     * MY_ENUM_UNSPECIFIED = 0;
+     * MY_ENUM_VALUE1 = 1;
+     * MY_ENUM_VALUE2 = 2;
+     * }
+     *
+     * message MyMessage {
+     * (buf.validate.field).enum.example = 1,
+     * (buf.validate.field).enum.example = 2
+     * }
+     * ```
+     * 
+ * + * repeated int32 example = 5 [json_name = "example", (.buf.validate.predefined) = { ... } + * @return This builder for chaining. + */ + public Builder clearExample() { + example_ = emptyIntList(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + // @@protoc_insertion_point(builder_scope:buf.validate.EnumRules) } diff --git a/src/main/java/build/buf/validate/EnumRulesOrBuilder.java b/src/main/java/build/buf/validate/EnumRulesOrBuilder.java index 989702c3..466abc4a 100644 --- a/src/main/java/build/buf/validate/EnumRulesOrBuilder.java +++ b/src/main/java/build/buf/validate/EnumRulesOrBuilder.java @@ -7,7 +7,8 @@ public interface EnumRulesOrBuilder extends // @@protoc_insertion_point(interface_extends:buf.validate.EnumRules) - com.google.protobuf.MessageOrBuilder { + com.google.protobuf.GeneratedMessage. + ExtendableMessageOrBuilder { /** *
@@ -28,7 +29,7 @@ public interface EnumRulesOrBuilder extends
    * ```
    * 
* - * optional int32 const = 1 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional int32 const = 1 [json_name = "const", (.buf.validate.predefined) = { ... } * @return Whether the const field is set. */ boolean hasConst(); @@ -51,7 +52,7 @@ public interface EnumRulesOrBuilder extends * ``` * * - * optional int32 const = 1 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional int32 const = 1 [json_name = "const", (.buf.validate.predefined) = { ... } * @return The const. */ int getConst(); @@ -123,7 +124,7 @@ public interface EnumRulesOrBuilder extends * ``` * * - * repeated int32 in = 3 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated int32 in = 3 [json_name = "in", (.buf.validate.predefined) = { ... } * @return A list containing the in. */ java.util.List getInList(); @@ -147,7 +148,7 @@ public interface EnumRulesOrBuilder extends * ``` * * - * repeated int32 in = 3 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated int32 in = 3 [json_name = "in", (.buf.validate.predefined) = { ... } * @return The count of in. */ int getInCount(); @@ -171,7 +172,7 @@ public interface EnumRulesOrBuilder extends * ``` * * - * repeated int32 in = 3 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated int32 in = 3 [json_name = "in", (.buf.validate.predefined) = { ... } * @param index The index of the element to return. * @return The in at the given index. */ @@ -197,7 +198,7 @@ public interface EnumRulesOrBuilder extends * ``` * * - * repeated int32 not_in = 4 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated int32 not_in = 4 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @return A list containing the notIn. */ java.util.List getNotInList(); @@ -221,7 +222,7 @@ public interface EnumRulesOrBuilder extends * ``` * * - * repeated int32 not_in = 4 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated int32 not_in = 4 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @return The count of notIn. */ int getNotInCount(); @@ -245,9 +246,83 @@ public interface EnumRulesOrBuilder extends * ``` * * - * repeated int32 not_in = 4 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated int32 not_in = 4 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @param index The index of the element to return. * @return The notIn at the given index. */ int getNotIn(int index); + + /** + *
+   * `example` specifies values that the field may have. These values SHOULD
+   * conform to other constraints. `example` values will not impact validation
+   * but may be used as helpful guidance on how to populate the given field.
+   *
+   * ```proto
+   * enum MyEnum {
+   * MY_ENUM_UNSPECIFIED = 0;
+   * MY_ENUM_VALUE1 = 1;
+   * MY_ENUM_VALUE2 = 2;
+   * }
+   *
+   * message MyMessage {
+   * (buf.validate.field).enum.example = 1,
+   * (buf.validate.field).enum.example = 2
+   * }
+   * ```
+   * 
+ * + * repeated int32 example = 5 [json_name = "example", (.buf.validate.predefined) = { ... } + * @return A list containing the example. + */ + java.util.List getExampleList(); + /** + *
+   * `example` specifies values that the field may have. These values SHOULD
+   * conform to other constraints. `example` values will not impact validation
+   * but may be used as helpful guidance on how to populate the given field.
+   *
+   * ```proto
+   * enum MyEnum {
+   * MY_ENUM_UNSPECIFIED = 0;
+   * MY_ENUM_VALUE1 = 1;
+   * MY_ENUM_VALUE2 = 2;
+   * }
+   *
+   * message MyMessage {
+   * (buf.validate.field).enum.example = 1,
+   * (buf.validate.field).enum.example = 2
+   * }
+   * ```
+   * 
+ * + * repeated int32 example = 5 [json_name = "example", (.buf.validate.predefined) = { ... } + * @return The count of example. + */ + int getExampleCount(); + /** + *
+   * `example` specifies values that the field may have. These values SHOULD
+   * conform to other constraints. `example` values will not impact validation
+   * but may be used as helpful guidance on how to populate the given field.
+   *
+   * ```proto
+   * enum MyEnum {
+   * MY_ENUM_UNSPECIFIED = 0;
+   * MY_ENUM_VALUE1 = 1;
+   * MY_ENUM_VALUE2 = 2;
+   * }
+   *
+   * message MyMessage {
+   * (buf.validate.field).enum.example = 1,
+   * (buf.validate.field).enum.example = 2
+   * }
+   * ```
+   * 
+ * + * repeated int32 example = 5 [json_name = "example", (.buf.validate.predefined) = { ... } + * @param index The index of the element to return. + * @return The example at the given index. + */ + int getExample(int index); } diff --git a/src/main/java/build/buf/validate/ExpressionProto.java b/src/main/java/build/buf/validate/ExpressionProto.java deleted file mode 100644 index 73350df3..00000000 --- a/src/main/java/build/buf/validate/ExpressionProto.java +++ /dev/null @@ -1,91 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// NO CHECKED-IN PROTOBUF GENCODE -// source: buf/validate/expression.proto -// Protobuf Java Version: 4.28.1 - -package build.buf.validate; - -public final class ExpressionProto { - private ExpressionProto() {} - static { - com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( - com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, - /* major= */ 4, - /* minor= */ 28, - /* patch= */ 1, - /* suffix= */ "", - ExpressionProto.class.getName()); - } - public static void registerAllExtensions( - com.google.protobuf.ExtensionRegistryLite registry) { - } - - public static void registerAllExtensions( - com.google.protobuf.ExtensionRegistry registry) { - registerAllExtensions( - (com.google.protobuf.ExtensionRegistryLite) registry); - } - static final com.google.protobuf.Descriptors.Descriptor - internal_static_buf_validate_Constraint_descriptor; - static final - com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_buf_validate_Constraint_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_buf_validate_Violations_descriptor; - static final - com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_buf_validate_Violations_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_buf_validate_Violation_descriptor; - static final - com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_buf_validate_Violation_fieldAccessorTable; - - public static com.google.protobuf.Descriptors.FileDescriptor - getDescriptor() { - return descriptor; - } - private static com.google.protobuf.Descriptors.FileDescriptor - descriptor; - static { - java.lang.String[] descriptorData = { - "\n\035buf/validate/expression.proto\022\014buf.val" + - "idate\"V\n\nConstraint\022\016\n\002id\030\001 \001(\tR\002id\022\030\n\007m" + - "essage\030\002 \001(\tR\007message\022\036\n\nexpression\030\003 \001(" + - "\tR\nexpression\"E\n\nViolations\0227\n\nviolation" + - "s\030\001 \003(\0132\027.buf.validate.ViolationR\nviolat" + - "ions\"\202\001\n\tViolation\022\035\n\nfield_path\030\001 \001(\tR\t" + - "fieldPath\022#\n\rconstraint_id\030\002 \001(\tR\014constr" + - "aintId\022\030\n\007message\030\003 \001(\tR\007message\022\027\n\007for_" + - "key\030\004 \001(\010R\006forKeyBp\n\022build.buf.validateB" + - "\017ExpressionProtoP\001ZGbuf.build/gen/go/buf" + - "build/protovalidate/protocolbuffers/go/b" + - "uf/validateb\006proto3" - }; - descriptor = com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - }); - internal_static_buf_validate_Constraint_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_buf_validate_Constraint_fieldAccessorTable = new - com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_buf_validate_Constraint_descriptor, - new java.lang.String[] { "Id", "Message", "Expression", }); - internal_static_buf_validate_Violations_descriptor = - getDescriptor().getMessageTypes().get(1); - internal_static_buf_validate_Violations_fieldAccessorTable = new - com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_buf_validate_Violations_descriptor, - new java.lang.String[] { "Violations", }); - internal_static_buf_validate_Violation_descriptor = - getDescriptor().getMessageTypes().get(2); - internal_static_buf_validate_Violation_fieldAccessorTable = new - com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_buf_validate_Violation_descriptor, - new java.lang.String[] { "FieldPath", "ConstraintId", "Message", "ForKey", }); - descriptor.resolveAllFeaturesImmutable(); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/src/main/java/build/buf/validate/FieldConstraints.java b/src/main/java/build/buf/validate/FieldConstraints.java index ac5919f8..d9d3e3e6 100644 --- a/src/main/java/build/buf/validate/FieldConstraints.java +++ b/src/main/java/build/buf/validate/FieldConstraints.java @@ -49,6 +49,7 @@ private FieldConstraints() { build.buf.validate.FieldConstraints.class, build.buf.validate.FieldConstraints.Builder.class); } + private int bitField0_; private int typeCase_ = 0; @SuppressWarnings("serial") private java.lang.Object type_; @@ -278,7 +279,35 @@ public build.buf.validate.ConstraintOrBuilder getCelOrBuilder( * ``` * * - * bool required = 25 [json_name = "required"]; + * optional bool required = 25 [json_name = "required"]; + * @return Whether the required field is set. + */ + @java.lang.Override + public boolean hasRequired() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + *
+   * If `required` is true, the field must be populated. A populated field can be
+   * described as "serialized in the wire format," which includes:
+   *
+   * - the following "nullable" fields must be explicitly set to be considered populated:
+   * - singular message fields (whose fields may be unpopulated/default values)
+   * - member fields of a oneof (may be their default value)
+   * - proto3 optional fields (may be their default value)
+   * - proto2 scalar fields (both optional and required)
+   * - proto3 scalar fields must be non-zero to be considered populated
+   * - repeated and map fields must be non-empty to be considered populated
+   *
+   * ```proto
+   * message MyMessage {
+   * // The field `value` must be set to a non-null value.
+   * optional MyOtherMessage value = 1 [(buf.validate.field).required = true];
+   * }
+   * ```
+   * 
+ * + * optional bool required = 25 [json_name = "required"]; * @return The required. */ @java.lang.Override @@ -305,11 +334,11 @@ public boolean getRequired() { * ``` * * - * .buf.validate.Ignore ignore = 27 [json_name = "ignore"]; - * @return The enum numeric value on the wire for ignore. + * optional .buf.validate.Ignore ignore = 27 [json_name = "ignore"]; + * @return Whether the ignore field is set. */ - @java.lang.Override public int getIgnoreValue() { - return ignore_; + @java.lang.Override public boolean hasIgnore() { + return ((bitField0_ & 0x00000002) != 0); } /** *
@@ -328,12 +357,12 @@ public boolean getRequired() {
    * ```
    * 
* - * .buf.validate.Ignore ignore = 27 [json_name = "ignore"]; + * optional .buf.validate.Ignore ignore = 27 [json_name = "ignore"]; * @return The ignore. */ @java.lang.Override public build.buf.validate.Ignore getIgnore() { build.buf.validate.Ignore result = build.buf.validate.Ignore.forNumber(ignore_); - return result == null ? build.buf.validate.Ignore.UNRECOGNIZED : result; + return result == null ? build.buf.validate.Ignore.IGNORE_UNSPECIFIED : result; } public static final int FLOAT_FIELD_NUMBER = 1; @@ -1030,9 +1059,23 @@ public build.buf.validate.TimestampRulesOrBuilder getTimestampOrBuilder() { * DEPRECATED: use ignore=IGNORE_ALWAYS instead. TODO: remove this field pre-v1. * * - * bool skipped = 24 [json_name = "skipped", deprecated = true]; + * optional bool skipped = 24 [json_name = "skipped", deprecated = true]; + * @deprecated buf.validate.FieldConstraints.skipped is deprecated. + * See buf/validate/validate.proto;l=245 + * @return Whether the skipped field is set. + */ + @java.lang.Override + @java.lang.Deprecated public boolean hasSkipped() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + *
+   * DEPRECATED: use ignore=IGNORE_ALWAYS instead. TODO: remove this field pre-v1.
+   * 
+ * + * optional bool skipped = 24 [json_name = "skipped", deprecated = true]; * @deprecated buf.validate.FieldConstraints.skipped is deprecated. - * See buf/validate/validate.proto;l=196 + * See buf/validate/validate.proto;l=245 * @return The skipped. */ @java.lang.Override @@ -1047,9 +1090,23 @@ public build.buf.validate.TimestampRulesOrBuilder getTimestampOrBuilder() { * DEPRECATED: use ignore=IGNORE_IF_UNPOPULATED instead. TODO: remove this field pre-v1. * * - * bool ignore_empty = 26 [json_name = "ignoreEmpty", deprecated = true]; + * optional bool ignore_empty = 26 [json_name = "ignoreEmpty", deprecated = true]; * @deprecated buf.validate.FieldConstraints.ignore_empty is deprecated. - * See buf/validate/validate.proto;l=198 + * See buf/validate/validate.proto;l=247 + * @return Whether the ignoreEmpty field is set. + */ + @java.lang.Override + @java.lang.Deprecated public boolean hasIgnoreEmpty() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + *
+   * DEPRECATED: use ignore=IGNORE_IF_UNPOPULATED instead. TODO: remove this field pre-v1.
+   * 
+ * + * optional bool ignore_empty = 26 [json_name = "ignoreEmpty", deprecated = true]; + * @deprecated buf.validate.FieldConstraints.ignore_empty is deprecated. + * See buf/validate/validate.proto;l=247 * @return The ignoreEmpty. */ @java.lang.Override @@ -1064,6 +1121,126 @@ public final boolean isInitialized() { if (isInitialized == 1) return true; if (isInitialized == 0) return false; + if (hasFloat()) { + if (!getFloat().isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + if (hasDouble()) { + if (!getDouble().isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + if (hasInt32()) { + if (!getInt32().isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + if (hasInt64()) { + if (!getInt64().isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + if (hasUint32()) { + if (!getUint32().isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + if (hasUint64()) { + if (!getUint64().isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + if (hasSint32()) { + if (!getSint32().isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + if (hasSint64()) { + if (!getSint64().isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + if (hasFixed32()) { + if (!getFixed32().isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + if (hasFixed64()) { + if (!getFixed64().isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + if (hasSfixed32()) { + if (!getSfixed32().isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + if (hasSfixed64()) { + if (!getSfixed64().isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + if (hasBool()) { + if (!getBool().isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + if (hasString()) { + if (!getString().isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + if (hasBytes()) { + if (!getBytes().isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + if (hasEnum()) { + if (!getEnum().isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + if (hasRepeated()) { + if (!getRepeated().isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + if (hasMap()) { + if (!getMap().isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + if (hasDuration()) { + if (!getDuration().isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + if (hasTimestamp()) { + if (!getTimestamp().isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } memoizedIsInitialized = 1; return true; } @@ -1137,16 +1314,16 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) for (int i = 0; i < cel_.size(); i++) { output.writeMessage(23, cel_.get(i)); } - if (skipped_ != false) { + if (((bitField0_ & 0x00000004) != 0)) { output.writeBool(24, skipped_); } - if (required_ != false) { + if (((bitField0_ & 0x00000001) != 0)) { output.writeBool(25, required_); } - if (ignoreEmpty_ != false) { + if (((bitField0_ & 0x00000008) != 0)) { output.writeBool(26, ignoreEmpty_); } - if (ignore_ != build.buf.validate.Ignore.IGNORE_UNSPECIFIED.getNumber()) { + if (((bitField0_ & 0x00000002) != 0)) { output.writeEnum(27, ignore_); } getUnknownFields().writeTo(output); @@ -1246,19 +1423,19 @@ public int getSerializedSize() { size += com.google.protobuf.CodedOutputStream .computeMessageSize(23, cel_.get(i)); } - if (skipped_ != false) { + if (((bitField0_ & 0x00000004) != 0)) { size += com.google.protobuf.CodedOutputStream .computeBoolSize(24, skipped_); } - if (required_ != false) { + if (((bitField0_ & 0x00000001) != 0)) { size += com.google.protobuf.CodedOutputStream .computeBoolSize(25, required_); } - if (ignoreEmpty_ != false) { + if (((bitField0_ & 0x00000008) != 0)) { size += com.google.protobuf.CodedOutputStream .computeBoolSize(26, ignoreEmpty_); } - if (ignore_ != build.buf.validate.Ignore.IGNORE_UNSPECIFIED.getNumber()) { + if (((bitField0_ & 0x00000002) != 0)) { size += com.google.protobuf.CodedOutputStream .computeEnumSize(27, ignore_); } @@ -1279,13 +1456,25 @@ public boolean equals(final java.lang.Object obj) { if (!getCelList() .equals(other.getCelList())) return false; - if (getRequired() - != other.getRequired()) return false; - if (ignore_ != other.ignore_) return false; - if (getSkipped() - != other.getSkipped()) return false; - if (getIgnoreEmpty() - != other.getIgnoreEmpty()) return false; + if (hasRequired() != other.hasRequired()) return false; + if (hasRequired()) { + if (getRequired() + != other.getRequired()) return false; + } + if (hasIgnore() != other.hasIgnore()) return false; + if (hasIgnore()) { + if (ignore_ != other.ignore_) return false; + } + if (hasSkipped() != other.hasSkipped()) return false; + if (hasSkipped()) { + if (getSkipped() + != other.getSkipped()) return false; + } + if (hasIgnoreEmpty() != other.hasIgnoreEmpty()) return false; + if (hasIgnoreEmpty()) { + if (getIgnoreEmpty() + != other.getIgnoreEmpty()) return false; + } if (!getTypeCase().equals(other.getTypeCase())) return false; switch (typeCase_) { case 1: @@ -1390,17 +1579,25 @@ public int hashCode() { hash = (37 * hash) + CEL_FIELD_NUMBER; hash = (53 * hash) + getCelList().hashCode(); } - hash = (37 * hash) + REQUIRED_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getRequired()); - hash = (37 * hash) + IGNORE_FIELD_NUMBER; - hash = (53 * hash) + ignore_; - hash = (37 * hash) + SKIPPED_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getSkipped()); - hash = (37 * hash) + IGNORE_EMPTY_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getIgnoreEmpty()); + if (hasRequired()) { + hash = (37 * hash) + REQUIRED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getRequired()); + } + if (hasIgnore()) { + hash = (37 * hash) + IGNORE_FIELD_NUMBER; + hash = (53 * hash) + ignore_; + } + if (hasSkipped()) { + hash = (37 * hash) + SKIPPED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getSkipped()); + } + if (hasIgnoreEmpty()) { + hash = (37 * hash) + IGNORE_EMPTY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getIgnoreEmpty()); + } switch (typeCase_) { case 1: hash = (37 * hash) + FLOAT_FIELD_NUMBER; @@ -1748,18 +1945,24 @@ private void buildPartialRepeatedFields(build.buf.validate.FieldConstraints resu private void buildPartial0(build.buf.validate.FieldConstraints result) { int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; if (((from_bitField0_ & 0x00000002) != 0)) { result.required_ = required_; + to_bitField0_ |= 0x00000001; } if (((from_bitField0_ & 0x00000004) != 0)) { result.ignore_ = ignore_; + to_bitField0_ |= 0x00000002; } if (((from_bitField0_ & 0x01000000) != 0)) { result.skipped_ = skipped_; + to_bitField0_ |= 0x00000004; } if (((from_bitField0_ & 0x02000000) != 0)) { result.ignoreEmpty_ = ignoreEmpty_; + to_bitField0_ |= 0x00000008; } + result.bitField0_ |= to_bitField0_; } private void buildPartialOneofs(build.buf.validate.FieldConstraints result) { @@ -1889,16 +2092,16 @@ public Builder mergeFrom(build.buf.validate.FieldConstraints other) { } } } - if (other.getRequired() != false) { + if (other.hasRequired()) { setRequired(other.getRequired()); } - if (other.ignore_ != 0) { - setIgnoreValue(other.getIgnoreValue()); + if (other.hasIgnore()) { + setIgnore(other.getIgnore()); } - if (other.getSkipped() != false) { + if (other.hasSkipped()) { setSkipped(other.getSkipped()); } - if (other.getIgnoreEmpty() != false) { + if (other.hasIgnoreEmpty()) { setIgnoreEmpty(other.getIgnoreEmpty()); } switch (other.getTypeCase()) { @@ -1997,6 +2200,106 @@ public Builder mergeFrom(build.buf.validate.FieldConstraints other) { @java.lang.Override public final boolean isInitialized() { + if (hasFloat()) { + if (!getFloat().isInitialized()) { + return false; + } + } + if (hasDouble()) { + if (!getDouble().isInitialized()) { + return false; + } + } + if (hasInt32()) { + if (!getInt32().isInitialized()) { + return false; + } + } + if (hasInt64()) { + if (!getInt64().isInitialized()) { + return false; + } + } + if (hasUint32()) { + if (!getUint32().isInitialized()) { + return false; + } + } + if (hasUint64()) { + if (!getUint64().isInitialized()) { + return false; + } + } + if (hasSint32()) { + if (!getSint32().isInitialized()) { + return false; + } + } + if (hasSint64()) { + if (!getSint64().isInitialized()) { + return false; + } + } + if (hasFixed32()) { + if (!getFixed32().isInitialized()) { + return false; + } + } + if (hasFixed64()) { + if (!getFixed64().isInitialized()) { + return false; + } + } + if (hasSfixed32()) { + if (!getSfixed32().isInitialized()) { + return false; + } + } + if (hasSfixed64()) { + if (!getSfixed64().isInitialized()) { + return false; + } + } + if (hasBool()) { + if (!getBool().isInitialized()) { + return false; + } + } + if (hasString()) { + if (!getString().isInitialized()) { + return false; + } + } + if (hasBytes()) { + if (!getBytes().isInitialized()) { + return false; + } + } + if (hasEnum()) { + if (!getEnum().isInitialized()) { + return false; + } + } + if (hasRepeated()) { + if (!getRepeated().isInitialized()) { + return false; + } + } + if (hasMap()) { + if (!getMap().isInitialized()) { + return false; + } + } + if (hasDuration()) { + if (!getDuration().isInitialized()) { + return false; + } + } + if (hasTimestamp()) { + if (!getTimestamp().isInitialized()) { + return false; + } + } return true; } @@ -2192,8 +2495,15 @@ public Builder mergeFrom( break; } // case 208 case 216: { - ignore_ = input.readEnum(); - bitField0_ |= 0x00000004; + int tmpRaw = input.readEnum(); + build.buf.validate.Ignore tmpValue = + build.buf.validate.Ignore.forNumber(tmpRaw); + if (tmpValue == null) { + mergeUnknownVarintField(27, tmpRaw); + } else { + ignore_ = tmpRaw; + bitField0_ |= 0x00000004; + } break; } // case 216 default: { @@ -2796,7 +3106,35 @@ public build.buf.validate.Constraint.Builder addCelBuilder( * ``` * * - * bool required = 25 [json_name = "required"]; + * optional bool required = 25 [json_name = "required"]; + * @return Whether the required field is set. + */ + @java.lang.Override + public boolean hasRequired() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + *
+     * If `required` is true, the field must be populated. A populated field can be
+     * described as "serialized in the wire format," which includes:
+     *
+     * - the following "nullable" fields must be explicitly set to be considered populated:
+     * - singular message fields (whose fields may be unpopulated/default values)
+     * - member fields of a oneof (may be their default value)
+     * - proto3 optional fields (may be their default value)
+     * - proto2 scalar fields (both optional and required)
+     * - proto3 scalar fields must be non-zero to be considered populated
+     * - repeated and map fields must be non-empty to be considered populated
+     *
+     * ```proto
+     * message MyMessage {
+     * // The field `value` must be set to a non-null value.
+     * optional MyOtherMessage value = 1 [(buf.validate.field).required = true];
+     * }
+     * ```
+     * 
+ * + * optional bool required = 25 [json_name = "required"]; * @return The required. */ @java.lang.Override @@ -2824,7 +3162,7 @@ public boolean getRequired() { * ``` * * - * bool required = 25 [json_name = "required"]; + * optional bool required = 25 [json_name = "required"]; * @param value The required to set. * @return This builder for chaining. */ @@ -2856,7 +3194,7 @@ public Builder setRequired(boolean value) { * ``` * * - * bool required = 25 [json_name = "required"]; + * optional bool required = 25 [json_name = "required"]; * @return This builder for chaining. */ public Builder clearRequired() { @@ -2884,11 +3222,11 @@ public Builder clearRequired() { * ``` * * - * .buf.validate.Ignore ignore = 27 [json_name = "ignore"]; - * @return The enum numeric value on the wire for ignore. + * optional .buf.validate.Ignore ignore = 27 [json_name = "ignore"]; + * @return Whether the ignore field is set. */ - @java.lang.Override public int getIgnoreValue() { - return ignore_; + @java.lang.Override public boolean hasIgnore() { + return ((bitField0_ & 0x00000004) != 0); } /** *
@@ -2907,40 +3245,13 @@ public Builder clearRequired() {
      * ```
      * 
* - * .buf.validate.Ignore ignore = 27 [json_name = "ignore"]; - * @param value The enum numeric value on the wire for ignore to set. - * @return This builder for chaining. - */ - public Builder setIgnoreValue(int value) { - ignore_ = value; - bitField0_ |= 0x00000004; - onChanged(); - return this; - } - /** - *
-     * Skip validation on the field if its value matches the specified criteria.
-     * See Ignore enum for details.
-     *
-     * ```proto
-     * message UpdateRequest {
-     * // The uri rule only applies if the field is populated and not an empty
-     * // string.
-     * optional string url = 1 [
-     * (buf.validate.field).ignore = IGNORE_IF_DEFAULT_VALUE,
-     * (buf.validate.field).string.uri = true,
-     * ];
-     * }
-     * ```
-     * 
- * - * .buf.validate.Ignore ignore = 27 [json_name = "ignore"]; + * optional .buf.validate.Ignore ignore = 27 [json_name = "ignore"]; * @return The ignore. */ @java.lang.Override public build.buf.validate.Ignore getIgnore() { build.buf.validate.Ignore result = build.buf.validate.Ignore.forNumber(ignore_); - return result == null ? build.buf.validate.Ignore.UNRECOGNIZED : result; + return result == null ? build.buf.validate.Ignore.IGNORE_UNSPECIFIED : result; } /** *
@@ -2959,7 +3270,7 @@ public build.buf.validate.Ignore getIgnore() {
      * ```
      * 
* - * .buf.validate.Ignore ignore = 27 [json_name = "ignore"]; + * optional .buf.validate.Ignore ignore = 27 [json_name = "ignore"]; * @param value The ignore to set. * @return This builder for chaining. */ @@ -2989,7 +3300,7 @@ public Builder setIgnore(build.buf.validate.Ignore value) { * ``` * * - * .buf.validate.Ignore ignore = 27 [json_name = "ignore"]; + * optional .buf.validate.Ignore ignore = 27 [json_name = "ignore"]; * @return This builder for chaining. */ public Builder clearIgnore() { @@ -6095,9 +6406,23 @@ public build.buf.validate.TimestampRulesOrBuilder getTimestampOrBuilder() { * DEPRECATED: use ignore=IGNORE_ALWAYS instead. TODO: remove this field pre-v1. * * - * bool skipped = 24 [json_name = "skipped", deprecated = true]; + * optional bool skipped = 24 [json_name = "skipped", deprecated = true]; + * @deprecated buf.validate.FieldConstraints.skipped is deprecated. + * See buf/validate/validate.proto;l=245 + * @return Whether the skipped field is set. + */ + @java.lang.Override + @java.lang.Deprecated public boolean hasSkipped() { + return ((bitField0_ & 0x01000000) != 0); + } + /** + *
+     * DEPRECATED: use ignore=IGNORE_ALWAYS instead. TODO: remove this field pre-v1.
+     * 
+ * + * optional bool skipped = 24 [json_name = "skipped", deprecated = true]; * @deprecated buf.validate.FieldConstraints.skipped is deprecated. - * See buf/validate/validate.proto;l=196 + * See buf/validate/validate.proto;l=245 * @return The skipped. */ @java.lang.Override @@ -6109,9 +6434,9 @@ public build.buf.validate.TimestampRulesOrBuilder getTimestampOrBuilder() { * DEPRECATED: use ignore=IGNORE_ALWAYS instead. TODO: remove this field pre-v1. * * - * bool skipped = 24 [json_name = "skipped", deprecated = true]; + * optional bool skipped = 24 [json_name = "skipped", deprecated = true]; * @deprecated buf.validate.FieldConstraints.skipped is deprecated. - * See buf/validate/validate.proto;l=196 + * See buf/validate/validate.proto;l=245 * @param value The skipped to set. * @return This builder for chaining. */ @@ -6127,9 +6452,9 @@ public build.buf.validate.TimestampRulesOrBuilder getTimestampOrBuilder() { * DEPRECATED: use ignore=IGNORE_ALWAYS instead. TODO: remove this field pre-v1. * * - * bool skipped = 24 [json_name = "skipped", deprecated = true]; + * optional bool skipped = 24 [json_name = "skipped", deprecated = true]; * @deprecated buf.validate.FieldConstraints.skipped is deprecated. - * See buf/validate/validate.proto;l=196 + * See buf/validate/validate.proto;l=245 * @return This builder for chaining. */ @java.lang.Deprecated public Builder clearSkipped() { @@ -6145,9 +6470,23 @@ public build.buf.validate.TimestampRulesOrBuilder getTimestampOrBuilder() { * DEPRECATED: use ignore=IGNORE_IF_UNPOPULATED instead. TODO: remove this field pre-v1. * * - * bool ignore_empty = 26 [json_name = "ignoreEmpty", deprecated = true]; + * optional bool ignore_empty = 26 [json_name = "ignoreEmpty", deprecated = true]; + * @deprecated buf.validate.FieldConstraints.ignore_empty is deprecated. + * See buf/validate/validate.proto;l=247 + * @return Whether the ignoreEmpty field is set. + */ + @java.lang.Override + @java.lang.Deprecated public boolean hasIgnoreEmpty() { + return ((bitField0_ & 0x02000000) != 0); + } + /** + *
+     * DEPRECATED: use ignore=IGNORE_IF_UNPOPULATED instead. TODO: remove this field pre-v1.
+     * 
+ * + * optional bool ignore_empty = 26 [json_name = "ignoreEmpty", deprecated = true]; * @deprecated buf.validate.FieldConstraints.ignore_empty is deprecated. - * See buf/validate/validate.proto;l=198 + * See buf/validate/validate.proto;l=247 * @return The ignoreEmpty. */ @java.lang.Override @@ -6159,9 +6498,9 @@ public build.buf.validate.TimestampRulesOrBuilder getTimestampOrBuilder() { * DEPRECATED: use ignore=IGNORE_IF_UNPOPULATED instead. TODO: remove this field pre-v1. * * - * bool ignore_empty = 26 [json_name = "ignoreEmpty", deprecated = true]; + * optional bool ignore_empty = 26 [json_name = "ignoreEmpty", deprecated = true]; * @deprecated buf.validate.FieldConstraints.ignore_empty is deprecated. - * See buf/validate/validate.proto;l=198 + * See buf/validate/validate.proto;l=247 * @param value The ignoreEmpty to set. * @return This builder for chaining. */ @@ -6177,9 +6516,9 @@ public build.buf.validate.TimestampRulesOrBuilder getTimestampOrBuilder() { * DEPRECATED: use ignore=IGNORE_IF_UNPOPULATED instead. TODO: remove this field pre-v1. * * - * bool ignore_empty = 26 [json_name = "ignoreEmpty", deprecated = true]; + * optional bool ignore_empty = 26 [json_name = "ignoreEmpty", deprecated = true]; * @deprecated buf.validate.FieldConstraints.ignore_empty is deprecated. - * See buf/validate/validate.proto;l=198 + * See buf/validate/validate.proto;l=247 * @return This builder for chaining. */ @java.lang.Deprecated public Builder clearIgnoreEmpty() { diff --git a/src/main/java/build/buf/validate/FieldConstraintsOrBuilder.java b/src/main/java/build/buf/validate/FieldConstraintsOrBuilder.java index 56b4c287..8b7bc882 100644 --- a/src/main/java/build/buf/validate/FieldConstraintsOrBuilder.java +++ b/src/main/java/build/buf/validate/FieldConstraintsOrBuilder.java @@ -139,7 +139,32 @@ build.buf.validate.ConstraintOrBuilder getCelOrBuilder( * ``` * * - * bool required = 25 [json_name = "required"]; + * optional bool required = 25 [json_name = "required"]; + * @return Whether the required field is set. + */ + boolean hasRequired(); + /** + *
+   * If `required` is true, the field must be populated. A populated field can be
+   * described as "serialized in the wire format," which includes:
+   *
+   * - the following "nullable" fields must be explicitly set to be considered populated:
+   * - singular message fields (whose fields may be unpopulated/default values)
+   * - member fields of a oneof (may be their default value)
+   * - proto3 optional fields (may be their default value)
+   * - proto2 scalar fields (both optional and required)
+   * - proto3 scalar fields must be non-zero to be considered populated
+   * - repeated and map fields must be non-empty to be considered populated
+   *
+   * ```proto
+   * message MyMessage {
+   * // The field `value` must be set to a non-null value.
+   * optional MyOtherMessage value = 1 [(buf.validate.field).required = true];
+   * }
+   * ```
+   * 
+ * + * optional bool required = 25 [json_name = "required"]; * @return The required. */ boolean getRequired(); @@ -161,10 +186,10 @@ build.buf.validate.ConstraintOrBuilder getCelOrBuilder( * ``` * * - * .buf.validate.Ignore ignore = 27 [json_name = "ignore"]; - * @return The enum numeric value on the wire for ignore. + * optional .buf.validate.Ignore ignore = 27 [json_name = "ignore"]; + * @return Whether the ignore field is set. */ - int getIgnoreValue(); + boolean hasIgnore(); /** *
    * Skip validation on the field if its value matches the specified criteria.
@@ -182,7 +207,7 @@ build.buf.validate.ConstraintOrBuilder getCelOrBuilder(
    * ```
    * 
* - * .buf.validate.Ignore ignore = 27 [json_name = "ignore"]; + * optional .buf.validate.Ignore ignore = 27 [json_name = "ignore"]; * @return The ignore. */ build.buf.validate.Ignore getIgnore(); @@ -543,9 +568,20 @@ build.buf.validate.ConstraintOrBuilder getCelOrBuilder( * DEPRECATED: use ignore=IGNORE_ALWAYS instead. TODO: remove this field pre-v1. * * - * bool skipped = 24 [json_name = "skipped", deprecated = true]; + * optional bool skipped = 24 [json_name = "skipped", deprecated = true]; + * @deprecated buf.validate.FieldConstraints.skipped is deprecated. + * See buf/validate/validate.proto;l=245 + * @return Whether the skipped field is set. + */ + @java.lang.Deprecated boolean hasSkipped(); + /** + *
+   * DEPRECATED: use ignore=IGNORE_ALWAYS instead. TODO: remove this field pre-v1.
+   * 
+ * + * optional bool skipped = 24 [json_name = "skipped", deprecated = true]; * @deprecated buf.validate.FieldConstraints.skipped is deprecated. - * See buf/validate/validate.proto;l=196 + * See buf/validate/validate.proto;l=245 * @return The skipped. */ @java.lang.Deprecated boolean getSkipped(); @@ -555,9 +591,20 @@ build.buf.validate.ConstraintOrBuilder getCelOrBuilder( * DEPRECATED: use ignore=IGNORE_IF_UNPOPULATED instead. TODO: remove this field pre-v1. * * - * bool ignore_empty = 26 [json_name = "ignoreEmpty", deprecated = true]; + * optional bool ignore_empty = 26 [json_name = "ignoreEmpty", deprecated = true]; + * @deprecated buf.validate.FieldConstraints.ignore_empty is deprecated. + * See buf/validate/validate.proto;l=247 + * @return Whether the ignoreEmpty field is set. + */ + @java.lang.Deprecated boolean hasIgnoreEmpty(); + /** + *
+   * DEPRECATED: use ignore=IGNORE_IF_UNPOPULATED instead. TODO: remove this field pre-v1.
+   * 
+ * + * optional bool ignore_empty = 26 [json_name = "ignoreEmpty", deprecated = true]; * @deprecated buf.validate.FieldConstraints.ignore_empty is deprecated. - * See buf/validate/validate.proto;l=198 + * See buf/validate/validate.proto;l=247 * @return The ignoreEmpty. */ @java.lang.Deprecated boolean getIgnoreEmpty(); diff --git a/src/main/java/build/buf/validate/Fixed32Rules.java b/src/main/java/build/buf/validate/Fixed32Rules.java index 606114d1..69ff8dd9 100644 --- a/src/main/java/build/buf/validate/Fixed32Rules.java +++ b/src/main/java/build/buf/validate/Fixed32Rules.java @@ -13,7 +13,8 @@ * Protobuf type {@code buf.validate.Fixed32Rules} */ public final class Fixed32Rules extends - com.google.protobuf.GeneratedMessage implements + com.google.protobuf.GeneratedMessage.ExtendableMessage< + Fixed32Rules> implements // @@protoc_insertion_point(message_implements:buf.validate.Fixed32Rules) Fixed32RulesOrBuilder { private static final long serialVersionUID = 0L; @@ -27,12 +28,13 @@ public final class Fixed32Rules extends Fixed32Rules.class.getName()); } // Use Fixed32Rules.newBuilder() to construct. - private Fixed32Rules(com.google.protobuf.GeneratedMessage.Builder builder) { + private Fixed32Rules(com.google.protobuf.GeneratedMessage.ExtendableBuilder builder) { super(builder); } private Fixed32Rules() { in_ = emptyIntList(); notIn_ = emptyIntList(); + example_ = emptyIntList(); } public static final com.google.protobuf.Descriptors.Descriptor @@ -148,7 +150,7 @@ public int getNumber() { * ``` * * - * optional fixed32 const = 1 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional fixed32 const = 1 [json_name = "const", (.buf.validate.predefined) = { ... } * @return Whether the const field is set. */ @java.lang.Override @@ -168,7 +170,7 @@ public boolean hasConst() { * ``` * * - * optional fixed32 const = 1 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional fixed32 const = 1 [json_name = "const", (.buf.validate.predefined) = { ... } * @return The const. */ @java.lang.Override @@ -191,7 +193,7 @@ public int getConst() { * ``` * * - * fixed32 lt = 2 [json_name = "lt", (.buf.validate.priv.field) = { ... } + * fixed32 lt = 2 [json_name = "lt", (.buf.validate.predefined) = { ... } * @return Whether the lt field is set. */ @java.lang.Override @@ -212,7 +214,7 @@ public boolean hasLt() { * ``` * * - * fixed32 lt = 2 [json_name = "lt", (.buf.validate.priv.field) = { ... } + * fixed32 lt = 2 [json_name = "lt", (.buf.validate.predefined) = { ... } * @return The lt. */ @java.lang.Override @@ -238,7 +240,7 @@ public int getLt() { * ``` * * - * fixed32 lte = 3 [json_name = "lte", (.buf.validate.priv.field) = { ... } + * fixed32 lte = 3 [json_name = "lte", (.buf.validate.predefined) = { ... } * @return Whether the lte field is set. */ @java.lang.Override @@ -259,7 +261,7 @@ public boolean hasLte() { * ``` * * - * fixed32 lte = 3 [json_name = "lte", (.buf.validate.priv.field) = { ... } + * fixed32 lte = 3 [json_name = "lte", (.buf.validate.predefined) = { ... } * @return The lte. */ @java.lang.Override @@ -293,7 +295,7 @@ public int getLte() { * ``` * * - * fixed32 gt = 4 [json_name = "gt", (.buf.validate.priv.field) = { ... } + * fixed32 gt = 4 [json_name = "gt", (.buf.validate.predefined) = { ... } * @return Whether the gt field is set. */ @java.lang.Override @@ -322,7 +324,7 @@ public boolean hasGt() { * ``` * * - * fixed32 gt = 4 [json_name = "gt", (.buf.validate.priv.field) = { ... } + * fixed32 gt = 4 [json_name = "gt", (.buf.validate.predefined) = { ... } * @return The gt. */ @java.lang.Override @@ -356,7 +358,7 @@ public int getGt() { * ``` * * - * fixed32 gte = 5 [json_name = "gte", (.buf.validate.priv.field) = { ... } + * fixed32 gte = 5 [json_name = "gte", (.buf.validate.predefined) = { ... } * @return Whether the gte field is set. */ @java.lang.Override @@ -385,7 +387,7 @@ public boolean hasGte() { * ``` * * - * fixed32 gte = 5 [json_name = "gte", (.buf.validate.priv.field) = { ... } + * fixed32 gte = 5 [json_name = "gte", (.buf.validate.predefined) = { ... } * @return The gte. */ @java.lang.Override @@ -414,7 +416,7 @@ public int getGte() { * ``` * * - * repeated fixed32 in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated fixed32 in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @return A list containing the in. */ @java.lang.Override @@ -436,7 +438,7 @@ public int getGte() { * ``` * * - * repeated fixed32 in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated fixed32 in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @return The count of in. */ public int getInCount() { @@ -456,14 +458,13 @@ public int getInCount() { * ``` * * - * repeated fixed32 in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated fixed32 in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @param index The index of the element to return. * @return The in at the given index. */ public int getIn(int index) { return in_.getInt(index); } - private int inMemoizedSerializedSize = -1; public static final int NOT_IN_FIELD_NUMBER = 7; @SuppressWarnings("serial") @@ -483,7 +484,7 @@ public int getIn(int index) { * ``` * * - * repeated fixed32 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated fixed32 not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @return A list containing the notIn. */ @java.lang.Override @@ -505,7 +506,7 @@ public int getIn(int index) { * ``` * * - * repeated fixed32 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated fixed32 not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @return The count of notIn. */ public int getNotInCount() { @@ -525,14 +526,87 @@ public int getNotInCount() { * ``` * * - * repeated fixed32 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated fixed32 not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @param index The index of the element to return. * @return The notIn at the given index. */ public int getNotIn(int index) { return notIn_.getInt(index); } - private int notInMemoizedSerializedSize = -1; + + public static final int EXAMPLE_FIELD_NUMBER = 8; + @SuppressWarnings("serial") + private com.google.protobuf.Internal.IntList example_ = + emptyIntList(); + /** + *
+   * `example` specifies values that the field may have. These values SHOULD
+   * conform to other constraints. `example` values will not impact validation
+   * but may be used as helpful guidance on how to populate the given field.
+   *
+   * ```proto
+   * message MyFixed32 {
+   * fixed32 value = 1 [
+   * (buf.validate.field).fixed32.example = 1,
+   * (buf.validate.field).fixed32.example = 2
+   * ];
+   * }
+   * ```
+   * 
+ * + * repeated fixed32 example = 8 [json_name = "example", (.buf.validate.predefined) = { ... } + * @return A list containing the example. + */ + @java.lang.Override + public java.util.List + getExampleList() { + return example_; + } + /** + *
+   * `example` specifies values that the field may have. These values SHOULD
+   * conform to other constraints. `example` values will not impact validation
+   * but may be used as helpful guidance on how to populate the given field.
+   *
+   * ```proto
+   * message MyFixed32 {
+   * fixed32 value = 1 [
+   * (buf.validate.field).fixed32.example = 1,
+   * (buf.validate.field).fixed32.example = 2
+   * ];
+   * }
+   * ```
+   * 
+ * + * repeated fixed32 example = 8 [json_name = "example", (.buf.validate.predefined) = { ... } + * @return The count of example. + */ + public int getExampleCount() { + return example_.size(); + } + /** + *
+   * `example` specifies values that the field may have. These values SHOULD
+   * conform to other constraints. `example` values will not impact validation
+   * but may be used as helpful guidance on how to populate the given field.
+   *
+   * ```proto
+   * message MyFixed32 {
+   * fixed32 value = 1 [
+   * (buf.validate.field).fixed32.example = 1,
+   * (buf.validate.field).fixed32.example = 2
+   * ];
+   * }
+   * ```
+   * 
+ * + * repeated fixed32 example = 8 [json_name = "example", (.buf.validate.predefined) = { ... } + * @param index The index of the element to return. + * @return The example at the given index. + */ + public int getExample(int index) { + return example_.getInt(index); + } private byte memoizedIsInitialized = -1; @java.lang.Override @@ -541,6 +615,10 @@ public final boolean isInitialized() { if (isInitialized == 1) return true; if (isInitialized == 0) return false; + if (!extensionsAreInitialized()) { + memoizedIsInitialized = 0; + return false; + } memoizedIsInitialized = 1; return true; } @@ -548,7 +626,9 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - getSerializedSize(); + com.google.protobuf.GeneratedMessage + .ExtendableMessage.ExtensionSerializer + extensionWriter = newExtensionSerializer(); if (((bitField0_ & 0x00000001) != 0)) { output.writeFixed32(1, const_); } @@ -568,20 +648,16 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) output.writeFixed32( 5, (int)((java.lang.Integer) greaterThan_)); } - if (getInList().size() > 0) { - output.writeUInt32NoTag(50); - output.writeUInt32NoTag(inMemoizedSerializedSize); - } for (int i = 0; i < in_.size(); i++) { - output.writeFixed32NoTag(in_.getInt(i)); - } - if (getNotInList().size() > 0) { - output.writeUInt32NoTag(58); - output.writeUInt32NoTag(notInMemoizedSerializedSize); + output.writeFixed32(6, in_.getInt(i)); } for (int i = 0; i < notIn_.size(); i++) { - output.writeFixed32NoTag(notIn_.getInt(i)); + output.writeFixed32(7, notIn_.getInt(i)); } + for (int i = 0; i < example_.size(); i++) { + output.writeFixed32(8, example_.getInt(i)); + } + extensionWriter.writeUntil(536870912, output); getUnknownFields().writeTo(output); } @@ -619,24 +695,21 @@ public int getSerializedSize() { int dataSize = 0; dataSize = 4 * getInList().size(); size += dataSize; - if (!getInList().isEmpty()) { - size += 1; - size += com.google.protobuf.CodedOutputStream - .computeInt32SizeNoTag(dataSize); - } - inMemoizedSerializedSize = dataSize; + size += 1 * getInList().size(); } { int dataSize = 0; dataSize = 4 * getNotInList().size(); size += dataSize; - if (!getNotInList().isEmpty()) { - size += 1; - size += com.google.protobuf.CodedOutputStream - .computeInt32SizeNoTag(dataSize); - } - notInMemoizedSerializedSize = dataSize; + size += 1 * getNotInList().size(); } + { + int dataSize = 0; + dataSize = 4 * getExampleList().size(); + size += dataSize; + size += 1 * getExampleList().size(); + } + size += extensionsSerializedSize(); size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -661,6 +734,8 @@ public boolean equals(final java.lang.Object obj) { .equals(other.getInList())) return false; if (!getNotInList() .equals(other.getNotInList())) return false; + if (!getExampleList() + .equals(other.getExampleList())) return false; if (!getLessThanCase().equals(other.getLessThanCase())) return false; switch (lessThanCase_) { case 2: @@ -688,6 +763,8 @@ public boolean equals(final java.lang.Object obj) { default: } if (!getUnknownFields().equals(other.getUnknownFields())) return false; + if (!getExtensionFields().equals(other.getExtensionFields())) + return false; return true; } @@ -710,6 +787,10 @@ public int hashCode() { hash = (37 * hash) + NOT_IN_FIELD_NUMBER; hash = (53 * hash) + getNotInList().hashCode(); } + if (getExampleCount() > 0) { + hash = (37 * hash) + EXAMPLE_FIELD_NUMBER; + hash = (53 * hash) + getExampleList().hashCode(); + } switch (lessThanCase_) { case 2: hash = (37 * hash) + LT_FIELD_NUMBER; @@ -734,6 +815,7 @@ public int hashCode() { case 0: default: } + hash = hashFields(hash, getExtensionFields()); hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -839,7 +921,8 @@ protected Builder newBuilderForType( * Protobuf type {@code buf.validate.Fixed32Rules} */ public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder implements + com.google.protobuf.GeneratedMessage.ExtendableBuilder< + build.buf.validate.Fixed32Rules, Builder> implements // @@protoc_insertion_point(builder_implements:buf.validate.Fixed32Rules) build.buf.validate.Fixed32RulesOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor @@ -872,6 +955,7 @@ public Builder clear() { const_ = 0; in_ = emptyIntList(); notIn_ = emptyIntList(); + example_ = emptyIntList(); lessThanCase_ = 0; lessThan_ = null; greaterThanCase_ = 0; @@ -923,6 +1007,10 @@ private void buildPartial0(build.buf.validate.Fixed32Rules result) { notIn_.makeImmutable(); result.notIn_ = notIn_; } + if (((from_bitField0_ & 0x00000080) != 0)) { + example_.makeImmutable(); + result.example_ = example_; + } result.bitField0_ |= to_bitField0_; } @@ -970,6 +1058,17 @@ public Builder mergeFrom(build.buf.validate.Fixed32Rules other) { } onChanged(); } + if (!other.example_.isEmpty()) { + if (example_.isEmpty()) { + example_ = other.example_; + example_.makeImmutable(); + bitField0_ |= 0x00000080; + } else { + ensureExampleIsMutable(); + example_.addAll(other.example_); + } + onChanged(); + } switch (other.getLessThanCase()) { case LT: { setLt(other.getLt()); @@ -996,6 +1095,7 @@ public Builder mergeFrom(build.buf.validate.Fixed32Rules other) { break; } } + this.mergeExtensionFields(other); this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -1003,6 +1103,9 @@ public Builder mergeFrom(build.buf.validate.Fixed32Rules other) { @java.lang.Override public final boolean isInitialized() { + if (!extensionsAreInitialized()) { + return false; + } return true; } @@ -1081,6 +1184,23 @@ public Builder mergeFrom( input.popLimit(limit); break; } // case 58 + case 69: { + int v = input.readFixed32(); + ensureExampleIsMutable(); + example_.addInt(v); + break; + } // case 69 + case 66: { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + int alloc = length > 4096 ? 4096 : length; + ensureExampleIsMutable(alloc / 4); + while (input.getBytesUntilLimit() > 0) { + example_.addInt(input.readFixed32()); + } + input.popLimit(limit); + break; + } // case 66 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { done = true; // was an endgroup tag @@ -1142,7 +1262,7 @@ public Builder clearGreaterThan() { * ``` * * - * optional fixed32 const = 1 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional fixed32 const = 1 [json_name = "const", (.buf.validate.predefined) = { ... } * @return Whether the const field is set. */ @java.lang.Override @@ -1162,7 +1282,7 @@ public boolean hasConst() { * ``` * * - * optional fixed32 const = 1 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional fixed32 const = 1 [json_name = "const", (.buf.validate.predefined) = { ... } * @return The const. */ @java.lang.Override @@ -1182,7 +1302,7 @@ public int getConst() { * ``` * * - * optional fixed32 const = 1 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional fixed32 const = 1 [json_name = "const", (.buf.validate.predefined) = { ... } * @param value The const to set. * @return This builder for chaining. */ @@ -1206,7 +1326,7 @@ public Builder setConst(int value) { * ``` * * - * optional fixed32 const = 1 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional fixed32 const = 1 [json_name = "const", (.buf.validate.predefined) = { ... } * @return This builder for chaining. */ public Builder clearConst() { @@ -1230,7 +1350,7 @@ public Builder clearConst() { * ``` * * - * fixed32 lt = 2 [json_name = "lt", (.buf.validate.priv.field) = { ... } + * fixed32 lt = 2 [json_name = "lt", (.buf.validate.predefined) = { ... } * @return Whether the lt field is set. */ public boolean hasLt() { @@ -1250,7 +1370,7 @@ public boolean hasLt() { * ``` * * - * fixed32 lt = 2 [json_name = "lt", (.buf.validate.priv.field) = { ... } + * fixed32 lt = 2 [json_name = "lt", (.buf.validate.predefined) = { ... } * @return The lt. */ public int getLt() { @@ -1273,7 +1393,7 @@ public int getLt() { * ``` * * - * fixed32 lt = 2 [json_name = "lt", (.buf.validate.priv.field) = { ... } + * fixed32 lt = 2 [json_name = "lt", (.buf.validate.predefined) = { ... } * @param value The lt to set. * @return This builder for chaining. */ @@ -1298,7 +1418,7 @@ public Builder setLt(int value) { * ``` * * - * fixed32 lt = 2 [json_name = "lt", (.buf.validate.priv.field) = { ... } + * fixed32 lt = 2 [json_name = "lt", (.buf.validate.predefined) = { ... } * @return This builder for chaining. */ public Builder clearLt() { @@ -1324,7 +1444,7 @@ public Builder clearLt() { * ``` * * - * fixed32 lte = 3 [json_name = "lte", (.buf.validate.priv.field) = { ... } + * fixed32 lte = 3 [json_name = "lte", (.buf.validate.predefined) = { ... } * @return Whether the lte field is set. */ public boolean hasLte() { @@ -1344,7 +1464,7 @@ public boolean hasLte() { * ``` * * - * fixed32 lte = 3 [json_name = "lte", (.buf.validate.priv.field) = { ... } + * fixed32 lte = 3 [json_name = "lte", (.buf.validate.predefined) = { ... } * @return The lte. */ public int getLte() { @@ -1367,7 +1487,7 @@ public int getLte() { * ``` * * - * fixed32 lte = 3 [json_name = "lte", (.buf.validate.priv.field) = { ... } + * fixed32 lte = 3 [json_name = "lte", (.buf.validate.predefined) = { ... } * @param value The lte to set. * @return This builder for chaining. */ @@ -1392,7 +1512,7 @@ public Builder setLte(int value) { * ``` * * - * fixed32 lte = 3 [json_name = "lte", (.buf.validate.priv.field) = { ... } + * fixed32 lte = 3 [json_name = "lte", (.buf.validate.predefined) = { ... } * @return This builder for chaining. */ public Builder clearLte() { @@ -1426,7 +1546,7 @@ public Builder clearLte() { * ``` * * - * fixed32 gt = 4 [json_name = "gt", (.buf.validate.priv.field) = { ... } + * fixed32 gt = 4 [json_name = "gt", (.buf.validate.predefined) = { ... } * @return Whether the gt field is set. */ public boolean hasGt() { @@ -1454,7 +1574,7 @@ public boolean hasGt() { * ``` * * - * fixed32 gt = 4 [json_name = "gt", (.buf.validate.priv.field) = { ... } + * fixed32 gt = 4 [json_name = "gt", (.buf.validate.predefined) = { ... } * @return The gt. */ public int getGt() { @@ -1485,7 +1605,7 @@ public int getGt() { * ``` * * - * fixed32 gt = 4 [json_name = "gt", (.buf.validate.priv.field) = { ... } + * fixed32 gt = 4 [json_name = "gt", (.buf.validate.predefined) = { ... } * @param value The gt to set. * @return This builder for chaining. */ @@ -1518,7 +1638,7 @@ public Builder setGt(int value) { * ``` * * - * fixed32 gt = 4 [json_name = "gt", (.buf.validate.priv.field) = { ... } + * fixed32 gt = 4 [json_name = "gt", (.buf.validate.predefined) = { ... } * @return This builder for chaining. */ public Builder clearGt() { @@ -1552,7 +1672,7 @@ public Builder clearGt() { * ``` * * - * fixed32 gte = 5 [json_name = "gte", (.buf.validate.priv.field) = { ... } + * fixed32 gte = 5 [json_name = "gte", (.buf.validate.predefined) = { ... } * @return Whether the gte field is set. */ public boolean hasGte() { @@ -1580,7 +1700,7 @@ public boolean hasGte() { * ``` * * - * fixed32 gte = 5 [json_name = "gte", (.buf.validate.priv.field) = { ... } + * fixed32 gte = 5 [json_name = "gte", (.buf.validate.predefined) = { ... } * @return The gte. */ public int getGte() { @@ -1611,7 +1731,7 @@ public int getGte() { * ``` * * - * fixed32 gte = 5 [json_name = "gte", (.buf.validate.priv.field) = { ... } + * fixed32 gte = 5 [json_name = "gte", (.buf.validate.predefined) = { ... } * @param value The gte to set. * @return This builder for chaining. */ @@ -1644,7 +1764,7 @@ public Builder setGte(int value) { * ``` * * - * fixed32 gte = 5 [json_name = "gte", (.buf.validate.priv.field) = { ... } + * fixed32 gte = 5 [json_name = "gte", (.buf.validate.predefined) = { ... } * @return This builder for chaining. */ public Builder clearGte() { @@ -1683,7 +1803,7 @@ private void ensureInIsMutable(int capacity) { * ``` * * - * repeated fixed32 in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated fixed32 in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @return A list containing the in. */ public java.util.List @@ -1705,7 +1825,7 @@ private void ensureInIsMutable(int capacity) { * ``` * * - * repeated fixed32 in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated fixed32 in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @return The count of in. */ public int getInCount() { @@ -1725,7 +1845,7 @@ public int getInCount() { * ``` * * - * repeated fixed32 in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated fixed32 in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @param index The index of the element to return. * @return The in at the given index. */ @@ -1746,7 +1866,7 @@ public int getIn(int index) { * ``` * * - * repeated fixed32 in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated fixed32 in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @param index The index to set the value at. * @param value The in to set. * @return This builder for chaining. @@ -1774,7 +1894,7 @@ public Builder setIn( * ``` * * - * repeated fixed32 in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated fixed32 in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @param value The in to add. * @return This builder for chaining. */ @@ -1800,7 +1920,7 @@ public Builder addIn(int value) { * ``` * * - * repeated fixed32 in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated fixed32 in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @param values The in to add. * @return This builder for chaining. */ @@ -1827,7 +1947,7 @@ public Builder addAllIn( * ``` * * - * repeated fixed32 in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated fixed32 in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @return This builder for chaining. */ public Builder clearIn() { @@ -1864,7 +1984,7 @@ private void ensureNotInIsMutable(int capacity) { * ``` * * - * repeated fixed32 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated fixed32 not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @return A list containing the notIn. */ public java.util.List @@ -1886,7 +2006,7 @@ private void ensureNotInIsMutable(int capacity) { * ``` * * - * repeated fixed32 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated fixed32 not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @return The count of notIn. */ public int getNotInCount() { @@ -1906,7 +2026,7 @@ public int getNotInCount() { * ``` * * - * repeated fixed32 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated fixed32 not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @param index The index of the element to return. * @return The notIn at the given index. */ @@ -1927,7 +2047,7 @@ public int getNotIn(int index) { * ``` * * - * repeated fixed32 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated fixed32 not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @param index The index to set the value at. * @param value The notIn to set. * @return This builder for chaining. @@ -1955,7 +2075,7 @@ public Builder setNotIn( * ``` * * - * repeated fixed32 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated fixed32 not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @param value The notIn to add. * @return This builder for chaining. */ @@ -1981,7 +2101,7 @@ public Builder addNotIn(int value) { * ``` * * - * repeated fixed32 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated fixed32 not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @param values The notIn to add. * @return This builder for chaining. */ @@ -2008,7 +2128,7 @@ public Builder addAllNotIn( * ``` * * - * repeated fixed32 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated fixed32 not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @return This builder for chaining. */ public Builder clearNotIn() { @@ -2018,6 +2138,201 @@ public Builder clearNotIn() { return this; } + private com.google.protobuf.Internal.IntList example_ = emptyIntList(); + private void ensureExampleIsMutable() { + if (!example_.isModifiable()) { + example_ = makeMutableCopy(example_); + } + bitField0_ |= 0x00000080; + } + private void ensureExampleIsMutable(int capacity) { + if (!example_.isModifiable()) { + example_ = makeMutableCopy(example_, capacity); + } + bitField0_ |= 0x00000080; + } + /** + *
+     * `example` specifies values that the field may have. These values SHOULD
+     * conform to other constraints. `example` values will not impact validation
+     * but may be used as helpful guidance on how to populate the given field.
+     *
+     * ```proto
+     * message MyFixed32 {
+     * fixed32 value = 1 [
+     * (buf.validate.field).fixed32.example = 1,
+     * (buf.validate.field).fixed32.example = 2
+     * ];
+     * }
+     * ```
+     * 
+ * + * repeated fixed32 example = 8 [json_name = "example", (.buf.validate.predefined) = { ... } + * @return A list containing the example. + */ + public java.util.List + getExampleList() { + example_.makeImmutable(); + return example_; + } + /** + *
+     * `example` specifies values that the field may have. These values SHOULD
+     * conform to other constraints. `example` values will not impact validation
+     * but may be used as helpful guidance on how to populate the given field.
+     *
+     * ```proto
+     * message MyFixed32 {
+     * fixed32 value = 1 [
+     * (buf.validate.field).fixed32.example = 1,
+     * (buf.validate.field).fixed32.example = 2
+     * ];
+     * }
+     * ```
+     * 
+ * + * repeated fixed32 example = 8 [json_name = "example", (.buf.validate.predefined) = { ... } + * @return The count of example. + */ + public int getExampleCount() { + return example_.size(); + } + /** + *
+     * `example` specifies values that the field may have. These values SHOULD
+     * conform to other constraints. `example` values will not impact validation
+     * but may be used as helpful guidance on how to populate the given field.
+     *
+     * ```proto
+     * message MyFixed32 {
+     * fixed32 value = 1 [
+     * (buf.validate.field).fixed32.example = 1,
+     * (buf.validate.field).fixed32.example = 2
+     * ];
+     * }
+     * ```
+     * 
+ * + * repeated fixed32 example = 8 [json_name = "example", (.buf.validate.predefined) = { ... } + * @param index The index of the element to return. + * @return The example at the given index. + */ + public int getExample(int index) { + return example_.getInt(index); + } + /** + *
+     * `example` specifies values that the field may have. These values SHOULD
+     * conform to other constraints. `example` values will not impact validation
+     * but may be used as helpful guidance on how to populate the given field.
+     *
+     * ```proto
+     * message MyFixed32 {
+     * fixed32 value = 1 [
+     * (buf.validate.field).fixed32.example = 1,
+     * (buf.validate.field).fixed32.example = 2
+     * ];
+     * }
+     * ```
+     * 
+ * + * repeated fixed32 example = 8 [json_name = "example", (.buf.validate.predefined) = { ... } + * @param index The index to set the value at. + * @param value The example to set. + * @return This builder for chaining. + */ + public Builder setExample( + int index, int value) { + + ensureExampleIsMutable(); + example_.setInt(index, value); + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + *
+     * `example` specifies values that the field may have. These values SHOULD
+     * conform to other constraints. `example` values will not impact validation
+     * but may be used as helpful guidance on how to populate the given field.
+     *
+     * ```proto
+     * message MyFixed32 {
+     * fixed32 value = 1 [
+     * (buf.validate.field).fixed32.example = 1,
+     * (buf.validate.field).fixed32.example = 2
+     * ];
+     * }
+     * ```
+     * 
+ * + * repeated fixed32 example = 8 [json_name = "example", (.buf.validate.predefined) = { ... } + * @param value The example to add. + * @return This builder for chaining. + */ + public Builder addExample(int value) { + + ensureExampleIsMutable(); + example_.addInt(value); + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + *
+     * `example` specifies values that the field may have. These values SHOULD
+     * conform to other constraints. `example` values will not impact validation
+     * but may be used as helpful guidance on how to populate the given field.
+     *
+     * ```proto
+     * message MyFixed32 {
+     * fixed32 value = 1 [
+     * (buf.validate.field).fixed32.example = 1,
+     * (buf.validate.field).fixed32.example = 2
+     * ];
+     * }
+     * ```
+     * 
+ * + * repeated fixed32 example = 8 [json_name = "example", (.buf.validate.predefined) = { ... } + * @param values The example to add. + * @return This builder for chaining. + */ + public Builder addAllExample( + java.lang.Iterable values) { + ensureExampleIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, example_); + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + *
+     * `example` specifies values that the field may have. These values SHOULD
+     * conform to other constraints. `example` values will not impact validation
+     * but may be used as helpful guidance on how to populate the given field.
+     *
+     * ```proto
+     * message MyFixed32 {
+     * fixed32 value = 1 [
+     * (buf.validate.field).fixed32.example = 1,
+     * (buf.validate.field).fixed32.example = 2
+     * ];
+     * }
+     * ```
+     * 
+ * + * repeated fixed32 example = 8 [json_name = "example", (.buf.validate.predefined) = { ... } + * @return This builder for chaining. + */ + public Builder clearExample() { + example_ = emptyIntList(); + bitField0_ = (bitField0_ & ~0x00000080); + onChanged(); + return this; + } + // @@protoc_insertion_point(builder_scope:buf.validate.Fixed32Rules) } diff --git a/src/main/java/build/buf/validate/Fixed32RulesOrBuilder.java b/src/main/java/build/buf/validate/Fixed32RulesOrBuilder.java index 75b73b51..f2d79378 100644 --- a/src/main/java/build/buf/validate/Fixed32RulesOrBuilder.java +++ b/src/main/java/build/buf/validate/Fixed32RulesOrBuilder.java @@ -7,7 +7,8 @@ public interface Fixed32RulesOrBuilder extends // @@protoc_insertion_point(interface_extends:buf.validate.Fixed32Rules) - com.google.protobuf.MessageOrBuilder { + com.google.protobuf.GeneratedMessage. + ExtendableMessageOrBuilder { /** *
@@ -22,7 +23,7 @@ public interface Fixed32RulesOrBuilder extends
    * ```
    * 
* - * optional fixed32 const = 1 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional fixed32 const = 1 [json_name = "const", (.buf.validate.predefined) = { ... } * @return Whether the const field is set. */ boolean hasConst(); @@ -39,7 +40,7 @@ public interface Fixed32RulesOrBuilder extends * ``` * * - * optional fixed32 const = 1 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional fixed32 const = 1 [json_name = "const", (.buf.validate.predefined) = { ... } * @return The const. */ int getConst(); @@ -58,7 +59,7 @@ public interface Fixed32RulesOrBuilder extends * ``` * * - * fixed32 lt = 2 [json_name = "lt", (.buf.validate.priv.field) = { ... } + * fixed32 lt = 2 [json_name = "lt", (.buf.validate.predefined) = { ... } * @return Whether the lt field is set. */ boolean hasLt(); @@ -76,7 +77,7 @@ public interface Fixed32RulesOrBuilder extends * ``` * * - * fixed32 lt = 2 [json_name = "lt", (.buf.validate.priv.field) = { ... } + * fixed32 lt = 2 [json_name = "lt", (.buf.validate.predefined) = { ... } * @return The lt. */ int getLt(); @@ -95,7 +96,7 @@ public interface Fixed32RulesOrBuilder extends * ``` * * - * fixed32 lte = 3 [json_name = "lte", (.buf.validate.priv.field) = { ... } + * fixed32 lte = 3 [json_name = "lte", (.buf.validate.predefined) = { ... } * @return Whether the lte field is set. */ boolean hasLte(); @@ -113,7 +114,7 @@ public interface Fixed32RulesOrBuilder extends * ``` * * - * fixed32 lte = 3 [json_name = "lte", (.buf.validate.priv.field) = { ... } + * fixed32 lte = 3 [json_name = "lte", (.buf.validate.predefined) = { ... } * @return The lte. */ int getLte(); @@ -140,7 +141,7 @@ public interface Fixed32RulesOrBuilder extends * ``` * * - * fixed32 gt = 4 [json_name = "gt", (.buf.validate.priv.field) = { ... } + * fixed32 gt = 4 [json_name = "gt", (.buf.validate.predefined) = { ... } * @return Whether the gt field is set. */ boolean hasGt(); @@ -166,7 +167,7 @@ public interface Fixed32RulesOrBuilder extends * ``` * * - * fixed32 gt = 4 [json_name = "gt", (.buf.validate.priv.field) = { ... } + * fixed32 gt = 4 [json_name = "gt", (.buf.validate.predefined) = { ... } * @return The gt. */ int getGt(); @@ -193,7 +194,7 @@ public interface Fixed32RulesOrBuilder extends * ``` * * - * fixed32 gte = 5 [json_name = "gte", (.buf.validate.priv.field) = { ... } + * fixed32 gte = 5 [json_name = "gte", (.buf.validate.predefined) = { ... } * @return Whether the gte field is set. */ boolean hasGte(); @@ -219,7 +220,7 @@ public interface Fixed32RulesOrBuilder extends * ``` * * - * fixed32 gte = 5 [json_name = "gte", (.buf.validate.priv.field) = { ... } + * fixed32 gte = 5 [json_name = "gte", (.buf.validate.predefined) = { ... } * @return The gte. */ int getGte(); @@ -238,7 +239,7 @@ public interface Fixed32RulesOrBuilder extends * ``` * * - * repeated fixed32 in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated fixed32 in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @return A list containing the in. */ java.util.List getInList(); @@ -256,7 +257,7 @@ public interface Fixed32RulesOrBuilder extends * ``` * * - * repeated fixed32 in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated fixed32 in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @return The count of in. */ int getInCount(); @@ -274,7 +275,7 @@ public interface Fixed32RulesOrBuilder extends * ``` * * - * repeated fixed32 in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated fixed32 in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @param index The index of the element to return. * @return The in at the given index. */ @@ -294,7 +295,7 @@ public interface Fixed32RulesOrBuilder extends * ``` * * - * repeated fixed32 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated fixed32 not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @return A list containing the notIn. */ java.util.List getNotInList(); @@ -312,7 +313,7 @@ public interface Fixed32RulesOrBuilder extends * ``` * * - * repeated fixed32 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated fixed32 not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @return The count of notIn. */ int getNotInCount(); @@ -330,12 +331,74 @@ public interface Fixed32RulesOrBuilder extends * ``` * * - * repeated fixed32 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated fixed32 not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @param index The index of the element to return. * @return The notIn at the given index. */ int getNotIn(int index); + /** + *
+   * `example` specifies values that the field may have. These values SHOULD
+   * conform to other constraints. `example` values will not impact validation
+   * but may be used as helpful guidance on how to populate the given field.
+   *
+   * ```proto
+   * message MyFixed32 {
+   * fixed32 value = 1 [
+   * (buf.validate.field).fixed32.example = 1,
+   * (buf.validate.field).fixed32.example = 2
+   * ];
+   * }
+   * ```
+   * 
+ * + * repeated fixed32 example = 8 [json_name = "example", (.buf.validate.predefined) = { ... } + * @return A list containing the example. + */ + java.util.List getExampleList(); + /** + *
+   * `example` specifies values that the field may have. These values SHOULD
+   * conform to other constraints. `example` values will not impact validation
+   * but may be used as helpful guidance on how to populate the given field.
+   *
+   * ```proto
+   * message MyFixed32 {
+   * fixed32 value = 1 [
+   * (buf.validate.field).fixed32.example = 1,
+   * (buf.validate.field).fixed32.example = 2
+   * ];
+   * }
+   * ```
+   * 
+ * + * repeated fixed32 example = 8 [json_name = "example", (.buf.validate.predefined) = { ... } + * @return The count of example. + */ + int getExampleCount(); + /** + *
+   * `example` specifies values that the field may have. These values SHOULD
+   * conform to other constraints. `example` values will not impact validation
+   * but may be used as helpful guidance on how to populate the given field.
+   *
+   * ```proto
+   * message MyFixed32 {
+   * fixed32 value = 1 [
+   * (buf.validate.field).fixed32.example = 1,
+   * (buf.validate.field).fixed32.example = 2
+   * ];
+   * }
+   * ```
+   * 
+ * + * repeated fixed32 example = 8 [json_name = "example", (.buf.validate.predefined) = { ... } + * @param index The index of the element to return. + * @return The example at the given index. + */ + int getExample(int index); + build.buf.validate.Fixed32Rules.LessThanCase getLessThanCase(); build.buf.validate.Fixed32Rules.GreaterThanCase getGreaterThanCase(); diff --git a/src/main/java/build/buf/validate/Fixed64Rules.java b/src/main/java/build/buf/validate/Fixed64Rules.java index 21f1dbb7..54156356 100644 --- a/src/main/java/build/buf/validate/Fixed64Rules.java +++ b/src/main/java/build/buf/validate/Fixed64Rules.java @@ -13,7 +13,8 @@ * Protobuf type {@code buf.validate.Fixed64Rules} */ public final class Fixed64Rules extends - com.google.protobuf.GeneratedMessage implements + com.google.protobuf.GeneratedMessage.ExtendableMessage< + Fixed64Rules> implements // @@protoc_insertion_point(message_implements:buf.validate.Fixed64Rules) Fixed64RulesOrBuilder { private static final long serialVersionUID = 0L; @@ -27,12 +28,13 @@ public final class Fixed64Rules extends Fixed64Rules.class.getName()); } // Use Fixed64Rules.newBuilder() to construct. - private Fixed64Rules(com.google.protobuf.GeneratedMessage.Builder builder) { + private Fixed64Rules(com.google.protobuf.GeneratedMessage.ExtendableBuilder builder) { super(builder); } private Fixed64Rules() { in_ = emptyLongList(); notIn_ = emptyLongList(); + example_ = emptyLongList(); } public static final com.google.protobuf.Descriptors.Descriptor @@ -148,7 +150,7 @@ public int getNumber() { * ``` * * - * optional fixed64 const = 1 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional fixed64 const = 1 [json_name = "const", (.buf.validate.predefined) = { ... } * @return Whether the const field is set. */ @java.lang.Override @@ -168,7 +170,7 @@ public boolean hasConst() { * ``` * * - * optional fixed64 const = 1 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional fixed64 const = 1 [json_name = "const", (.buf.validate.predefined) = { ... } * @return The const. */ @java.lang.Override @@ -191,7 +193,7 @@ public long getConst() { * ``` * * - * fixed64 lt = 2 [json_name = "lt", (.buf.validate.priv.field) = { ... } + * fixed64 lt = 2 [json_name = "lt", (.buf.validate.predefined) = { ... } * @return Whether the lt field is set. */ @java.lang.Override @@ -212,7 +214,7 @@ public boolean hasLt() { * ``` * * - * fixed64 lt = 2 [json_name = "lt", (.buf.validate.priv.field) = { ... } + * fixed64 lt = 2 [json_name = "lt", (.buf.validate.predefined) = { ... } * @return The lt. */ @java.lang.Override @@ -238,7 +240,7 @@ public long getLt() { * ``` * * - * fixed64 lte = 3 [json_name = "lte", (.buf.validate.priv.field) = { ... } + * fixed64 lte = 3 [json_name = "lte", (.buf.validate.predefined) = { ... } * @return Whether the lte field is set. */ @java.lang.Override @@ -259,7 +261,7 @@ public boolean hasLte() { * ``` * * - * fixed64 lte = 3 [json_name = "lte", (.buf.validate.priv.field) = { ... } + * fixed64 lte = 3 [json_name = "lte", (.buf.validate.predefined) = { ... } * @return The lte. */ @java.lang.Override @@ -293,7 +295,7 @@ public long getLte() { * ``` * * - * fixed64 gt = 4 [json_name = "gt", (.buf.validate.priv.field) = { ... } + * fixed64 gt = 4 [json_name = "gt", (.buf.validate.predefined) = { ... } * @return Whether the gt field is set. */ @java.lang.Override @@ -322,7 +324,7 @@ public boolean hasGt() { * ``` * * - * fixed64 gt = 4 [json_name = "gt", (.buf.validate.priv.field) = { ... } + * fixed64 gt = 4 [json_name = "gt", (.buf.validate.predefined) = { ... } * @return The gt. */ @java.lang.Override @@ -356,7 +358,7 @@ public long getGt() { * ``` * * - * fixed64 gte = 5 [json_name = "gte", (.buf.validate.priv.field) = { ... } + * fixed64 gte = 5 [json_name = "gte", (.buf.validate.predefined) = { ... } * @return Whether the gte field is set. */ @java.lang.Override @@ -385,7 +387,7 @@ public boolean hasGte() { * ``` * * - * fixed64 gte = 5 [json_name = "gte", (.buf.validate.priv.field) = { ... } + * fixed64 gte = 5 [json_name = "gte", (.buf.validate.predefined) = { ... } * @return The gte. */ @java.lang.Override @@ -414,7 +416,7 @@ public long getGte() { * ``` * * - * repeated fixed64 in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated fixed64 in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @return A list containing the in. */ @java.lang.Override @@ -436,7 +438,7 @@ public long getGte() { * ``` * * - * repeated fixed64 in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated fixed64 in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @return The count of in. */ public int getInCount() { @@ -456,14 +458,13 @@ public int getInCount() { * ``` * * - * repeated fixed64 in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated fixed64 in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @param index The index of the element to return. * @return The in at the given index. */ public long getIn(int index) { return in_.getLong(index); } - private int inMemoizedSerializedSize = -1; public static final int NOT_IN_FIELD_NUMBER = 7; @SuppressWarnings("serial") @@ -483,7 +484,7 @@ public long getIn(int index) { * ``` * * - * repeated fixed64 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated fixed64 not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @return A list containing the notIn. */ @java.lang.Override @@ -505,7 +506,7 @@ public long getIn(int index) { * ``` * * - * repeated fixed64 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated fixed64 not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @return The count of notIn. */ public int getNotInCount() { @@ -525,14 +526,87 @@ public int getNotInCount() { * ``` * * - * repeated fixed64 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated fixed64 not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @param index The index of the element to return. * @return The notIn at the given index. */ public long getNotIn(int index) { return notIn_.getLong(index); } - private int notInMemoizedSerializedSize = -1; + + public static final int EXAMPLE_FIELD_NUMBER = 8; + @SuppressWarnings("serial") + private com.google.protobuf.Internal.LongList example_ = + emptyLongList(); + /** + *
+   * `example` specifies values that the field may have. These values SHOULD
+   * conform to other constraints. `example` values will not impact validation
+   * but may be used as helpful guidance on how to populate the given field.
+   *
+   * ```proto
+   * message MyFixed64 {
+   * fixed64 value = 1 [
+   * (buf.validate.field).fixed64.example = 1,
+   * (buf.validate.field).fixed64.example = 2
+   * ];
+   * }
+   * ```
+   * 
+ * + * repeated fixed64 example = 8 [json_name = "example", (.buf.validate.predefined) = { ... } + * @return A list containing the example. + */ + @java.lang.Override + public java.util.List + getExampleList() { + return example_; + } + /** + *
+   * `example` specifies values that the field may have. These values SHOULD
+   * conform to other constraints. `example` values will not impact validation
+   * but may be used as helpful guidance on how to populate the given field.
+   *
+   * ```proto
+   * message MyFixed64 {
+   * fixed64 value = 1 [
+   * (buf.validate.field).fixed64.example = 1,
+   * (buf.validate.field).fixed64.example = 2
+   * ];
+   * }
+   * ```
+   * 
+ * + * repeated fixed64 example = 8 [json_name = "example", (.buf.validate.predefined) = { ... } + * @return The count of example. + */ + public int getExampleCount() { + return example_.size(); + } + /** + *
+   * `example` specifies values that the field may have. These values SHOULD
+   * conform to other constraints. `example` values will not impact validation
+   * but may be used as helpful guidance on how to populate the given field.
+   *
+   * ```proto
+   * message MyFixed64 {
+   * fixed64 value = 1 [
+   * (buf.validate.field).fixed64.example = 1,
+   * (buf.validate.field).fixed64.example = 2
+   * ];
+   * }
+   * ```
+   * 
+ * + * repeated fixed64 example = 8 [json_name = "example", (.buf.validate.predefined) = { ... } + * @param index The index of the element to return. + * @return The example at the given index. + */ + public long getExample(int index) { + return example_.getLong(index); + } private byte memoizedIsInitialized = -1; @java.lang.Override @@ -541,6 +615,10 @@ public final boolean isInitialized() { if (isInitialized == 1) return true; if (isInitialized == 0) return false; + if (!extensionsAreInitialized()) { + memoizedIsInitialized = 0; + return false; + } memoizedIsInitialized = 1; return true; } @@ -548,7 +626,9 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - getSerializedSize(); + com.google.protobuf.GeneratedMessage + .ExtendableMessage.ExtensionSerializer + extensionWriter = newExtensionSerializer(); if (((bitField0_ & 0x00000001) != 0)) { output.writeFixed64(1, const_); } @@ -568,20 +648,16 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) output.writeFixed64( 5, (long)((java.lang.Long) greaterThan_)); } - if (getInList().size() > 0) { - output.writeUInt32NoTag(50); - output.writeUInt32NoTag(inMemoizedSerializedSize); - } for (int i = 0; i < in_.size(); i++) { - output.writeFixed64NoTag(in_.getLong(i)); - } - if (getNotInList().size() > 0) { - output.writeUInt32NoTag(58); - output.writeUInt32NoTag(notInMemoizedSerializedSize); + output.writeFixed64(6, in_.getLong(i)); } for (int i = 0; i < notIn_.size(); i++) { - output.writeFixed64NoTag(notIn_.getLong(i)); + output.writeFixed64(7, notIn_.getLong(i)); } + for (int i = 0; i < example_.size(); i++) { + output.writeFixed64(8, example_.getLong(i)); + } + extensionWriter.writeUntil(536870912, output); getUnknownFields().writeTo(output); } @@ -619,24 +695,21 @@ public int getSerializedSize() { int dataSize = 0; dataSize = 8 * getInList().size(); size += dataSize; - if (!getInList().isEmpty()) { - size += 1; - size += com.google.protobuf.CodedOutputStream - .computeInt32SizeNoTag(dataSize); - } - inMemoizedSerializedSize = dataSize; + size += 1 * getInList().size(); } { int dataSize = 0; dataSize = 8 * getNotInList().size(); size += dataSize; - if (!getNotInList().isEmpty()) { - size += 1; - size += com.google.protobuf.CodedOutputStream - .computeInt32SizeNoTag(dataSize); - } - notInMemoizedSerializedSize = dataSize; + size += 1 * getNotInList().size(); } + { + int dataSize = 0; + dataSize = 8 * getExampleList().size(); + size += dataSize; + size += 1 * getExampleList().size(); + } + size += extensionsSerializedSize(); size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -661,6 +734,8 @@ public boolean equals(final java.lang.Object obj) { .equals(other.getInList())) return false; if (!getNotInList() .equals(other.getNotInList())) return false; + if (!getExampleList() + .equals(other.getExampleList())) return false; if (!getLessThanCase().equals(other.getLessThanCase())) return false; switch (lessThanCase_) { case 2: @@ -688,6 +763,8 @@ public boolean equals(final java.lang.Object obj) { default: } if (!getUnknownFields().equals(other.getUnknownFields())) return false; + if (!getExtensionFields().equals(other.getExtensionFields())) + return false; return true; } @@ -711,6 +788,10 @@ public int hashCode() { hash = (37 * hash) + NOT_IN_FIELD_NUMBER; hash = (53 * hash) + getNotInList().hashCode(); } + if (getExampleCount() > 0) { + hash = (37 * hash) + EXAMPLE_FIELD_NUMBER; + hash = (53 * hash) + getExampleList().hashCode(); + } switch (lessThanCase_) { case 2: hash = (37 * hash) + LT_FIELD_NUMBER; @@ -739,6 +820,7 @@ public int hashCode() { case 0: default: } + hash = hashFields(hash, getExtensionFields()); hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -844,7 +926,8 @@ protected Builder newBuilderForType( * Protobuf type {@code buf.validate.Fixed64Rules} */ public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder implements + com.google.protobuf.GeneratedMessage.ExtendableBuilder< + build.buf.validate.Fixed64Rules, Builder> implements // @@protoc_insertion_point(builder_implements:buf.validate.Fixed64Rules) build.buf.validate.Fixed64RulesOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor @@ -877,6 +960,7 @@ public Builder clear() { const_ = 0L; in_ = emptyLongList(); notIn_ = emptyLongList(); + example_ = emptyLongList(); lessThanCase_ = 0; lessThan_ = null; greaterThanCase_ = 0; @@ -928,6 +1012,10 @@ private void buildPartial0(build.buf.validate.Fixed64Rules result) { notIn_.makeImmutable(); result.notIn_ = notIn_; } + if (((from_bitField0_ & 0x00000080) != 0)) { + example_.makeImmutable(); + result.example_ = example_; + } result.bitField0_ |= to_bitField0_; } @@ -975,6 +1063,17 @@ public Builder mergeFrom(build.buf.validate.Fixed64Rules other) { } onChanged(); } + if (!other.example_.isEmpty()) { + if (example_.isEmpty()) { + example_ = other.example_; + example_.makeImmutable(); + bitField0_ |= 0x00000080; + } else { + ensureExampleIsMutable(); + example_.addAll(other.example_); + } + onChanged(); + } switch (other.getLessThanCase()) { case LT: { setLt(other.getLt()); @@ -1001,6 +1100,7 @@ public Builder mergeFrom(build.buf.validate.Fixed64Rules other) { break; } } + this.mergeExtensionFields(other); this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -1008,6 +1108,9 @@ public Builder mergeFrom(build.buf.validate.Fixed64Rules other) { @java.lang.Override public final boolean isInitialized() { + if (!extensionsAreInitialized()) { + return false; + } return true; } @@ -1086,6 +1189,23 @@ public Builder mergeFrom( input.popLimit(limit); break; } // case 58 + case 65: { + long v = input.readFixed64(); + ensureExampleIsMutable(); + example_.addLong(v); + break; + } // case 65 + case 66: { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + int alloc = length > 4096 ? 4096 : length; + ensureExampleIsMutable(alloc / 8); + while (input.getBytesUntilLimit() > 0) { + example_.addLong(input.readFixed64()); + } + input.popLimit(limit); + break; + } // case 66 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { done = true; // was an endgroup tag @@ -1147,7 +1267,7 @@ public Builder clearGreaterThan() { * ``` * * - * optional fixed64 const = 1 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional fixed64 const = 1 [json_name = "const", (.buf.validate.predefined) = { ... } * @return Whether the const field is set. */ @java.lang.Override @@ -1167,7 +1287,7 @@ public boolean hasConst() { * ``` * * - * optional fixed64 const = 1 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional fixed64 const = 1 [json_name = "const", (.buf.validate.predefined) = { ... } * @return The const. */ @java.lang.Override @@ -1187,7 +1307,7 @@ public long getConst() { * ``` * * - * optional fixed64 const = 1 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional fixed64 const = 1 [json_name = "const", (.buf.validate.predefined) = { ... } * @param value The const to set. * @return This builder for chaining. */ @@ -1211,7 +1331,7 @@ public Builder setConst(long value) { * ``` * * - * optional fixed64 const = 1 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional fixed64 const = 1 [json_name = "const", (.buf.validate.predefined) = { ... } * @return This builder for chaining. */ public Builder clearConst() { @@ -1235,7 +1355,7 @@ public Builder clearConst() { * ``` * * - * fixed64 lt = 2 [json_name = "lt", (.buf.validate.priv.field) = { ... } + * fixed64 lt = 2 [json_name = "lt", (.buf.validate.predefined) = { ... } * @return Whether the lt field is set. */ public boolean hasLt() { @@ -1255,7 +1375,7 @@ public boolean hasLt() { * ``` * * - * fixed64 lt = 2 [json_name = "lt", (.buf.validate.priv.field) = { ... } + * fixed64 lt = 2 [json_name = "lt", (.buf.validate.predefined) = { ... } * @return The lt. */ public long getLt() { @@ -1278,7 +1398,7 @@ public long getLt() { * ``` * * - * fixed64 lt = 2 [json_name = "lt", (.buf.validate.priv.field) = { ... } + * fixed64 lt = 2 [json_name = "lt", (.buf.validate.predefined) = { ... } * @param value The lt to set. * @return This builder for chaining. */ @@ -1303,7 +1423,7 @@ public Builder setLt(long value) { * ``` * * - * fixed64 lt = 2 [json_name = "lt", (.buf.validate.priv.field) = { ... } + * fixed64 lt = 2 [json_name = "lt", (.buf.validate.predefined) = { ... } * @return This builder for chaining. */ public Builder clearLt() { @@ -1329,7 +1449,7 @@ public Builder clearLt() { * ``` * * - * fixed64 lte = 3 [json_name = "lte", (.buf.validate.priv.field) = { ... } + * fixed64 lte = 3 [json_name = "lte", (.buf.validate.predefined) = { ... } * @return Whether the lte field is set. */ public boolean hasLte() { @@ -1349,7 +1469,7 @@ public boolean hasLte() { * ``` * * - * fixed64 lte = 3 [json_name = "lte", (.buf.validate.priv.field) = { ... } + * fixed64 lte = 3 [json_name = "lte", (.buf.validate.predefined) = { ... } * @return The lte. */ public long getLte() { @@ -1372,7 +1492,7 @@ public long getLte() { * ``` * * - * fixed64 lte = 3 [json_name = "lte", (.buf.validate.priv.field) = { ... } + * fixed64 lte = 3 [json_name = "lte", (.buf.validate.predefined) = { ... } * @param value The lte to set. * @return This builder for chaining. */ @@ -1397,7 +1517,7 @@ public Builder setLte(long value) { * ``` * * - * fixed64 lte = 3 [json_name = "lte", (.buf.validate.priv.field) = { ... } + * fixed64 lte = 3 [json_name = "lte", (.buf.validate.predefined) = { ... } * @return This builder for chaining. */ public Builder clearLte() { @@ -1431,7 +1551,7 @@ public Builder clearLte() { * ``` * * - * fixed64 gt = 4 [json_name = "gt", (.buf.validate.priv.field) = { ... } + * fixed64 gt = 4 [json_name = "gt", (.buf.validate.predefined) = { ... } * @return Whether the gt field is set. */ public boolean hasGt() { @@ -1459,7 +1579,7 @@ public boolean hasGt() { * ``` * * - * fixed64 gt = 4 [json_name = "gt", (.buf.validate.priv.field) = { ... } + * fixed64 gt = 4 [json_name = "gt", (.buf.validate.predefined) = { ... } * @return The gt. */ public long getGt() { @@ -1490,7 +1610,7 @@ public long getGt() { * ``` * * - * fixed64 gt = 4 [json_name = "gt", (.buf.validate.priv.field) = { ... } + * fixed64 gt = 4 [json_name = "gt", (.buf.validate.predefined) = { ... } * @param value The gt to set. * @return This builder for chaining. */ @@ -1523,7 +1643,7 @@ public Builder setGt(long value) { * ``` * * - * fixed64 gt = 4 [json_name = "gt", (.buf.validate.priv.field) = { ... } + * fixed64 gt = 4 [json_name = "gt", (.buf.validate.predefined) = { ... } * @return This builder for chaining. */ public Builder clearGt() { @@ -1557,7 +1677,7 @@ public Builder clearGt() { * ``` * * - * fixed64 gte = 5 [json_name = "gte", (.buf.validate.priv.field) = { ... } + * fixed64 gte = 5 [json_name = "gte", (.buf.validate.predefined) = { ... } * @return Whether the gte field is set. */ public boolean hasGte() { @@ -1585,7 +1705,7 @@ public boolean hasGte() { * ``` * * - * fixed64 gte = 5 [json_name = "gte", (.buf.validate.priv.field) = { ... } + * fixed64 gte = 5 [json_name = "gte", (.buf.validate.predefined) = { ... } * @return The gte. */ public long getGte() { @@ -1616,7 +1736,7 @@ public long getGte() { * ``` * * - * fixed64 gte = 5 [json_name = "gte", (.buf.validate.priv.field) = { ... } + * fixed64 gte = 5 [json_name = "gte", (.buf.validate.predefined) = { ... } * @param value The gte to set. * @return This builder for chaining. */ @@ -1649,7 +1769,7 @@ public Builder setGte(long value) { * ``` * * - * fixed64 gte = 5 [json_name = "gte", (.buf.validate.priv.field) = { ... } + * fixed64 gte = 5 [json_name = "gte", (.buf.validate.predefined) = { ... } * @return This builder for chaining. */ public Builder clearGte() { @@ -1688,7 +1808,7 @@ private void ensureInIsMutable(int capacity) { * ``` * * - * repeated fixed64 in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated fixed64 in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @return A list containing the in. */ public java.util.List @@ -1710,7 +1830,7 @@ private void ensureInIsMutable(int capacity) { * ``` * * - * repeated fixed64 in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated fixed64 in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @return The count of in. */ public int getInCount() { @@ -1730,7 +1850,7 @@ public int getInCount() { * ``` * * - * repeated fixed64 in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated fixed64 in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @param index The index of the element to return. * @return The in at the given index. */ @@ -1751,7 +1871,7 @@ public long getIn(int index) { * ``` * * - * repeated fixed64 in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated fixed64 in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @param index The index to set the value at. * @param value The in to set. * @return This builder for chaining. @@ -1779,7 +1899,7 @@ public Builder setIn( * ``` * * - * repeated fixed64 in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated fixed64 in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @param value The in to add. * @return This builder for chaining. */ @@ -1805,7 +1925,7 @@ public Builder addIn(long value) { * ``` * * - * repeated fixed64 in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated fixed64 in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @param values The in to add. * @return This builder for chaining. */ @@ -1832,7 +1952,7 @@ public Builder addAllIn( * ``` * * - * repeated fixed64 in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated fixed64 in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @return This builder for chaining. */ public Builder clearIn() { @@ -1869,7 +1989,7 @@ private void ensureNotInIsMutable(int capacity) { * ``` * * - * repeated fixed64 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated fixed64 not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @return A list containing the notIn. */ public java.util.List @@ -1891,7 +2011,7 @@ private void ensureNotInIsMutable(int capacity) { * ``` * * - * repeated fixed64 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated fixed64 not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @return The count of notIn. */ public int getNotInCount() { @@ -1911,7 +2031,7 @@ public int getNotInCount() { * ``` * * - * repeated fixed64 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated fixed64 not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @param index The index of the element to return. * @return The notIn at the given index. */ @@ -1932,7 +2052,7 @@ public long getNotIn(int index) { * ``` * * - * repeated fixed64 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated fixed64 not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @param index The index to set the value at. * @param value The notIn to set. * @return This builder for chaining. @@ -1960,7 +2080,7 @@ public Builder setNotIn( * ``` * * - * repeated fixed64 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated fixed64 not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @param value The notIn to add. * @return This builder for chaining. */ @@ -1986,7 +2106,7 @@ public Builder addNotIn(long value) { * ``` * * - * repeated fixed64 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated fixed64 not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @param values The notIn to add. * @return This builder for chaining. */ @@ -2013,7 +2133,7 @@ public Builder addAllNotIn( * ``` * * - * repeated fixed64 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated fixed64 not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @return This builder for chaining. */ public Builder clearNotIn() { @@ -2023,6 +2143,201 @@ public Builder clearNotIn() { return this; } + private com.google.protobuf.Internal.LongList example_ = emptyLongList(); + private void ensureExampleIsMutable() { + if (!example_.isModifiable()) { + example_ = makeMutableCopy(example_); + } + bitField0_ |= 0x00000080; + } + private void ensureExampleIsMutable(int capacity) { + if (!example_.isModifiable()) { + example_ = makeMutableCopy(example_, capacity); + } + bitField0_ |= 0x00000080; + } + /** + *
+     * `example` specifies values that the field may have. These values SHOULD
+     * conform to other constraints. `example` values will not impact validation
+     * but may be used as helpful guidance on how to populate the given field.
+     *
+     * ```proto
+     * message MyFixed64 {
+     * fixed64 value = 1 [
+     * (buf.validate.field).fixed64.example = 1,
+     * (buf.validate.field).fixed64.example = 2
+     * ];
+     * }
+     * ```
+     * 
+ * + * repeated fixed64 example = 8 [json_name = "example", (.buf.validate.predefined) = { ... } + * @return A list containing the example. + */ + public java.util.List + getExampleList() { + example_.makeImmutable(); + return example_; + } + /** + *
+     * `example` specifies values that the field may have. These values SHOULD
+     * conform to other constraints. `example` values will not impact validation
+     * but may be used as helpful guidance on how to populate the given field.
+     *
+     * ```proto
+     * message MyFixed64 {
+     * fixed64 value = 1 [
+     * (buf.validate.field).fixed64.example = 1,
+     * (buf.validate.field).fixed64.example = 2
+     * ];
+     * }
+     * ```
+     * 
+ * + * repeated fixed64 example = 8 [json_name = "example", (.buf.validate.predefined) = { ... } + * @return The count of example. + */ + public int getExampleCount() { + return example_.size(); + } + /** + *
+     * `example` specifies values that the field may have. These values SHOULD
+     * conform to other constraints. `example` values will not impact validation
+     * but may be used as helpful guidance on how to populate the given field.
+     *
+     * ```proto
+     * message MyFixed64 {
+     * fixed64 value = 1 [
+     * (buf.validate.field).fixed64.example = 1,
+     * (buf.validate.field).fixed64.example = 2
+     * ];
+     * }
+     * ```
+     * 
+ * + * repeated fixed64 example = 8 [json_name = "example", (.buf.validate.predefined) = { ... } + * @param index The index of the element to return. + * @return The example at the given index. + */ + public long getExample(int index) { + return example_.getLong(index); + } + /** + *
+     * `example` specifies values that the field may have. These values SHOULD
+     * conform to other constraints. `example` values will not impact validation
+     * but may be used as helpful guidance on how to populate the given field.
+     *
+     * ```proto
+     * message MyFixed64 {
+     * fixed64 value = 1 [
+     * (buf.validate.field).fixed64.example = 1,
+     * (buf.validate.field).fixed64.example = 2
+     * ];
+     * }
+     * ```
+     * 
+ * + * repeated fixed64 example = 8 [json_name = "example", (.buf.validate.predefined) = { ... } + * @param index The index to set the value at. + * @param value The example to set. + * @return This builder for chaining. + */ + public Builder setExample( + int index, long value) { + + ensureExampleIsMutable(); + example_.setLong(index, value); + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + *
+     * `example` specifies values that the field may have. These values SHOULD
+     * conform to other constraints. `example` values will not impact validation
+     * but may be used as helpful guidance on how to populate the given field.
+     *
+     * ```proto
+     * message MyFixed64 {
+     * fixed64 value = 1 [
+     * (buf.validate.field).fixed64.example = 1,
+     * (buf.validate.field).fixed64.example = 2
+     * ];
+     * }
+     * ```
+     * 
+ * + * repeated fixed64 example = 8 [json_name = "example", (.buf.validate.predefined) = { ... } + * @param value The example to add. + * @return This builder for chaining. + */ + public Builder addExample(long value) { + + ensureExampleIsMutable(); + example_.addLong(value); + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + *
+     * `example` specifies values that the field may have. These values SHOULD
+     * conform to other constraints. `example` values will not impact validation
+     * but may be used as helpful guidance on how to populate the given field.
+     *
+     * ```proto
+     * message MyFixed64 {
+     * fixed64 value = 1 [
+     * (buf.validate.field).fixed64.example = 1,
+     * (buf.validate.field).fixed64.example = 2
+     * ];
+     * }
+     * ```
+     * 
+ * + * repeated fixed64 example = 8 [json_name = "example", (.buf.validate.predefined) = { ... } + * @param values The example to add. + * @return This builder for chaining. + */ + public Builder addAllExample( + java.lang.Iterable values) { + ensureExampleIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, example_); + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + *
+     * `example` specifies values that the field may have. These values SHOULD
+     * conform to other constraints. `example` values will not impact validation
+     * but may be used as helpful guidance on how to populate the given field.
+     *
+     * ```proto
+     * message MyFixed64 {
+     * fixed64 value = 1 [
+     * (buf.validate.field).fixed64.example = 1,
+     * (buf.validate.field).fixed64.example = 2
+     * ];
+     * }
+     * ```
+     * 
+ * + * repeated fixed64 example = 8 [json_name = "example", (.buf.validate.predefined) = { ... } + * @return This builder for chaining. + */ + public Builder clearExample() { + example_ = emptyLongList(); + bitField0_ = (bitField0_ & ~0x00000080); + onChanged(); + return this; + } + // @@protoc_insertion_point(builder_scope:buf.validate.Fixed64Rules) } diff --git a/src/main/java/build/buf/validate/Fixed64RulesOrBuilder.java b/src/main/java/build/buf/validate/Fixed64RulesOrBuilder.java index 122ca9ce..fc2a747c 100644 --- a/src/main/java/build/buf/validate/Fixed64RulesOrBuilder.java +++ b/src/main/java/build/buf/validate/Fixed64RulesOrBuilder.java @@ -7,7 +7,8 @@ public interface Fixed64RulesOrBuilder extends // @@protoc_insertion_point(interface_extends:buf.validate.Fixed64Rules) - com.google.protobuf.MessageOrBuilder { + com.google.protobuf.GeneratedMessage. + ExtendableMessageOrBuilder { /** *
@@ -22,7 +23,7 @@ public interface Fixed64RulesOrBuilder extends
    * ```
    * 
* - * optional fixed64 const = 1 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional fixed64 const = 1 [json_name = "const", (.buf.validate.predefined) = { ... } * @return Whether the const field is set. */ boolean hasConst(); @@ -39,7 +40,7 @@ public interface Fixed64RulesOrBuilder extends * ``` * * - * optional fixed64 const = 1 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional fixed64 const = 1 [json_name = "const", (.buf.validate.predefined) = { ... } * @return The const. */ long getConst(); @@ -58,7 +59,7 @@ public interface Fixed64RulesOrBuilder extends * ``` * * - * fixed64 lt = 2 [json_name = "lt", (.buf.validate.priv.field) = { ... } + * fixed64 lt = 2 [json_name = "lt", (.buf.validate.predefined) = { ... } * @return Whether the lt field is set. */ boolean hasLt(); @@ -76,7 +77,7 @@ public interface Fixed64RulesOrBuilder extends * ``` * * - * fixed64 lt = 2 [json_name = "lt", (.buf.validate.priv.field) = { ... } + * fixed64 lt = 2 [json_name = "lt", (.buf.validate.predefined) = { ... } * @return The lt. */ long getLt(); @@ -95,7 +96,7 @@ public interface Fixed64RulesOrBuilder extends * ``` * * - * fixed64 lte = 3 [json_name = "lte", (.buf.validate.priv.field) = { ... } + * fixed64 lte = 3 [json_name = "lte", (.buf.validate.predefined) = { ... } * @return Whether the lte field is set. */ boolean hasLte(); @@ -113,7 +114,7 @@ public interface Fixed64RulesOrBuilder extends * ``` * * - * fixed64 lte = 3 [json_name = "lte", (.buf.validate.priv.field) = { ... } + * fixed64 lte = 3 [json_name = "lte", (.buf.validate.predefined) = { ... } * @return The lte. */ long getLte(); @@ -140,7 +141,7 @@ public interface Fixed64RulesOrBuilder extends * ``` * * - * fixed64 gt = 4 [json_name = "gt", (.buf.validate.priv.field) = { ... } + * fixed64 gt = 4 [json_name = "gt", (.buf.validate.predefined) = { ... } * @return Whether the gt field is set. */ boolean hasGt(); @@ -166,7 +167,7 @@ public interface Fixed64RulesOrBuilder extends * ``` * * - * fixed64 gt = 4 [json_name = "gt", (.buf.validate.priv.field) = { ... } + * fixed64 gt = 4 [json_name = "gt", (.buf.validate.predefined) = { ... } * @return The gt. */ long getGt(); @@ -193,7 +194,7 @@ public interface Fixed64RulesOrBuilder extends * ``` * * - * fixed64 gte = 5 [json_name = "gte", (.buf.validate.priv.field) = { ... } + * fixed64 gte = 5 [json_name = "gte", (.buf.validate.predefined) = { ... } * @return Whether the gte field is set. */ boolean hasGte(); @@ -219,7 +220,7 @@ public interface Fixed64RulesOrBuilder extends * ``` * * - * fixed64 gte = 5 [json_name = "gte", (.buf.validate.priv.field) = { ... } + * fixed64 gte = 5 [json_name = "gte", (.buf.validate.predefined) = { ... } * @return The gte. */ long getGte(); @@ -238,7 +239,7 @@ public interface Fixed64RulesOrBuilder extends * ``` * * - * repeated fixed64 in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated fixed64 in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @return A list containing the in. */ java.util.List getInList(); @@ -256,7 +257,7 @@ public interface Fixed64RulesOrBuilder extends * ``` * * - * repeated fixed64 in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated fixed64 in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @return The count of in. */ int getInCount(); @@ -274,7 +275,7 @@ public interface Fixed64RulesOrBuilder extends * ``` * * - * repeated fixed64 in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated fixed64 in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @param index The index of the element to return. * @return The in at the given index. */ @@ -294,7 +295,7 @@ public interface Fixed64RulesOrBuilder extends * ``` * * - * repeated fixed64 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated fixed64 not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @return A list containing the notIn. */ java.util.List getNotInList(); @@ -312,7 +313,7 @@ public interface Fixed64RulesOrBuilder extends * ``` * * - * repeated fixed64 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated fixed64 not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @return The count of notIn. */ int getNotInCount(); @@ -330,12 +331,74 @@ public interface Fixed64RulesOrBuilder extends * ``` * * - * repeated fixed64 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated fixed64 not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @param index The index of the element to return. * @return The notIn at the given index. */ long getNotIn(int index); + /** + *
+   * `example` specifies values that the field may have. These values SHOULD
+   * conform to other constraints. `example` values will not impact validation
+   * but may be used as helpful guidance on how to populate the given field.
+   *
+   * ```proto
+   * message MyFixed64 {
+   * fixed64 value = 1 [
+   * (buf.validate.field).fixed64.example = 1,
+   * (buf.validate.field).fixed64.example = 2
+   * ];
+   * }
+   * ```
+   * 
+ * + * repeated fixed64 example = 8 [json_name = "example", (.buf.validate.predefined) = { ... } + * @return A list containing the example. + */ + java.util.List getExampleList(); + /** + *
+   * `example` specifies values that the field may have. These values SHOULD
+   * conform to other constraints. `example` values will not impact validation
+   * but may be used as helpful guidance on how to populate the given field.
+   *
+   * ```proto
+   * message MyFixed64 {
+   * fixed64 value = 1 [
+   * (buf.validate.field).fixed64.example = 1,
+   * (buf.validate.field).fixed64.example = 2
+   * ];
+   * }
+   * ```
+   * 
+ * + * repeated fixed64 example = 8 [json_name = "example", (.buf.validate.predefined) = { ... } + * @return The count of example. + */ + int getExampleCount(); + /** + *
+   * `example` specifies values that the field may have. These values SHOULD
+   * conform to other constraints. `example` values will not impact validation
+   * but may be used as helpful guidance on how to populate the given field.
+   *
+   * ```proto
+   * message MyFixed64 {
+   * fixed64 value = 1 [
+   * (buf.validate.field).fixed64.example = 1,
+   * (buf.validate.field).fixed64.example = 2
+   * ];
+   * }
+   * ```
+   * 
+ * + * repeated fixed64 example = 8 [json_name = "example", (.buf.validate.predefined) = { ... } + * @param index The index of the element to return. + * @return The example at the given index. + */ + long getExample(int index); + build.buf.validate.Fixed64Rules.LessThanCase getLessThanCase(); build.buf.validate.Fixed64Rules.GreaterThanCase getGreaterThanCase(); diff --git a/src/main/java/build/buf/validate/FloatRules.java b/src/main/java/build/buf/validate/FloatRules.java index 4b8f22a9..8ab9183a 100644 --- a/src/main/java/build/buf/validate/FloatRules.java +++ b/src/main/java/build/buf/validate/FloatRules.java @@ -14,7 +14,8 @@ * Protobuf type {@code buf.validate.FloatRules} */ public final class FloatRules extends - com.google.protobuf.GeneratedMessage implements + com.google.protobuf.GeneratedMessage.ExtendableMessage< + FloatRules> implements // @@protoc_insertion_point(message_implements:buf.validate.FloatRules) FloatRulesOrBuilder { private static final long serialVersionUID = 0L; @@ -28,12 +29,13 @@ public final class FloatRules extends FloatRules.class.getName()); } // Use FloatRules.newBuilder() to construct. - private FloatRules(com.google.protobuf.GeneratedMessage.Builder builder) { + private FloatRules(com.google.protobuf.GeneratedMessage.ExtendableBuilder builder) { super(builder); } private FloatRules() { in_ = emptyFloatList(); notIn_ = emptyFloatList(); + example_ = emptyFloatList(); } public static final com.google.protobuf.Descriptors.Descriptor @@ -149,7 +151,7 @@ public int getNumber() { * ``` * * - * optional float const = 1 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional float const = 1 [json_name = "const", (.buf.validate.predefined) = { ... } * @return Whether the const field is set. */ @java.lang.Override @@ -169,7 +171,7 @@ public boolean hasConst() { * ``` * * - * optional float const = 1 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional float const = 1 [json_name = "const", (.buf.validate.predefined) = { ... } * @return The const. */ @java.lang.Override @@ -192,7 +194,7 @@ public float getConst() { * ``` * * - * float lt = 2 [json_name = "lt", (.buf.validate.priv.field) = { ... } + * float lt = 2 [json_name = "lt", (.buf.validate.predefined) = { ... } * @return Whether the lt field is set. */ @java.lang.Override @@ -213,7 +215,7 @@ public boolean hasLt() { * ``` * * - * float lt = 2 [json_name = "lt", (.buf.validate.priv.field) = { ... } + * float lt = 2 [json_name = "lt", (.buf.validate.predefined) = { ... } * @return The lt. */ @java.lang.Override @@ -239,7 +241,7 @@ public float getLt() { * ``` * * - * float lte = 3 [json_name = "lte", (.buf.validate.priv.field) = { ... } + * float lte = 3 [json_name = "lte", (.buf.validate.predefined) = { ... } * @return Whether the lte field is set. */ @java.lang.Override @@ -260,7 +262,7 @@ public boolean hasLte() { * ``` * * - * float lte = 3 [json_name = "lte", (.buf.validate.priv.field) = { ... } + * float lte = 3 [json_name = "lte", (.buf.validate.predefined) = { ... } * @return The lte. */ @java.lang.Override @@ -294,7 +296,7 @@ public float getLte() { * ``` * * - * float gt = 4 [json_name = "gt", (.buf.validate.priv.field) = { ... } + * float gt = 4 [json_name = "gt", (.buf.validate.predefined) = { ... } * @return Whether the gt field is set. */ @java.lang.Override @@ -323,7 +325,7 @@ public boolean hasGt() { * ``` * * - * float gt = 4 [json_name = "gt", (.buf.validate.priv.field) = { ... } + * float gt = 4 [json_name = "gt", (.buf.validate.predefined) = { ... } * @return The gt. */ @java.lang.Override @@ -357,7 +359,7 @@ public float getGt() { * ``` * * - * float gte = 5 [json_name = "gte", (.buf.validate.priv.field) = { ... } + * float gte = 5 [json_name = "gte", (.buf.validate.predefined) = { ... } * @return Whether the gte field is set. */ @java.lang.Override @@ -386,7 +388,7 @@ public boolean hasGte() { * ``` * * - * float gte = 5 [json_name = "gte", (.buf.validate.priv.field) = { ... } + * float gte = 5 [json_name = "gte", (.buf.validate.predefined) = { ... } * @return The gte. */ @java.lang.Override @@ -415,7 +417,7 @@ public float getGte() { * ``` * * - * repeated float in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated float in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @return A list containing the in. */ @java.lang.Override @@ -437,7 +439,7 @@ public float getGte() { * ``` * * - * repeated float in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated float in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @return The count of in. */ public int getInCount() { @@ -457,14 +459,13 @@ public int getInCount() { * ``` * * - * repeated float in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated float in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @param index The index of the element to return. * @return The in at the given index. */ public float getIn(int index) { return in_.getFloat(index); } - private int inMemoizedSerializedSize = -1; public static final int NOT_IN_FIELD_NUMBER = 7; @SuppressWarnings("serial") @@ -484,7 +485,7 @@ public float getIn(int index) { * ``` * * - * repeated float not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated float not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @return A list containing the notIn. */ @java.lang.Override @@ -506,7 +507,7 @@ public float getIn(int index) { * ``` * * - * repeated float not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated float not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @return The count of notIn. */ public int getNotInCount() { @@ -526,14 +527,13 @@ public int getNotInCount() { * ``` * * - * repeated float not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated float not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @param index The index of the element to return. * @return The notIn at the given index. */ public float getNotIn(int index) { return notIn_.getFloat(index); } - private int notInMemoizedSerializedSize = -1; public static final int FINITE_FIELD_NUMBER = 8; private boolean finite_ = false; @@ -543,7 +543,20 @@ public float getNotIn(int index) { * infinite or NaN, an error message is generated. * * - * bool finite = 8 [json_name = "finite", (.buf.validate.priv.field) = { ... } + * optional bool finite = 8 [json_name = "finite", (.buf.validate.predefined) = { ... } + * @return Whether the finite field is set. + */ + @java.lang.Override + public boolean hasFinite() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + *
+   * `finite` requires the field value to be finite. If the field value is
+   * infinite or NaN, an error message is generated.
+   * 
+ * + * optional bool finite = 8 [json_name = "finite", (.buf.validate.predefined) = { ... } * @return The finite. */ @java.lang.Override @@ -551,6 +564,80 @@ public boolean getFinite() { return finite_; } + public static final int EXAMPLE_FIELD_NUMBER = 9; + @SuppressWarnings("serial") + private com.google.protobuf.Internal.FloatList example_ = + emptyFloatList(); + /** + *
+   * `example` specifies values that the field may have. These values SHOULD
+   * conform to other constraints. `example` values will not impact validation
+   * but may be used as helpful guidance on how to populate the given field.
+   *
+   * ```proto
+   * message MyFloat {
+   * float value = 1 [
+   * (buf.validate.field).float.example = 1.0,
+   * (buf.validate.field).float.example = "Infinity"
+   * ];
+   * }
+   * ```
+   * 
+ * + * repeated float example = 9 [json_name = "example", (.buf.validate.predefined) = { ... } + * @return A list containing the example. + */ + @java.lang.Override + public java.util.List + getExampleList() { + return example_; + } + /** + *
+   * `example` specifies values that the field may have. These values SHOULD
+   * conform to other constraints. `example` values will not impact validation
+   * but may be used as helpful guidance on how to populate the given field.
+   *
+   * ```proto
+   * message MyFloat {
+   * float value = 1 [
+   * (buf.validate.field).float.example = 1.0,
+   * (buf.validate.field).float.example = "Infinity"
+   * ];
+   * }
+   * ```
+   * 
+ * + * repeated float example = 9 [json_name = "example", (.buf.validate.predefined) = { ... } + * @return The count of example. + */ + public int getExampleCount() { + return example_.size(); + } + /** + *
+   * `example` specifies values that the field may have. These values SHOULD
+   * conform to other constraints. `example` values will not impact validation
+   * but may be used as helpful guidance on how to populate the given field.
+   *
+   * ```proto
+   * message MyFloat {
+   * float value = 1 [
+   * (buf.validate.field).float.example = 1.0,
+   * (buf.validate.field).float.example = "Infinity"
+   * ];
+   * }
+   * ```
+   * 
+ * + * repeated float example = 9 [json_name = "example", (.buf.validate.predefined) = { ... } + * @param index The index of the element to return. + * @return The example at the given index. + */ + public float getExample(int index) { + return example_.getFloat(index); + } + private byte memoizedIsInitialized = -1; @java.lang.Override public final boolean isInitialized() { @@ -558,6 +645,10 @@ public final boolean isInitialized() { if (isInitialized == 1) return true; if (isInitialized == 0) return false; + if (!extensionsAreInitialized()) { + memoizedIsInitialized = 0; + return false; + } memoizedIsInitialized = 1; return true; } @@ -565,7 +656,9 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - getSerializedSize(); + com.google.protobuf.GeneratedMessage + .ExtendableMessage.ExtensionSerializer + extensionWriter = newExtensionSerializer(); if (((bitField0_ & 0x00000001) != 0)) { output.writeFloat(1, const_); } @@ -585,23 +678,19 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) output.writeFloat( 5, (float)((java.lang.Float) greaterThan_)); } - if (getInList().size() > 0) { - output.writeUInt32NoTag(50); - output.writeUInt32NoTag(inMemoizedSerializedSize); - } for (int i = 0; i < in_.size(); i++) { - output.writeFloatNoTag(in_.getFloat(i)); - } - if (getNotInList().size() > 0) { - output.writeUInt32NoTag(58); - output.writeUInt32NoTag(notInMemoizedSerializedSize); + output.writeFloat(6, in_.getFloat(i)); } for (int i = 0; i < notIn_.size(); i++) { - output.writeFloatNoTag(notIn_.getFloat(i)); + output.writeFloat(7, notIn_.getFloat(i)); } - if (finite_ != false) { + if (((bitField0_ & 0x00000002) != 0)) { output.writeBool(8, finite_); } + for (int i = 0; i < example_.size(); i++) { + output.writeFloat(9, example_.getFloat(i)); + } + extensionWriter.writeUntil(536870912, output); getUnknownFields().writeTo(output); } @@ -639,28 +728,25 @@ public int getSerializedSize() { int dataSize = 0; dataSize = 4 * getInList().size(); size += dataSize; - if (!getInList().isEmpty()) { - size += 1; - size += com.google.protobuf.CodedOutputStream - .computeInt32SizeNoTag(dataSize); - } - inMemoizedSerializedSize = dataSize; + size += 1 * getInList().size(); } { int dataSize = 0; dataSize = 4 * getNotInList().size(); size += dataSize; - if (!getNotInList().isEmpty()) { - size += 1; - size += com.google.protobuf.CodedOutputStream - .computeInt32SizeNoTag(dataSize); - } - notInMemoizedSerializedSize = dataSize; + size += 1 * getNotInList().size(); } - if (finite_ != false) { + if (((bitField0_ & 0x00000002) != 0)) { size += com.google.protobuf.CodedOutputStream .computeBoolSize(8, finite_); } + { + int dataSize = 0; + dataSize = 4 * getExampleList().size(); + size += dataSize; + size += 1 * getExampleList().size(); + } + size += extensionsSerializedSize(); size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -686,8 +772,13 @@ public boolean equals(final java.lang.Object obj) { .equals(other.getInList())) return false; if (!getNotInList() .equals(other.getNotInList())) return false; - if (getFinite() - != other.getFinite()) return false; + if (hasFinite() != other.hasFinite()) return false; + if (hasFinite()) { + if (getFinite() + != other.getFinite()) return false; + } + if (!getExampleList() + .equals(other.getExampleList())) return false; if (!getLessThanCase().equals(other.getLessThanCase())) return false; switch (lessThanCase_) { case 2: @@ -719,6 +810,8 @@ public boolean equals(final java.lang.Object obj) { default: } if (!getUnknownFields().equals(other.getUnknownFields())) return false; + if (!getExtensionFields().equals(other.getExtensionFields())) + return false; return true; } @@ -742,9 +835,15 @@ public int hashCode() { hash = (37 * hash) + NOT_IN_FIELD_NUMBER; hash = (53 * hash) + getNotInList().hashCode(); } - hash = (37 * hash) + FINITE_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getFinite()); + if (hasFinite()) { + hash = (37 * hash) + FINITE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getFinite()); + } + if (getExampleCount() > 0) { + hash = (37 * hash) + EXAMPLE_FIELD_NUMBER; + hash = (53 * hash) + getExampleList().hashCode(); + } switch (lessThanCase_) { case 2: hash = (37 * hash) + LT_FIELD_NUMBER; @@ -773,6 +872,7 @@ public int hashCode() { case 0: default: } + hash = hashFields(hash, getExtensionFields()); hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -879,7 +979,8 @@ protected Builder newBuilderForType( * Protobuf type {@code buf.validate.FloatRules} */ public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder implements + com.google.protobuf.GeneratedMessage.ExtendableBuilder< + build.buf.validate.FloatRules, Builder> implements // @@protoc_insertion_point(builder_implements:buf.validate.FloatRules) build.buf.validate.FloatRulesOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor @@ -913,6 +1014,7 @@ public Builder clear() { in_ = emptyFloatList(); notIn_ = emptyFloatList(); finite_ = false; + example_ = emptyFloatList(); lessThanCase_ = 0; lessThan_ = null; greaterThanCase_ = 0; @@ -966,6 +1068,11 @@ private void buildPartial0(build.buf.validate.FloatRules result) { } if (((from_bitField0_ & 0x00000080) != 0)) { result.finite_ = finite_; + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + example_.makeImmutable(); + result.example_ = example_; } result.bitField0_ |= to_bitField0_; } @@ -1014,9 +1121,20 @@ public Builder mergeFrom(build.buf.validate.FloatRules other) { } onChanged(); } - if (other.getFinite() != false) { + if (other.hasFinite()) { setFinite(other.getFinite()); } + if (!other.example_.isEmpty()) { + if (example_.isEmpty()) { + example_ = other.example_; + example_.makeImmutable(); + bitField0_ |= 0x00000100; + } else { + ensureExampleIsMutable(); + example_.addAll(other.example_); + } + onChanged(); + } switch (other.getLessThanCase()) { case LT: { setLt(other.getLt()); @@ -1043,6 +1161,7 @@ public Builder mergeFrom(build.buf.validate.FloatRules other) { break; } } + this.mergeExtensionFields(other); this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -1050,6 +1169,9 @@ public Builder mergeFrom(build.buf.validate.FloatRules other) { @java.lang.Override public final boolean isInitialized() { + if (!extensionsAreInitialized()) { + return false; + } return true; } @@ -1133,6 +1255,23 @@ public Builder mergeFrom( bitField0_ |= 0x00000080; break; } // case 64 + case 77: { + float v = input.readFloat(); + ensureExampleIsMutable(); + example_.addFloat(v); + break; + } // case 77 + case 74: { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + int alloc = length > 4096 ? 4096 : length; + ensureExampleIsMutable(alloc / 4); + while (input.getBytesUntilLimit() > 0) { + example_.addFloat(input.readFloat()); + } + input.popLimit(limit); + break; + } // case 74 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { done = true; // was an endgroup tag @@ -1194,7 +1333,7 @@ public Builder clearGreaterThan() { * ``` * * - * optional float const = 1 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional float const = 1 [json_name = "const", (.buf.validate.predefined) = { ... } * @return Whether the const field is set. */ @java.lang.Override @@ -1214,7 +1353,7 @@ public boolean hasConst() { * ``` * * - * optional float const = 1 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional float const = 1 [json_name = "const", (.buf.validate.predefined) = { ... } * @return The const. */ @java.lang.Override @@ -1234,7 +1373,7 @@ public float getConst() { * ``` * * - * optional float const = 1 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional float const = 1 [json_name = "const", (.buf.validate.predefined) = { ... } * @param value The const to set. * @return This builder for chaining. */ @@ -1258,7 +1397,7 @@ public Builder setConst(float value) { * ``` * * - * optional float const = 1 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional float const = 1 [json_name = "const", (.buf.validate.predefined) = { ... } * @return This builder for chaining. */ public Builder clearConst() { @@ -1282,7 +1421,7 @@ public Builder clearConst() { * ``` * * - * float lt = 2 [json_name = "lt", (.buf.validate.priv.field) = { ... } + * float lt = 2 [json_name = "lt", (.buf.validate.predefined) = { ... } * @return Whether the lt field is set. */ public boolean hasLt() { @@ -1302,7 +1441,7 @@ public boolean hasLt() { * ``` * * - * float lt = 2 [json_name = "lt", (.buf.validate.priv.field) = { ... } + * float lt = 2 [json_name = "lt", (.buf.validate.predefined) = { ... } * @return The lt. */ public float getLt() { @@ -1325,7 +1464,7 @@ public float getLt() { * ``` * * - * float lt = 2 [json_name = "lt", (.buf.validate.priv.field) = { ... } + * float lt = 2 [json_name = "lt", (.buf.validate.predefined) = { ... } * @param value The lt to set. * @return This builder for chaining. */ @@ -1350,7 +1489,7 @@ public Builder setLt(float value) { * ``` * * - * float lt = 2 [json_name = "lt", (.buf.validate.priv.field) = { ... } + * float lt = 2 [json_name = "lt", (.buf.validate.predefined) = { ... } * @return This builder for chaining. */ public Builder clearLt() { @@ -1376,7 +1515,7 @@ public Builder clearLt() { * ``` * * - * float lte = 3 [json_name = "lte", (.buf.validate.priv.field) = { ... } + * float lte = 3 [json_name = "lte", (.buf.validate.predefined) = { ... } * @return Whether the lte field is set. */ public boolean hasLte() { @@ -1396,7 +1535,7 @@ public boolean hasLte() { * ``` * * - * float lte = 3 [json_name = "lte", (.buf.validate.priv.field) = { ... } + * float lte = 3 [json_name = "lte", (.buf.validate.predefined) = { ... } * @return The lte. */ public float getLte() { @@ -1419,7 +1558,7 @@ public float getLte() { * ``` * * - * float lte = 3 [json_name = "lte", (.buf.validate.priv.field) = { ... } + * float lte = 3 [json_name = "lte", (.buf.validate.predefined) = { ... } * @param value The lte to set. * @return This builder for chaining. */ @@ -1444,7 +1583,7 @@ public Builder setLte(float value) { * ``` * * - * float lte = 3 [json_name = "lte", (.buf.validate.priv.field) = { ... } + * float lte = 3 [json_name = "lte", (.buf.validate.predefined) = { ... } * @return This builder for chaining. */ public Builder clearLte() { @@ -1478,7 +1617,7 @@ public Builder clearLte() { * ``` * * - * float gt = 4 [json_name = "gt", (.buf.validate.priv.field) = { ... } + * float gt = 4 [json_name = "gt", (.buf.validate.predefined) = { ... } * @return Whether the gt field is set. */ public boolean hasGt() { @@ -1506,7 +1645,7 @@ public boolean hasGt() { * ``` * * - * float gt = 4 [json_name = "gt", (.buf.validate.priv.field) = { ... } + * float gt = 4 [json_name = "gt", (.buf.validate.predefined) = { ... } * @return The gt. */ public float getGt() { @@ -1537,7 +1676,7 @@ public float getGt() { * ``` * * - * float gt = 4 [json_name = "gt", (.buf.validate.priv.field) = { ... } + * float gt = 4 [json_name = "gt", (.buf.validate.predefined) = { ... } * @param value The gt to set. * @return This builder for chaining. */ @@ -1570,7 +1709,7 @@ public Builder setGt(float value) { * ``` * * - * float gt = 4 [json_name = "gt", (.buf.validate.priv.field) = { ... } + * float gt = 4 [json_name = "gt", (.buf.validate.predefined) = { ... } * @return This builder for chaining. */ public Builder clearGt() { @@ -1604,7 +1743,7 @@ public Builder clearGt() { * ``` * * - * float gte = 5 [json_name = "gte", (.buf.validate.priv.field) = { ... } + * float gte = 5 [json_name = "gte", (.buf.validate.predefined) = { ... } * @return Whether the gte field is set. */ public boolean hasGte() { @@ -1632,7 +1771,7 @@ public boolean hasGte() { * ``` * * - * float gte = 5 [json_name = "gte", (.buf.validate.priv.field) = { ... } + * float gte = 5 [json_name = "gte", (.buf.validate.predefined) = { ... } * @return The gte. */ public float getGte() { @@ -1663,7 +1802,7 @@ public float getGte() { * ``` * * - * float gte = 5 [json_name = "gte", (.buf.validate.priv.field) = { ... } + * float gte = 5 [json_name = "gte", (.buf.validate.predefined) = { ... } * @param value The gte to set. * @return This builder for chaining. */ @@ -1696,7 +1835,7 @@ public Builder setGte(float value) { * ``` * * - * float gte = 5 [json_name = "gte", (.buf.validate.priv.field) = { ... } + * float gte = 5 [json_name = "gte", (.buf.validate.predefined) = { ... } * @return This builder for chaining. */ public Builder clearGte() { @@ -1735,7 +1874,7 @@ private void ensureInIsMutable(int capacity) { * ``` * * - * repeated float in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated float in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @return A list containing the in. */ public java.util.List @@ -1757,7 +1896,7 @@ private void ensureInIsMutable(int capacity) { * ``` * * - * repeated float in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated float in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @return The count of in. */ public int getInCount() { @@ -1777,7 +1916,7 @@ public int getInCount() { * ``` * * - * repeated float in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated float in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @param index The index of the element to return. * @return The in at the given index. */ @@ -1798,7 +1937,7 @@ public float getIn(int index) { * ``` * * - * repeated float in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated float in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @param index The index to set the value at. * @param value The in to set. * @return This builder for chaining. @@ -1826,7 +1965,7 @@ public Builder setIn( * ``` * * - * repeated float in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated float in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @param value The in to add. * @return This builder for chaining. */ @@ -1852,7 +1991,7 @@ public Builder addIn(float value) { * ``` * * - * repeated float in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated float in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @param values The in to add. * @return This builder for chaining. */ @@ -1879,7 +2018,7 @@ public Builder addAllIn( * ``` * * - * repeated float in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated float in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @return This builder for chaining. */ public Builder clearIn() { @@ -1916,7 +2055,7 @@ private void ensureNotInIsMutable(int capacity) { * ``` * * - * repeated float not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated float not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @return A list containing the notIn. */ public java.util.List @@ -1938,7 +2077,7 @@ private void ensureNotInIsMutable(int capacity) { * ``` * * - * repeated float not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated float not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @return The count of notIn. */ public int getNotInCount() { @@ -1958,7 +2097,7 @@ public int getNotInCount() { * ``` * * - * repeated float not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated float not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @param index The index of the element to return. * @return The notIn at the given index. */ @@ -1979,7 +2118,7 @@ public float getNotIn(int index) { * ``` * * - * repeated float not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated float not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @param index The index to set the value at. * @param value The notIn to set. * @return This builder for chaining. @@ -2007,7 +2146,7 @@ public Builder setNotIn( * ``` * * - * repeated float not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated float not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @param value The notIn to add. * @return This builder for chaining. */ @@ -2033,7 +2172,7 @@ public Builder addNotIn(float value) { * ``` * * - * repeated float not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated float not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @param values The notIn to add. * @return This builder for chaining. */ @@ -2060,7 +2199,7 @@ public Builder addAllNotIn( * ``` * * - * repeated float not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated float not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @return This builder for chaining. */ public Builder clearNotIn() { @@ -2077,7 +2216,20 @@ public Builder clearNotIn() { * infinite or NaN, an error message is generated. * * - * bool finite = 8 [json_name = "finite", (.buf.validate.priv.field) = { ... } + * optional bool finite = 8 [json_name = "finite", (.buf.validate.predefined) = { ... } + * @return Whether the finite field is set. + */ + @java.lang.Override + public boolean hasFinite() { + return ((bitField0_ & 0x00000080) != 0); + } + /** + *
+     * `finite` requires the field value to be finite. If the field value is
+     * infinite or NaN, an error message is generated.
+     * 
+ * + * optional bool finite = 8 [json_name = "finite", (.buf.validate.predefined) = { ... } * @return The finite. */ @java.lang.Override @@ -2090,7 +2242,7 @@ public boolean getFinite() { * infinite or NaN, an error message is generated. * * - * bool finite = 8 [json_name = "finite", (.buf.validate.priv.field) = { ... } + * optional bool finite = 8 [json_name = "finite", (.buf.validate.predefined) = { ... } * @param value The finite to set. * @return This builder for chaining. */ @@ -2107,7 +2259,7 @@ public Builder setFinite(boolean value) { * infinite or NaN, an error message is generated. * * - * bool finite = 8 [json_name = "finite", (.buf.validate.priv.field) = { ... } + * optional bool finite = 8 [json_name = "finite", (.buf.validate.predefined) = { ... } * @return This builder for chaining. */ public Builder clearFinite() { @@ -2117,6 +2269,201 @@ public Builder clearFinite() { return this; } + private com.google.protobuf.Internal.FloatList example_ = emptyFloatList(); + private void ensureExampleIsMutable() { + if (!example_.isModifiable()) { + example_ = makeMutableCopy(example_); + } + bitField0_ |= 0x00000100; + } + private void ensureExampleIsMutable(int capacity) { + if (!example_.isModifiable()) { + example_ = makeMutableCopy(example_, capacity); + } + bitField0_ |= 0x00000100; + } + /** + *
+     * `example` specifies values that the field may have. These values SHOULD
+     * conform to other constraints. `example` values will not impact validation
+     * but may be used as helpful guidance on how to populate the given field.
+     *
+     * ```proto
+     * message MyFloat {
+     * float value = 1 [
+     * (buf.validate.field).float.example = 1.0,
+     * (buf.validate.field).float.example = "Infinity"
+     * ];
+     * }
+     * ```
+     * 
+ * + * repeated float example = 9 [json_name = "example", (.buf.validate.predefined) = { ... } + * @return A list containing the example. + */ + public java.util.List + getExampleList() { + example_.makeImmutable(); + return example_; + } + /** + *
+     * `example` specifies values that the field may have. These values SHOULD
+     * conform to other constraints. `example` values will not impact validation
+     * but may be used as helpful guidance on how to populate the given field.
+     *
+     * ```proto
+     * message MyFloat {
+     * float value = 1 [
+     * (buf.validate.field).float.example = 1.0,
+     * (buf.validate.field).float.example = "Infinity"
+     * ];
+     * }
+     * ```
+     * 
+ * + * repeated float example = 9 [json_name = "example", (.buf.validate.predefined) = { ... } + * @return The count of example. + */ + public int getExampleCount() { + return example_.size(); + } + /** + *
+     * `example` specifies values that the field may have. These values SHOULD
+     * conform to other constraints. `example` values will not impact validation
+     * but may be used as helpful guidance on how to populate the given field.
+     *
+     * ```proto
+     * message MyFloat {
+     * float value = 1 [
+     * (buf.validate.field).float.example = 1.0,
+     * (buf.validate.field).float.example = "Infinity"
+     * ];
+     * }
+     * ```
+     * 
+ * + * repeated float example = 9 [json_name = "example", (.buf.validate.predefined) = { ... } + * @param index The index of the element to return. + * @return The example at the given index. + */ + public float getExample(int index) { + return example_.getFloat(index); + } + /** + *
+     * `example` specifies values that the field may have. These values SHOULD
+     * conform to other constraints. `example` values will not impact validation
+     * but may be used as helpful guidance on how to populate the given field.
+     *
+     * ```proto
+     * message MyFloat {
+     * float value = 1 [
+     * (buf.validate.field).float.example = 1.0,
+     * (buf.validate.field).float.example = "Infinity"
+     * ];
+     * }
+     * ```
+     * 
+ * + * repeated float example = 9 [json_name = "example", (.buf.validate.predefined) = { ... } + * @param index The index to set the value at. + * @param value The example to set. + * @return This builder for chaining. + */ + public Builder setExample( + int index, float value) { + + ensureExampleIsMutable(); + example_.setFloat(index, value); + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + *
+     * `example` specifies values that the field may have. These values SHOULD
+     * conform to other constraints. `example` values will not impact validation
+     * but may be used as helpful guidance on how to populate the given field.
+     *
+     * ```proto
+     * message MyFloat {
+     * float value = 1 [
+     * (buf.validate.field).float.example = 1.0,
+     * (buf.validate.field).float.example = "Infinity"
+     * ];
+     * }
+     * ```
+     * 
+ * + * repeated float example = 9 [json_name = "example", (.buf.validate.predefined) = { ... } + * @param value The example to add. + * @return This builder for chaining. + */ + public Builder addExample(float value) { + + ensureExampleIsMutable(); + example_.addFloat(value); + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + *
+     * `example` specifies values that the field may have. These values SHOULD
+     * conform to other constraints. `example` values will not impact validation
+     * but may be used as helpful guidance on how to populate the given field.
+     *
+     * ```proto
+     * message MyFloat {
+     * float value = 1 [
+     * (buf.validate.field).float.example = 1.0,
+     * (buf.validate.field).float.example = "Infinity"
+     * ];
+     * }
+     * ```
+     * 
+ * + * repeated float example = 9 [json_name = "example", (.buf.validate.predefined) = { ... } + * @param values The example to add. + * @return This builder for chaining. + */ + public Builder addAllExample( + java.lang.Iterable values) { + ensureExampleIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, example_); + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + *
+     * `example` specifies values that the field may have. These values SHOULD
+     * conform to other constraints. `example` values will not impact validation
+     * but may be used as helpful guidance on how to populate the given field.
+     *
+     * ```proto
+     * message MyFloat {
+     * float value = 1 [
+     * (buf.validate.field).float.example = 1.0,
+     * (buf.validate.field).float.example = "Infinity"
+     * ];
+     * }
+     * ```
+     * 
+ * + * repeated float example = 9 [json_name = "example", (.buf.validate.predefined) = { ... } + * @return This builder for chaining. + */ + public Builder clearExample() { + example_ = emptyFloatList(); + bitField0_ = (bitField0_ & ~0x00000100); + onChanged(); + return this; + } + // @@protoc_insertion_point(builder_scope:buf.validate.FloatRules) } diff --git a/src/main/java/build/buf/validate/FloatRulesOrBuilder.java b/src/main/java/build/buf/validate/FloatRulesOrBuilder.java index 7877adbf..b338d76f 100644 --- a/src/main/java/build/buf/validate/FloatRulesOrBuilder.java +++ b/src/main/java/build/buf/validate/FloatRulesOrBuilder.java @@ -7,7 +7,8 @@ public interface FloatRulesOrBuilder extends // @@protoc_insertion_point(interface_extends:buf.validate.FloatRules) - com.google.protobuf.MessageOrBuilder { + com.google.protobuf.GeneratedMessage. + ExtendableMessageOrBuilder { /** *
@@ -22,7 +23,7 @@ public interface FloatRulesOrBuilder extends
    * ```
    * 
* - * optional float const = 1 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional float const = 1 [json_name = "const", (.buf.validate.predefined) = { ... } * @return Whether the const field is set. */ boolean hasConst(); @@ -39,7 +40,7 @@ public interface FloatRulesOrBuilder extends * ``` * * - * optional float const = 1 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional float const = 1 [json_name = "const", (.buf.validate.predefined) = { ... } * @return The const. */ float getConst(); @@ -58,7 +59,7 @@ public interface FloatRulesOrBuilder extends * ``` * * - * float lt = 2 [json_name = "lt", (.buf.validate.priv.field) = { ... } + * float lt = 2 [json_name = "lt", (.buf.validate.predefined) = { ... } * @return Whether the lt field is set. */ boolean hasLt(); @@ -76,7 +77,7 @@ public interface FloatRulesOrBuilder extends * ``` * * - * float lt = 2 [json_name = "lt", (.buf.validate.priv.field) = { ... } + * float lt = 2 [json_name = "lt", (.buf.validate.predefined) = { ... } * @return The lt. */ float getLt(); @@ -95,7 +96,7 @@ public interface FloatRulesOrBuilder extends * ``` * * - * float lte = 3 [json_name = "lte", (.buf.validate.priv.field) = { ... } + * float lte = 3 [json_name = "lte", (.buf.validate.predefined) = { ... } * @return Whether the lte field is set. */ boolean hasLte(); @@ -113,7 +114,7 @@ public interface FloatRulesOrBuilder extends * ``` * * - * float lte = 3 [json_name = "lte", (.buf.validate.priv.field) = { ... } + * float lte = 3 [json_name = "lte", (.buf.validate.predefined) = { ... } * @return The lte. */ float getLte(); @@ -140,7 +141,7 @@ public interface FloatRulesOrBuilder extends * ``` * * - * float gt = 4 [json_name = "gt", (.buf.validate.priv.field) = { ... } + * float gt = 4 [json_name = "gt", (.buf.validate.predefined) = { ... } * @return Whether the gt field is set. */ boolean hasGt(); @@ -166,7 +167,7 @@ public interface FloatRulesOrBuilder extends * ``` * * - * float gt = 4 [json_name = "gt", (.buf.validate.priv.field) = { ... } + * float gt = 4 [json_name = "gt", (.buf.validate.predefined) = { ... } * @return The gt. */ float getGt(); @@ -193,7 +194,7 @@ public interface FloatRulesOrBuilder extends * ``` * * - * float gte = 5 [json_name = "gte", (.buf.validate.priv.field) = { ... } + * float gte = 5 [json_name = "gte", (.buf.validate.predefined) = { ... } * @return Whether the gte field is set. */ boolean hasGte(); @@ -219,7 +220,7 @@ public interface FloatRulesOrBuilder extends * ``` * * - * float gte = 5 [json_name = "gte", (.buf.validate.priv.field) = { ... } + * float gte = 5 [json_name = "gte", (.buf.validate.predefined) = { ... } * @return The gte. */ float getGte(); @@ -238,7 +239,7 @@ public interface FloatRulesOrBuilder extends * ``` * * - * repeated float in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated float in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @return A list containing the in. */ java.util.List getInList(); @@ -256,7 +257,7 @@ public interface FloatRulesOrBuilder extends * ``` * * - * repeated float in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated float in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @return The count of in. */ int getInCount(); @@ -274,7 +275,7 @@ public interface FloatRulesOrBuilder extends * ``` * * - * repeated float in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated float in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @param index The index of the element to return. * @return The in at the given index. */ @@ -294,7 +295,7 @@ public interface FloatRulesOrBuilder extends * ``` * * - * repeated float not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated float not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @return A list containing the notIn. */ java.util.List getNotInList(); @@ -312,7 +313,7 @@ public interface FloatRulesOrBuilder extends * ``` * * - * repeated float not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated float not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @return The count of notIn. */ int getNotInCount(); @@ -330,7 +331,7 @@ public interface FloatRulesOrBuilder extends * ``` * * - * repeated float not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated float not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @param index The index of the element to return. * @return The notIn at the given index. */ @@ -342,11 +343,83 @@ public interface FloatRulesOrBuilder extends * infinite or NaN, an error message is generated. * * - * bool finite = 8 [json_name = "finite", (.buf.validate.priv.field) = { ... } + * optional bool finite = 8 [json_name = "finite", (.buf.validate.predefined) = { ... } + * @return Whether the finite field is set. + */ + boolean hasFinite(); + /** + *
+   * `finite` requires the field value to be finite. If the field value is
+   * infinite or NaN, an error message is generated.
+   * 
+ * + * optional bool finite = 8 [json_name = "finite", (.buf.validate.predefined) = { ... } * @return The finite. */ boolean getFinite(); + /** + *
+   * `example` specifies values that the field may have. These values SHOULD
+   * conform to other constraints. `example` values will not impact validation
+   * but may be used as helpful guidance on how to populate the given field.
+   *
+   * ```proto
+   * message MyFloat {
+   * float value = 1 [
+   * (buf.validate.field).float.example = 1.0,
+   * (buf.validate.field).float.example = "Infinity"
+   * ];
+   * }
+   * ```
+   * 
+ * + * repeated float example = 9 [json_name = "example", (.buf.validate.predefined) = { ... } + * @return A list containing the example. + */ + java.util.List getExampleList(); + /** + *
+   * `example` specifies values that the field may have. These values SHOULD
+   * conform to other constraints. `example` values will not impact validation
+   * but may be used as helpful guidance on how to populate the given field.
+   *
+   * ```proto
+   * message MyFloat {
+   * float value = 1 [
+   * (buf.validate.field).float.example = 1.0,
+   * (buf.validate.field).float.example = "Infinity"
+   * ];
+   * }
+   * ```
+   * 
+ * + * repeated float example = 9 [json_name = "example", (.buf.validate.predefined) = { ... } + * @return The count of example. + */ + int getExampleCount(); + /** + *
+   * `example` specifies values that the field may have. These values SHOULD
+   * conform to other constraints. `example` values will not impact validation
+   * but may be used as helpful guidance on how to populate the given field.
+   *
+   * ```proto
+   * message MyFloat {
+   * float value = 1 [
+   * (buf.validate.field).float.example = 1.0,
+   * (buf.validate.field).float.example = "Infinity"
+   * ];
+   * }
+   * ```
+   * 
+ * + * repeated float example = 9 [json_name = "example", (.buf.validate.predefined) = { ... } + * @param index The index of the element to return. + * @return The example at the given index. + */ + float getExample(int index); + build.buf.validate.FloatRules.LessThanCase getLessThanCase(); build.buf.validate.FloatRules.GreaterThanCase getGreaterThanCase(); diff --git a/src/main/java/build/buf/validate/Ignore.java b/src/main/java/build/buf/validate/Ignore.java index 95b7a16b..9bff5672 100644 --- a/src/main/java/build/buf/validate/Ignore.java +++ b/src/main/java/build/buf/validate/Ignore.java @@ -178,7 +178,6 @@ public enum Ignore * IGNORE_ALWAYS = 3; */ IGNORE_ALWAYS(3), - UNRECOGNIZED(-1), ; static { @@ -388,10 +387,6 @@ public enum Ignore public final int getNumber() { - if (this == UNRECOGNIZED) { - throw new java.lang.IllegalArgumentException( - "Can't get the number of an unknown enum value."); - } return value; } @@ -433,10 +428,6 @@ public Ignore findValueByNumber(int number) { public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { - if (this == UNRECOGNIZED) { - throw new java.lang.IllegalStateException( - "Can't get the descriptor of an unrecognized enum value."); - } return getDescriptor().getValues().get(ordinal()); } public final com.google.protobuf.Descriptors.EnumDescriptor @@ -460,9 +451,6 @@ public static Ignore valueOf( throw new java.lang.IllegalArgumentException( "EnumValueDescriptor is not for this type."); } - if (desc.getIndex() == -1) { - return UNRECOGNIZED; - } return VALUES[desc.getIndex()]; } diff --git a/src/main/java/build/buf/validate/Int32Rules.java b/src/main/java/build/buf/validate/Int32Rules.java index 089c75ea..f984b128 100644 --- a/src/main/java/build/buf/validate/Int32Rules.java +++ b/src/main/java/build/buf/validate/Int32Rules.java @@ -14,7 +14,8 @@ * Protobuf type {@code buf.validate.Int32Rules} */ public final class Int32Rules extends - com.google.protobuf.GeneratedMessage implements + com.google.protobuf.GeneratedMessage.ExtendableMessage< + Int32Rules> implements // @@protoc_insertion_point(message_implements:buf.validate.Int32Rules) Int32RulesOrBuilder { private static final long serialVersionUID = 0L; @@ -28,12 +29,13 @@ public final class Int32Rules extends Int32Rules.class.getName()); } // Use Int32Rules.newBuilder() to construct. - private Int32Rules(com.google.protobuf.GeneratedMessage.Builder builder) { + private Int32Rules(com.google.protobuf.GeneratedMessage.ExtendableBuilder builder) { super(builder); } private Int32Rules() { in_ = emptyIntList(); notIn_ = emptyIntList(); + example_ = emptyIntList(); } public static final com.google.protobuf.Descriptors.Descriptor @@ -149,7 +151,7 @@ public int getNumber() { * ``` * * - * optional int32 const = 1 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional int32 const = 1 [json_name = "const", (.buf.validate.predefined) = { ... } * @return Whether the const field is set. */ @java.lang.Override @@ -169,7 +171,7 @@ public boolean hasConst() { * ``` * * - * optional int32 const = 1 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional int32 const = 1 [json_name = "const", (.buf.validate.predefined) = { ... } * @return The const. */ @java.lang.Override @@ -192,7 +194,7 @@ public int getConst() { * ``` * * - * int32 lt = 2 [json_name = "lt", (.buf.validate.priv.field) = { ... } + * int32 lt = 2 [json_name = "lt", (.buf.validate.predefined) = { ... } * @return Whether the lt field is set. */ @java.lang.Override @@ -213,7 +215,7 @@ public boolean hasLt() { * ``` * * - * int32 lt = 2 [json_name = "lt", (.buf.validate.priv.field) = { ... } + * int32 lt = 2 [json_name = "lt", (.buf.validate.predefined) = { ... } * @return The lt. */ @java.lang.Override @@ -239,7 +241,7 @@ public int getLt() { * ``` * * - * int32 lte = 3 [json_name = "lte", (.buf.validate.priv.field) = { ... } + * int32 lte = 3 [json_name = "lte", (.buf.validate.predefined) = { ... } * @return Whether the lte field is set. */ @java.lang.Override @@ -260,7 +262,7 @@ public boolean hasLte() { * ``` * * - * int32 lte = 3 [json_name = "lte", (.buf.validate.priv.field) = { ... } + * int32 lte = 3 [json_name = "lte", (.buf.validate.predefined) = { ... } * @return The lte. */ @java.lang.Override @@ -294,7 +296,7 @@ public int getLte() { * ``` * * - * int32 gt = 4 [json_name = "gt", (.buf.validate.priv.field) = { ... } + * int32 gt = 4 [json_name = "gt", (.buf.validate.predefined) = { ... } * @return Whether the gt field is set. */ @java.lang.Override @@ -323,7 +325,7 @@ public boolean hasGt() { * ``` * * - * int32 gt = 4 [json_name = "gt", (.buf.validate.priv.field) = { ... } + * int32 gt = 4 [json_name = "gt", (.buf.validate.predefined) = { ... } * @return The gt. */ @java.lang.Override @@ -357,7 +359,7 @@ public int getGt() { * ``` * * - * int32 gte = 5 [json_name = "gte", (.buf.validate.priv.field) = { ... } + * int32 gte = 5 [json_name = "gte", (.buf.validate.predefined) = { ... } * @return Whether the gte field is set. */ @java.lang.Override @@ -386,7 +388,7 @@ public boolean hasGte() { * ``` * * - * int32 gte = 5 [json_name = "gte", (.buf.validate.priv.field) = { ... } + * int32 gte = 5 [json_name = "gte", (.buf.validate.predefined) = { ... } * @return The gte. */ @java.lang.Override @@ -415,7 +417,7 @@ public int getGte() { * ``` * * - * repeated int32 in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated int32 in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @return A list containing the in. */ @java.lang.Override @@ -437,7 +439,7 @@ public int getGte() { * ``` * * - * repeated int32 in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated int32 in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @return The count of in. */ public int getInCount() { @@ -457,14 +459,13 @@ public int getInCount() { * ``` * * - * repeated int32 in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated int32 in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @param index The index of the element to return. * @return The in at the given index. */ public int getIn(int index) { return in_.getInt(index); } - private int inMemoizedSerializedSize = -1; public static final int NOT_IN_FIELD_NUMBER = 7; @SuppressWarnings("serial") @@ -484,7 +485,7 @@ public int getIn(int index) { * ``` * * - * repeated int32 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated int32 not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @return A list containing the notIn. */ @java.lang.Override @@ -506,7 +507,7 @@ public int getIn(int index) { * ``` * * - * repeated int32 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated int32 not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @return The count of notIn. */ public int getNotInCount() { @@ -526,14 +527,87 @@ public int getNotInCount() { * ``` * * - * repeated int32 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated int32 not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @param index The index of the element to return. * @return The notIn at the given index. */ public int getNotIn(int index) { return notIn_.getInt(index); } - private int notInMemoizedSerializedSize = -1; + + public static final int EXAMPLE_FIELD_NUMBER = 8; + @SuppressWarnings("serial") + private com.google.protobuf.Internal.IntList example_ = + emptyIntList(); + /** + *
+   * `example` specifies values that the field may have. These values SHOULD
+   * conform to other constraints. `example` values will not impact validation
+   * but may be used as helpful guidance on how to populate the given field.
+   *
+   * ```proto
+   * message MyInt32 {
+   * int32 value = 1 [
+   * (buf.validate.field).int32.example = 1,
+   * (buf.validate.field).int32.example = -10
+   * ];
+   * }
+   * ```
+   * 
+ * + * repeated int32 example = 8 [json_name = "example", (.buf.validate.predefined) = { ... } + * @return A list containing the example. + */ + @java.lang.Override + public java.util.List + getExampleList() { + return example_; + } + /** + *
+   * `example` specifies values that the field may have. These values SHOULD
+   * conform to other constraints. `example` values will not impact validation
+   * but may be used as helpful guidance on how to populate the given field.
+   *
+   * ```proto
+   * message MyInt32 {
+   * int32 value = 1 [
+   * (buf.validate.field).int32.example = 1,
+   * (buf.validate.field).int32.example = -10
+   * ];
+   * }
+   * ```
+   * 
+ * + * repeated int32 example = 8 [json_name = "example", (.buf.validate.predefined) = { ... } + * @return The count of example. + */ + public int getExampleCount() { + return example_.size(); + } + /** + *
+   * `example` specifies values that the field may have. These values SHOULD
+   * conform to other constraints. `example` values will not impact validation
+   * but may be used as helpful guidance on how to populate the given field.
+   *
+   * ```proto
+   * message MyInt32 {
+   * int32 value = 1 [
+   * (buf.validate.field).int32.example = 1,
+   * (buf.validate.field).int32.example = -10
+   * ];
+   * }
+   * ```
+   * 
+ * + * repeated int32 example = 8 [json_name = "example", (.buf.validate.predefined) = { ... } + * @param index The index of the element to return. + * @return The example at the given index. + */ + public int getExample(int index) { + return example_.getInt(index); + } private byte memoizedIsInitialized = -1; @java.lang.Override @@ -542,6 +616,10 @@ public final boolean isInitialized() { if (isInitialized == 1) return true; if (isInitialized == 0) return false; + if (!extensionsAreInitialized()) { + memoizedIsInitialized = 0; + return false; + } memoizedIsInitialized = 1; return true; } @@ -549,7 +627,9 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - getSerializedSize(); + com.google.protobuf.GeneratedMessage + .ExtendableMessage.ExtensionSerializer + extensionWriter = newExtensionSerializer(); if (((bitField0_ & 0x00000001) != 0)) { output.writeInt32(1, const_); } @@ -569,20 +649,16 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) output.writeInt32( 5, (int)((java.lang.Integer) greaterThan_)); } - if (getInList().size() > 0) { - output.writeUInt32NoTag(50); - output.writeUInt32NoTag(inMemoizedSerializedSize); - } for (int i = 0; i < in_.size(); i++) { - output.writeInt32NoTag(in_.getInt(i)); - } - if (getNotInList().size() > 0) { - output.writeUInt32NoTag(58); - output.writeUInt32NoTag(notInMemoizedSerializedSize); + output.writeInt32(6, in_.getInt(i)); } for (int i = 0; i < notIn_.size(); i++) { - output.writeInt32NoTag(notIn_.getInt(i)); + output.writeInt32(7, notIn_.getInt(i)); + } + for (int i = 0; i < example_.size(); i++) { + output.writeInt32(8, example_.getInt(i)); } + extensionWriter.writeUntil(536870912, output); getUnknownFields().writeTo(output); } @@ -623,12 +699,7 @@ public int getSerializedSize() { .computeInt32SizeNoTag(in_.getInt(i)); } size += dataSize; - if (!getInList().isEmpty()) { - size += 1; - size += com.google.protobuf.CodedOutputStream - .computeInt32SizeNoTag(dataSize); - } - inMemoizedSerializedSize = dataSize; + size += 1 * getInList().size(); } { int dataSize = 0; @@ -637,13 +708,18 @@ public int getSerializedSize() { .computeInt32SizeNoTag(notIn_.getInt(i)); } size += dataSize; - if (!getNotInList().isEmpty()) { - size += 1; - size += com.google.protobuf.CodedOutputStream - .computeInt32SizeNoTag(dataSize); + size += 1 * getNotInList().size(); + } + { + int dataSize = 0; + for (int i = 0; i < example_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream + .computeInt32SizeNoTag(example_.getInt(i)); } - notInMemoizedSerializedSize = dataSize; + size += dataSize; + size += 1 * getExampleList().size(); } + size += extensionsSerializedSize(); size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -668,6 +744,8 @@ public boolean equals(final java.lang.Object obj) { .equals(other.getInList())) return false; if (!getNotInList() .equals(other.getNotInList())) return false; + if (!getExampleList() + .equals(other.getExampleList())) return false; if (!getLessThanCase().equals(other.getLessThanCase())) return false; switch (lessThanCase_) { case 2: @@ -695,6 +773,8 @@ public boolean equals(final java.lang.Object obj) { default: } if (!getUnknownFields().equals(other.getUnknownFields())) return false; + if (!getExtensionFields().equals(other.getExtensionFields())) + return false; return true; } @@ -717,6 +797,10 @@ public int hashCode() { hash = (37 * hash) + NOT_IN_FIELD_NUMBER; hash = (53 * hash) + getNotInList().hashCode(); } + if (getExampleCount() > 0) { + hash = (37 * hash) + EXAMPLE_FIELD_NUMBER; + hash = (53 * hash) + getExampleList().hashCode(); + } switch (lessThanCase_) { case 2: hash = (37 * hash) + LT_FIELD_NUMBER; @@ -741,6 +825,7 @@ public int hashCode() { case 0: default: } + hash = hashFields(hash, getExtensionFields()); hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -847,7 +932,8 @@ protected Builder newBuilderForType( * Protobuf type {@code buf.validate.Int32Rules} */ public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder implements + com.google.protobuf.GeneratedMessage.ExtendableBuilder< + build.buf.validate.Int32Rules, Builder> implements // @@protoc_insertion_point(builder_implements:buf.validate.Int32Rules) build.buf.validate.Int32RulesOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor @@ -880,6 +966,7 @@ public Builder clear() { const_ = 0; in_ = emptyIntList(); notIn_ = emptyIntList(); + example_ = emptyIntList(); lessThanCase_ = 0; lessThan_ = null; greaterThanCase_ = 0; @@ -931,6 +1018,10 @@ private void buildPartial0(build.buf.validate.Int32Rules result) { notIn_.makeImmutable(); result.notIn_ = notIn_; } + if (((from_bitField0_ & 0x00000080) != 0)) { + example_.makeImmutable(); + result.example_ = example_; + } result.bitField0_ |= to_bitField0_; } @@ -978,6 +1069,17 @@ public Builder mergeFrom(build.buf.validate.Int32Rules other) { } onChanged(); } + if (!other.example_.isEmpty()) { + if (example_.isEmpty()) { + example_ = other.example_; + example_.makeImmutable(); + bitField0_ |= 0x00000080; + } else { + ensureExampleIsMutable(); + example_.addAll(other.example_); + } + onChanged(); + } switch (other.getLessThanCase()) { case LT: { setLt(other.getLt()); @@ -1004,6 +1106,7 @@ public Builder mergeFrom(build.buf.validate.Int32Rules other) { break; } } + this.mergeExtensionFields(other); this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -1011,6 +1114,9 @@ public Builder mergeFrom(build.buf.validate.Int32Rules other) { @java.lang.Override public final boolean isInitialized() { + if (!extensionsAreInitialized()) { + return false; + } return true; } @@ -1087,6 +1193,22 @@ public Builder mergeFrom( input.popLimit(limit); break; } // case 58 + case 64: { + int v = input.readInt32(); + ensureExampleIsMutable(); + example_.addInt(v); + break; + } // case 64 + case 66: { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + ensureExampleIsMutable(); + while (input.getBytesUntilLimit() > 0) { + example_.addInt(input.readInt32()); + } + input.popLimit(limit); + break; + } // case 66 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { done = true; // was an endgroup tag @@ -1148,7 +1270,7 @@ public Builder clearGreaterThan() { * ``` * * - * optional int32 const = 1 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional int32 const = 1 [json_name = "const", (.buf.validate.predefined) = { ... } * @return Whether the const field is set. */ @java.lang.Override @@ -1168,7 +1290,7 @@ public boolean hasConst() { * ``` * * - * optional int32 const = 1 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional int32 const = 1 [json_name = "const", (.buf.validate.predefined) = { ... } * @return The const. */ @java.lang.Override @@ -1188,7 +1310,7 @@ public int getConst() { * ``` * * - * optional int32 const = 1 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional int32 const = 1 [json_name = "const", (.buf.validate.predefined) = { ... } * @param value The const to set. * @return This builder for chaining. */ @@ -1212,7 +1334,7 @@ public Builder setConst(int value) { * ``` * * - * optional int32 const = 1 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional int32 const = 1 [json_name = "const", (.buf.validate.predefined) = { ... } * @return This builder for chaining. */ public Builder clearConst() { @@ -1236,7 +1358,7 @@ public Builder clearConst() { * ``` * * - * int32 lt = 2 [json_name = "lt", (.buf.validate.priv.field) = { ... } + * int32 lt = 2 [json_name = "lt", (.buf.validate.predefined) = { ... } * @return Whether the lt field is set. */ public boolean hasLt() { @@ -1256,7 +1378,7 @@ public boolean hasLt() { * ``` * * - * int32 lt = 2 [json_name = "lt", (.buf.validate.priv.field) = { ... } + * int32 lt = 2 [json_name = "lt", (.buf.validate.predefined) = { ... } * @return The lt. */ public int getLt() { @@ -1279,7 +1401,7 @@ public int getLt() { * ``` * * - * int32 lt = 2 [json_name = "lt", (.buf.validate.priv.field) = { ... } + * int32 lt = 2 [json_name = "lt", (.buf.validate.predefined) = { ... } * @param value The lt to set. * @return This builder for chaining. */ @@ -1304,7 +1426,7 @@ public Builder setLt(int value) { * ``` * * - * int32 lt = 2 [json_name = "lt", (.buf.validate.priv.field) = { ... } + * int32 lt = 2 [json_name = "lt", (.buf.validate.predefined) = { ... } * @return This builder for chaining. */ public Builder clearLt() { @@ -1330,7 +1452,7 @@ public Builder clearLt() { * ``` * * - * int32 lte = 3 [json_name = "lte", (.buf.validate.priv.field) = { ... } + * int32 lte = 3 [json_name = "lte", (.buf.validate.predefined) = { ... } * @return Whether the lte field is set. */ public boolean hasLte() { @@ -1350,7 +1472,7 @@ public boolean hasLte() { * ``` * * - * int32 lte = 3 [json_name = "lte", (.buf.validate.priv.field) = { ... } + * int32 lte = 3 [json_name = "lte", (.buf.validate.predefined) = { ... } * @return The lte. */ public int getLte() { @@ -1373,7 +1495,7 @@ public int getLte() { * ``` * * - * int32 lte = 3 [json_name = "lte", (.buf.validate.priv.field) = { ... } + * int32 lte = 3 [json_name = "lte", (.buf.validate.predefined) = { ... } * @param value The lte to set. * @return This builder for chaining. */ @@ -1398,7 +1520,7 @@ public Builder setLte(int value) { * ``` * * - * int32 lte = 3 [json_name = "lte", (.buf.validate.priv.field) = { ... } + * int32 lte = 3 [json_name = "lte", (.buf.validate.predefined) = { ... } * @return This builder for chaining. */ public Builder clearLte() { @@ -1432,7 +1554,7 @@ public Builder clearLte() { * ``` * * - * int32 gt = 4 [json_name = "gt", (.buf.validate.priv.field) = { ... } + * int32 gt = 4 [json_name = "gt", (.buf.validate.predefined) = { ... } * @return Whether the gt field is set. */ public boolean hasGt() { @@ -1460,7 +1582,7 @@ public boolean hasGt() { * ``` * * - * int32 gt = 4 [json_name = "gt", (.buf.validate.priv.field) = { ... } + * int32 gt = 4 [json_name = "gt", (.buf.validate.predefined) = { ... } * @return The gt. */ public int getGt() { @@ -1491,7 +1613,7 @@ public int getGt() { * ``` * * - * int32 gt = 4 [json_name = "gt", (.buf.validate.priv.field) = { ... } + * int32 gt = 4 [json_name = "gt", (.buf.validate.predefined) = { ... } * @param value The gt to set. * @return This builder for chaining. */ @@ -1524,7 +1646,7 @@ public Builder setGt(int value) { * ``` * * - * int32 gt = 4 [json_name = "gt", (.buf.validate.priv.field) = { ... } + * int32 gt = 4 [json_name = "gt", (.buf.validate.predefined) = { ... } * @return This builder for chaining. */ public Builder clearGt() { @@ -1558,7 +1680,7 @@ public Builder clearGt() { * ``` * * - * int32 gte = 5 [json_name = "gte", (.buf.validate.priv.field) = { ... } + * int32 gte = 5 [json_name = "gte", (.buf.validate.predefined) = { ... } * @return Whether the gte field is set. */ public boolean hasGte() { @@ -1586,7 +1708,7 @@ public boolean hasGte() { * ``` * * - * int32 gte = 5 [json_name = "gte", (.buf.validate.priv.field) = { ... } + * int32 gte = 5 [json_name = "gte", (.buf.validate.predefined) = { ... } * @return The gte. */ public int getGte() { @@ -1617,7 +1739,7 @@ public int getGte() { * ``` * * - * int32 gte = 5 [json_name = "gte", (.buf.validate.priv.field) = { ... } + * int32 gte = 5 [json_name = "gte", (.buf.validate.predefined) = { ... } * @param value The gte to set. * @return This builder for chaining. */ @@ -1650,7 +1772,7 @@ public Builder setGte(int value) { * ``` * * - * int32 gte = 5 [json_name = "gte", (.buf.validate.priv.field) = { ... } + * int32 gte = 5 [json_name = "gte", (.buf.validate.predefined) = { ... } * @return This builder for chaining. */ public Builder clearGte() { @@ -1683,7 +1805,7 @@ private void ensureInIsMutable() { * ``` * * - * repeated int32 in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated int32 in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @return A list containing the in. */ public java.util.List @@ -1705,7 +1827,7 @@ private void ensureInIsMutable() { * ``` * * - * repeated int32 in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated int32 in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @return The count of in. */ public int getInCount() { @@ -1725,7 +1847,7 @@ public int getInCount() { * ``` * * - * repeated int32 in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated int32 in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @param index The index of the element to return. * @return The in at the given index. */ @@ -1746,7 +1868,7 @@ public int getIn(int index) { * ``` * * - * repeated int32 in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated int32 in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @param index The index to set the value at. * @param value The in to set. * @return This builder for chaining. @@ -1774,7 +1896,7 @@ public Builder setIn( * ``` * * - * repeated int32 in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated int32 in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @param value The in to add. * @return This builder for chaining. */ @@ -1800,7 +1922,7 @@ public Builder addIn(int value) { * ``` * * - * repeated int32 in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated int32 in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @param values The in to add. * @return This builder for chaining. */ @@ -1827,7 +1949,7 @@ public Builder addAllIn( * ``` * * - * repeated int32 in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated int32 in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @return This builder for chaining. */ public Builder clearIn() { @@ -1858,7 +1980,7 @@ private void ensureNotInIsMutable() { * ``` * * - * repeated int32 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated int32 not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @return A list containing the notIn. */ public java.util.List @@ -1880,7 +2002,7 @@ private void ensureNotInIsMutable() { * ``` * * - * repeated int32 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated int32 not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @return The count of notIn. */ public int getNotInCount() { @@ -1900,7 +2022,7 @@ public int getNotInCount() { * ``` * * - * repeated int32 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated int32 not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @param index The index of the element to return. * @return The notIn at the given index. */ @@ -1921,7 +2043,7 @@ public int getNotIn(int index) { * ``` * * - * repeated int32 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated int32 not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @param index The index to set the value at. * @param value The notIn to set. * @return This builder for chaining. @@ -1949,7 +2071,7 @@ public Builder setNotIn( * ``` * * - * repeated int32 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated int32 not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @param value The notIn to add. * @return This builder for chaining. */ @@ -1975,7 +2097,7 @@ public Builder addNotIn(int value) { * ``` * * - * repeated int32 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated int32 not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @param values The notIn to add. * @return This builder for chaining. */ @@ -2002,7 +2124,7 @@ public Builder addAllNotIn( * ``` * * - * repeated int32 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated int32 not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @return This builder for chaining. */ public Builder clearNotIn() { @@ -2012,6 +2134,195 @@ public Builder clearNotIn() { return this; } + private com.google.protobuf.Internal.IntList example_ = emptyIntList(); + private void ensureExampleIsMutable() { + if (!example_.isModifiable()) { + example_ = makeMutableCopy(example_); + } + bitField0_ |= 0x00000080; + } + /** + *
+     * `example` specifies values that the field may have. These values SHOULD
+     * conform to other constraints. `example` values will not impact validation
+     * but may be used as helpful guidance on how to populate the given field.
+     *
+     * ```proto
+     * message MyInt32 {
+     * int32 value = 1 [
+     * (buf.validate.field).int32.example = 1,
+     * (buf.validate.field).int32.example = -10
+     * ];
+     * }
+     * ```
+     * 
+ * + * repeated int32 example = 8 [json_name = "example", (.buf.validate.predefined) = { ... } + * @return A list containing the example. + */ + public java.util.List + getExampleList() { + example_.makeImmutable(); + return example_; + } + /** + *
+     * `example` specifies values that the field may have. These values SHOULD
+     * conform to other constraints. `example` values will not impact validation
+     * but may be used as helpful guidance on how to populate the given field.
+     *
+     * ```proto
+     * message MyInt32 {
+     * int32 value = 1 [
+     * (buf.validate.field).int32.example = 1,
+     * (buf.validate.field).int32.example = -10
+     * ];
+     * }
+     * ```
+     * 
+ * + * repeated int32 example = 8 [json_name = "example", (.buf.validate.predefined) = { ... } + * @return The count of example. + */ + public int getExampleCount() { + return example_.size(); + } + /** + *
+     * `example` specifies values that the field may have. These values SHOULD
+     * conform to other constraints. `example` values will not impact validation
+     * but may be used as helpful guidance on how to populate the given field.
+     *
+     * ```proto
+     * message MyInt32 {
+     * int32 value = 1 [
+     * (buf.validate.field).int32.example = 1,
+     * (buf.validate.field).int32.example = -10
+     * ];
+     * }
+     * ```
+     * 
+ * + * repeated int32 example = 8 [json_name = "example", (.buf.validate.predefined) = { ... } + * @param index The index of the element to return. + * @return The example at the given index. + */ + public int getExample(int index) { + return example_.getInt(index); + } + /** + *
+     * `example` specifies values that the field may have. These values SHOULD
+     * conform to other constraints. `example` values will not impact validation
+     * but may be used as helpful guidance on how to populate the given field.
+     *
+     * ```proto
+     * message MyInt32 {
+     * int32 value = 1 [
+     * (buf.validate.field).int32.example = 1,
+     * (buf.validate.field).int32.example = -10
+     * ];
+     * }
+     * ```
+     * 
+ * + * repeated int32 example = 8 [json_name = "example", (.buf.validate.predefined) = { ... } + * @param index The index to set the value at. + * @param value The example to set. + * @return This builder for chaining. + */ + public Builder setExample( + int index, int value) { + + ensureExampleIsMutable(); + example_.setInt(index, value); + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + *
+     * `example` specifies values that the field may have. These values SHOULD
+     * conform to other constraints. `example` values will not impact validation
+     * but may be used as helpful guidance on how to populate the given field.
+     *
+     * ```proto
+     * message MyInt32 {
+     * int32 value = 1 [
+     * (buf.validate.field).int32.example = 1,
+     * (buf.validate.field).int32.example = -10
+     * ];
+     * }
+     * ```
+     * 
+ * + * repeated int32 example = 8 [json_name = "example", (.buf.validate.predefined) = { ... } + * @param value The example to add. + * @return This builder for chaining. + */ + public Builder addExample(int value) { + + ensureExampleIsMutable(); + example_.addInt(value); + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + *
+     * `example` specifies values that the field may have. These values SHOULD
+     * conform to other constraints. `example` values will not impact validation
+     * but may be used as helpful guidance on how to populate the given field.
+     *
+     * ```proto
+     * message MyInt32 {
+     * int32 value = 1 [
+     * (buf.validate.field).int32.example = 1,
+     * (buf.validate.field).int32.example = -10
+     * ];
+     * }
+     * ```
+     * 
+ * + * repeated int32 example = 8 [json_name = "example", (.buf.validate.predefined) = { ... } + * @param values The example to add. + * @return This builder for chaining. + */ + public Builder addAllExample( + java.lang.Iterable values) { + ensureExampleIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, example_); + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + *
+     * `example` specifies values that the field may have. These values SHOULD
+     * conform to other constraints. `example` values will not impact validation
+     * but may be used as helpful guidance on how to populate the given field.
+     *
+     * ```proto
+     * message MyInt32 {
+     * int32 value = 1 [
+     * (buf.validate.field).int32.example = 1,
+     * (buf.validate.field).int32.example = -10
+     * ];
+     * }
+     * ```
+     * 
+ * + * repeated int32 example = 8 [json_name = "example", (.buf.validate.predefined) = { ... } + * @return This builder for chaining. + */ + public Builder clearExample() { + example_ = emptyIntList(); + bitField0_ = (bitField0_ & ~0x00000080); + onChanged(); + return this; + } + // @@protoc_insertion_point(builder_scope:buf.validate.Int32Rules) } diff --git a/src/main/java/build/buf/validate/Int32RulesOrBuilder.java b/src/main/java/build/buf/validate/Int32RulesOrBuilder.java index 13d9729a..1b9bfafc 100644 --- a/src/main/java/build/buf/validate/Int32RulesOrBuilder.java +++ b/src/main/java/build/buf/validate/Int32RulesOrBuilder.java @@ -7,7 +7,8 @@ public interface Int32RulesOrBuilder extends // @@protoc_insertion_point(interface_extends:buf.validate.Int32Rules) - com.google.protobuf.MessageOrBuilder { + com.google.protobuf.GeneratedMessage. + ExtendableMessageOrBuilder { /** *
@@ -22,7 +23,7 @@ public interface Int32RulesOrBuilder extends
    * ```
    * 
* - * optional int32 const = 1 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional int32 const = 1 [json_name = "const", (.buf.validate.predefined) = { ... } * @return Whether the const field is set. */ boolean hasConst(); @@ -39,7 +40,7 @@ public interface Int32RulesOrBuilder extends * ``` * * - * optional int32 const = 1 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional int32 const = 1 [json_name = "const", (.buf.validate.predefined) = { ... } * @return The const. */ int getConst(); @@ -58,7 +59,7 @@ public interface Int32RulesOrBuilder extends * ``` * * - * int32 lt = 2 [json_name = "lt", (.buf.validate.priv.field) = { ... } + * int32 lt = 2 [json_name = "lt", (.buf.validate.predefined) = { ... } * @return Whether the lt field is set. */ boolean hasLt(); @@ -76,7 +77,7 @@ public interface Int32RulesOrBuilder extends * ``` * * - * int32 lt = 2 [json_name = "lt", (.buf.validate.priv.field) = { ... } + * int32 lt = 2 [json_name = "lt", (.buf.validate.predefined) = { ... } * @return The lt. */ int getLt(); @@ -95,7 +96,7 @@ public interface Int32RulesOrBuilder extends * ``` * * - * int32 lte = 3 [json_name = "lte", (.buf.validate.priv.field) = { ... } + * int32 lte = 3 [json_name = "lte", (.buf.validate.predefined) = { ... } * @return Whether the lte field is set. */ boolean hasLte(); @@ -113,7 +114,7 @@ public interface Int32RulesOrBuilder extends * ``` * * - * int32 lte = 3 [json_name = "lte", (.buf.validate.priv.field) = { ... } + * int32 lte = 3 [json_name = "lte", (.buf.validate.predefined) = { ... } * @return The lte. */ int getLte(); @@ -140,7 +141,7 @@ public interface Int32RulesOrBuilder extends * ``` * * - * int32 gt = 4 [json_name = "gt", (.buf.validate.priv.field) = { ... } + * int32 gt = 4 [json_name = "gt", (.buf.validate.predefined) = { ... } * @return Whether the gt field is set. */ boolean hasGt(); @@ -166,7 +167,7 @@ public interface Int32RulesOrBuilder extends * ``` * * - * int32 gt = 4 [json_name = "gt", (.buf.validate.priv.field) = { ... } + * int32 gt = 4 [json_name = "gt", (.buf.validate.predefined) = { ... } * @return The gt. */ int getGt(); @@ -193,7 +194,7 @@ public interface Int32RulesOrBuilder extends * ``` * * - * int32 gte = 5 [json_name = "gte", (.buf.validate.priv.field) = { ... } + * int32 gte = 5 [json_name = "gte", (.buf.validate.predefined) = { ... } * @return Whether the gte field is set. */ boolean hasGte(); @@ -219,7 +220,7 @@ public interface Int32RulesOrBuilder extends * ``` * * - * int32 gte = 5 [json_name = "gte", (.buf.validate.priv.field) = { ... } + * int32 gte = 5 [json_name = "gte", (.buf.validate.predefined) = { ... } * @return The gte. */ int getGte(); @@ -238,7 +239,7 @@ public interface Int32RulesOrBuilder extends * ``` * * - * repeated int32 in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated int32 in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @return A list containing the in. */ java.util.List getInList(); @@ -256,7 +257,7 @@ public interface Int32RulesOrBuilder extends * ``` * * - * repeated int32 in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated int32 in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @return The count of in. */ int getInCount(); @@ -274,7 +275,7 @@ public interface Int32RulesOrBuilder extends * ``` * * - * repeated int32 in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated int32 in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @param index The index of the element to return. * @return The in at the given index. */ @@ -294,7 +295,7 @@ public interface Int32RulesOrBuilder extends * ``` * * - * repeated int32 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated int32 not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @return A list containing the notIn. */ java.util.List getNotInList(); @@ -312,7 +313,7 @@ public interface Int32RulesOrBuilder extends * ``` * * - * repeated int32 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated int32 not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @return The count of notIn. */ int getNotInCount(); @@ -330,12 +331,74 @@ public interface Int32RulesOrBuilder extends * ``` * * - * repeated int32 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated int32 not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @param index The index of the element to return. * @return The notIn at the given index. */ int getNotIn(int index); + /** + *
+   * `example` specifies values that the field may have. These values SHOULD
+   * conform to other constraints. `example` values will not impact validation
+   * but may be used as helpful guidance on how to populate the given field.
+   *
+   * ```proto
+   * message MyInt32 {
+   * int32 value = 1 [
+   * (buf.validate.field).int32.example = 1,
+   * (buf.validate.field).int32.example = -10
+   * ];
+   * }
+   * ```
+   * 
+ * + * repeated int32 example = 8 [json_name = "example", (.buf.validate.predefined) = { ... } + * @return A list containing the example. + */ + java.util.List getExampleList(); + /** + *
+   * `example` specifies values that the field may have. These values SHOULD
+   * conform to other constraints. `example` values will not impact validation
+   * but may be used as helpful guidance on how to populate the given field.
+   *
+   * ```proto
+   * message MyInt32 {
+   * int32 value = 1 [
+   * (buf.validate.field).int32.example = 1,
+   * (buf.validate.field).int32.example = -10
+   * ];
+   * }
+   * ```
+   * 
+ * + * repeated int32 example = 8 [json_name = "example", (.buf.validate.predefined) = { ... } + * @return The count of example. + */ + int getExampleCount(); + /** + *
+   * `example` specifies values that the field may have. These values SHOULD
+   * conform to other constraints. `example` values will not impact validation
+   * but may be used as helpful guidance on how to populate the given field.
+   *
+   * ```proto
+   * message MyInt32 {
+   * int32 value = 1 [
+   * (buf.validate.field).int32.example = 1,
+   * (buf.validate.field).int32.example = -10
+   * ];
+   * }
+   * ```
+   * 
+ * + * repeated int32 example = 8 [json_name = "example", (.buf.validate.predefined) = { ... } + * @param index The index of the element to return. + * @return The example at the given index. + */ + int getExample(int index); + build.buf.validate.Int32Rules.LessThanCase getLessThanCase(); build.buf.validate.Int32Rules.GreaterThanCase getGreaterThanCase(); diff --git a/src/main/java/build/buf/validate/Int64Rules.java b/src/main/java/build/buf/validate/Int64Rules.java index b8c7ec8a..2e6989e2 100644 --- a/src/main/java/build/buf/validate/Int64Rules.java +++ b/src/main/java/build/buf/validate/Int64Rules.java @@ -14,7 +14,8 @@ * Protobuf type {@code buf.validate.Int64Rules} */ public final class Int64Rules extends - com.google.protobuf.GeneratedMessage implements + com.google.protobuf.GeneratedMessage.ExtendableMessage< + Int64Rules> implements // @@protoc_insertion_point(message_implements:buf.validate.Int64Rules) Int64RulesOrBuilder { private static final long serialVersionUID = 0L; @@ -28,12 +29,13 @@ public final class Int64Rules extends Int64Rules.class.getName()); } // Use Int64Rules.newBuilder() to construct. - private Int64Rules(com.google.protobuf.GeneratedMessage.Builder builder) { + private Int64Rules(com.google.protobuf.GeneratedMessage.ExtendableBuilder builder) { super(builder); } private Int64Rules() { in_ = emptyLongList(); notIn_ = emptyLongList(); + example_ = emptyLongList(); } public static final com.google.protobuf.Descriptors.Descriptor @@ -149,7 +151,7 @@ public int getNumber() { * ``` * * - * optional int64 const = 1 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional int64 const = 1 [json_name = "const", (.buf.validate.predefined) = { ... } * @return Whether the const field is set. */ @java.lang.Override @@ -169,7 +171,7 @@ public boolean hasConst() { * ``` * * - * optional int64 const = 1 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional int64 const = 1 [json_name = "const", (.buf.validate.predefined) = { ... } * @return The const. */ @java.lang.Override @@ -192,7 +194,7 @@ public long getConst() { * ``` * * - * int64 lt = 2 [json_name = "lt", (.buf.validate.priv.field) = { ... } + * int64 lt = 2 [json_name = "lt", (.buf.validate.predefined) = { ... } * @return Whether the lt field is set. */ @java.lang.Override @@ -213,7 +215,7 @@ public boolean hasLt() { * ``` * * - * int64 lt = 2 [json_name = "lt", (.buf.validate.priv.field) = { ... } + * int64 lt = 2 [json_name = "lt", (.buf.validate.predefined) = { ... } * @return The lt. */ @java.lang.Override @@ -239,7 +241,7 @@ public long getLt() { * ``` * * - * int64 lte = 3 [json_name = "lte", (.buf.validate.priv.field) = { ... } + * int64 lte = 3 [json_name = "lte", (.buf.validate.predefined) = { ... } * @return Whether the lte field is set. */ @java.lang.Override @@ -260,7 +262,7 @@ public boolean hasLte() { * ``` * * - * int64 lte = 3 [json_name = "lte", (.buf.validate.priv.field) = { ... } + * int64 lte = 3 [json_name = "lte", (.buf.validate.predefined) = { ... } * @return The lte. */ @java.lang.Override @@ -294,7 +296,7 @@ public long getLte() { * ``` * * - * int64 gt = 4 [json_name = "gt", (.buf.validate.priv.field) = { ... } + * int64 gt = 4 [json_name = "gt", (.buf.validate.predefined) = { ... } * @return Whether the gt field is set. */ @java.lang.Override @@ -323,7 +325,7 @@ public boolean hasGt() { * ``` * * - * int64 gt = 4 [json_name = "gt", (.buf.validate.priv.field) = { ... } + * int64 gt = 4 [json_name = "gt", (.buf.validate.predefined) = { ... } * @return The gt. */ @java.lang.Override @@ -357,7 +359,7 @@ public long getGt() { * ``` * * - * int64 gte = 5 [json_name = "gte", (.buf.validate.priv.field) = { ... } + * int64 gte = 5 [json_name = "gte", (.buf.validate.predefined) = { ... } * @return Whether the gte field is set. */ @java.lang.Override @@ -386,7 +388,7 @@ public boolean hasGte() { * ``` * * - * int64 gte = 5 [json_name = "gte", (.buf.validate.priv.field) = { ... } + * int64 gte = 5 [json_name = "gte", (.buf.validate.predefined) = { ... } * @return The gte. */ @java.lang.Override @@ -415,7 +417,7 @@ public long getGte() { * ``` * * - * repeated int64 in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated int64 in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @return A list containing the in. */ @java.lang.Override @@ -437,7 +439,7 @@ public long getGte() { * ``` * * - * repeated int64 in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated int64 in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @return The count of in. */ public int getInCount() { @@ -457,14 +459,13 @@ public int getInCount() { * ``` * * - * repeated int64 in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated int64 in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @param index The index of the element to return. * @return The in at the given index. */ public long getIn(int index) { return in_.getLong(index); } - private int inMemoizedSerializedSize = -1; public static final int NOT_IN_FIELD_NUMBER = 7; @SuppressWarnings("serial") @@ -484,7 +485,7 @@ public long getIn(int index) { * ``` * * - * repeated int64 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated int64 not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @return A list containing the notIn. */ @java.lang.Override @@ -506,7 +507,7 @@ public long getIn(int index) { * ``` * * - * repeated int64 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated int64 not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @return The count of notIn. */ public int getNotInCount() { @@ -526,14 +527,87 @@ public int getNotInCount() { * ``` * * - * repeated int64 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated int64 not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @param index The index of the element to return. * @return The notIn at the given index. */ public long getNotIn(int index) { return notIn_.getLong(index); } - private int notInMemoizedSerializedSize = -1; + + public static final int EXAMPLE_FIELD_NUMBER = 9; + @SuppressWarnings("serial") + private com.google.protobuf.Internal.LongList example_ = + emptyLongList(); + /** + *
+   * `example` specifies values that the field may have. These values SHOULD
+   * conform to other constraints. `example` values will not impact validation
+   * but may be used as helpful guidance on how to populate the given field.
+   *
+   * ```proto
+   * message MyInt64 {
+   * int64 value = 1 [
+   * (buf.validate.field).int64.example = 1,
+   * (buf.validate.field).int64.example = -10
+   * ];
+   * }
+   * ```
+   * 
+ * + * repeated int64 example = 9 [json_name = "example", (.buf.validate.predefined) = { ... } + * @return A list containing the example. + */ + @java.lang.Override + public java.util.List + getExampleList() { + return example_; + } + /** + *
+   * `example` specifies values that the field may have. These values SHOULD
+   * conform to other constraints. `example` values will not impact validation
+   * but may be used as helpful guidance on how to populate the given field.
+   *
+   * ```proto
+   * message MyInt64 {
+   * int64 value = 1 [
+   * (buf.validate.field).int64.example = 1,
+   * (buf.validate.field).int64.example = -10
+   * ];
+   * }
+   * ```
+   * 
+ * + * repeated int64 example = 9 [json_name = "example", (.buf.validate.predefined) = { ... } + * @return The count of example. + */ + public int getExampleCount() { + return example_.size(); + } + /** + *
+   * `example` specifies values that the field may have. These values SHOULD
+   * conform to other constraints. `example` values will not impact validation
+   * but may be used as helpful guidance on how to populate the given field.
+   *
+   * ```proto
+   * message MyInt64 {
+   * int64 value = 1 [
+   * (buf.validate.field).int64.example = 1,
+   * (buf.validate.field).int64.example = -10
+   * ];
+   * }
+   * ```
+   * 
+ * + * repeated int64 example = 9 [json_name = "example", (.buf.validate.predefined) = { ... } + * @param index The index of the element to return. + * @return The example at the given index. + */ + public long getExample(int index) { + return example_.getLong(index); + } private byte memoizedIsInitialized = -1; @java.lang.Override @@ -542,6 +616,10 @@ public final boolean isInitialized() { if (isInitialized == 1) return true; if (isInitialized == 0) return false; + if (!extensionsAreInitialized()) { + memoizedIsInitialized = 0; + return false; + } memoizedIsInitialized = 1; return true; } @@ -549,7 +627,9 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - getSerializedSize(); + com.google.protobuf.GeneratedMessage + .ExtendableMessage.ExtensionSerializer + extensionWriter = newExtensionSerializer(); if (((bitField0_ & 0x00000001) != 0)) { output.writeInt64(1, const_); } @@ -569,20 +649,16 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) output.writeInt64( 5, (long)((java.lang.Long) greaterThan_)); } - if (getInList().size() > 0) { - output.writeUInt32NoTag(50); - output.writeUInt32NoTag(inMemoizedSerializedSize); - } for (int i = 0; i < in_.size(); i++) { - output.writeInt64NoTag(in_.getLong(i)); - } - if (getNotInList().size() > 0) { - output.writeUInt32NoTag(58); - output.writeUInt32NoTag(notInMemoizedSerializedSize); + output.writeInt64(6, in_.getLong(i)); } for (int i = 0; i < notIn_.size(); i++) { - output.writeInt64NoTag(notIn_.getLong(i)); + output.writeInt64(7, notIn_.getLong(i)); + } + for (int i = 0; i < example_.size(); i++) { + output.writeInt64(9, example_.getLong(i)); } + extensionWriter.writeUntil(536870912, output); getUnknownFields().writeTo(output); } @@ -623,12 +699,7 @@ public int getSerializedSize() { .computeInt64SizeNoTag(in_.getLong(i)); } size += dataSize; - if (!getInList().isEmpty()) { - size += 1; - size += com.google.protobuf.CodedOutputStream - .computeInt32SizeNoTag(dataSize); - } - inMemoizedSerializedSize = dataSize; + size += 1 * getInList().size(); } { int dataSize = 0; @@ -637,13 +708,18 @@ public int getSerializedSize() { .computeInt64SizeNoTag(notIn_.getLong(i)); } size += dataSize; - if (!getNotInList().isEmpty()) { - size += 1; - size += com.google.protobuf.CodedOutputStream - .computeInt32SizeNoTag(dataSize); + size += 1 * getNotInList().size(); + } + { + int dataSize = 0; + for (int i = 0; i < example_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream + .computeInt64SizeNoTag(example_.getLong(i)); } - notInMemoizedSerializedSize = dataSize; + size += dataSize; + size += 1 * getExampleList().size(); } + size += extensionsSerializedSize(); size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -668,6 +744,8 @@ public boolean equals(final java.lang.Object obj) { .equals(other.getInList())) return false; if (!getNotInList() .equals(other.getNotInList())) return false; + if (!getExampleList() + .equals(other.getExampleList())) return false; if (!getLessThanCase().equals(other.getLessThanCase())) return false; switch (lessThanCase_) { case 2: @@ -695,6 +773,8 @@ public boolean equals(final java.lang.Object obj) { default: } if (!getUnknownFields().equals(other.getUnknownFields())) return false; + if (!getExtensionFields().equals(other.getExtensionFields())) + return false; return true; } @@ -718,6 +798,10 @@ public int hashCode() { hash = (37 * hash) + NOT_IN_FIELD_NUMBER; hash = (53 * hash) + getNotInList().hashCode(); } + if (getExampleCount() > 0) { + hash = (37 * hash) + EXAMPLE_FIELD_NUMBER; + hash = (53 * hash) + getExampleList().hashCode(); + } switch (lessThanCase_) { case 2: hash = (37 * hash) + LT_FIELD_NUMBER; @@ -746,6 +830,7 @@ public int hashCode() { case 0: default: } + hash = hashFields(hash, getExtensionFields()); hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -852,7 +937,8 @@ protected Builder newBuilderForType( * Protobuf type {@code buf.validate.Int64Rules} */ public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder implements + com.google.protobuf.GeneratedMessage.ExtendableBuilder< + build.buf.validate.Int64Rules, Builder> implements // @@protoc_insertion_point(builder_implements:buf.validate.Int64Rules) build.buf.validate.Int64RulesOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor @@ -885,6 +971,7 @@ public Builder clear() { const_ = 0L; in_ = emptyLongList(); notIn_ = emptyLongList(); + example_ = emptyLongList(); lessThanCase_ = 0; lessThan_ = null; greaterThanCase_ = 0; @@ -936,6 +1023,10 @@ private void buildPartial0(build.buf.validate.Int64Rules result) { notIn_.makeImmutable(); result.notIn_ = notIn_; } + if (((from_bitField0_ & 0x00000080) != 0)) { + example_.makeImmutable(); + result.example_ = example_; + } result.bitField0_ |= to_bitField0_; } @@ -983,6 +1074,17 @@ public Builder mergeFrom(build.buf.validate.Int64Rules other) { } onChanged(); } + if (!other.example_.isEmpty()) { + if (example_.isEmpty()) { + example_ = other.example_; + example_.makeImmutable(); + bitField0_ |= 0x00000080; + } else { + ensureExampleIsMutable(); + example_.addAll(other.example_); + } + onChanged(); + } switch (other.getLessThanCase()) { case LT: { setLt(other.getLt()); @@ -1009,6 +1111,7 @@ public Builder mergeFrom(build.buf.validate.Int64Rules other) { break; } } + this.mergeExtensionFields(other); this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -1016,6 +1119,9 @@ public Builder mergeFrom(build.buf.validate.Int64Rules other) { @java.lang.Override public final boolean isInitialized() { + if (!extensionsAreInitialized()) { + return false; + } return true; } @@ -1092,6 +1198,22 @@ public Builder mergeFrom( input.popLimit(limit); break; } // case 58 + case 72: { + long v = input.readInt64(); + ensureExampleIsMutable(); + example_.addLong(v); + break; + } // case 72 + case 74: { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + ensureExampleIsMutable(); + while (input.getBytesUntilLimit() > 0) { + example_.addLong(input.readInt64()); + } + input.popLimit(limit); + break; + } // case 74 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { done = true; // was an endgroup tag @@ -1153,7 +1275,7 @@ public Builder clearGreaterThan() { * ``` * * - * optional int64 const = 1 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional int64 const = 1 [json_name = "const", (.buf.validate.predefined) = { ... } * @return Whether the const field is set. */ @java.lang.Override @@ -1173,7 +1295,7 @@ public boolean hasConst() { * ``` * * - * optional int64 const = 1 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional int64 const = 1 [json_name = "const", (.buf.validate.predefined) = { ... } * @return The const. */ @java.lang.Override @@ -1193,7 +1315,7 @@ public long getConst() { * ``` * * - * optional int64 const = 1 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional int64 const = 1 [json_name = "const", (.buf.validate.predefined) = { ... } * @param value The const to set. * @return This builder for chaining. */ @@ -1217,7 +1339,7 @@ public Builder setConst(long value) { * ``` * * - * optional int64 const = 1 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional int64 const = 1 [json_name = "const", (.buf.validate.predefined) = { ... } * @return This builder for chaining. */ public Builder clearConst() { @@ -1241,7 +1363,7 @@ public Builder clearConst() { * ``` * * - * int64 lt = 2 [json_name = "lt", (.buf.validate.priv.field) = { ... } + * int64 lt = 2 [json_name = "lt", (.buf.validate.predefined) = { ... } * @return Whether the lt field is set. */ public boolean hasLt() { @@ -1261,7 +1383,7 @@ public boolean hasLt() { * ``` * * - * int64 lt = 2 [json_name = "lt", (.buf.validate.priv.field) = { ... } + * int64 lt = 2 [json_name = "lt", (.buf.validate.predefined) = { ... } * @return The lt. */ public long getLt() { @@ -1284,7 +1406,7 @@ public long getLt() { * ``` * * - * int64 lt = 2 [json_name = "lt", (.buf.validate.priv.field) = { ... } + * int64 lt = 2 [json_name = "lt", (.buf.validate.predefined) = { ... } * @param value The lt to set. * @return This builder for chaining. */ @@ -1309,7 +1431,7 @@ public Builder setLt(long value) { * ``` * * - * int64 lt = 2 [json_name = "lt", (.buf.validate.priv.field) = { ... } + * int64 lt = 2 [json_name = "lt", (.buf.validate.predefined) = { ... } * @return This builder for chaining. */ public Builder clearLt() { @@ -1335,7 +1457,7 @@ public Builder clearLt() { * ``` * * - * int64 lte = 3 [json_name = "lte", (.buf.validate.priv.field) = { ... } + * int64 lte = 3 [json_name = "lte", (.buf.validate.predefined) = { ... } * @return Whether the lte field is set. */ public boolean hasLte() { @@ -1355,7 +1477,7 @@ public boolean hasLte() { * ``` * * - * int64 lte = 3 [json_name = "lte", (.buf.validate.priv.field) = { ... } + * int64 lte = 3 [json_name = "lte", (.buf.validate.predefined) = { ... } * @return The lte. */ public long getLte() { @@ -1378,7 +1500,7 @@ public long getLte() { * ``` * * - * int64 lte = 3 [json_name = "lte", (.buf.validate.priv.field) = { ... } + * int64 lte = 3 [json_name = "lte", (.buf.validate.predefined) = { ... } * @param value The lte to set. * @return This builder for chaining. */ @@ -1403,7 +1525,7 @@ public Builder setLte(long value) { * ``` * * - * int64 lte = 3 [json_name = "lte", (.buf.validate.priv.field) = { ... } + * int64 lte = 3 [json_name = "lte", (.buf.validate.predefined) = { ... } * @return This builder for chaining. */ public Builder clearLte() { @@ -1437,7 +1559,7 @@ public Builder clearLte() { * ``` * * - * int64 gt = 4 [json_name = "gt", (.buf.validate.priv.field) = { ... } + * int64 gt = 4 [json_name = "gt", (.buf.validate.predefined) = { ... } * @return Whether the gt field is set. */ public boolean hasGt() { @@ -1465,7 +1587,7 @@ public boolean hasGt() { * ``` * * - * int64 gt = 4 [json_name = "gt", (.buf.validate.priv.field) = { ... } + * int64 gt = 4 [json_name = "gt", (.buf.validate.predefined) = { ... } * @return The gt. */ public long getGt() { @@ -1496,7 +1618,7 @@ public long getGt() { * ``` * * - * int64 gt = 4 [json_name = "gt", (.buf.validate.priv.field) = { ... } + * int64 gt = 4 [json_name = "gt", (.buf.validate.predefined) = { ... } * @param value The gt to set. * @return This builder for chaining. */ @@ -1529,7 +1651,7 @@ public Builder setGt(long value) { * ``` * * - * int64 gt = 4 [json_name = "gt", (.buf.validate.priv.field) = { ... } + * int64 gt = 4 [json_name = "gt", (.buf.validate.predefined) = { ... } * @return This builder for chaining. */ public Builder clearGt() { @@ -1563,7 +1685,7 @@ public Builder clearGt() { * ``` * * - * int64 gte = 5 [json_name = "gte", (.buf.validate.priv.field) = { ... } + * int64 gte = 5 [json_name = "gte", (.buf.validate.predefined) = { ... } * @return Whether the gte field is set. */ public boolean hasGte() { @@ -1591,7 +1713,7 @@ public boolean hasGte() { * ``` * * - * int64 gte = 5 [json_name = "gte", (.buf.validate.priv.field) = { ... } + * int64 gte = 5 [json_name = "gte", (.buf.validate.predefined) = { ... } * @return The gte. */ public long getGte() { @@ -1622,7 +1744,7 @@ public long getGte() { * ``` * * - * int64 gte = 5 [json_name = "gte", (.buf.validate.priv.field) = { ... } + * int64 gte = 5 [json_name = "gte", (.buf.validate.predefined) = { ... } * @param value The gte to set. * @return This builder for chaining. */ @@ -1655,7 +1777,7 @@ public Builder setGte(long value) { * ``` * * - * int64 gte = 5 [json_name = "gte", (.buf.validate.priv.field) = { ... } + * int64 gte = 5 [json_name = "gte", (.buf.validate.predefined) = { ... } * @return This builder for chaining. */ public Builder clearGte() { @@ -1688,7 +1810,7 @@ private void ensureInIsMutable() { * ``` * * - * repeated int64 in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated int64 in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @return A list containing the in. */ public java.util.List @@ -1710,7 +1832,7 @@ private void ensureInIsMutable() { * ``` * * - * repeated int64 in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated int64 in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @return The count of in. */ public int getInCount() { @@ -1730,7 +1852,7 @@ public int getInCount() { * ``` * * - * repeated int64 in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated int64 in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @param index The index of the element to return. * @return The in at the given index. */ @@ -1751,7 +1873,7 @@ public long getIn(int index) { * ``` * * - * repeated int64 in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated int64 in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @param index The index to set the value at. * @param value The in to set. * @return This builder for chaining. @@ -1779,7 +1901,7 @@ public Builder setIn( * ``` * * - * repeated int64 in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated int64 in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @param value The in to add. * @return This builder for chaining. */ @@ -1805,7 +1927,7 @@ public Builder addIn(long value) { * ``` * * - * repeated int64 in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated int64 in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @param values The in to add. * @return This builder for chaining. */ @@ -1832,7 +1954,7 @@ public Builder addAllIn( * ``` * * - * repeated int64 in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated int64 in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @return This builder for chaining. */ public Builder clearIn() { @@ -1863,7 +1985,7 @@ private void ensureNotInIsMutable() { * ``` * * - * repeated int64 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated int64 not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @return A list containing the notIn. */ public java.util.List @@ -1885,7 +2007,7 @@ private void ensureNotInIsMutable() { * ``` * * - * repeated int64 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated int64 not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @return The count of notIn. */ public int getNotInCount() { @@ -1905,7 +2027,7 @@ public int getNotInCount() { * ``` * * - * repeated int64 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated int64 not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @param index The index of the element to return. * @return The notIn at the given index. */ @@ -1926,7 +2048,7 @@ public long getNotIn(int index) { * ``` * * - * repeated int64 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated int64 not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @param index The index to set the value at. * @param value The notIn to set. * @return This builder for chaining. @@ -1954,7 +2076,7 @@ public Builder setNotIn( * ``` * * - * repeated int64 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated int64 not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @param value The notIn to add. * @return This builder for chaining. */ @@ -1980,7 +2102,7 @@ public Builder addNotIn(long value) { * ``` * * - * repeated int64 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated int64 not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @param values The notIn to add. * @return This builder for chaining. */ @@ -2007,7 +2129,7 @@ public Builder addAllNotIn( * ``` * * - * repeated int64 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated int64 not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @return This builder for chaining. */ public Builder clearNotIn() { @@ -2017,6 +2139,195 @@ public Builder clearNotIn() { return this; } + private com.google.protobuf.Internal.LongList example_ = emptyLongList(); + private void ensureExampleIsMutable() { + if (!example_.isModifiable()) { + example_ = makeMutableCopy(example_); + } + bitField0_ |= 0x00000080; + } + /** + *
+     * `example` specifies values that the field may have. These values SHOULD
+     * conform to other constraints. `example` values will not impact validation
+     * but may be used as helpful guidance on how to populate the given field.
+     *
+     * ```proto
+     * message MyInt64 {
+     * int64 value = 1 [
+     * (buf.validate.field).int64.example = 1,
+     * (buf.validate.field).int64.example = -10
+     * ];
+     * }
+     * ```
+     * 
+ * + * repeated int64 example = 9 [json_name = "example", (.buf.validate.predefined) = { ... } + * @return A list containing the example. + */ + public java.util.List + getExampleList() { + example_.makeImmutable(); + return example_; + } + /** + *
+     * `example` specifies values that the field may have. These values SHOULD
+     * conform to other constraints. `example` values will not impact validation
+     * but may be used as helpful guidance on how to populate the given field.
+     *
+     * ```proto
+     * message MyInt64 {
+     * int64 value = 1 [
+     * (buf.validate.field).int64.example = 1,
+     * (buf.validate.field).int64.example = -10
+     * ];
+     * }
+     * ```
+     * 
+ * + * repeated int64 example = 9 [json_name = "example", (.buf.validate.predefined) = { ... } + * @return The count of example. + */ + public int getExampleCount() { + return example_.size(); + } + /** + *
+     * `example` specifies values that the field may have. These values SHOULD
+     * conform to other constraints. `example` values will not impact validation
+     * but may be used as helpful guidance on how to populate the given field.
+     *
+     * ```proto
+     * message MyInt64 {
+     * int64 value = 1 [
+     * (buf.validate.field).int64.example = 1,
+     * (buf.validate.field).int64.example = -10
+     * ];
+     * }
+     * ```
+     * 
+ * + * repeated int64 example = 9 [json_name = "example", (.buf.validate.predefined) = { ... } + * @param index The index of the element to return. + * @return The example at the given index. + */ + public long getExample(int index) { + return example_.getLong(index); + } + /** + *
+     * `example` specifies values that the field may have. These values SHOULD
+     * conform to other constraints. `example` values will not impact validation
+     * but may be used as helpful guidance on how to populate the given field.
+     *
+     * ```proto
+     * message MyInt64 {
+     * int64 value = 1 [
+     * (buf.validate.field).int64.example = 1,
+     * (buf.validate.field).int64.example = -10
+     * ];
+     * }
+     * ```
+     * 
+ * + * repeated int64 example = 9 [json_name = "example", (.buf.validate.predefined) = { ... } + * @param index The index to set the value at. + * @param value The example to set. + * @return This builder for chaining. + */ + public Builder setExample( + int index, long value) { + + ensureExampleIsMutable(); + example_.setLong(index, value); + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + *
+     * `example` specifies values that the field may have. These values SHOULD
+     * conform to other constraints. `example` values will not impact validation
+     * but may be used as helpful guidance on how to populate the given field.
+     *
+     * ```proto
+     * message MyInt64 {
+     * int64 value = 1 [
+     * (buf.validate.field).int64.example = 1,
+     * (buf.validate.field).int64.example = -10
+     * ];
+     * }
+     * ```
+     * 
+ * + * repeated int64 example = 9 [json_name = "example", (.buf.validate.predefined) = { ... } + * @param value The example to add. + * @return This builder for chaining. + */ + public Builder addExample(long value) { + + ensureExampleIsMutable(); + example_.addLong(value); + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + *
+     * `example` specifies values that the field may have. These values SHOULD
+     * conform to other constraints. `example` values will not impact validation
+     * but may be used as helpful guidance on how to populate the given field.
+     *
+     * ```proto
+     * message MyInt64 {
+     * int64 value = 1 [
+     * (buf.validate.field).int64.example = 1,
+     * (buf.validate.field).int64.example = -10
+     * ];
+     * }
+     * ```
+     * 
+ * + * repeated int64 example = 9 [json_name = "example", (.buf.validate.predefined) = { ... } + * @param values The example to add. + * @return This builder for chaining. + */ + public Builder addAllExample( + java.lang.Iterable values) { + ensureExampleIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, example_); + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + *
+     * `example` specifies values that the field may have. These values SHOULD
+     * conform to other constraints. `example` values will not impact validation
+     * but may be used as helpful guidance on how to populate the given field.
+     *
+     * ```proto
+     * message MyInt64 {
+     * int64 value = 1 [
+     * (buf.validate.field).int64.example = 1,
+     * (buf.validate.field).int64.example = -10
+     * ];
+     * }
+     * ```
+     * 
+ * + * repeated int64 example = 9 [json_name = "example", (.buf.validate.predefined) = { ... } + * @return This builder for chaining. + */ + public Builder clearExample() { + example_ = emptyLongList(); + bitField0_ = (bitField0_ & ~0x00000080); + onChanged(); + return this; + } + // @@protoc_insertion_point(builder_scope:buf.validate.Int64Rules) } diff --git a/src/main/java/build/buf/validate/Int64RulesOrBuilder.java b/src/main/java/build/buf/validate/Int64RulesOrBuilder.java index 6c6ce0d8..8accc6e0 100644 --- a/src/main/java/build/buf/validate/Int64RulesOrBuilder.java +++ b/src/main/java/build/buf/validate/Int64RulesOrBuilder.java @@ -7,7 +7,8 @@ public interface Int64RulesOrBuilder extends // @@protoc_insertion_point(interface_extends:buf.validate.Int64Rules) - com.google.protobuf.MessageOrBuilder { + com.google.protobuf.GeneratedMessage. + ExtendableMessageOrBuilder { /** *
@@ -22,7 +23,7 @@ public interface Int64RulesOrBuilder extends
    * ```
    * 
* - * optional int64 const = 1 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional int64 const = 1 [json_name = "const", (.buf.validate.predefined) = { ... } * @return Whether the const field is set. */ boolean hasConst(); @@ -39,7 +40,7 @@ public interface Int64RulesOrBuilder extends * ``` * * - * optional int64 const = 1 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional int64 const = 1 [json_name = "const", (.buf.validate.predefined) = { ... } * @return The const. */ long getConst(); @@ -58,7 +59,7 @@ public interface Int64RulesOrBuilder extends * ``` * * - * int64 lt = 2 [json_name = "lt", (.buf.validate.priv.field) = { ... } + * int64 lt = 2 [json_name = "lt", (.buf.validate.predefined) = { ... } * @return Whether the lt field is set. */ boolean hasLt(); @@ -76,7 +77,7 @@ public interface Int64RulesOrBuilder extends * ``` * * - * int64 lt = 2 [json_name = "lt", (.buf.validate.priv.field) = { ... } + * int64 lt = 2 [json_name = "lt", (.buf.validate.predefined) = { ... } * @return The lt. */ long getLt(); @@ -95,7 +96,7 @@ public interface Int64RulesOrBuilder extends * ``` * * - * int64 lte = 3 [json_name = "lte", (.buf.validate.priv.field) = { ... } + * int64 lte = 3 [json_name = "lte", (.buf.validate.predefined) = { ... } * @return Whether the lte field is set. */ boolean hasLte(); @@ -113,7 +114,7 @@ public interface Int64RulesOrBuilder extends * ``` * * - * int64 lte = 3 [json_name = "lte", (.buf.validate.priv.field) = { ... } + * int64 lte = 3 [json_name = "lte", (.buf.validate.predefined) = { ... } * @return The lte. */ long getLte(); @@ -140,7 +141,7 @@ public interface Int64RulesOrBuilder extends * ``` * * - * int64 gt = 4 [json_name = "gt", (.buf.validate.priv.field) = { ... } + * int64 gt = 4 [json_name = "gt", (.buf.validate.predefined) = { ... } * @return Whether the gt field is set. */ boolean hasGt(); @@ -166,7 +167,7 @@ public interface Int64RulesOrBuilder extends * ``` * * - * int64 gt = 4 [json_name = "gt", (.buf.validate.priv.field) = { ... } + * int64 gt = 4 [json_name = "gt", (.buf.validate.predefined) = { ... } * @return The gt. */ long getGt(); @@ -193,7 +194,7 @@ public interface Int64RulesOrBuilder extends * ``` * * - * int64 gte = 5 [json_name = "gte", (.buf.validate.priv.field) = { ... } + * int64 gte = 5 [json_name = "gte", (.buf.validate.predefined) = { ... } * @return Whether the gte field is set. */ boolean hasGte(); @@ -219,7 +220,7 @@ public interface Int64RulesOrBuilder extends * ``` * * - * int64 gte = 5 [json_name = "gte", (.buf.validate.priv.field) = { ... } + * int64 gte = 5 [json_name = "gte", (.buf.validate.predefined) = { ... } * @return The gte. */ long getGte(); @@ -238,7 +239,7 @@ public interface Int64RulesOrBuilder extends * ``` * * - * repeated int64 in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated int64 in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @return A list containing the in. */ java.util.List getInList(); @@ -256,7 +257,7 @@ public interface Int64RulesOrBuilder extends * ``` * * - * repeated int64 in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated int64 in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @return The count of in. */ int getInCount(); @@ -274,7 +275,7 @@ public interface Int64RulesOrBuilder extends * ``` * * - * repeated int64 in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated int64 in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @param index The index of the element to return. * @return The in at the given index. */ @@ -294,7 +295,7 @@ public interface Int64RulesOrBuilder extends * ``` * * - * repeated int64 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated int64 not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @return A list containing the notIn. */ java.util.List getNotInList(); @@ -312,7 +313,7 @@ public interface Int64RulesOrBuilder extends * ``` * * - * repeated int64 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated int64 not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @return The count of notIn. */ int getNotInCount(); @@ -330,12 +331,74 @@ public interface Int64RulesOrBuilder extends * ``` * * - * repeated int64 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated int64 not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @param index The index of the element to return. * @return The notIn at the given index. */ long getNotIn(int index); + /** + *
+   * `example` specifies values that the field may have. These values SHOULD
+   * conform to other constraints. `example` values will not impact validation
+   * but may be used as helpful guidance on how to populate the given field.
+   *
+   * ```proto
+   * message MyInt64 {
+   * int64 value = 1 [
+   * (buf.validate.field).int64.example = 1,
+   * (buf.validate.field).int64.example = -10
+   * ];
+   * }
+   * ```
+   * 
+ * + * repeated int64 example = 9 [json_name = "example", (.buf.validate.predefined) = { ... } + * @return A list containing the example. + */ + java.util.List getExampleList(); + /** + *
+   * `example` specifies values that the field may have. These values SHOULD
+   * conform to other constraints. `example` values will not impact validation
+   * but may be used as helpful guidance on how to populate the given field.
+   *
+   * ```proto
+   * message MyInt64 {
+   * int64 value = 1 [
+   * (buf.validate.field).int64.example = 1,
+   * (buf.validate.field).int64.example = -10
+   * ];
+   * }
+   * ```
+   * 
+ * + * repeated int64 example = 9 [json_name = "example", (.buf.validate.predefined) = { ... } + * @return The count of example. + */ + int getExampleCount(); + /** + *
+   * `example` specifies values that the field may have. These values SHOULD
+   * conform to other constraints. `example` values will not impact validation
+   * but may be used as helpful guidance on how to populate the given field.
+   *
+   * ```proto
+   * message MyInt64 {
+   * int64 value = 1 [
+   * (buf.validate.field).int64.example = 1,
+   * (buf.validate.field).int64.example = -10
+   * ];
+   * }
+   * ```
+   * 
+ * + * repeated int64 example = 9 [json_name = "example", (.buf.validate.predefined) = { ... } + * @param index The index of the element to return. + * @return The example at the given index. + */ + long getExample(int index); + build.buf.validate.Int64Rules.LessThanCase getLessThanCase(); build.buf.validate.Int64Rules.GreaterThanCase getGreaterThanCase(); diff --git a/src/main/java/build/buf/validate/KnownRegex.java b/src/main/java/build/buf/validate/KnownRegex.java index 03c6abb7..7ee2c5b8 100644 --- a/src/main/java/build/buf/validate/KnownRegex.java +++ b/src/main/java/build/buf/validate/KnownRegex.java @@ -34,7 +34,6 @@ public enum KnownRegex * KNOWN_REGEX_HTTP_HEADER_VALUE = 2; */ KNOWN_REGEX_HTTP_HEADER_VALUE(2), - UNRECOGNIZED(-1), ; static { @@ -69,10 +68,6 @@ public enum KnownRegex public final int getNumber() { - if (this == UNRECOGNIZED) { - throw new java.lang.IllegalArgumentException( - "Can't get the number of an unknown enum value."); - } return value; } @@ -113,10 +108,6 @@ public KnownRegex findValueByNumber(int number) { public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { - if (this == UNRECOGNIZED) { - throw new java.lang.IllegalStateException( - "Can't get the descriptor of an unrecognized enum value."); - } return getDescriptor().getValues().get(ordinal()); } public final com.google.protobuf.Descriptors.EnumDescriptor @@ -136,9 +127,6 @@ public static KnownRegex valueOf( throw new java.lang.IllegalArgumentException( "EnumValueDescriptor is not for this type."); } - if (desc.getIndex() == -1) { - return UNRECOGNIZED; - } return VALUES[desc.getIndex()]; } diff --git a/src/main/java/build/buf/validate/MapRules.java b/src/main/java/build/buf/validate/MapRules.java index 1e7c4cf8..5839d869 100644 --- a/src/main/java/build/buf/validate/MapRules.java +++ b/src/main/java/build/buf/validate/MapRules.java @@ -13,7 +13,8 @@ * Protobuf type {@code buf.validate.MapRules} */ public final class MapRules extends - com.google.protobuf.GeneratedMessage implements + com.google.protobuf.GeneratedMessage.ExtendableMessage< + MapRules> implements // @@protoc_insertion_point(message_implements:buf.validate.MapRules) MapRulesOrBuilder { private static final long serialVersionUID = 0L; @@ -27,7 +28,7 @@ public final class MapRules extends MapRules.class.getName()); } // Use MapRules.newBuilder() to construct. - private MapRules(com.google.protobuf.GeneratedMessage.Builder builder) { + private MapRules(com.google.protobuf.GeneratedMessage.ExtendableBuilder builder) { super(builder); } private MapRules() { @@ -62,7 +63,7 @@ private MapRules() { * ``` * * - * optional uint64 min_pairs = 1 [json_name = "minPairs", (.buf.validate.priv.field) = { ... } + * optional uint64 min_pairs = 1 [json_name = "minPairs", (.buf.validate.predefined) = { ... } * @return Whether the minPairs field is set. */ @java.lang.Override @@ -82,7 +83,7 @@ public boolean hasMinPairs() { * ``` * * - * optional uint64 min_pairs = 1 [json_name = "minPairs", (.buf.validate.priv.field) = { ... } + * optional uint64 min_pairs = 1 [json_name = "minPairs", (.buf.validate.predefined) = { ... } * @return The minPairs. */ @java.lang.Override @@ -105,7 +106,7 @@ public long getMinPairs() { * ``` * * - * optional uint64 max_pairs = 2 [json_name = "maxPairs", (.buf.validate.priv.field) = { ... } + * optional uint64 max_pairs = 2 [json_name = "maxPairs", (.buf.validate.predefined) = { ... } * @return Whether the maxPairs field is set. */ @java.lang.Override @@ -125,7 +126,7 @@ public boolean hasMaxPairs() { * ``` * * - * optional uint64 max_pairs = 2 [json_name = "maxPairs", (.buf.validate.priv.field) = { ... } + * optional uint64 max_pairs = 2 [json_name = "maxPairs", (.buf.validate.predefined) = { ... } * @return The maxPairs. */ @java.lang.Override @@ -294,6 +295,22 @@ public final boolean isInitialized() { if (isInitialized == 1) return true; if (isInitialized == 0) return false; + if (hasKeys()) { + if (!getKeys().isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + if (hasValues()) { + if (!getValues().isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + if (!extensionsAreInitialized()) { + memoizedIsInitialized = 0; + return false; + } memoizedIsInitialized = 1; return true; } @@ -301,6 +318,9 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + com.google.protobuf.GeneratedMessage + .ExtendableMessage.ExtensionSerializer + extensionWriter = newExtensionSerializer(); if (((bitField0_ & 0x00000001) != 0)) { output.writeUInt64(1, minPairs_); } @@ -313,6 +333,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) if (((bitField0_ & 0x00000008) != 0)) { output.writeMessage(5, getValues()); } + extensionWriter.writeUntil(536870912, output); getUnknownFields().writeTo(output); } @@ -338,6 +359,7 @@ public int getSerializedSize() { size += com.google.protobuf.CodedOutputStream .computeMessageSize(5, getValues()); } + size += extensionsSerializedSize(); size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -374,6 +396,8 @@ public boolean equals(final java.lang.Object obj) { .equals(other.getValues())) return false; } if (!getUnknownFields().equals(other.getUnknownFields())) return false; + if (!getExtensionFields().equals(other.getExtensionFields())) + return false; return true; } @@ -402,6 +426,7 @@ public int hashCode() { hash = (37 * hash) + VALUES_FIELD_NUMBER; hash = (53 * hash) + getValues().hashCode(); } + hash = hashFields(hash, getExtensionFields()); hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -507,7 +532,8 @@ protected Builder newBuilderForType( * Protobuf type {@code buf.validate.MapRules} */ public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder implements + com.google.protobuf.GeneratedMessage.ExtendableBuilder< + build.buf.validate.MapRules, Builder> implements // @@protoc_insertion_point(builder_implements:buf.validate.MapRules) build.buf.validate.MapRulesOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor @@ -637,6 +663,7 @@ public Builder mergeFrom(build.buf.validate.MapRules other) { if (other.hasValues()) { mergeValues(other.getValues()); } + this.mergeExtensionFields(other); this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -644,6 +671,19 @@ public Builder mergeFrom(build.buf.validate.MapRules other) { @java.lang.Override public final boolean isInitialized() { + if (hasKeys()) { + if (!getKeys().isInitialized()) { + return false; + } + } + if (hasValues()) { + if (!getValues().isInitialized()) { + return false; + } + } + if (!extensionsAreInitialized()) { + return false; + } return true; } @@ -718,7 +758,7 @@ public Builder mergeFrom( * ``` * * - * optional uint64 min_pairs = 1 [json_name = "minPairs", (.buf.validate.priv.field) = { ... } + * optional uint64 min_pairs = 1 [json_name = "minPairs", (.buf.validate.predefined) = { ... } * @return Whether the minPairs field is set. */ @java.lang.Override @@ -738,7 +778,7 @@ public boolean hasMinPairs() { * ``` * * - * optional uint64 min_pairs = 1 [json_name = "minPairs", (.buf.validate.priv.field) = { ... } + * optional uint64 min_pairs = 1 [json_name = "minPairs", (.buf.validate.predefined) = { ... } * @return The minPairs. */ @java.lang.Override @@ -758,7 +798,7 @@ public long getMinPairs() { * ``` * * - * optional uint64 min_pairs = 1 [json_name = "minPairs", (.buf.validate.priv.field) = { ... } + * optional uint64 min_pairs = 1 [json_name = "minPairs", (.buf.validate.predefined) = { ... } * @param value The minPairs to set. * @return This builder for chaining. */ @@ -782,7 +822,7 @@ public Builder setMinPairs(long value) { * ``` * * - * optional uint64 min_pairs = 1 [json_name = "minPairs", (.buf.validate.priv.field) = { ... } + * optional uint64 min_pairs = 1 [json_name = "minPairs", (.buf.validate.predefined) = { ... } * @return This builder for chaining. */ public Builder clearMinPairs() { @@ -806,7 +846,7 @@ public Builder clearMinPairs() { * ``` * * - * optional uint64 max_pairs = 2 [json_name = "maxPairs", (.buf.validate.priv.field) = { ... } + * optional uint64 max_pairs = 2 [json_name = "maxPairs", (.buf.validate.predefined) = { ... } * @return Whether the maxPairs field is set. */ @java.lang.Override @@ -826,7 +866,7 @@ public boolean hasMaxPairs() { * ``` * * - * optional uint64 max_pairs = 2 [json_name = "maxPairs", (.buf.validate.priv.field) = { ... } + * optional uint64 max_pairs = 2 [json_name = "maxPairs", (.buf.validate.predefined) = { ... } * @return The maxPairs. */ @java.lang.Override @@ -846,7 +886,7 @@ public long getMaxPairs() { * ``` * * - * optional uint64 max_pairs = 2 [json_name = "maxPairs", (.buf.validate.priv.field) = { ... } + * optional uint64 max_pairs = 2 [json_name = "maxPairs", (.buf.validate.predefined) = { ... } * @param value The maxPairs to set. * @return This builder for chaining. */ @@ -870,7 +910,7 @@ public Builder setMaxPairs(long value) { * ``` * * - * optional uint64 max_pairs = 2 [json_name = "maxPairs", (.buf.validate.priv.field) = { ... } + * optional uint64 max_pairs = 2 [json_name = "maxPairs", (.buf.validate.predefined) = { ... } * @return This builder for chaining. */ public Builder clearMaxPairs() { diff --git a/src/main/java/build/buf/validate/MapRulesOrBuilder.java b/src/main/java/build/buf/validate/MapRulesOrBuilder.java index 8408f5ba..548fb1de 100644 --- a/src/main/java/build/buf/validate/MapRulesOrBuilder.java +++ b/src/main/java/build/buf/validate/MapRulesOrBuilder.java @@ -7,7 +7,8 @@ public interface MapRulesOrBuilder extends // @@protoc_insertion_point(interface_extends:buf.validate.MapRules) - com.google.protobuf.MessageOrBuilder { + com.google.protobuf.GeneratedMessage. + ExtendableMessageOrBuilder { /** *
@@ -22,7 +23,7 @@ public interface MapRulesOrBuilder extends
    * ```
    * 
* - * optional uint64 min_pairs = 1 [json_name = "minPairs", (.buf.validate.priv.field) = { ... } + * optional uint64 min_pairs = 1 [json_name = "minPairs", (.buf.validate.predefined) = { ... } * @return Whether the minPairs field is set. */ boolean hasMinPairs(); @@ -39,7 +40,7 @@ public interface MapRulesOrBuilder extends * ``` * * - * optional uint64 min_pairs = 1 [json_name = "minPairs", (.buf.validate.priv.field) = { ... } + * optional uint64 min_pairs = 1 [json_name = "minPairs", (.buf.validate.predefined) = { ... } * @return The minPairs. */ long getMinPairs(); @@ -57,7 +58,7 @@ public interface MapRulesOrBuilder extends * ``` * * - * optional uint64 max_pairs = 2 [json_name = "maxPairs", (.buf.validate.priv.field) = { ... } + * optional uint64 max_pairs = 2 [json_name = "maxPairs", (.buf.validate.predefined) = { ... } * @return Whether the maxPairs field is set. */ boolean hasMaxPairs(); @@ -74,7 +75,7 @@ public interface MapRulesOrBuilder extends * ``` * * - * optional uint64 max_pairs = 2 [json_name = "maxPairs", (.buf.validate.priv.field) = { ... } + * optional uint64 max_pairs = 2 [json_name = "maxPairs", (.buf.validate.predefined) = { ... } * @return The maxPairs. */ long getMaxPairs(); diff --git a/src/main/java/build/buf/validate/PredefinedConstraints.java b/src/main/java/build/buf/validate/PredefinedConstraints.java new file mode 100644 index 00000000..dcb26503 --- /dev/null +++ b/src/main/java/build/buf/validate/PredefinedConstraints.java @@ -0,0 +1,1120 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/validate.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate; + +/** + *
+ * PredefinedConstraints are custom constraints that can be re-used with
+ * multiple fields.
+ * 
+ * + * Protobuf type {@code buf.validate.PredefinedConstraints} + */ +public final class PredefinedConstraints extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:buf.validate.PredefinedConstraints) + PredefinedConstraintsOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 1, + /* suffix= */ "", + PredefinedConstraints.class.getName()); + } + // Use PredefinedConstraints.newBuilder() to construct. + private PredefinedConstraints(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private PredefinedConstraints() { + cel_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.ValidateProto.internal_static_buf_validate_PredefinedConstraints_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.ValidateProto.internal_static_buf_validate_PredefinedConstraints_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.PredefinedConstraints.class, build.buf.validate.PredefinedConstraints.Builder.class); + } + + public static final int CEL_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private java.util.List cel_; + /** + *
+   * `cel` is a repeated field used to represent a textual expression
+   * in the Common Expression Language (CEL) syntax. For more information on
+   * CEL, [see our documentation](https://github.com/bufbuild/protovalidate/blob/main/docs/cel.md).
+   *
+   * ```proto
+   * message MyMessage {
+   * // The field `value` must be greater than 42.
+   * optional int32 value = 1 [(buf.validate.predefined).cel = {
+   * id: "my_message.value",
+   * message: "value must be greater than 42",
+   * expression: "this > 42",
+   * }];
+   * }
+   * ```
+   * 
+ * + * repeated .buf.validate.Constraint cel = 1 [json_name = "cel"]; + */ + @java.lang.Override + public java.util.List getCelList() { + return cel_; + } + /** + *
+   * `cel` is a repeated field used to represent a textual expression
+   * in the Common Expression Language (CEL) syntax. For more information on
+   * CEL, [see our documentation](https://github.com/bufbuild/protovalidate/blob/main/docs/cel.md).
+   *
+   * ```proto
+   * message MyMessage {
+   * // The field `value` must be greater than 42.
+   * optional int32 value = 1 [(buf.validate.predefined).cel = {
+   * id: "my_message.value",
+   * message: "value must be greater than 42",
+   * expression: "this > 42",
+   * }];
+   * }
+   * ```
+   * 
+ * + * repeated .buf.validate.Constraint cel = 1 [json_name = "cel"]; + */ + @java.lang.Override + public java.util.List + getCelOrBuilderList() { + return cel_; + } + /** + *
+   * `cel` is a repeated field used to represent a textual expression
+   * in the Common Expression Language (CEL) syntax. For more information on
+   * CEL, [see our documentation](https://github.com/bufbuild/protovalidate/blob/main/docs/cel.md).
+   *
+   * ```proto
+   * message MyMessage {
+   * // The field `value` must be greater than 42.
+   * optional int32 value = 1 [(buf.validate.predefined).cel = {
+   * id: "my_message.value",
+   * message: "value must be greater than 42",
+   * expression: "this > 42",
+   * }];
+   * }
+   * ```
+   * 
+ * + * repeated .buf.validate.Constraint cel = 1 [json_name = "cel"]; + */ + @java.lang.Override + public int getCelCount() { + return cel_.size(); + } + /** + *
+   * `cel` is a repeated field used to represent a textual expression
+   * in the Common Expression Language (CEL) syntax. For more information on
+   * CEL, [see our documentation](https://github.com/bufbuild/protovalidate/blob/main/docs/cel.md).
+   *
+   * ```proto
+   * message MyMessage {
+   * // The field `value` must be greater than 42.
+   * optional int32 value = 1 [(buf.validate.predefined).cel = {
+   * id: "my_message.value",
+   * message: "value must be greater than 42",
+   * expression: "this > 42",
+   * }];
+   * }
+   * ```
+   * 
+ * + * repeated .buf.validate.Constraint cel = 1 [json_name = "cel"]; + */ + @java.lang.Override + public build.buf.validate.Constraint getCel(int index) { + return cel_.get(index); + } + /** + *
+   * `cel` is a repeated field used to represent a textual expression
+   * in the Common Expression Language (CEL) syntax. For more information on
+   * CEL, [see our documentation](https://github.com/bufbuild/protovalidate/blob/main/docs/cel.md).
+   *
+   * ```proto
+   * message MyMessage {
+   * // The field `value` must be greater than 42.
+   * optional int32 value = 1 [(buf.validate.predefined).cel = {
+   * id: "my_message.value",
+   * message: "value must be greater than 42",
+   * expression: "this > 42",
+   * }];
+   * }
+   * ```
+   * 
+ * + * repeated .buf.validate.Constraint cel = 1 [json_name = "cel"]; + */ + @java.lang.Override + public build.buf.validate.ConstraintOrBuilder getCelOrBuilder( + int index) { + return cel_.get(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 < cel_.size(); i++) { + output.writeMessage(1, cel_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < cel_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, cel_.get(i)); + } + 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.PredefinedConstraints)) { + return super.equals(obj); + } + build.buf.validate.PredefinedConstraints other = (build.buf.validate.PredefinedConstraints) obj; + + if (!getCelList() + .equals(other.getCelList())) 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 (getCelCount() > 0) { + hash = (37 * hash) + CEL_FIELD_NUMBER; + hash = (53 * hash) + getCelList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.PredefinedConstraints parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.PredefinedConstraints 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.PredefinedConstraints parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.PredefinedConstraints 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.PredefinedConstraints parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.PredefinedConstraints parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.PredefinedConstraints parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.PredefinedConstraints 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.PredefinedConstraints parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.PredefinedConstraints 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.PredefinedConstraints parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.PredefinedConstraints 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.PredefinedConstraints 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; + } + /** + *
+   * PredefinedConstraints are custom constraints that can be re-used with
+   * multiple fields.
+   * 
+ * + * Protobuf type {@code buf.validate.PredefinedConstraints} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.PredefinedConstraints) + build.buf.validate.PredefinedConstraintsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.ValidateProto.internal_static_buf_validate_PredefinedConstraints_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.ValidateProto.internal_static_buf_validate_PredefinedConstraints_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.PredefinedConstraints.class, build.buf.validate.PredefinedConstraints.Builder.class); + } + + // Construct using build.buf.validate.PredefinedConstraints.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (celBuilder_ == null) { + cel_ = java.util.Collections.emptyList(); + } else { + cel_ = null; + celBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.ValidateProto.internal_static_buf_validate_PredefinedConstraints_descriptor; + } + + @java.lang.Override + public build.buf.validate.PredefinedConstraints getDefaultInstanceForType() { + return build.buf.validate.PredefinedConstraints.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.PredefinedConstraints build() { + build.buf.validate.PredefinedConstraints result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.PredefinedConstraints buildPartial() { + build.buf.validate.PredefinedConstraints result = new build.buf.validate.PredefinedConstraints(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(build.buf.validate.PredefinedConstraints result) { + if (celBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + cel_ = java.util.Collections.unmodifiableList(cel_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.cel_ = cel_; + } else { + result.cel_ = celBuilder_.build(); + } + } + + private void buildPartial0(build.buf.validate.PredefinedConstraints result) { + int from_bitField0_ = bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof build.buf.validate.PredefinedConstraints) { + return mergeFrom((build.buf.validate.PredefinedConstraints)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.PredefinedConstraints other) { + if (other == build.buf.validate.PredefinedConstraints.getDefaultInstance()) return this; + if (celBuilder_ == null) { + if (!other.cel_.isEmpty()) { + if (cel_.isEmpty()) { + cel_ = other.cel_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureCelIsMutable(); + cel_.addAll(other.cel_); + } + onChanged(); + } + } else { + if (!other.cel_.isEmpty()) { + if (celBuilder_.isEmpty()) { + celBuilder_.dispose(); + celBuilder_ = null; + cel_ = other.cel_; + bitField0_ = (bitField0_ & ~0x00000001); + celBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getCelFieldBuilder() : null; + } else { + celBuilder_.addAllMessages(other.cel_); + } + } + } + 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: { + build.buf.validate.Constraint m = + input.readMessage( + build.buf.validate.Constraint.parser(), + extensionRegistry); + if (celBuilder_ == null) { + ensureCelIsMutable(); + cel_.add(m); + } else { + celBuilder_.addMessage(m); + } + 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.util.List cel_ = + java.util.Collections.emptyList(); + private void ensureCelIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + cel_ = new java.util.ArrayList(cel_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + build.buf.validate.Constraint, build.buf.validate.Constraint.Builder, build.buf.validate.ConstraintOrBuilder> celBuilder_; + + /** + *
+     * `cel` is a repeated field used to represent a textual expression
+     * in the Common Expression Language (CEL) syntax. For more information on
+     * CEL, [see our documentation](https://github.com/bufbuild/protovalidate/blob/main/docs/cel.md).
+     *
+     * ```proto
+     * message MyMessage {
+     * // The field `value` must be greater than 42.
+     * optional int32 value = 1 [(buf.validate.predefined).cel = {
+     * id: "my_message.value",
+     * message: "value must be greater than 42",
+     * expression: "this > 42",
+     * }];
+     * }
+     * ```
+     * 
+ * + * repeated .buf.validate.Constraint cel = 1 [json_name = "cel"]; + */ + public java.util.List getCelList() { + if (celBuilder_ == null) { + return java.util.Collections.unmodifiableList(cel_); + } else { + return celBuilder_.getMessageList(); + } + } + /** + *
+     * `cel` is a repeated field used to represent a textual expression
+     * in the Common Expression Language (CEL) syntax. For more information on
+     * CEL, [see our documentation](https://github.com/bufbuild/protovalidate/blob/main/docs/cel.md).
+     *
+     * ```proto
+     * message MyMessage {
+     * // The field `value` must be greater than 42.
+     * optional int32 value = 1 [(buf.validate.predefined).cel = {
+     * id: "my_message.value",
+     * message: "value must be greater than 42",
+     * expression: "this > 42",
+     * }];
+     * }
+     * ```
+     * 
+ * + * repeated .buf.validate.Constraint cel = 1 [json_name = "cel"]; + */ + public int getCelCount() { + if (celBuilder_ == null) { + return cel_.size(); + } else { + return celBuilder_.getCount(); + } + } + /** + *
+     * `cel` is a repeated field used to represent a textual expression
+     * in the Common Expression Language (CEL) syntax. For more information on
+     * CEL, [see our documentation](https://github.com/bufbuild/protovalidate/blob/main/docs/cel.md).
+     *
+     * ```proto
+     * message MyMessage {
+     * // The field `value` must be greater than 42.
+     * optional int32 value = 1 [(buf.validate.predefined).cel = {
+     * id: "my_message.value",
+     * message: "value must be greater than 42",
+     * expression: "this > 42",
+     * }];
+     * }
+     * ```
+     * 
+ * + * repeated .buf.validate.Constraint cel = 1 [json_name = "cel"]; + */ + public build.buf.validate.Constraint getCel(int index) { + if (celBuilder_ == null) { + return cel_.get(index); + } else { + return celBuilder_.getMessage(index); + } + } + /** + *
+     * `cel` is a repeated field used to represent a textual expression
+     * in the Common Expression Language (CEL) syntax. For more information on
+     * CEL, [see our documentation](https://github.com/bufbuild/protovalidate/blob/main/docs/cel.md).
+     *
+     * ```proto
+     * message MyMessage {
+     * // The field `value` must be greater than 42.
+     * optional int32 value = 1 [(buf.validate.predefined).cel = {
+     * id: "my_message.value",
+     * message: "value must be greater than 42",
+     * expression: "this > 42",
+     * }];
+     * }
+     * ```
+     * 
+ * + * repeated .buf.validate.Constraint cel = 1 [json_name = "cel"]; + */ + public Builder setCel( + int index, build.buf.validate.Constraint value) { + if (celBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCelIsMutable(); + cel_.set(index, value); + onChanged(); + } else { + celBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * `cel` is a repeated field used to represent a textual expression
+     * in the Common Expression Language (CEL) syntax. For more information on
+     * CEL, [see our documentation](https://github.com/bufbuild/protovalidate/blob/main/docs/cel.md).
+     *
+     * ```proto
+     * message MyMessage {
+     * // The field `value` must be greater than 42.
+     * optional int32 value = 1 [(buf.validate.predefined).cel = {
+     * id: "my_message.value",
+     * message: "value must be greater than 42",
+     * expression: "this > 42",
+     * }];
+     * }
+     * ```
+     * 
+ * + * repeated .buf.validate.Constraint cel = 1 [json_name = "cel"]; + */ + public Builder setCel( + int index, build.buf.validate.Constraint.Builder builderForValue) { + if (celBuilder_ == null) { + ensureCelIsMutable(); + cel_.set(index, builderForValue.build()); + onChanged(); + } else { + celBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * `cel` is a repeated field used to represent a textual expression
+     * in the Common Expression Language (CEL) syntax. For more information on
+     * CEL, [see our documentation](https://github.com/bufbuild/protovalidate/blob/main/docs/cel.md).
+     *
+     * ```proto
+     * message MyMessage {
+     * // The field `value` must be greater than 42.
+     * optional int32 value = 1 [(buf.validate.predefined).cel = {
+     * id: "my_message.value",
+     * message: "value must be greater than 42",
+     * expression: "this > 42",
+     * }];
+     * }
+     * ```
+     * 
+ * + * repeated .buf.validate.Constraint cel = 1 [json_name = "cel"]; + */ + public Builder addCel(build.buf.validate.Constraint value) { + if (celBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCelIsMutable(); + cel_.add(value); + onChanged(); + } else { + celBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * `cel` is a repeated field used to represent a textual expression
+     * in the Common Expression Language (CEL) syntax. For more information on
+     * CEL, [see our documentation](https://github.com/bufbuild/protovalidate/blob/main/docs/cel.md).
+     *
+     * ```proto
+     * message MyMessage {
+     * // The field `value` must be greater than 42.
+     * optional int32 value = 1 [(buf.validate.predefined).cel = {
+     * id: "my_message.value",
+     * message: "value must be greater than 42",
+     * expression: "this > 42",
+     * }];
+     * }
+     * ```
+     * 
+ * + * repeated .buf.validate.Constraint cel = 1 [json_name = "cel"]; + */ + public Builder addCel( + int index, build.buf.validate.Constraint value) { + if (celBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCelIsMutable(); + cel_.add(index, value); + onChanged(); + } else { + celBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * `cel` is a repeated field used to represent a textual expression
+     * in the Common Expression Language (CEL) syntax. For more information on
+     * CEL, [see our documentation](https://github.com/bufbuild/protovalidate/blob/main/docs/cel.md).
+     *
+     * ```proto
+     * message MyMessage {
+     * // The field `value` must be greater than 42.
+     * optional int32 value = 1 [(buf.validate.predefined).cel = {
+     * id: "my_message.value",
+     * message: "value must be greater than 42",
+     * expression: "this > 42",
+     * }];
+     * }
+     * ```
+     * 
+ * + * repeated .buf.validate.Constraint cel = 1 [json_name = "cel"]; + */ + public Builder addCel( + build.buf.validate.Constraint.Builder builderForValue) { + if (celBuilder_ == null) { + ensureCelIsMutable(); + cel_.add(builderForValue.build()); + onChanged(); + } else { + celBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * `cel` is a repeated field used to represent a textual expression
+     * in the Common Expression Language (CEL) syntax. For more information on
+     * CEL, [see our documentation](https://github.com/bufbuild/protovalidate/blob/main/docs/cel.md).
+     *
+     * ```proto
+     * message MyMessage {
+     * // The field `value` must be greater than 42.
+     * optional int32 value = 1 [(buf.validate.predefined).cel = {
+     * id: "my_message.value",
+     * message: "value must be greater than 42",
+     * expression: "this > 42",
+     * }];
+     * }
+     * ```
+     * 
+ * + * repeated .buf.validate.Constraint cel = 1 [json_name = "cel"]; + */ + public Builder addCel( + int index, build.buf.validate.Constraint.Builder builderForValue) { + if (celBuilder_ == null) { + ensureCelIsMutable(); + cel_.add(index, builderForValue.build()); + onChanged(); + } else { + celBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * `cel` is a repeated field used to represent a textual expression
+     * in the Common Expression Language (CEL) syntax. For more information on
+     * CEL, [see our documentation](https://github.com/bufbuild/protovalidate/blob/main/docs/cel.md).
+     *
+     * ```proto
+     * message MyMessage {
+     * // The field `value` must be greater than 42.
+     * optional int32 value = 1 [(buf.validate.predefined).cel = {
+     * id: "my_message.value",
+     * message: "value must be greater than 42",
+     * expression: "this > 42",
+     * }];
+     * }
+     * ```
+     * 
+ * + * repeated .buf.validate.Constraint cel = 1 [json_name = "cel"]; + */ + public Builder addAllCel( + java.lang.Iterable values) { + if (celBuilder_ == null) { + ensureCelIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, cel_); + onChanged(); + } else { + celBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * `cel` is a repeated field used to represent a textual expression
+     * in the Common Expression Language (CEL) syntax. For more information on
+     * CEL, [see our documentation](https://github.com/bufbuild/protovalidate/blob/main/docs/cel.md).
+     *
+     * ```proto
+     * message MyMessage {
+     * // The field `value` must be greater than 42.
+     * optional int32 value = 1 [(buf.validate.predefined).cel = {
+     * id: "my_message.value",
+     * message: "value must be greater than 42",
+     * expression: "this > 42",
+     * }];
+     * }
+     * ```
+     * 
+ * + * repeated .buf.validate.Constraint cel = 1 [json_name = "cel"]; + */ + public Builder clearCel() { + if (celBuilder_ == null) { + cel_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + celBuilder_.clear(); + } + return this; + } + /** + *
+     * `cel` is a repeated field used to represent a textual expression
+     * in the Common Expression Language (CEL) syntax. For more information on
+     * CEL, [see our documentation](https://github.com/bufbuild/protovalidate/blob/main/docs/cel.md).
+     *
+     * ```proto
+     * message MyMessage {
+     * // The field `value` must be greater than 42.
+     * optional int32 value = 1 [(buf.validate.predefined).cel = {
+     * id: "my_message.value",
+     * message: "value must be greater than 42",
+     * expression: "this > 42",
+     * }];
+     * }
+     * ```
+     * 
+ * + * repeated .buf.validate.Constraint cel = 1 [json_name = "cel"]; + */ + public Builder removeCel(int index) { + if (celBuilder_ == null) { + ensureCelIsMutable(); + cel_.remove(index); + onChanged(); + } else { + celBuilder_.remove(index); + } + return this; + } + /** + *
+     * `cel` is a repeated field used to represent a textual expression
+     * in the Common Expression Language (CEL) syntax. For more information on
+     * CEL, [see our documentation](https://github.com/bufbuild/protovalidate/blob/main/docs/cel.md).
+     *
+     * ```proto
+     * message MyMessage {
+     * // The field `value` must be greater than 42.
+     * optional int32 value = 1 [(buf.validate.predefined).cel = {
+     * id: "my_message.value",
+     * message: "value must be greater than 42",
+     * expression: "this > 42",
+     * }];
+     * }
+     * ```
+     * 
+ * + * repeated .buf.validate.Constraint cel = 1 [json_name = "cel"]; + */ + public build.buf.validate.Constraint.Builder getCelBuilder( + int index) { + return getCelFieldBuilder().getBuilder(index); + } + /** + *
+     * `cel` is a repeated field used to represent a textual expression
+     * in the Common Expression Language (CEL) syntax. For more information on
+     * CEL, [see our documentation](https://github.com/bufbuild/protovalidate/blob/main/docs/cel.md).
+     *
+     * ```proto
+     * message MyMessage {
+     * // The field `value` must be greater than 42.
+     * optional int32 value = 1 [(buf.validate.predefined).cel = {
+     * id: "my_message.value",
+     * message: "value must be greater than 42",
+     * expression: "this > 42",
+     * }];
+     * }
+     * ```
+     * 
+ * + * repeated .buf.validate.Constraint cel = 1 [json_name = "cel"]; + */ + public build.buf.validate.ConstraintOrBuilder getCelOrBuilder( + int index) { + if (celBuilder_ == null) { + return cel_.get(index); } else { + return celBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * `cel` is a repeated field used to represent a textual expression
+     * in the Common Expression Language (CEL) syntax. For more information on
+     * CEL, [see our documentation](https://github.com/bufbuild/protovalidate/blob/main/docs/cel.md).
+     *
+     * ```proto
+     * message MyMessage {
+     * // The field `value` must be greater than 42.
+     * optional int32 value = 1 [(buf.validate.predefined).cel = {
+     * id: "my_message.value",
+     * message: "value must be greater than 42",
+     * expression: "this > 42",
+     * }];
+     * }
+     * ```
+     * 
+ * + * repeated .buf.validate.Constraint cel = 1 [json_name = "cel"]; + */ + public java.util.List + getCelOrBuilderList() { + if (celBuilder_ != null) { + return celBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(cel_); + } + } + /** + *
+     * `cel` is a repeated field used to represent a textual expression
+     * in the Common Expression Language (CEL) syntax. For more information on
+     * CEL, [see our documentation](https://github.com/bufbuild/protovalidate/blob/main/docs/cel.md).
+     *
+     * ```proto
+     * message MyMessage {
+     * // The field `value` must be greater than 42.
+     * optional int32 value = 1 [(buf.validate.predefined).cel = {
+     * id: "my_message.value",
+     * message: "value must be greater than 42",
+     * expression: "this > 42",
+     * }];
+     * }
+     * ```
+     * 
+ * + * repeated .buf.validate.Constraint cel = 1 [json_name = "cel"]; + */ + public build.buf.validate.Constraint.Builder addCelBuilder() { + return getCelFieldBuilder().addBuilder( + build.buf.validate.Constraint.getDefaultInstance()); + } + /** + *
+     * `cel` is a repeated field used to represent a textual expression
+     * in the Common Expression Language (CEL) syntax. For more information on
+     * CEL, [see our documentation](https://github.com/bufbuild/protovalidate/blob/main/docs/cel.md).
+     *
+     * ```proto
+     * message MyMessage {
+     * // The field `value` must be greater than 42.
+     * optional int32 value = 1 [(buf.validate.predefined).cel = {
+     * id: "my_message.value",
+     * message: "value must be greater than 42",
+     * expression: "this > 42",
+     * }];
+     * }
+     * ```
+     * 
+ * + * repeated .buf.validate.Constraint cel = 1 [json_name = "cel"]; + */ + public build.buf.validate.Constraint.Builder addCelBuilder( + int index) { + return getCelFieldBuilder().addBuilder( + index, build.buf.validate.Constraint.getDefaultInstance()); + } + /** + *
+     * `cel` is a repeated field used to represent a textual expression
+     * in the Common Expression Language (CEL) syntax. For more information on
+     * CEL, [see our documentation](https://github.com/bufbuild/protovalidate/blob/main/docs/cel.md).
+     *
+     * ```proto
+     * message MyMessage {
+     * // The field `value` must be greater than 42.
+     * optional int32 value = 1 [(buf.validate.predefined).cel = {
+     * id: "my_message.value",
+     * message: "value must be greater than 42",
+     * expression: "this > 42",
+     * }];
+     * }
+     * ```
+     * 
+ * + * repeated .buf.validate.Constraint cel = 1 [json_name = "cel"]; + */ + public java.util.List + getCelBuilderList() { + return getCelFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + build.buf.validate.Constraint, build.buf.validate.Constraint.Builder, build.buf.validate.ConstraintOrBuilder> + getCelFieldBuilder() { + if (celBuilder_ == null) { + celBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + build.buf.validate.Constraint, build.buf.validate.Constraint.Builder, build.buf.validate.ConstraintOrBuilder>( + cel_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + cel_ = null; + } + return celBuilder_; + } + + // @@protoc_insertion_point(builder_scope:buf.validate.PredefinedConstraints) + } + + // @@protoc_insertion_point(class_scope:buf.validate.PredefinedConstraints) + private static final build.buf.validate.PredefinedConstraints DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.PredefinedConstraints(); + } + + public static build.buf.validate.PredefinedConstraints getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PredefinedConstraints 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.PredefinedConstraints getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/src/main/java/build/buf/validate/PredefinedConstraintsOrBuilder.java b/src/main/java/build/buf/validate/PredefinedConstraintsOrBuilder.java new file mode 100644 index 00000000..84188cd9 --- /dev/null +++ b/src/main/java/build/buf/validate/PredefinedConstraintsOrBuilder.java @@ -0,0 +1,120 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/validate.proto +// Protobuf Java Version: 4.28.1 + +package build.buf.validate; + +public interface PredefinedConstraintsOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.PredefinedConstraints) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * `cel` is a repeated field used to represent a textual expression
+   * in the Common Expression Language (CEL) syntax. For more information on
+   * CEL, [see our documentation](https://github.com/bufbuild/protovalidate/blob/main/docs/cel.md).
+   *
+   * ```proto
+   * message MyMessage {
+   * // The field `value` must be greater than 42.
+   * optional int32 value = 1 [(buf.validate.predefined).cel = {
+   * id: "my_message.value",
+   * message: "value must be greater than 42",
+   * expression: "this > 42",
+   * }];
+   * }
+   * ```
+   * 
+ * + * repeated .buf.validate.Constraint cel = 1 [json_name = "cel"]; + */ + java.util.List + getCelList(); + /** + *
+   * `cel` is a repeated field used to represent a textual expression
+   * in the Common Expression Language (CEL) syntax. For more information on
+   * CEL, [see our documentation](https://github.com/bufbuild/protovalidate/blob/main/docs/cel.md).
+   *
+   * ```proto
+   * message MyMessage {
+   * // The field `value` must be greater than 42.
+   * optional int32 value = 1 [(buf.validate.predefined).cel = {
+   * id: "my_message.value",
+   * message: "value must be greater than 42",
+   * expression: "this > 42",
+   * }];
+   * }
+   * ```
+   * 
+ * + * repeated .buf.validate.Constraint cel = 1 [json_name = "cel"]; + */ + build.buf.validate.Constraint getCel(int index); + /** + *
+   * `cel` is a repeated field used to represent a textual expression
+   * in the Common Expression Language (CEL) syntax. For more information on
+   * CEL, [see our documentation](https://github.com/bufbuild/protovalidate/blob/main/docs/cel.md).
+   *
+   * ```proto
+   * message MyMessage {
+   * // The field `value` must be greater than 42.
+   * optional int32 value = 1 [(buf.validate.predefined).cel = {
+   * id: "my_message.value",
+   * message: "value must be greater than 42",
+   * expression: "this > 42",
+   * }];
+   * }
+   * ```
+   * 
+ * + * repeated .buf.validate.Constraint cel = 1 [json_name = "cel"]; + */ + int getCelCount(); + /** + *
+   * `cel` is a repeated field used to represent a textual expression
+   * in the Common Expression Language (CEL) syntax. For more information on
+   * CEL, [see our documentation](https://github.com/bufbuild/protovalidate/blob/main/docs/cel.md).
+   *
+   * ```proto
+   * message MyMessage {
+   * // The field `value` must be greater than 42.
+   * optional int32 value = 1 [(buf.validate.predefined).cel = {
+   * id: "my_message.value",
+   * message: "value must be greater than 42",
+   * expression: "this > 42",
+   * }];
+   * }
+   * ```
+   * 
+ * + * repeated .buf.validate.Constraint cel = 1 [json_name = "cel"]; + */ + java.util.List + getCelOrBuilderList(); + /** + *
+   * `cel` is a repeated field used to represent a textual expression
+   * in the Common Expression Language (CEL) syntax. For more information on
+   * CEL, [see our documentation](https://github.com/bufbuild/protovalidate/blob/main/docs/cel.md).
+   *
+   * ```proto
+   * message MyMessage {
+   * // The field `value` must be greater than 42.
+   * optional int32 value = 1 [(buf.validate.predefined).cel = {
+   * id: "my_message.value",
+   * message: "value must be greater than 42",
+   * expression: "this > 42",
+   * }];
+   * }
+   * ```
+   * 
+ * + * repeated .buf.validate.Constraint cel = 1 [json_name = "cel"]; + */ + build.buf.validate.ConstraintOrBuilder getCelOrBuilder( + int index); +} diff --git a/src/main/java/build/buf/validate/RepeatedRules.java b/src/main/java/build/buf/validate/RepeatedRules.java index f3fc473c..0824fa78 100644 --- a/src/main/java/build/buf/validate/RepeatedRules.java +++ b/src/main/java/build/buf/validate/RepeatedRules.java @@ -13,7 +13,8 @@ * Protobuf type {@code buf.validate.RepeatedRules} */ public final class RepeatedRules extends - com.google.protobuf.GeneratedMessage implements + com.google.protobuf.GeneratedMessage.ExtendableMessage< + RepeatedRules> implements // @@protoc_insertion_point(message_implements:buf.validate.RepeatedRules) RepeatedRulesOrBuilder { private static final long serialVersionUID = 0L; @@ -27,7 +28,7 @@ public final class RepeatedRules extends RepeatedRules.class.getName()); } // Use RepeatedRules.newBuilder() to construct. - private RepeatedRules(com.google.protobuf.GeneratedMessage.Builder builder) { + private RepeatedRules(com.google.protobuf.GeneratedMessage.ExtendableBuilder builder) { super(builder); } private RepeatedRules() { @@ -64,7 +65,7 @@ private RepeatedRules() { * ``` * * - * optional uint64 min_items = 1 [json_name = "minItems", (.buf.validate.priv.field) = { ... } + * optional uint64 min_items = 1 [json_name = "minItems", (.buf.validate.predefined) = { ... } * @return Whether the minItems field is set. */ @java.lang.Override @@ -86,7 +87,7 @@ public boolean hasMinItems() { * ``` * * - * optional uint64 min_items = 1 [json_name = "minItems", (.buf.validate.priv.field) = { ... } + * optional uint64 min_items = 1 [json_name = "minItems", (.buf.validate.predefined) = { ... } * @return The minItems. */ @java.lang.Override @@ -111,7 +112,7 @@ public long getMinItems() { * ``` * * - * optional uint64 max_items = 2 [json_name = "maxItems", (.buf.validate.priv.field) = { ... } + * optional uint64 max_items = 2 [json_name = "maxItems", (.buf.validate.predefined) = { ... } * @return Whether the maxItems field is set. */ @java.lang.Override @@ -133,7 +134,7 @@ public boolean hasMaxItems() { * ``` * * - * optional uint64 max_items = 2 [json_name = "maxItems", (.buf.validate.priv.field) = { ... } + * optional uint64 max_items = 2 [json_name = "maxItems", (.buf.validate.predefined) = { ... } * @return The maxItems. */ @java.lang.Override @@ -157,7 +158,7 @@ public long getMaxItems() { * ``` * * - * optional bool unique = 3 [json_name = "unique", (.buf.validate.priv.field) = { ... } + * optional bool unique = 3 [json_name = "unique", (.buf.validate.predefined) = { ... } * @return Whether the unique field is set. */ @java.lang.Override @@ -178,7 +179,7 @@ public boolean hasUnique() { * ``` * * - * optional bool unique = 3 [json_name = "unique", (.buf.validate.priv.field) = { ... } + * optional bool unique = 3 [json_name = "unique", (.buf.validate.predefined) = { ... } * @return The unique. */ @java.lang.Override @@ -273,6 +274,16 @@ public final boolean isInitialized() { if (isInitialized == 1) return true; if (isInitialized == 0) return false; + if (hasItems()) { + if (!getItems().isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + if (!extensionsAreInitialized()) { + memoizedIsInitialized = 0; + return false; + } memoizedIsInitialized = 1; return true; } @@ -280,6 +291,9 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + com.google.protobuf.GeneratedMessage + .ExtendableMessage.ExtensionSerializer + extensionWriter = newExtensionSerializer(); if (((bitField0_ & 0x00000001) != 0)) { output.writeUInt64(1, minItems_); } @@ -292,6 +306,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) if (((bitField0_ & 0x00000008) != 0)) { output.writeMessage(4, getItems()); } + extensionWriter.writeUntil(536870912, output); getUnknownFields().writeTo(output); } @@ -317,6 +332,7 @@ public int getSerializedSize() { size += com.google.protobuf.CodedOutputStream .computeMessageSize(4, getItems()); } + size += extensionsSerializedSize(); size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -353,6 +369,8 @@ public boolean equals(final java.lang.Object obj) { .equals(other.getItems())) return false; } if (!getUnknownFields().equals(other.getUnknownFields())) return false; + if (!getExtensionFields().equals(other.getExtensionFields())) + return false; return true; } @@ -382,6 +400,7 @@ public int hashCode() { hash = (37 * hash) + ITEMS_FIELD_NUMBER; hash = (53 * hash) + getItems().hashCode(); } + hash = hashFields(hash, getExtensionFields()); hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -487,7 +506,8 @@ protected Builder newBuilderForType( * Protobuf type {@code buf.validate.RepeatedRules} */ public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder implements + com.google.protobuf.GeneratedMessage.ExtendableBuilder< + build.buf.validate.RepeatedRules, Builder> implements // @@protoc_insertion_point(builder_implements:buf.validate.RepeatedRules) build.buf.validate.RepeatedRulesOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor @@ -610,6 +630,7 @@ public Builder mergeFrom(build.buf.validate.RepeatedRules other) { if (other.hasItems()) { mergeItems(other.getItems()); } + this.mergeExtensionFields(other); this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -617,6 +638,14 @@ public Builder mergeFrom(build.buf.validate.RepeatedRules other) { @java.lang.Override public final boolean isInitialized() { + if (hasItems()) { + if (!getItems().isInitialized()) { + return false; + } + } + if (!extensionsAreInitialized()) { + return false; + } return true; } @@ -691,7 +720,7 @@ public Builder mergeFrom( * ``` * * - * optional uint64 min_items = 1 [json_name = "minItems", (.buf.validate.priv.field) = { ... } + * optional uint64 min_items = 1 [json_name = "minItems", (.buf.validate.predefined) = { ... } * @return Whether the minItems field is set. */ @java.lang.Override @@ -713,7 +742,7 @@ public boolean hasMinItems() { * ``` * * - * optional uint64 min_items = 1 [json_name = "minItems", (.buf.validate.priv.field) = { ... } + * optional uint64 min_items = 1 [json_name = "minItems", (.buf.validate.predefined) = { ... } * @return The minItems. */ @java.lang.Override @@ -735,7 +764,7 @@ public long getMinItems() { * ``` * * - * optional uint64 min_items = 1 [json_name = "minItems", (.buf.validate.priv.field) = { ... } + * optional uint64 min_items = 1 [json_name = "minItems", (.buf.validate.predefined) = { ... } * @param value The minItems to set. * @return This builder for chaining. */ @@ -761,7 +790,7 @@ public Builder setMinItems(long value) { * ``` * * - * optional uint64 min_items = 1 [json_name = "minItems", (.buf.validate.priv.field) = { ... } + * optional uint64 min_items = 1 [json_name = "minItems", (.buf.validate.predefined) = { ... } * @return This builder for chaining. */ public Builder clearMinItems() { @@ -787,7 +816,7 @@ public Builder clearMinItems() { * ``` * * - * optional uint64 max_items = 2 [json_name = "maxItems", (.buf.validate.priv.field) = { ... } + * optional uint64 max_items = 2 [json_name = "maxItems", (.buf.validate.predefined) = { ... } * @return Whether the maxItems field is set. */ @java.lang.Override @@ -809,7 +838,7 @@ public boolean hasMaxItems() { * ``` * * - * optional uint64 max_items = 2 [json_name = "maxItems", (.buf.validate.priv.field) = { ... } + * optional uint64 max_items = 2 [json_name = "maxItems", (.buf.validate.predefined) = { ... } * @return The maxItems. */ @java.lang.Override @@ -831,7 +860,7 @@ public long getMaxItems() { * ``` * * - * optional uint64 max_items = 2 [json_name = "maxItems", (.buf.validate.priv.field) = { ... } + * optional uint64 max_items = 2 [json_name = "maxItems", (.buf.validate.predefined) = { ... } * @param value The maxItems to set. * @return This builder for chaining. */ @@ -857,7 +886,7 @@ public Builder setMaxItems(long value) { * ``` * * - * optional uint64 max_items = 2 [json_name = "maxItems", (.buf.validate.priv.field) = { ... } + * optional uint64 max_items = 2 [json_name = "maxItems", (.buf.validate.predefined) = { ... } * @return This builder for chaining. */ public Builder clearMaxItems() { @@ -882,7 +911,7 @@ public Builder clearMaxItems() { * ``` * * - * optional bool unique = 3 [json_name = "unique", (.buf.validate.priv.field) = { ... } + * optional bool unique = 3 [json_name = "unique", (.buf.validate.predefined) = { ... } * @return Whether the unique field is set. */ @java.lang.Override @@ -903,7 +932,7 @@ public boolean hasUnique() { * ``` * * - * optional bool unique = 3 [json_name = "unique", (.buf.validate.priv.field) = { ... } + * optional bool unique = 3 [json_name = "unique", (.buf.validate.predefined) = { ... } * @return The unique. */ @java.lang.Override @@ -924,7 +953,7 @@ public boolean getUnique() { * ``` * * - * optional bool unique = 3 [json_name = "unique", (.buf.validate.priv.field) = { ... } + * optional bool unique = 3 [json_name = "unique", (.buf.validate.predefined) = { ... } * @param value The unique to set. * @return This builder for chaining. */ @@ -949,7 +978,7 @@ public Builder setUnique(boolean value) { * ``` * * - * optional bool unique = 3 [json_name = "unique", (.buf.validate.priv.field) = { ... } + * optional bool unique = 3 [json_name = "unique", (.buf.validate.predefined) = { ... } * @return This builder for chaining. */ public Builder clearUnique() { diff --git a/src/main/java/build/buf/validate/RepeatedRulesOrBuilder.java b/src/main/java/build/buf/validate/RepeatedRulesOrBuilder.java index 11c2e478..ec91aa41 100644 --- a/src/main/java/build/buf/validate/RepeatedRulesOrBuilder.java +++ b/src/main/java/build/buf/validate/RepeatedRulesOrBuilder.java @@ -7,7 +7,8 @@ public interface RepeatedRulesOrBuilder extends // @@protoc_insertion_point(interface_extends:buf.validate.RepeatedRules) - com.google.protobuf.MessageOrBuilder { + com.google.protobuf.GeneratedMessage. + ExtendableMessageOrBuilder { /** *
@@ -24,7 +25,7 @@ public interface RepeatedRulesOrBuilder extends
    * ```
    * 
* - * optional uint64 min_items = 1 [json_name = "minItems", (.buf.validate.priv.field) = { ... } + * optional uint64 min_items = 1 [json_name = "minItems", (.buf.validate.predefined) = { ... } * @return Whether the minItems field is set. */ boolean hasMinItems(); @@ -43,7 +44,7 @@ public interface RepeatedRulesOrBuilder extends * ``` * * - * optional uint64 min_items = 1 [json_name = "minItems", (.buf.validate.priv.field) = { ... } + * optional uint64 min_items = 1 [json_name = "minItems", (.buf.validate.predefined) = { ... } * @return The minItems. */ long getMinItems(); @@ -63,7 +64,7 @@ public interface RepeatedRulesOrBuilder extends * ``` * * - * optional uint64 max_items = 2 [json_name = "maxItems", (.buf.validate.priv.field) = { ... } + * optional uint64 max_items = 2 [json_name = "maxItems", (.buf.validate.predefined) = { ... } * @return Whether the maxItems field is set. */ boolean hasMaxItems(); @@ -82,7 +83,7 @@ public interface RepeatedRulesOrBuilder extends * ``` * * - * optional uint64 max_items = 2 [json_name = "maxItems", (.buf.validate.priv.field) = { ... } + * optional uint64 max_items = 2 [json_name = "maxItems", (.buf.validate.predefined) = { ... } * @return The maxItems. */ long getMaxItems(); @@ -101,7 +102,7 @@ public interface RepeatedRulesOrBuilder extends * ``` * * - * optional bool unique = 3 [json_name = "unique", (.buf.validate.priv.field) = { ... } + * optional bool unique = 3 [json_name = "unique", (.buf.validate.predefined) = { ... } * @return Whether the unique field is set. */ boolean hasUnique(); @@ -119,7 +120,7 @@ public interface RepeatedRulesOrBuilder extends * ``` * * - * optional bool unique = 3 [json_name = "unique", (.buf.validate.priv.field) = { ... } + * optional bool unique = 3 [json_name = "unique", (.buf.validate.predefined) = { ... } * @return The unique. */ boolean getUnique(); diff --git a/src/main/java/build/buf/validate/SFixed32Rules.java b/src/main/java/build/buf/validate/SFixed32Rules.java index fb87aafc..b78dad95 100644 --- a/src/main/java/build/buf/validate/SFixed32Rules.java +++ b/src/main/java/build/buf/validate/SFixed32Rules.java @@ -13,7 +13,8 @@ * Protobuf type {@code buf.validate.SFixed32Rules} */ public final class SFixed32Rules extends - com.google.protobuf.GeneratedMessage implements + com.google.protobuf.GeneratedMessage.ExtendableMessage< + SFixed32Rules> implements // @@protoc_insertion_point(message_implements:buf.validate.SFixed32Rules) SFixed32RulesOrBuilder { private static final long serialVersionUID = 0L; @@ -27,12 +28,13 @@ public final class SFixed32Rules extends SFixed32Rules.class.getName()); } // Use SFixed32Rules.newBuilder() to construct. - private SFixed32Rules(com.google.protobuf.GeneratedMessage.Builder builder) { + private SFixed32Rules(com.google.protobuf.GeneratedMessage.ExtendableBuilder builder) { super(builder); } private SFixed32Rules() { in_ = emptyIntList(); notIn_ = emptyIntList(); + example_ = emptyIntList(); } public static final com.google.protobuf.Descriptors.Descriptor @@ -148,7 +150,7 @@ public int getNumber() { * ``` * * - * optional sfixed32 const = 1 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional sfixed32 const = 1 [json_name = "const", (.buf.validate.predefined) = { ... } * @return Whether the const field is set. */ @java.lang.Override @@ -168,7 +170,7 @@ public boolean hasConst() { * ``` * * - * optional sfixed32 const = 1 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional sfixed32 const = 1 [json_name = "const", (.buf.validate.predefined) = { ... } * @return The const. */ @java.lang.Override @@ -191,7 +193,7 @@ public int getConst() { * ``` * * - * sfixed32 lt = 2 [json_name = "lt", (.buf.validate.priv.field) = { ... } + * sfixed32 lt = 2 [json_name = "lt", (.buf.validate.predefined) = { ... } * @return Whether the lt field is set. */ @java.lang.Override @@ -212,7 +214,7 @@ public boolean hasLt() { * ``` * * - * sfixed32 lt = 2 [json_name = "lt", (.buf.validate.priv.field) = { ... } + * sfixed32 lt = 2 [json_name = "lt", (.buf.validate.predefined) = { ... } * @return The lt. */ @java.lang.Override @@ -238,7 +240,7 @@ public int getLt() { * ``` * * - * sfixed32 lte = 3 [json_name = "lte", (.buf.validate.priv.field) = { ... } + * sfixed32 lte = 3 [json_name = "lte", (.buf.validate.predefined) = { ... } * @return Whether the lte field is set. */ @java.lang.Override @@ -259,7 +261,7 @@ public boolean hasLte() { * ``` * * - * sfixed32 lte = 3 [json_name = "lte", (.buf.validate.priv.field) = { ... } + * sfixed32 lte = 3 [json_name = "lte", (.buf.validate.predefined) = { ... } * @return The lte. */ @java.lang.Override @@ -293,7 +295,7 @@ public int getLte() { * ``` * * - * sfixed32 gt = 4 [json_name = "gt", (.buf.validate.priv.field) = { ... } + * sfixed32 gt = 4 [json_name = "gt", (.buf.validate.predefined) = { ... } * @return Whether the gt field is set. */ @java.lang.Override @@ -322,7 +324,7 @@ public boolean hasGt() { * ``` * * - * sfixed32 gt = 4 [json_name = "gt", (.buf.validate.priv.field) = { ... } + * sfixed32 gt = 4 [json_name = "gt", (.buf.validate.predefined) = { ... } * @return The gt. */ @java.lang.Override @@ -356,7 +358,7 @@ public int getGt() { * ``` * * - * sfixed32 gte = 5 [json_name = "gte", (.buf.validate.priv.field) = { ... } + * sfixed32 gte = 5 [json_name = "gte", (.buf.validate.predefined) = { ... } * @return Whether the gte field is set. */ @java.lang.Override @@ -385,7 +387,7 @@ public boolean hasGte() { * ``` * * - * sfixed32 gte = 5 [json_name = "gte", (.buf.validate.priv.field) = { ... } + * sfixed32 gte = 5 [json_name = "gte", (.buf.validate.predefined) = { ... } * @return The gte. */ @java.lang.Override @@ -414,7 +416,7 @@ public int getGte() { * ``` * * - * repeated sfixed32 in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated sfixed32 in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @return A list containing the in. */ @java.lang.Override @@ -436,7 +438,7 @@ public int getGte() { * ``` * * - * repeated sfixed32 in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated sfixed32 in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @return The count of in. */ public int getInCount() { @@ -456,14 +458,13 @@ public int getInCount() { * ``` * * - * repeated sfixed32 in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated sfixed32 in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @param index The index of the element to return. * @return The in at the given index. */ public int getIn(int index) { return in_.getInt(index); } - private int inMemoizedSerializedSize = -1; public static final int NOT_IN_FIELD_NUMBER = 7; @SuppressWarnings("serial") @@ -483,7 +484,7 @@ public int getIn(int index) { * ``` * * - * repeated sfixed32 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated sfixed32 not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @return A list containing the notIn. */ @java.lang.Override @@ -505,7 +506,7 @@ public int getIn(int index) { * ``` * * - * repeated sfixed32 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated sfixed32 not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @return The count of notIn. */ public int getNotInCount() { @@ -525,14 +526,87 @@ public int getNotInCount() { * ``` * * - * repeated sfixed32 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated sfixed32 not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @param index The index of the element to return. * @return The notIn at the given index. */ public int getNotIn(int index) { return notIn_.getInt(index); } - private int notInMemoizedSerializedSize = -1; + + public static final int EXAMPLE_FIELD_NUMBER = 8; + @SuppressWarnings("serial") + private com.google.protobuf.Internal.IntList example_ = + emptyIntList(); + /** + *
+   * `example` specifies values that the field may have. These values SHOULD
+   * conform to other constraints. `example` values will not impact validation
+   * but may be used as helpful guidance on how to populate the given field.
+   *
+   * ```proto
+   * message MySFixed32 {
+   * sfixed32 value = 1 [
+   * (buf.validate.field).sfixed32.example = 1,
+   * (buf.validate.field).sfixed32.example = 2
+   * ];
+   * }
+   * ```
+   * 
+ * + * repeated sfixed32 example = 8 [json_name = "example", (.buf.validate.predefined) = { ... } + * @return A list containing the example. + */ + @java.lang.Override + public java.util.List + getExampleList() { + return example_; + } + /** + *
+   * `example` specifies values that the field may have. These values SHOULD
+   * conform to other constraints. `example` values will not impact validation
+   * but may be used as helpful guidance on how to populate the given field.
+   *
+   * ```proto
+   * message MySFixed32 {
+   * sfixed32 value = 1 [
+   * (buf.validate.field).sfixed32.example = 1,
+   * (buf.validate.field).sfixed32.example = 2
+   * ];
+   * }
+   * ```
+   * 
+ * + * repeated sfixed32 example = 8 [json_name = "example", (.buf.validate.predefined) = { ... } + * @return The count of example. + */ + public int getExampleCount() { + return example_.size(); + } + /** + *
+   * `example` specifies values that the field may have. These values SHOULD
+   * conform to other constraints. `example` values will not impact validation
+   * but may be used as helpful guidance on how to populate the given field.
+   *
+   * ```proto
+   * message MySFixed32 {
+   * sfixed32 value = 1 [
+   * (buf.validate.field).sfixed32.example = 1,
+   * (buf.validate.field).sfixed32.example = 2
+   * ];
+   * }
+   * ```
+   * 
+ * + * repeated sfixed32 example = 8 [json_name = "example", (.buf.validate.predefined) = { ... } + * @param index The index of the element to return. + * @return The example at the given index. + */ + public int getExample(int index) { + return example_.getInt(index); + } private byte memoizedIsInitialized = -1; @java.lang.Override @@ -541,6 +615,10 @@ public final boolean isInitialized() { if (isInitialized == 1) return true; if (isInitialized == 0) return false; + if (!extensionsAreInitialized()) { + memoizedIsInitialized = 0; + return false; + } memoizedIsInitialized = 1; return true; } @@ -548,7 +626,9 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - getSerializedSize(); + com.google.protobuf.GeneratedMessage + .ExtendableMessage.ExtensionSerializer + extensionWriter = newExtensionSerializer(); if (((bitField0_ & 0x00000001) != 0)) { output.writeSFixed32(1, const_); } @@ -568,20 +648,16 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) output.writeSFixed32( 5, (int)((java.lang.Integer) greaterThan_)); } - if (getInList().size() > 0) { - output.writeUInt32NoTag(50); - output.writeUInt32NoTag(inMemoizedSerializedSize); - } for (int i = 0; i < in_.size(); i++) { - output.writeSFixed32NoTag(in_.getInt(i)); - } - if (getNotInList().size() > 0) { - output.writeUInt32NoTag(58); - output.writeUInt32NoTag(notInMemoizedSerializedSize); + output.writeSFixed32(6, in_.getInt(i)); } for (int i = 0; i < notIn_.size(); i++) { - output.writeSFixed32NoTag(notIn_.getInt(i)); + output.writeSFixed32(7, notIn_.getInt(i)); } + for (int i = 0; i < example_.size(); i++) { + output.writeSFixed32(8, example_.getInt(i)); + } + extensionWriter.writeUntil(536870912, output); getUnknownFields().writeTo(output); } @@ -619,24 +695,21 @@ public int getSerializedSize() { int dataSize = 0; dataSize = 4 * getInList().size(); size += dataSize; - if (!getInList().isEmpty()) { - size += 1; - size += com.google.protobuf.CodedOutputStream - .computeInt32SizeNoTag(dataSize); - } - inMemoizedSerializedSize = dataSize; + size += 1 * getInList().size(); } { int dataSize = 0; dataSize = 4 * getNotInList().size(); size += dataSize; - if (!getNotInList().isEmpty()) { - size += 1; - size += com.google.protobuf.CodedOutputStream - .computeInt32SizeNoTag(dataSize); - } - notInMemoizedSerializedSize = dataSize; + size += 1 * getNotInList().size(); } + { + int dataSize = 0; + dataSize = 4 * getExampleList().size(); + size += dataSize; + size += 1 * getExampleList().size(); + } + size += extensionsSerializedSize(); size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -661,6 +734,8 @@ public boolean equals(final java.lang.Object obj) { .equals(other.getInList())) return false; if (!getNotInList() .equals(other.getNotInList())) return false; + if (!getExampleList() + .equals(other.getExampleList())) return false; if (!getLessThanCase().equals(other.getLessThanCase())) return false; switch (lessThanCase_) { case 2: @@ -688,6 +763,8 @@ public boolean equals(final java.lang.Object obj) { default: } if (!getUnknownFields().equals(other.getUnknownFields())) return false; + if (!getExtensionFields().equals(other.getExtensionFields())) + return false; return true; } @@ -710,6 +787,10 @@ public int hashCode() { hash = (37 * hash) + NOT_IN_FIELD_NUMBER; hash = (53 * hash) + getNotInList().hashCode(); } + if (getExampleCount() > 0) { + hash = (37 * hash) + EXAMPLE_FIELD_NUMBER; + hash = (53 * hash) + getExampleList().hashCode(); + } switch (lessThanCase_) { case 2: hash = (37 * hash) + LT_FIELD_NUMBER; @@ -734,6 +815,7 @@ public int hashCode() { case 0: default: } + hash = hashFields(hash, getExtensionFields()); hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -839,7 +921,8 @@ protected Builder newBuilderForType( * Protobuf type {@code buf.validate.SFixed32Rules} */ public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder implements + com.google.protobuf.GeneratedMessage.ExtendableBuilder< + build.buf.validate.SFixed32Rules, Builder> implements // @@protoc_insertion_point(builder_implements:buf.validate.SFixed32Rules) build.buf.validate.SFixed32RulesOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor @@ -872,6 +955,7 @@ public Builder clear() { const_ = 0; in_ = emptyIntList(); notIn_ = emptyIntList(); + example_ = emptyIntList(); lessThanCase_ = 0; lessThan_ = null; greaterThanCase_ = 0; @@ -923,6 +1007,10 @@ private void buildPartial0(build.buf.validate.SFixed32Rules result) { notIn_.makeImmutable(); result.notIn_ = notIn_; } + if (((from_bitField0_ & 0x00000080) != 0)) { + example_.makeImmutable(); + result.example_ = example_; + } result.bitField0_ |= to_bitField0_; } @@ -970,6 +1058,17 @@ public Builder mergeFrom(build.buf.validate.SFixed32Rules other) { } onChanged(); } + if (!other.example_.isEmpty()) { + if (example_.isEmpty()) { + example_ = other.example_; + example_.makeImmutable(); + bitField0_ |= 0x00000080; + } else { + ensureExampleIsMutable(); + example_.addAll(other.example_); + } + onChanged(); + } switch (other.getLessThanCase()) { case LT: { setLt(other.getLt()); @@ -996,6 +1095,7 @@ public Builder mergeFrom(build.buf.validate.SFixed32Rules other) { break; } } + this.mergeExtensionFields(other); this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -1003,6 +1103,9 @@ public Builder mergeFrom(build.buf.validate.SFixed32Rules other) { @java.lang.Override public final boolean isInitialized() { + if (!extensionsAreInitialized()) { + return false; + } return true; } @@ -1081,6 +1184,23 @@ public Builder mergeFrom( input.popLimit(limit); break; } // case 58 + case 69: { + int v = input.readSFixed32(); + ensureExampleIsMutable(); + example_.addInt(v); + break; + } // case 69 + case 66: { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + int alloc = length > 4096 ? 4096 : length; + ensureExampleIsMutable(alloc / 4); + while (input.getBytesUntilLimit() > 0) { + example_.addInt(input.readSFixed32()); + } + input.popLimit(limit); + break; + } // case 66 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { done = true; // was an endgroup tag @@ -1142,7 +1262,7 @@ public Builder clearGreaterThan() { * ``` * * - * optional sfixed32 const = 1 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional sfixed32 const = 1 [json_name = "const", (.buf.validate.predefined) = { ... } * @return Whether the const field is set. */ @java.lang.Override @@ -1162,7 +1282,7 @@ public boolean hasConst() { * ``` * * - * optional sfixed32 const = 1 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional sfixed32 const = 1 [json_name = "const", (.buf.validate.predefined) = { ... } * @return The const. */ @java.lang.Override @@ -1182,7 +1302,7 @@ public int getConst() { * ``` * * - * optional sfixed32 const = 1 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional sfixed32 const = 1 [json_name = "const", (.buf.validate.predefined) = { ... } * @param value The const to set. * @return This builder for chaining. */ @@ -1206,7 +1326,7 @@ public Builder setConst(int value) { * ``` * * - * optional sfixed32 const = 1 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional sfixed32 const = 1 [json_name = "const", (.buf.validate.predefined) = { ... } * @return This builder for chaining. */ public Builder clearConst() { @@ -1230,7 +1350,7 @@ public Builder clearConst() { * ``` * * - * sfixed32 lt = 2 [json_name = "lt", (.buf.validate.priv.field) = { ... } + * sfixed32 lt = 2 [json_name = "lt", (.buf.validate.predefined) = { ... } * @return Whether the lt field is set. */ public boolean hasLt() { @@ -1250,7 +1370,7 @@ public boolean hasLt() { * ``` * * - * sfixed32 lt = 2 [json_name = "lt", (.buf.validate.priv.field) = { ... } + * sfixed32 lt = 2 [json_name = "lt", (.buf.validate.predefined) = { ... } * @return The lt. */ public int getLt() { @@ -1273,7 +1393,7 @@ public int getLt() { * ``` * * - * sfixed32 lt = 2 [json_name = "lt", (.buf.validate.priv.field) = { ... } + * sfixed32 lt = 2 [json_name = "lt", (.buf.validate.predefined) = { ... } * @param value The lt to set. * @return This builder for chaining. */ @@ -1298,7 +1418,7 @@ public Builder setLt(int value) { * ``` * * - * sfixed32 lt = 2 [json_name = "lt", (.buf.validate.priv.field) = { ... } + * sfixed32 lt = 2 [json_name = "lt", (.buf.validate.predefined) = { ... } * @return This builder for chaining. */ public Builder clearLt() { @@ -1324,7 +1444,7 @@ public Builder clearLt() { * ``` * * - * sfixed32 lte = 3 [json_name = "lte", (.buf.validate.priv.field) = { ... } + * sfixed32 lte = 3 [json_name = "lte", (.buf.validate.predefined) = { ... } * @return Whether the lte field is set. */ public boolean hasLte() { @@ -1344,7 +1464,7 @@ public boolean hasLte() { * ``` * * - * sfixed32 lte = 3 [json_name = "lte", (.buf.validate.priv.field) = { ... } + * sfixed32 lte = 3 [json_name = "lte", (.buf.validate.predefined) = { ... } * @return The lte. */ public int getLte() { @@ -1367,7 +1487,7 @@ public int getLte() { * ``` * * - * sfixed32 lte = 3 [json_name = "lte", (.buf.validate.priv.field) = { ... } + * sfixed32 lte = 3 [json_name = "lte", (.buf.validate.predefined) = { ... } * @param value The lte to set. * @return This builder for chaining. */ @@ -1392,7 +1512,7 @@ public Builder setLte(int value) { * ``` * * - * sfixed32 lte = 3 [json_name = "lte", (.buf.validate.priv.field) = { ... } + * sfixed32 lte = 3 [json_name = "lte", (.buf.validate.predefined) = { ... } * @return This builder for chaining. */ public Builder clearLte() { @@ -1426,7 +1546,7 @@ public Builder clearLte() { * ``` * * - * sfixed32 gt = 4 [json_name = "gt", (.buf.validate.priv.field) = { ... } + * sfixed32 gt = 4 [json_name = "gt", (.buf.validate.predefined) = { ... } * @return Whether the gt field is set. */ public boolean hasGt() { @@ -1454,7 +1574,7 @@ public boolean hasGt() { * ``` * * - * sfixed32 gt = 4 [json_name = "gt", (.buf.validate.priv.field) = { ... } + * sfixed32 gt = 4 [json_name = "gt", (.buf.validate.predefined) = { ... } * @return The gt. */ public int getGt() { @@ -1485,7 +1605,7 @@ public int getGt() { * ``` * * - * sfixed32 gt = 4 [json_name = "gt", (.buf.validate.priv.field) = { ... } + * sfixed32 gt = 4 [json_name = "gt", (.buf.validate.predefined) = { ... } * @param value The gt to set. * @return This builder for chaining. */ @@ -1518,7 +1638,7 @@ public Builder setGt(int value) { * ``` * * - * sfixed32 gt = 4 [json_name = "gt", (.buf.validate.priv.field) = { ... } + * sfixed32 gt = 4 [json_name = "gt", (.buf.validate.predefined) = { ... } * @return This builder for chaining. */ public Builder clearGt() { @@ -1552,7 +1672,7 @@ public Builder clearGt() { * ``` * * - * sfixed32 gte = 5 [json_name = "gte", (.buf.validate.priv.field) = { ... } + * sfixed32 gte = 5 [json_name = "gte", (.buf.validate.predefined) = { ... } * @return Whether the gte field is set. */ public boolean hasGte() { @@ -1580,7 +1700,7 @@ public boolean hasGte() { * ``` * * - * sfixed32 gte = 5 [json_name = "gte", (.buf.validate.priv.field) = { ... } + * sfixed32 gte = 5 [json_name = "gte", (.buf.validate.predefined) = { ... } * @return The gte. */ public int getGte() { @@ -1611,7 +1731,7 @@ public int getGte() { * ``` * * - * sfixed32 gte = 5 [json_name = "gte", (.buf.validate.priv.field) = { ... } + * sfixed32 gte = 5 [json_name = "gte", (.buf.validate.predefined) = { ... } * @param value The gte to set. * @return This builder for chaining. */ @@ -1644,7 +1764,7 @@ public Builder setGte(int value) { * ``` * * - * sfixed32 gte = 5 [json_name = "gte", (.buf.validate.priv.field) = { ... } + * sfixed32 gte = 5 [json_name = "gte", (.buf.validate.predefined) = { ... } * @return This builder for chaining. */ public Builder clearGte() { @@ -1683,7 +1803,7 @@ private void ensureInIsMutable(int capacity) { * ``` * * - * repeated sfixed32 in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated sfixed32 in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @return A list containing the in. */ public java.util.List @@ -1705,7 +1825,7 @@ private void ensureInIsMutable(int capacity) { * ``` * * - * repeated sfixed32 in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated sfixed32 in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @return The count of in. */ public int getInCount() { @@ -1725,7 +1845,7 @@ public int getInCount() { * ``` * * - * repeated sfixed32 in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated sfixed32 in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @param index The index of the element to return. * @return The in at the given index. */ @@ -1746,7 +1866,7 @@ public int getIn(int index) { * ``` * * - * repeated sfixed32 in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated sfixed32 in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @param index The index to set the value at. * @param value The in to set. * @return This builder for chaining. @@ -1774,7 +1894,7 @@ public Builder setIn( * ``` * * - * repeated sfixed32 in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated sfixed32 in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @param value The in to add. * @return This builder for chaining. */ @@ -1800,7 +1920,7 @@ public Builder addIn(int value) { * ``` * * - * repeated sfixed32 in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated sfixed32 in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @param values The in to add. * @return This builder for chaining. */ @@ -1827,7 +1947,7 @@ public Builder addAllIn( * ``` * * - * repeated sfixed32 in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated sfixed32 in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @return This builder for chaining. */ public Builder clearIn() { @@ -1864,7 +1984,7 @@ private void ensureNotInIsMutable(int capacity) { * ``` * * - * repeated sfixed32 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated sfixed32 not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @return A list containing the notIn. */ public java.util.List @@ -1886,7 +2006,7 @@ private void ensureNotInIsMutable(int capacity) { * ``` * * - * repeated sfixed32 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated sfixed32 not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @return The count of notIn. */ public int getNotInCount() { @@ -1906,7 +2026,7 @@ public int getNotInCount() { * ``` * * - * repeated sfixed32 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated sfixed32 not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @param index The index of the element to return. * @return The notIn at the given index. */ @@ -1927,7 +2047,7 @@ public int getNotIn(int index) { * ``` * * - * repeated sfixed32 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated sfixed32 not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @param index The index to set the value at. * @param value The notIn to set. * @return This builder for chaining. @@ -1955,7 +2075,7 @@ public Builder setNotIn( * ``` * * - * repeated sfixed32 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated sfixed32 not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @param value The notIn to add. * @return This builder for chaining. */ @@ -1981,7 +2101,7 @@ public Builder addNotIn(int value) { * ``` * * - * repeated sfixed32 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated sfixed32 not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @param values The notIn to add. * @return This builder for chaining. */ @@ -2008,7 +2128,7 @@ public Builder addAllNotIn( * ``` * * - * repeated sfixed32 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated sfixed32 not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @return This builder for chaining. */ public Builder clearNotIn() { @@ -2018,6 +2138,201 @@ public Builder clearNotIn() { return this; } + private com.google.protobuf.Internal.IntList example_ = emptyIntList(); + private void ensureExampleIsMutable() { + if (!example_.isModifiable()) { + example_ = makeMutableCopy(example_); + } + bitField0_ |= 0x00000080; + } + private void ensureExampleIsMutable(int capacity) { + if (!example_.isModifiable()) { + example_ = makeMutableCopy(example_, capacity); + } + bitField0_ |= 0x00000080; + } + /** + *
+     * `example` specifies values that the field may have. These values SHOULD
+     * conform to other constraints. `example` values will not impact validation
+     * but may be used as helpful guidance on how to populate the given field.
+     *
+     * ```proto
+     * message MySFixed32 {
+     * sfixed32 value = 1 [
+     * (buf.validate.field).sfixed32.example = 1,
+     * (buf.validate.field).sfixed32.example = 2
+     * ];
+     * }
+     * ```
+     * 
+ * + * repeated sfixed32 example = 8 [json_name = "example", (.buf.validate.predefined) = { ... } + * @return A list containing the example. + */ + public java.util.List + getExampleList() { + example_.makeImmutable(); + return example_; + } + /** + *
+     * `example` specifies values that the field may have. These values SHOULD
+     * conform to other constraints. `example` values will not impact validation
+     * but may be used as helpful guidance on how to populate the given field.
+     *
+     * ```proto
+     * message MySFixed32 {
+     * sfixed32 value = 1 [
+     * (buf.validate.field).sfixed32.example = 1,
+     * (buf.validate.field).sfixed32.example = 2
+     * ];
+     * }
+     * ```
+     * 
+ * + * repeated sfixed32 example = 8 [json_name = "example", (.buf.validate.predefined) = { ... } + * @return The count of example. + */ + public int getExampleCount() { + return example_.size(); + } + /** + *
+     * `example` specifies values that the field may have. These values SHOULD
+     * conform to other constraints. `example` values will not impact validation
+     * but may be used as helpful guidance on how to populate the given field.
+     *
+     * ```proto
+     * message MySFixed32 {
+     * sfixed32 value = 1 [
+     * (buf.validate.field).sfixed32.example = 1,
+     * (buf.validate.field).sfixed32.example = 2
+     * ];
+     * }
+     * ```
+     * 
+ * + * repeated sfixed32 example = 8 [json_name = "example", (.buf.validate.predefined) = { ... } + * @param index The index of the element to return. + * @return The example at the given index. + */ + public int getExample(int index) { + return example_.getInt(index); + } + /** + *
+     * `example` specifies values that the field may have. These values SHOULD
+     * conform to other constraints. `example` values will not impact validation
+     * but may be used as helpful guidance on how to populate the given field.
+     *
+     * ```proto
+     * message MySFixed32 {
+     * sfixed32 value = 1 [
+     * (buf.validate.field).sfixed32.example = 1,
+     * (buf.validate.field).sfixed32.example = 2
+     * ];
+     * }
+     * ```
+     * 
+ * + * repeated sfixed32 example = 8 [json_name = "example", (.buf.validate.predefined) = { ... } + * @param index The index to set the value at. + * @param value The example to set. + * @return This builder for chaining. + */ + public Builder setExample( + int index, int value) { + + ensureExampleIsMutable(); + example_.setInt(index, value); + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + *
+     * `example` specifies values that the field may have. These values SHOULD
+     * conform to other constraints. `example` values will not impact validation
+     * but may be used as helpful guidance on how to populate the given field.
+     *
+     * ```proto
+     * message MySFixed32 {
+     * sfixed32 value = 1 [
+     * (buf.validate.field).sfixed32.example = 1,
+     * (buf.validate.field).sfixed32.example = 2
+     * ];
+     * }
+     * ```
+     * 
+ * + * repeated sfixed32 example = 8 [json_name = "example", (.buf.validate.predefined) = { ... } + * @param value The example to add. + * @return This builder for chaining. + */ + public Builder addExample(int value) { + + ensureExampleIsMutable(); + example_.addInt(value); + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + *
+     * `example` specifies values that the field may have. These values SHOULD
+     * conform to other constraints. `example` values will not impact validation
+     * but may be used as helpful guidance on how to populate the given field.
+     *
+     * ```proto
+     * message MySFixed32 {
+     * sfixed32 value = 1 [
+     * (buf.validate.field).sfixed32.example = 1,
+     * (buf.validate.field).sfixed32.example = 2
+     * ];
+     * }
+     * ```
+     * 
+ * + * repeated sfixed32 example = 8 [json_name = "example", (.buf.validate.predefined) = { ... } + * @param values The example to add. + * @return This builder for chaining. + */ + public Builder addAllExample( + java.lang.Iterable values) { + ensureExampleIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, example_); + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + *
+     * `example` specifies values that the field may have. These values SHOULD
+     * conform to other constraints. `example` values will not impact validation
+     * but may be used as helpful guidance on how to populate the given field.
+     *
+     * ```proto
+     * message MySFixed32 {
+     * sfixed32 value = 1 [
+     * (buf.validate.field).sfixed32.example = 1,
+     * (buf.validate.field).sfixed32.example = 2
+     * ];
+     * }
+     * ```
+     * 
+ * + * repeated sfixed32 example = 8 [json_name = "example", (.buf.validate.predefined) = { ... } + * @return This builder for chaining. + */ + public Builder clearExample() { + example_ = emptyIntList(); + bitField0_ = (bitField0_ & ~0x00000080); + onChanged(); + return this; + } + // @@protoc_insertion_point(builder_scope:buf.validate.SFixed32Rules) } diff --git a/src/main/java/build/buf/validate/SFixed32RulesOrBuilder.java b/src/main/java/build/buf/validate/SFixed32RulesOrBuilder.java index 677eb786..50892b17 100644 --- a/src/main/java/build/buf/validate/SFixed32RulesOrBuilder.java +++ b/src/main/java/build/buf/validate/SFixed32RulesOrBuilder.java @@ -7,7 +7,8 @@ public interface SFixed32RulesOrBuilder extends // @@protoc_insertion_point(interface_extends:buf.validate.SFixed32Rules) - com.google.protobuf.MessageOrBuilder { + com.google.protobuf.GeneratedMessage. + ExtendableMessageOrBuilder { /** *
@@ -22,7 +23,7 @@ public interface SFixed32RulesOrBuilder extends
    * ```
    * 
* - * optional sfixed32 const = 1 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional sfixed32 const = 1 [json_name = "const", (.buf.validate.predefined) = { ... } * @return Whether the const field is set. */ boolean hasConst(); @@ -39,7 +40,7 @@ public interface SFixed32RulesOrBuilder extends * ``` * * - * optional sfixed32 const = 1 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional sfixed32 const = 1 [json_name = "const", (.buf.validate.predefined) = { ... } * @return The const. */ int getConst(); @@ -58,7 +59,7 @@ public interface SFixed32RulesOrBuilder extends * ``` * * - * sfixed32 lt = 2 [json_name = "lt", (.buf.validate.priv.field) = { ... } + * sfixed32 lt = 2 [json_name = "lt", (.buf.validate.predefined) = { ... } * @return Whether the lt field is set. */ boolean hasLt(); @@ -76,7 +77,7 @@ public interface SFixed32RulesOrBuilder extends * ``` * * - * sfixed32 lt = 2 [json_name = "lt", (.buf.validate.priv.field) = { ... } + * sfixed32 lt = 2 [json_name = "lt", (.buf.validate.predefined) = { ... } * @return The lt. */ int getLt(); @@ -95,7 +96,7 @@ public interface SFixed32RulesOrBuilder extends * ``` * * - * sfixed32 lte = 3 [json_name = "lte", (.buf.validate.priv.field) = { ... } + * sfixed32 lte = 3 [json_name = "lte", (.buf.validate.predefined) = { ... } * @return Whether the lte field is set. */ boolean hasLte(); @@ -113,7 +114,7 @@ public interface SFixed32RulesOrBuilder extends * ``` * * - * sfixed32 lte = 3 [json_name = "lte", (.buf.validate.priv.field) = { ... } + * sfixed32 lte = 3 [json_name = "lte", (.buf.validate.predefined) = { ... } * @return The lte. */ int getLte(); @@ -140,7 +141,7 @@ public interface SFixed32RulesOrBuilder extends * ``` * * - * sfixed32 gt = 4 [json_name = "gt", (.buf.validate.priv.field) = { ... } + * sfixed32 gt = 4 [json_name = "gt", (.buf.validate.predefined) = { ... } * @return Whether the gt field is set. */ boolean hasGt(); @@ -166,7 +167,7 @@ public interface SFixed32RulesOrBuilder extends * ``` * * - * sfixed32 gt = 4 [json_name = "gt", (.buf.validate.priv.field) = { ... } + * sfixed32 gt = 4 [json_name = "gt", (.buf.validate.predefined) = { ... } * @return The gt. */ int getGt(); @@ -193,7 +194,7 @@ public interface SFixed32RulesOrBuilder extends * ``` * * - * sfixed32 gte = 5 [json_name = "gte", (.buf.validate.priv.field) = { ... } + * sfixed32 gte = 5 [json_name = "gte", (.buf.validate.predefined) = { ... } * @return Whether the gte field is set. */ boolean hasGte(); @@ -219,7 +220,7 @@ public interface SFixed32RulesOrBuilder extends * ``` * * - * sfixed32 gte = 5 [json_name = "gte", (.buf.validate.priv.field) = { ... } + * sfixed32 gte = 5 [json_name = "gte", (.buf.validate.predefined) = { ... } * @return The gte. */ int getGte(); @@ -238,7 +239,7 @@ public interface SFixed32RulesOrBuilder extends * ``` * * - * repeated sfixed32 in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated sfixed32 in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @return A list containing the in. */ java.util.List getInList(); @@ -256,7 +257,7 @@ public interface SFixed32RulesOrBuilder extends * ``` * * - * repeated sfixed32 in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated sfixed32 in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @return The count of in. */ int getInCount(); @@ -274,7 +275,7 @@ public interface SFixed32RulesOrBuilder extends * ``` * * - * repeated sfixed32 in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated sfixed32 in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @param index The index of the element to return. * @return The in at the given index. */ @@ -294,7 +295,7 @@ public interface SFixed32RulesOrBuilder extends * ``` * * - * repeated sfixed32 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated sfixed32 not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @return A list containing the notIn. */ java.util.List getNotInList(); @@ -312,7 +313,7 @@ public interface SFixed32RulesOrBuilder extends * ``` * * - * repeated sfixed32 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated sfixed32 not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @return The count of notIn. */ int getNotInCount(); @@ -330,12 +331,74 @@ public interface SFixed32RulesOrBuilder extends * ``` * * - * repeated sfixed32 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated sfixed32 not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @param index The index of the element to return. * @return The notIn at the given index. */ int getNotIn(int index); + /** + *
+   * `example` specifies values that the field may have. These values SHOULD
+   * conform to other constraints. `example` values will not impact validation
+   * but may be used as helpful guidance on how to populate the given field.
+   *
+   * ```proto
+   * message MySFixed32 {
+   * sfixed32 value = 1 [
+   * (buf.validate.field).sfixed32.example = 1,
+   * (buf.validate.field).sfixed32.example = 2
+   * ];
+   * }
+   * ```
+   * 
+ * + * repeated sfixed32 example = 8 [json_name = "example", (.buf.validate.predefined) = { ... } + * @return A list containing the example. + */ + java.util.List getExampleList(); + /** + *
+   * `example` specifies values that the field may have. These values SHOULD
+   * conform to other constraints. `example` values will not impact validation
+   * but may be used as helpful guidance on how to populate the given field.
+   *
+   * ```proto
+   * message MySFixed32 {
+   * sfixed32 value = 1 [
+   * (buf.validate.field).sfixed32.example = 1,
+   * (buf.validate.field).sfixed32.example = 2
+   * ];
+   * }
+   * ```
+   * 
+ * + * repeated sfixed32 example = 8 [json_name = "example", (.buf.validate.predefined) = { ... } + * @return The count of example. + */ + int getExampleCount(); + /** + *
+   * `example` specifies values that the field may have. These values SHOULD
+   * conform to other constraints. `example` values will not impact validation
+   * but may be used as helpful guidance on how to populate the given field.
+   *
+   * ```proto
+   * message MySFixed32 {
+   * sfixed32 value = 1 [
+   * (buf.validate.field).sfixed32.example = 1,
+   * (buf.validate.field).sfixed32.example = 2
+   * ];
+   * }
+   * ```
+   * 
+ * + * repeated sfixed32 example = 8 [json_name = "example", (.buf.validate.predefined) = { ... } + * @param index The index of the element to return. + * @return The example at the given index. + */ + int getExample(int index); + build.buf.validate.SFixed32Rules.LessThanCase getLessThanCase(); build.buf.validate.SFixed32Rules.GreaterThanCase getGreaterThanCase(); diff --git a/src/main/java/build/buf/validate/SFixed64Rules.java b/src/main/java/build/buf/validate/SFixed64Rules.java index e919a541..4d90ece0 100644 --- a/src/main/java/build/buf/validate/SFixed64Rules.java +++ b/src/main/java/build/buf/validate/SFixed64Rules.java @@ -13,7 +13,8 @@ * Protobuf type {@code buf.validate.SFixed64Rules} */ public final class SFixed64Rules extends - com.google.protobuf.GeneratedMessage implements + com.google.protobuf.GeneratedMessage.ExtendableMessage< + SFixed64Rules> implements // @@protoc_insertion_point(message_implements:buf.validate.SFixed64Rules) SFixed64RulesOrBuilder { private static final long serialVersionUID = 0L; @@ -27,12 +28,13 @@ public final class SFixed64Rules extends SFixed64Rules.class.getName()); } // Use SFixed64Rules.newBuilder() to construct. - private SFixed64Rules(com.google.protobuf.GeneratedMessage.Builder builder) { + private SFixed64Rules(com.google.protobuf.GeneratedMessage.ExtendableBuilder builder) { super(builder); } private SFixed64Rules() { in_ = emptyLongList(); notIn_ = emptyLongList(); + example_ = emptyLongList(); } public static final com.google.protobuf.Descriptors.Descriptor @@ -148,7 +150,7 @@ public int getNumber() { * ``` * * - * optional sfixed64 const = 1 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional sfixed64 const = 1 [json_name = "const", (.buf.validate.predefined) = { ... } * @return Whether the const field is set. */ @java.lang.Override @@ -168,7 +170,7 @@ public boolean hasConst() { * ``` * * - * optional sfixed64 const = 1 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional sfixed64 const = 1 [json_name = "const", (.buf.validate.predefined) = { ... } * @return The const. */ @java.lang.Override @@ -191,7 +193,7 @@ public long getConst() { * ``` * * - * sfixed64 lt = 2 [json_name = "lt", (.buf.validate.priv.field) = { ... } + * sfixed64 lt = 2 [json_name = "lt", (.buf.validate.predefined) = { ... } * @return Whether the lt field is set. */ @java.lang.Override @@ -212,7 +214,7 @@ public boolean hasLt() { * ``` * * - * sfixed64 lt = 2 [json_name = "lt", (.buf.validate.priv.field) = { ... } + * sfixed64 lt = 2 [json_name = "lt", (.buf.validate.predefined) = { ... } * @return The lt. */ @java.lang.Override @@ -238,7 +240,7 @@ public long getLt() { * ``` * * - * sfixed64 lte = 3 [json_name = "lte", (.buf.validate.priv.field) = { ... } + * sfixed64 lte = 3 [json_name = "lte", (.buf.validate.predefined) = { ... } * @return Whether the lte field is set. */ @java.lang.Override @@ -259,7 +261,7 @@ public boolean hasLte() { * ``` * * - * sfixed64 lte = 3 [json_name = "lte", (.buf.validate.priv.field) = { ... } + * sfixed64 lte = 3 [json_name = "lte", (.buf.validate.predefined) = { ... } * @return The lte. */ @java.lang.Override @@ -293,7 +295,7 @@ public long getLte() { * ``` * * - * sfixed64 gt = 4 [json_name = "gt", (.buf.validate.priv.field) = { ... } + * sfixed64 gt = 4 [json_name = "gt", (.buf.validate.predefined) = { ... } * @return Whether the gt field is set. */ @java.lang.Override @@ -322,7 +324,7 @@ public boolean hasGt() { * ``` * * - * sfixed64 gt = 4 [json_name = "gt", (.buf.validate.priv.field) = { ... } + * sfixed64 gt = 4 [json_name = "gt", (.buf.validate.predefined) = { ... } * @return The gt. */ @java.lang.Override @@ -356,7 +358,7 @@ public long getGt() { * ``` * * - * sfixed64 gte = 5 [json_name = "gte", (.buf.validate.priv.field) = { ... } + * sfixed64 gte = 5 [json_name = "gte", (.buf.validate.predefined) = { ... } * @return Whether the gte field is set. */ @java.lang.Override @@ -385,7 +387,7 @@ public boolean hasGte() { * ``` * * - * sfixed64 gte = 5 [json_name = "gte", (.buf.validate.priv.field) = { ... } + * sfixed64 gte = 5 [json_name = "gte", (.buf.validate.predefined) = { ... } * @return The gte. */ @java.lang.Override @@ -414,7 +416,7 @@ public long getGte() { * ``` * * - * repeated sfixed64 in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated sfixed64 in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @return A list containing the in. */ @java.lang.Override @@ -436,7 +438,7 @@ public long getGte() { * ``` * * - * repeated sfixed64 in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated sfixed64 in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @return The count of in. */ public int getInCount() { @@ -456,14 +458,13 @@ public int getInCount() { * ``` * * - * repeated sfixed64 in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated sfixed64 in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @param index The index of the element to return. * @return The in at the given index. */ public long getIn(int index) { return in_.getLong(index); } - private int inMemoizedSerializedSize = -1; public static final int NOT_IN_FIELD_NUMBER = 7; @SuppressWarnings("serial") @@ -483,7 +484,7 @@ public long getIn(int index) { * ``` * * - * repeated sfixed64 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated sfixed64 not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @return A list containing the notIn. */ @java.lang.Override @@ -505,7 +506,7 @@ public long getIn(int index) { * ``` * * - * repeated sfixed64 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated sfixed64 not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @return The count of notIn. */ public int getNotInCount() { @@ -525,14 +526,87 @@ public int getNotInCount() { * ``` * * - * repeated sfixed64 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated sfixed64 not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @param index The index of the element to return. * @return The notIn at the given index. */ public long getNotIn(int index) { return notIn_.getLong(index); } - private int notInMemoizedSerializedSize = -1; + + public static final int EXAMPLE_FIELD_NUMBER = 8; + @SuppressWarnings("serial") + private com.google.protobuf.Internal.LongList example_ = + emptyLongList(); + /** + *
+   * `example` specifies values that the field may have. These values SHOULD
+   * conform to other constraints. `example` values will not impact validation
+   * but may be used as helpful guidance on how to populate the given field.
+   *
+   * ```proto
+   * message MySFixed64 {
+   * sfixed64 value = 1 [
+   * (buf.validate.field).sfixed64.example = 1,
+   * (buf.validate.field).sfixed64.example = 2
+   * ];
+   * }
+   * ```
+   * 
+ * + * repeated sfixed64 example = 8 [json_name = "example", (.buf.validate.predefined) = { ... } + * @return A list containing the example. + */ + @java.lang.Override + public java.util.List + getExampleList() { + return example_; + } + /** + *
+   * `example` specifies values that the field may have. These values SHOULD
+   * conform to other constraints. `example` values will not impact validation
+   * but may be used as helpful guidance on how to populate the given field.
+   *
+   * ```proto
+   * message MySFixed64 {
+   * sfixed64 value = 1 [
+   * (buf.validate.field).sfixed64.example = 1,
+   * (buf.validate.field).sfixed64.example = 2
+   * ];
+   * }
+   * ```
+   * 
+ * + * repeated sfixed64 example = 8 [json_name = "example", (.buf.validate.predefined) = { ... } + * @return The count of example. + */ + public int getExampleCount() { + return example_.size(); + } + /** + *
+   * `example` specifies values that the field may have. These values SHOULD
+   * conform to other constraints. `example` values will not impact validation
+   * but may be used as helpful guidance on how to populate the given field.
+   *
+   * ```proto
+   * message MySFixed64 {
+   * sfixed64 value = 1 [
+   * (buf.validate.field).sfixed64.example = 1,
+   * (buf.validate.field).sfixed64.example = 2
+   * ];
+   * }
+   * ```
+   * 
+ * + * repeated sfixed64 example = 8 [json_name = "example", (.buf.validate.predefined) = { ... } + * @param index The index of the element to return. + * @return The example at the given index. + */ + public long getExample(int index) { + return example_.getLong(index); + } private byte memoizedIsInitialized = -1; @java.lang.Override @@ -541,6 +615,10 @@ public final boolean isInitialized() { if (isInitialized == 1) return true; if (isInitialized == 0) return false; + if (!extensionsAreInitialized()) { + memoizedIsInitialized = 0; + return false; + } memoizedIsInitialized = 1; return true; } @@ -548,7 +626,9 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - getSerializedSize(); + com.google.protobuf.GeneratedMessage + .ExtendableMessage.ExtensionSerializer + extensionWriter = newExtensionSerializer(); if (((bitField0_ & 0x00000001) != 0)) { output.writeSFixed64(1, const_); } @@ -568,20 +648,16 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) output.writeSFixed64( 5, (long)((java.lang.Long) greaterThan_)); } - if (getInList().size() > 0) { - output.writeUInt32NoTag(50); - output.writeUInt32NoTag(inMemoizedSerializedSize); - } for (int i = 0; i < in_.size(); i++) { - output.writeSFixed64NoTag(in_.getLong(i)); - } - if (getNotInList().size() > 0) { - output.writeUInt32NoTag(58); - output.writeUInt32NoTag(notInMemoizedSerializedSize); + output.writeSFixed64(6, in_.getLong(i)); } for (int i = 0; i < notIn_.size(); i++) { - output.writeSFixed64NoTag(notIn_.getLong(i)); + output.writeSFixed64(7, notIn_.getLong(i)); } + for (int i = 0; i < example_.size(); i++) { + output.writeSFixed64(8, example_.getLong(i)); + } + extensionWriter.writeUntil(536870912, output); getUnknownFields().writeTo(output); } @@ -619,24 +695,21 @@ public int getSerializedSize() { int dataSize = 0; dataSize = 8 * getInList().size(); size += dataSize; - if (!getInList().isEmpty()) { - size += 1; - size += com.google.protobuf.CodedOutputStream - .computeInt32SizeNoTag(dataSize); - } - inMemoizedSerializedSize = dataSize; + size += 1 * getInList().size(); } { int dataSize = 0; dataSize = 8 * getNotInList().size(); size += dataSize; - if (!getNotInList().isEmpty()) { - size += 1; - size += com.google.protobuf.CodedOutputStream - .computeInt32SizeNoTag(dataSize); - } - notInMemoizedSerializedSize = dataSize; + size += 1 * getNotInList().size(); } + { + int dataSize = 0; + dataSize = 8 * getExampleList().size(); + size += dataSize; + size += 1 * getExampleList().size(); + } + size += extensionsSerializedSize(); size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -661,6 +734,8 @@ public boolean equals(final java.lang.Object obj) { .equals(other.getInList())) return false; if (!getNotInList() .equals(other.getNotInList())) return false; + if (!getExampleList() + .equals(other.getExampleList())) return false; if (!getLessThanCase().equals(other.getLessThanCase())) return false; switch (lessThanCase_) { case 2: @@ -688,6 +763,8 @@ public boolean equals(final java.lang.Object obj) { default: } if (!getUnknownFields().equals(other.getUnknownFields())) return false; + if (!getExtensionFields().equals(other.getExtensionFields())) + return false; return true; } @@ -711,6 +788,10 @@ public int hashCode() { hash = (37 * hash) + NOT_IN_FIELD_NUMBER; hash = (53 * hash) + getNotInList().hashCode(); } + if (getExampleCount() > 0) { + hash = (37 * hash) + EXAMPLE_FIELD_NUMBER; + hash = (53 * hash) + getExampleList().hashCode(); + } switch (lessThanCase_) { case 2: hash = (37 * hash) + LT_FIELD_NUMBER; @@ -739,6 +820,7 @@ public int hashCode() { case 0: default: } + hash = hashFields(hash, getExtensionFields()); hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -844,7 +926,8 @@ protected Builder newBuilderForType( * Protobuf type {@code buf.validate.SFixed64Rules} */ public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder implements + com.google.protobuf.GeneratedMessage.ExtendableBuilder< + build.buf.validate.SFixed64Rules, Builder> implements // @@protoc_insertion_point(builder_implements:buf.validate.SFixed64Rules) build.buf.validate.SFixed64RulesOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor @@ -877,6 +960,7 @@ public Builder clear() { const_ = 0L; in_ = emptyLongList(); notIn_ = emptyLongList(); + example_ = emptyLongList(); lessThanCase_ = 0; lessThan_ = null; greaterThanCase_ = 0; @@ -928,6 +1012,10 @@ private void buildPartial0(build.buf.validate.SFixed64Rules result) { notIn_.makeImmutable(); result.notIn_ = notIn_; } + if (((from_bitField0_ & 0x00000080) != 0)) { + example_.makeImmutable(); + result.example_ = example_; + } result.bitField0_ |= to_bitField0_; } @@ -975,6 +1063,17 @@ public Builder mergeFrom(build.buf.validate.SFixed64Rules other) { } onChanged(); } + if (!other.example_.isEmpty()) { + if (example_.isEmpty()) { + example_ = other.example_; + example_.makeImmutable(); + bitField0_ |= 0x00000080; + } else { + ensureExampleIsMutable(); + example_.addAll(other.example_); + } + onChanged(); + } switch (other.getLessThanCase()) { case LT: { setLt(other.getLt()); @@ -1001,6 +1100,7 @@ public Builder mergeFrom(build.buf.validate.SFixed64Rules other) { break; } } + this.mergeExtensionFields(other); this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -1008,6 +1108,9 @@ public Builder mergeFrom(build.buf.validate.SFixed64Rules other) { @java.lang.Override public final boolean isInitialized() { + if (!extensionsAreInitialized()) { + return false; + } return true; } @@ -1086,6 +1189,23 @@ public Builder mergeFrom( input.popLimit(limit); break; } // case 58 + case 65: { + long v = input.readSFixed64(); + ensureExampleIsMutable(); + example_.addLong(v); + break; + } // case 65 + case 66: { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + int alloc = length > 4096 ? 4096 : length; + ensureExampleIsMutable(alloc / 8); + while (input.getBytesUntilLimit() > 0) { + example_.addLong(input.readSFixed64()); + } + input.popLimit(limit); + break; + } // case 66 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { done = true; // was an endgroup tag @@ -1147,7 +1267,7 @@ public Builder clearGreaterThan() { * ``` * * - * optional sfixed64 const = 1 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional sfixed64 const = 1 [json_name = "const", (.buf.validate.predefined) = { ... } * @return Whether the const field is set. */ @java.lang.Override @@ -1167,7 +1287,7 @@ public boolean hasConst() { * ``` * * - * optional sfixed64 const = 1 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional sfixed64 const = 1 [json_name = "const", (.buf.validate.predefined) = { ... } * @return The const. */ @java.lang.Override @@ -1187,7 +1307,7 @@ public long getConst() { * ``` * * - * optional sfixed64 const = 1 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional sfixed64 const = 1 [json_name = "const", (.buf.validate.predefined) = { ... } * @param value The const to set. * @return This builder for chaining. */ @@ -1211,7 +1331,7 @@ public Builder setConst(long value) { * ``` * * - * optional sfixed64 const = 1 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional sfixed64 const = 1 [json_name = "const", (.buf.validate.predefined) = { ... } * @return This builder for chaining. */ public Builder clearConst() { @@ -1235,7 +1355,7 @@ public Builder clearConst() { * ``` * * - * sfixed64 lt = 2 [json_name = "lt", (.buf.validate.priv.field) = { ... } + * sfixed64 lt = 2 [json_name = "lt", (.buf.validate.predefined) = { ... } * @return Whether the lt field is set. */ public boolean hasLt() { @@ -1255,7 +1375,7 @@ public boolean hasLt() { * ``` * * - * sfixed64 lt = 2 [json_name = "lt", (.buf.validate.priv.field) = { ... } + * sfixed64 lt = 2 [json_name = "lt", (.buf.validate.predefined) = { ... } * @return The lt. */ public long getLt() { @@ -1278,7 +1398,7 @@ public long getLt() { * ``` * * - * sfixed64 lt = 2 [json_name = "lt", (.buf.validate.priv.field) = { ... } + * sfixed64 lt = 2 [json_name = "lt", (.buf.validate.predefined) = { ... } * @param value The lt to set. * @return This builder for chaining. */ @@ -1303,7 +1423,7 @@ public Builder setLt(long value) { * ``` * * - * sfixed64 lt = 2 [json_name = "lt", (.buf.validate.priv.field) = { ... } + * sfixed64 lt = 2 [json_name = "lt", (.buf.validate.predefined) = { ... } * @return This builder for chaining. */ public Builder clearLt() { @@ -1329,7 +1449,7 @@ public Builder clearLt() { * ``` * * - * sfixed64 lte = 3 [json_name = "lte", (.buf.validate.priv.field) = { ... } + * sfixed64 lte = 3 [json_name = "lte", (.buf.validate.predefined) = { ... } * @return Whether the lte field is set. */ public boolean hasLte() { @@ -1349,7 +1469,7 @@ public boolean hasLte() { * ``` * * - * sfixed64 lte = 3 [json_name = "lte", (.buf.validate.priv.field) = { ... } + * sfixed64 lte = 3 [json_name = "lte", (.buf.validate.predefined) = { ... } * @return The lte. */ public long getLte() { @@ -1372,7 +1492,7 @@ public long getLte() { * ``` * * - * sfixed64 lte = 3 [json_name = "lte", (.buf.validate.priv.field) = { ... } + * sfixed64 lte = 3 [json_name = "lte", (.buf.validate.predefined) = { ... } * @param value The lte to set. * @return This builder for chaining. */ @@ -1397,7 +1517,7 @@ public Builder setLte(long value) { * ``` * * - * sfixed64 lte = 3 [json_name = "lte", (.buf.validate.priv.field) = { ... } + * sfixed64 lte = 3 [json_name = "lte", (.buf.validate.predefined) = { ... } * @return This builder for chaining. */ public Builder clearLte() { @@ -1431,7 +1551,7 @@ public Builder clearLte() { * ``` * * - * sfixed64 gt = 4 [json_name = "gt", (.buf.validate.priv.field) = { ... } + * sfixed64 gt = 4 [json_name = "gt", (.buf.validate.predefined) = { ... } * @return Whether the gt field is set. */ public boolean hasGt() { @@ -1459,7 +1579,7 @@ public boolean hasGt() { * ``` * * - * sfixed64 gt = 4 [json_name = "gt", (.buf.validate.priv.field) = { ... } + * sfixed64 gt = 4 [json_name = "gt", (.buf.validate.predefined) = { ... } * @return The gt. */ public long getGt() { @@ -1490,7 +1610,7 @@ public long getGt() { * ``` * * - * sfixed64 gt = 4 [json_name = "gt", (.buf.validate.priv.field) = { ... } + * sfixed64 gt = 4 [json_name = "gt", (.buf.validate.predefined) = { ... } * @param value The gt to set. * @return This builder for chaining. */ @@ -1523,7 +1643,7 @@ public Builder setGt(long value) { * ``` * * - * sfixed64 gt = 4 [json_name = "gt", (.buf.validate.priv.field) = { ... } + * sfixed64 gt = 4 [json_name = "gt", (.buf.validate.predefined) = { ... } * @return This builder for chaining. */ public Builder clearGt() { @@ -1557,7 +1677,7 @@ public Builder clearGt() { * ``` * * - * sfixed64 gte = 5 [json_name = "gte", (.buf.validate.priv.field) = { ... } + * sfixed64 gte = 5 [json_name = "gte", (.buf.validate.predefined) = { ... } * @return Whether the gte field is set. */ public boolean hasGte() { @@ -1585,7 +1705,7 @@ public boolean hasGte() { * ``` * * - * sfixed64 gte = 5 [json_name = "gte", (.buf.validate.priv.field) = { ... } + * sfixed64 gte = 5 [json_name = "gte", (.buf.validate.predefined) = { ... } * @return The gte. */ public long getGte() { @@ -1616,7 +1736,7 @@ public long getGte() { * ``` * * - * sfixed64 gte = 5 [json_name = "gte", (.buf.validate.priv.field) = { ... } + * sfixed64 gte = 5 [json_name = "gte", (.buf.validate.predefined) = { ... } * @param value The gte to set. * @return This builder for chaining. */ @@ -1649,7 +1769,7 @@ public Builder setGte(long value) { * ``` * * - * sfixed64 gte = 5 [json_name = "gte", (.buf.validate.priv.field) = { ... } + * sfixed64 gte = 5 [json_name = "gte", (.buf.validate.predefined) = { ... } * @return This builder for chaining. */ public Builder clearGte() { @@ -1688,7 +1808,7 @@ private void ensureInIsMutable(int capacity) { * ``` * * - * repeated sfixed64 in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated sfixed64 in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @return A list containing the in. */ public java.util.List @@ -1710,7 +1830,7 @@ private void ensureInIsMutable(int capacity) { * ``` * * - * repeated sfixed64 in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated sfixed64 in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @return The count of in. */ public int getInCount() { @@ -1730,7 +1850,7 @@ public int getInCount() { * ``` * * - * repeated sfixed64 in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated sfixed64 in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @param index The index of the element to return. * @return The in at the given index. */ @@ -1751,7 +1871,7 @@ public long getIn(int index) { * ``` * * - * repeated sfixed64 in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated sfixed64 in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @param index The index to set the value at. * @param value The in to set. * @return This builder for chaining. @@ -1779,7 +1899,7 @@ public Builder setIn( * ``` * * - * repeated sfixed64 in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated sfixed64 in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @param value The in to add. * @return This builder for chaining. */ @@ -1805,7 +1925,7 @@ public Builder addIn(long value) { * ``` * * - * repeated sfixed64 in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated sfixed64 in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @param values The in to add. * @return This builder for chaining. */ @@ -1832,7 +1952,7 @@ public Builder addAllIn( * ``` * * - * repeated sfixed64 in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated sfixed64 in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @return This builder for chaining. */ public Builder clearIn() { @@ -1869,7 +1989,7 @@ private void ensureNotInIsMutable(int capacity) { * ``` * * - * repeated sfixed64 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated sfixed64 not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @return A list containing the notIn. */ public java.util.List @@ -1891,7 +2011,7 @@ private void ensureNotInIsMutable(int capacity) { * ``` * * - * repeated sfixed64 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated sfixed64 not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @return The count of notIn. */ public int getNotInCount() { @@ -1911,7 +2031,7 @@ public int getNotInCount() { * ``` * * - * repeated sfixed64 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated sfixed64 not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @param index The index of the element to return. * @return The notIn at the given index. */ @@ -1932,7 +2052,7 @@ public long getNotIn(int index) { * ``` * * - * repeated sfixed64 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated sfixed64 not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @param index The index to set the value at. * @param value The notIn to set. * @return This builder for chaining. @@ -1960,7 +2080,7 @@ public Builder setNotIn( * ``` * * - * repeated sfixed64 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated sfixed64 not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @param value The notIn to add. * @return This builder for chaining. */ @@ -1986,7 +2106,7 @@ public Builder addNotIn(long value) { * ``` * * - * repeated sfixed64 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated sfixed64 not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @param values The notIn to add. * @return This builder for chaining. */ @@ -2013,7 +2133,7 @@ public Builder addAllNotIn( * ``` * * - * repeated sfixed64 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated sfixed64 not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @return This builder for chaining. */ public Builder clearNotIn() { @@ -2023,6 +2143,201 @@ public Builder clearNotIn() { return this; } + private com.google.protobuf.Internal.LongList example_ = emptyLongList(); + private void ensureExampleIsMutable() { + if (!example_.isModifiable()) { + example_ = makeMutableCopy(example_); + } + bitField0_ |= 0x00000080; + } + private void ensureExampleIsMutable(int capacity) { + if (!example_.isModifiable()) { + example_ = makeMutableCopy(example_, capacity); + } + bitField0_ |= 0x00000080; + } + /** + *
+     * `example` specifies values that the field may have. These values SHOULD
+     * conform to other constraints. `example` values will not impact validation
+     * but may be used as helpful guidance on how to populate the given field.
+     *
+     * ```proto
+     * message MySFixed64 {
+     * sfixed64 value = 1 [
+     * (buf.validate.field).sfixed64.example = 1,
+     * (buf.validate.field).sfixed64.example = 2
+     * ];
+     * }
+     * ```
+     * 
+ * + * repeated sfixed64 example = 8 [json_name = "example", (.buf.validate.predefined) = { ... } + * @return A list containing the example. + */ + public java.util.List + getExampleList() { + example_.makeImmutable(); + return example_; + } + /** + *
+     * `example` specifies values that the field may have. These values SHOULD
+     * conform to other constraints. `example` values will not impact validation
+     * but may be used as helpful guidance on how to populate the given field.
+     *
+     * ```proto
+     * message MySFixed64 {
+     * sfixed64 value = 1 [
+     * (buf.validate.field).sfixed64.example = 1,
+     * (buf.validate.field).sfixed64.example = 2
+     * ];
+     * }
+     * ```
+     * 
+ * + * repeated sfixed64 example = 8 [json_name = "example", (.buf.validate.predefined) = { ... } + * @return The count of example. + */ + public int getExampleCount() { + return example_.size(); + } + /** + *
+     * `example` specifies values that the field may have. These values SHOULD
+     * conform to other constraints. `example` values will not impact validation
+     * but may be used as helpful guidance on how to populate the given field.
+     *
+     * ```proto
+     * message MySFixed64 {
+     * sfixed64 value = 1 [
+     * (buf.validate.field).sfixed64.example = 1,
+     * (buf.validate.field).sfixed64.example = 2
+     * ];
+     * }
+     * ```
+     * 
+ * + * repeated sfixed64 example = 8 [json_name = "example", (.buf.validate.predefined) = { ... } + * @param index The index of the element to return. + * @return The example at the given index. + */ + public long getExample(int index) { + return example_.getLong(index); + } + /** + *
+     * `example` specifies values that the field may have. These values SHOULD
+     * conform to other constraints. `example` values will not impact validation
+     * but may be used as helpful guidance on how to populate the given field.
+     *
+     * ```proto
+     * message MySFixed64 {
+     * sfixed64 value = 1 [
+     * (buf.validate.field).sfixed64.example = 1,
+     * (buf.validate.field).sfixed64.example = 2
+     * ];
+     * }
+     * ```
+     * 
+ * + * repeated sfixed64 example = 8 [json_name = "example", (.buf.validate.predefined) = { ... } + * @param index The index to set the value at. + * @param value The example to set. + * @return This builder for chaining. + */ + public Builder setExample( + int index, long value) { + + ensureExampleIsMutable(); + example_.setLong(index, value); + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + *
+     * `example` specifies values that the field may have. These values SHOULD
+     * conform to other constraints. `example` values will not impact validation
+     * but may be used as helpful guidance on how to populate the given field.
+     *
+     * ```proto
+     * message MySFixed64 {
+     * sfixed64 value = 1 [
+     * (buf.validate.field).sfixed64.example = 1,
+     * (buf.validate.field).sfixed64.example = 2
+     * ];
+     * }
+     * ```
+     * 
+ * + * repeated sfixed64 example = 8 [json_name = "example", (.buf.validate.predefined) = { ... } + * @param value The example to add. + * @return This builder for chaining. + */ + public Builder addExample(long value) { + + ensureExampleIsMutable(); + example_.addLong(value); + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + *
+     * `example` specifies values that the field may have. These values SHOULD
+     * conform to other constraints. `example` values will not impact validation
+     * but may be used as helpful guidance on how to populate the given field.
+     *
+     * ```proto
+     * message MySFixed64 {
+     * sfixed64 value = 1 [
+     * (buf.validate.field).sfixed64.example = 1,
+     * (buf.validate.field).sfixed64.example = 2
+     * ];
+     * }
+     * ```
+     * 
+ * + * repeated sfixed64 example = 8 [json_name = "example", (.buf.validate.predefined) = { ... } + * @param values The example to add. + * @return This builder for chaining. + */ + public Builder addAllExample( + java.lang.Iterable values) { + ensureExampleIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, example_); + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + *
+     * `example` specifies values that the field may have. These values SHOULD
+     * conform to other constraints. `example` values will not impact validation
+     * but may be used as helpful guidance on how to populate the given field.
+     *
+     * ```proto
+     * message MySFixed64 {
+     * sfixed64 value = 1 [
+     * (buf.validate.field).sfixed64.example = 1,
+     * (buf.validate.field).sfixed64.example = 2
+     * ];
+     * }
+     * ```
+     * 
+ * + * repeated sfixed64 example = 8 [json_name = "example", (.buf.validate.predefined) = { ... } + * @return This builder for chaining. + */ + public Builder clearExample() { + example_ = emptyLongList(); + bitField0_ = (bitField0_ & ~0x00000080); + onChanged(); + return this; + } + // @@protoc_insertion_point(builder_scope:buf.validate.SFixed64Rules) } diff --git a/src/main/java/build/buf/validate/SFixed64RulesOrBuilder.java b/src/main/java/build/buf/validate/SFixed64RulesOrBuilder.java index 03946551..82c1e663 100644 --- a/src/main/java/build/buf/validate/SFixed64RulesOrBuilder.java +++ b/src/main/java/build/buf/validate/SFixed64RulesOrBuilder.java @@ -7,7 +7,8 @@ public interface SFixed64RulesOrBuilder extends // @@protoc_insertion_point(interface_extends:buf.validate.SFixed64Rules) - com.google.protobuf.MessageOrBuilder { + com.google.protobuf.GeneratedMessage. + ExtendableMessageOrBuilder { /** *
@@ -22,7 +23,7 @@ public interface SFixed64RulesOrBuilder extends
    * ```
    * 
* - * optional sfixed64 const = 1 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional sfixed64 const = 1 [json_name = "const", (.buf.validate.predefined) = { ... } * @return Whether the const field is set. */ boolean hasConst(); @@ -39,7 +40,7 @@ public interface SFixed64RulesOrBuilder extends * ``` * * - * optional sfixed64 const = 1 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional sfixed64 const = 1 [json_name = "const", (.buf.validate.predefined) = { ... } * @return The const. */ long getConst(); @@ -58,7 +59,7 @@ public interface SFixed64RulesOrBuilder extends * ``` * * - * sfixed64 lt = 2 [json_name = "lt", (.buf.validate.priv.field) = { ... } + * sfixed64 lt = 2 [json_name = "lt", (.buf.validate.predefined) = { ... } * @return Whether the lt field is set. */ boolean hasLt(); @@ -76,7 +77,7 @@ public interface SFixed64RulesOrBuilder extends * ``` * * - * sfixed64 lt = 2 [json_name = "lt", (.buf.validate.priv.field) = { ... } + * sfixed64 lt = 2 [json_name = "lt", (.buf.validate.predefined) = { ... } * @return The lt. */ long getLt(); @@ -95,7 +96,7 @@ public interface SFixed64RulesOrBuilder extends * ``` * * - * sfixed64 lte = 3 [json_name = "lte", (.buf.validate.priv.field) = { ... } + * sfixed64 lte = 3 [json_name = "lte", (.buf.validate.predefined) = { ... } * @return Whether the lte field is set. */ boolean hasLte(); @@ -113,7 +114,7 @@ public interface SFixed64RulesOrBuilder extends * ``` * * - * sfixed64 lte = 3 [json_name = "lte", (.buf.validate.priv.field) = { ... } + * sfixed64 lte = 3 [json_name = "lte", (.buf.validate.predefined) = { ... } * @return The lte. */ long getLte(); @@ -140,7 +141,7 @@ public interface SFixed64RulesOrBuilder extends * ``` * * - * sfixed64 gt = 4 [json_name = "gt", (.buf.validate.priv.field) = { ... } + * sfixed64 gt = 4 [json_name = "gt", (.buf.validate.predefined) = { ... } * @return Whether the gt field is set. */ boolean hasGt(); @@ -166,7 +167,7 @@ public interface SFixed64RulesOrBuilder extends * ``` * * - * sfixed64 gt = 4 [json_name = "gt", (.buf.validate.priv.field) = { ... } + * sfixed64 gt = 4 [json_name = "gt", (.buf.validate.predefined) = { ... } * @return The gt. */ long getGt(); @@ -193,7 +194,7 @@ public interface SFixed64RulesOrBuilder extends * ``` * * - * sfixed64 gte = 5 [json_name = "gte", (.buf.validate.priv.field) = { ... } + * sfixed64 gte = 5 [json_name = "gte", (.buf.validate.predefined) = { ... } * @return Whether the gte field is set. */ boolean hasGte(); @@ -219,7 +220,7 @@ public interface SFixed64RulesOrBuilder extends * ``` * * - * sfixed64 gte = 5 [json_name = "gte", (.buf.validate.priv.field) = { ... } + * sfixed64 gte = 5 [json_name = "gte", (.buf.validate.predefined) = { ... } * @return The gte. */ long getGte(); @@ -238,7 +239,7 @@ public interface SFixed64RulesOrBuilder extends * ``` * * - * repeated sfixed64 in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated sfixed64 in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @return A list containing the in. */ java.util.List getInList(); @@ -256,7 +257,7 @@ public interface SFixed64RulesOrBuilder extends * ``` * * - * repeated sfixed64 in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated sfixed64 in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @return The count of in. */ int getInCount(); @@ -274,7 +275,7 @@ public interface SFixed64RulesOrBuilder extends * ``` * * - * repeated sfixed64 in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated sfixed64 in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @param index The index of the element to return. * @return The in at the given index. */ @@ -294,7 +295,7 @@ public interface SFixed64RulesOrBuilder extends * ``` * * - * repeated sfixed64 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated sfixed64 not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @return A list containing the notIn. */ java.util.List getNotInList(); @@ -312,7 +313,7 @@ public interface SFixed64RulesOrBuilder extends * ``` * * - * repeated sfixed64 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated sfixed64 not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @return The count of notIn. */ int getNotInCount(); @@ -330,12 +331,74 @@ public interface SFixed64RulesOrBuilder extends * ``` * * - * repeated sfixed64 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated sfixed64 not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @param index The index of the element to return. * @return The notIn at the given index. */ long getNotIn(int index); + /** + *
+   * `example` specifies values that the field may have. These values SHOULD
+   * conform to other constraints. `example` values will not impact validation
+   * but may be used as helpful guidance on how to populate the given field.
+   *
+   * ```proto
+   * message MySFixed64 {
+   * sfixed64 value = 1 [
+   * (buf.validate.field).sfixed64.example = 1,
+   * (buf.validate.field).sfixed64.example = 2
+   * ];
+   * }
+   * ```
+   * 
+ * + * repeated sfixed64 example = 8 [json_name = "example", (.buf.validate.predefined) = { ... } + * @return A list containing the example. + */ + java.util.List getExampleList(); + /** + *
+   * `example` specifies values that the field may have. These values SHOULD
+   * conform to other constraints. `example` values will not impact validation
+   * but may be used as helpful guidance on how to populate the given field.
+   *
+   * ```proto
+   * message MySFixed64 {
+   * sfixed64 value = 1 [
+   * (buf.validate.field).sfixed64.example = 1,
+   * (buf.validate.field).sfixed64.example = 2
+   * ];
+   * }
+   * ```
+   * 
+ * + * repeated sfixed64 example = 8 [json_name = "example", (.buf.validate.predefined) = { ... } + * @return The count of example. + */ + int getExampleCount(); + /** + *
+   * `example` specifies values that the field may have. These values SHOULD
+   * conform to other constraints. `example` values will not impact validation
+   * but may be used as helpful guidance on how to populate the given field.
+   *
+   * ```proto
+   * message MySFixed64 {
+   * sfixed64 value = 1 [
+   * (buf.validate.field).sfixed64.example = 1,
+   * (buf.validate.field).sfixed64.example = 2
+   * ];
+   * }
+   * ```
+   * 
+ * + * repeated sfixed64 example = 8 [json_name = "example", (.buf.validate.predefined) = { ... } + * @param index The index of the element to return. + * @return The example at the given index. + */ + long getExample(int index); + build.buf.validate.SFixed64Rules.LessThanCase getLessThanCase(); build.buf.validate.SFixed64Rules.GreaterThanCase getGreaterThanCase(); diff --git a/src/main/java/build/buf/validate/SInt32Rules.java b/src/main/java/build/buf/validate/SInt32Rules.java index 1eb12513..49c4ab0f 100644 --- a/src/main/java/build/buf/validate/SInt32Rules.java +++ b/src/main/java/build/buf/validate/SInt32Rules.java @@ -13,7 +13,8 @@ * Protobuf type {@code buf.validate.SInt32Rules} */ public final class SInt32Rules extends - com.google.protobuf.GeneratedMessage implements + com.google.protobuf.GeneratedMessage.ExtendableMessage< + SInt32Rules> implements // @@protoc_insertion_point(message_implements:buf.validate.SInt32Rules) SInt32RulesOrBuilder { private static final long serialVersionUID = 0L; @@ -27,12 +28,13 @@ public final class SInt32Rules extends SInt32Rules.class.getName()); } // Use SInt32Rules.newBuilder() to construct. - private SInt32Rules(com.google.protobuf.GeneratedMessage.Builder builder) { + private SInt32Rules(com.google.protobuf.GeneratedMessage.ExtendableBuilder builder) { super(builder); } private SInt32Rules() { in_ = emptyIntList(); notIn_ = emptyIntList(); + example_ = emptyIntList(); } public static final com.google.protobuf.Descriptors.Descriptor @@ -148,7 +150,7 @@ public int getNumber() { * ``` * * - * optional sint32 const = 1 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional sint32 const = 1 [json_name = "const", (.buf.validate.predefined) = { ... } * @return Whether the const field is set. */ @java.lang.Override @@ -168,7 +170,7 @@ public boolean hasConst() { * ``` * * - * optional sint32 const = 1 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional sint32 const = 1 [json_name = "const", (.buf.validate.predefined) = { ... } * @return The const. */ @java.lang.Override @@ -191,7 +193,7 @@ public int getConst() { * ``` * * - * sint32 lt = 2 [json_name = "lt", (.buf.validate.priv.field) = { ... } + * sint32 lt = 2 [json_name = "lt", (.buf.validate.predefined) = { ... } * @return Whether the lt field is set. */ @java.lang.Override @@ -212,7 +214,7 @@ public boolean hasLt() { * ``` * * - * sint32 lt = 2 [json_name = "lt", (.buf.validate.priv.field) = { ... } + * sint32 lt = 2 [json_name = "lt", (.buf.validate.predefined) = { ... } * @return The lt. */ @java.lang.Override @@ -238,7 +240,7 @@ public int getLt() { * ``` * * - * sint32 lte = 3 [json_name = "lte", (.buf.validate.priv.field) = { ... } + * sint32 lte = 3 [json_name = "lte", (.buf.validate.predefined) = { ... } * @return Whether the lte field is set. */ @java.lang.Override @@ -259,7 +261,7 @@ public boolean hasLte() { * ``` * * - * sint32 lte = 3 [json_name = "lte", (.buf.validate.priv.field) = { ... } + * sint32 lte = 3 [json_name = "lte", (.buf.validate.predefined) = { ... } * @return The lte. */ @java.lang.Override @@ -293,7 +295,7 @@ public int getLte() { * ``` * * - * sint32 gt = 4 [json_name = "gt", (.buf.validate.priv.field) = { ... } + * sint32 gt = 4 [json_name = "gt", (.buf.validate.predefined) = { ... } * @return Whether the gt field is set. */ @java.lang.Override @@ -322,7 +324,7 @@ public boolean hasGt() { * ``` * * - * sint32 gt = 4 [json_name = "gt", (.buf.validate.priv.field) = { ... } + * sint32 gt = 4 [json_name = "gt", (.buf.validate.predefined) = { ... } * @return The gt. */ @java.lang.Override @@ -356,7 +358,7 @@ public int getGt() { * ``` * * - * sint32 gte = 5 [json_name = "gte", (.buf.validate.priv.field) = { ... } + * sint32 gte = 5 [json_name = "gte", (.buf.validate.predefined) = { ... } * @return Whether the gte field is set. */ @java.lang.Override @@ -385,7 +387,7 @@ public boolean hasGte() { * ``` * * - * sint32 gte = 5 [json_name = "gte", (.buf.validate.priv.field) = { ... } + * sint32 gte = 5 [json_name = "gte", (.buf.validate.predefined) = { ... } * @return The gte. */ @java.lang.Override @@ -414,7 +416,7 @@ public int getGte() { * ``` * * - * repeated sint32 in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated sint32 in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @return A list containing the in. */ @java.lang.Override @@ -436,7 +438,7 @@ public int getGte() { * ``` * * - * repeated sint32 in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated sint32 in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @return The count of in. */ public int getInCount() { @@ -456,14 +458,13 @@ public int getInCount() { * ``` * * - * repeated sint32 in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated sint32 in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @param index The index of the element to return. * @return The in at the given index. */ public int getIn(int index) { return in_.getInt(index); } - private int inMemoizedSerializedSize = -1; public static final int NOT_IN_FIELD_NUMBER = 7; @SuppressWarnings("serial") @@ -483,7 +484,7 @@ public int getIn(int index) { * ``` * * - * repeated sint32 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated sint32 not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @return A list containing the notIn. */ @java.lang.Override @@ -505,7 +506,7 @@ public int getIn(int index) { * ``` * * - * repeated sint32 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated sint32 not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @return The count of notIn. */ public int getNotInCount() { @@ -525,14 +526,87 @@ public int getNotInCount() { * ``` * * - * repeated sint32 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated sint32 not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @param index The index of the element to return. * @return The notIn at the given index. */ public int getNotIn(int index) { return notIn_.getInt(index); } - private int notInMemoizedSerializedSize = -1; + + public static final int EXAMPLE_FIELD_NUMBER = 8; + @SuppressWarnings("serial") + private com.google.protobuf.Internal.IntList example_ = + emptyIntList(); + /** + *
+   * `example` specifies values that the field may have. These values SHOULD
+   * conform to other constraints. `example` values will not impact validation
+   * but may be used as helpful guidance on how to populate the given field.
+   *
+   * ```proto
+   * message MySInt32 {
+   * sint32 value = 1 [
+   * (buf.validate.field).sint32.example = 1,
+   * (buf.validate.field).sint32.example = -10
+   * ];
+   * }
+   * ```
+   * 
+ * + * repeated sint32 example = 8 [json_name = "example", (.buf.validate.predefined) = { ... } + * @return A list containing the example. + */ + @java.lang.Override + public java.util.List + getExampleList() { + return example_; + } + /** + *
+   * `example` specifies values that the field may have. These values SHOULD
+   * conform to other constraints. `example` values will not impact validation
+   * but may be used as helpful guidance on how to populate the given field.
+   *
+   * ```proto
+   * message MySInt32 {
+   * sint32 value = 1 [
+   * (buf.validate.field).sint32.example = 1,
+   * (buf.validate.field).sint32.example = -10
+   * ];
+   * }
+   * ```
+   * 
+ * + * repeated sint32 example = 8 [json_name = "example", (.buf.validate.predefined) = { ... } + * @return The count of example. + */ + public int getExampleCount() { + return example_.size(); + } + /** + *
+   * `example` specifies values that the field may have. These values SHOULD
+   * conform to other constraints. `example` values will not impact validation
+   * but may be used as helpful guidance on how to populate the given field.
+   *
+   * ```proto
+   * message MySInt32 {
+   * sint32 value = 1 [
+   * (buf.validate.field).sint32.example = 1,
+   * (buf.validate.field).sint32.example = -10
+   * ];
+   * }
+   * ```
+   * 
+ * + * repeated sint32 example = 8 [json_name = "example", (.buf.validate.predefined) = { ... } + * @param index The index of the element to return. + * @return The example at the given index. + */ + public int getExample(int index) { + return example_.getInt(index); + } private byte memoizedIsInitialized = -1; @java.lang.Override @@ -541,6 +615,10 @@ public final boolean isInitialized() { if (isInitialized == 1) return true; if (isInitialized == 0) return false; + if (!extensionsAreInitialized()) { + memoizedIsInitialized = 0; + return false; + } memoizedIsInitialized = 1; return true; } @@ -548,7 +626,9 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - getSerializedSize(); + com.google.protobuf.GeneratedMessage + .ExtendableMessage.ExtensionSerializer + extensionWriter = newExtensionSerializer(); if (((bitField0_ & 0x00000001) != 0)) { output.writeSInt32(1, const_); } @@ -568,20 +648,16 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) output.writeSInt32( 5, (int)((java.lang.Integer) greaterThan_)); } - if (getInList().size() > 0) { - output.writeUInt32NoTag(50); - output.writeUInt32NoTag(inMemoizedSerializedSize); - } for (int i = 0; i < in_.size(); i++) { - output.writeSInt32NoTag(in_.getInt(i)); - } - if (getNotInList().size() > 0) { - output.writeUInt32NoTag(58); - output.writeUInt32NoTag(notInMemoizedSerializedSize); + output.writeSInt32(6, in_.getInt(i)); } for (int i = 0; i < notIn_.size(); i++) { - output.writeSInt32NoTag(notIn_.getInt(i)); + output.writeSInt32(7, notIn_.getInt(i)); + } + for (int i = 0; i < example_.size(); i++) { + output.writeSInt32(8, example_.getInt(i)); } + extensionWriter.writeUntil(536870912, output); getUnknownFields().writeTo(output); } @@ -622,12 +698,7 @@ public int getSerializedSize() { .computeSInt32SizeNoTag(in_.getInt(i)); } size += dataSize; - if (!getInList().isEmpty()) { - size += 1; - size += com.google.protobuf.CodedOutputStream - .computeInt32SizeNoTag(dataSize); - } - inMemoizedSerializedSize = dataSize; + size += 1 * getInList().size(); } { int dataSize = 0; @@ -636,13 +707,18 @@ public int getSerializedSize() { .computeSInt32SizeNoTag(notIn_.getInt(i)); } size += dataSize; - if (!getNotInList().isEmpty()) { - size += 1; - size += com.google.protobuf.CodedOutputStream - .computeInt32SizeNoTag(dataSize); + size += 1 * getNotInList().size(); + } + { + int dataSize = 0; + for (int i = 0; i < example_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream + .computeSInt32SizeNoTag(example_.getInt(i)); } - notInMemoizedSerializedSize = dataSize; + size += dataSize; + size += 1 * getExampleList().size(); } + size += extensionsSerializedSize(); size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -667,6 +743,8 @@ public boolean equals(final java.lang.Object obj) { .equals(other.getInList())) return false; if (!getNotInList() .equals(other.getNotInList())) return false; + if (!getExampleList() + .equals(other.getExampleList())) return false; if (!getLessThanCase().equals(other.getLessThanCase())) return false; switch (lessThanCase_) { case 2: @@ -694,6 +772,8 @@ public boolean equals(final java.lang.Object obj) { default: } if (!getUnknownFields().equals(other.getUnknownFields())) return false; + if (!getExtensionFields().equals(other.getExtensionFields())) + return false; return true; } @@ -716,6 +796,10 @@ public int hashCode() { hash = (37 * hash) + NOT_IN_FIELD_NUMBER; hash = (53 * hash) + getNotInList().hashCode(); } + if (getExampleCount() > 0) { + hash = (37 * hash) + EXAMPLE_FIELD_NUMBER; + hash = (53 * hash) + getExampleList().hashCode(); + } switch (lessThanCase_) { case 2: hash = (37 * hash) + LT_FIELD_NUMBER; @@ -740,6 +824,7 @@ public int hashCode() { case 0: default: } + hash = hashFields(hash, getExtensionFields()); hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -845,7 +930,8 @@ protected Builder newBuilderForType( * Protobuf type {@code buf.validate.SInt32Rules} */ public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder implements + com.google.protobuf.GeneratedMessage.ExtendableBuilder< + build.buf.validate.SInt32Rules, Builder> implements // @@protoc_insertion_point(builder_implements:buf.validate.SInt32Rules) build.buf.validate.SInt32RulesOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor @@ -878,6 +964,7 @@ public Builder clear() { const_ = 0; in_ = emptyIntList(); notIn_ = emptyIntList(); + example_ = emptyIntList(); lessThanCase_ = 0; lessThan_ = null; greaterThanCase_ = 0; @@ -929,6 +1016,10 @@ private void buildPartial0(build.buf.validate.SInt32Rules result) { notIn_.makeImmutable(); result.notIn_ = notIn_; } + if (((from_bitField0_ & 0x00000080) != 0)) { + example_.makeImmutable(); + result.example_ = example_; + } result.bitField0_ |= to_bitField0_; } @@ -976,6 +1067,17 @@ public Builder mergeFrom(build.buf.validate.SInt32Rules other) { } onChanged(); } + if (!other.example_.isEmpty()) { + if (example_.isEmpty()) { + example_ = other.example_; + example_.makeImmutable(); + bitField0_ |= 0x00000080; + } else { + ensureExampleIsMutable(); + example_.addAll(other.example_); + } + onChanged(); + } switch (other.getLessThanCase()) { case LT: { setLt(other.getLt()); @@ -1002,6 +1104,7 @@ public Builder mergeFrom(build.buf.validate.SInt32Rules other) { break; } } + this.mergeExtensionFields(other); this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -1009,6 +1112,9 @@ public Builder mergeFrom(build.buf.validate.SInt32Rules other) { @java.lang.Override public final boolean isInitialized() { + if (!extensionsAreInitialized()) { + return false; + } return true; } @@ -1085,6 +1191,22 @@ public Builder mergeFrom( input.popLimit(limit); break; } // case 58 + case 64: { + int v = input.readSInt32(); + ensureExampleIsMutable(); + example_.addInt(v); + break; + } // case 64 + case 66: { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + ensureExampleIsMutable(); + while (input.getBytesUntilLimit() > 0) { + example_.addInt(input.readSInt32()); + } + input.popLimit(limit); + break; + } // case 66 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { done = true; // was an endgroup tag @@ -1146,7 +1268,7 @@ public Builder clearGreaterThan() { * ``` * * - * optional sint32 const = 1 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional sint32 const = 1 [json_name = "const", (.buf.validate.predefined) = { ... } * @return Whether the const field is set. */ @java.lang.Override @@ -1166,7 +1288,7 @@ public boolean hasConst() { * ``` * * - * optional sint32 const = 1 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional sint32 const = 1 [json_name = "const", (.buf.validate.predefined) = { ... } * @return The const. */ @java.lang.Override @@ -1186,7 +1308,7 @@ public int getConst() { * ``` * * - * optional sint32 const = 1 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional sint32 const = 1 [json_name = "const", (.buf.validate.predefined) = { ... } * @param value The const to set. * @return This builder for chaining. */ @@ -1210,7 +1332,7 @@ public Builder setConst(int value) { * ``` * * - * optional sint32 const = 1 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional sint32 const = 1 [json_name = "const", (.buf.validate.predefined) = { ... } * @return This builder for chaining. */ public Builder clearConst() { @@ -1234,7 +1356,7 @@ public Builder clearConst() { * ``` * * - * sint32 lt = 2 [json_name = "lt", (.buf.validate.priv.field) = { ... } + * sint32 lt = 2 [json_name = "lt", (.buf.validate.predefined) = { ... } * @return Whether the lt field is set. */ public boolean hasLt() { @@ -1254,7 +1376,7 @@ public boolean hasLt() { * ``` * * - * sint32 lt = 2 [json_name = "lt", (.buf.validate.priv.field) = { ... } + * sint32 lt = 2 [json_name = "lt", (.buf.validate.predefined) = { ... } * @return The lt. */ public int getLt() { @@ -1277,7 +1399,7 @@ public int getLt() { * ``` * * - * sint32 lt = 2 [json_name = "lt", (.buf.validate.priv.field) = { ... } + * sint32 lt = 2 [json_name = "lt", (.buf.validate.predefined) = { ... } * @param value The lt to set. * @return This builder for chaining. */ @@ -1302,7 +1424,7 @@ public Builder setLt(int value) { * ``` * * - * sint32 lt = 2 [json_name = "lt", (.buf.validate.priv.field) = { ... } + * sint32 lt = 2 [json_name = "lt", (.buf.validate.predefined) = { ... } * @return This builder for chaining. */ public Builder clearLt() { @@ -1328,7 +1450,7 @@ public Builder clearLt() { * ``` * * - * sint32 lte = 3 [json_name = "lte", (.buf.validate.priv.field) = { ... } + * sint32 lte = 3 [json_name = "lte", (.buf.validate.predefined) = { ... } * @return Whether the lte field is set. */ public boolean hasLte() { @@ -1348,7 +1470,7 @@ public boolean hasLte() { * ``` * * - * sint32 lte = 3 [json_name = "lte", (.buf.validate.priv.field) = { ... } + * sint32 lte = 3 [json_name = "lte", (.buf.validate.predefined) = { ... } * @return The lte. */ public int getLte() { @@ -1371,7 +1493,7 @@ public int getLte() { * ``` * * - * sint32 lte = 3 [json_name = "lte", (.buf.validate.priv.field) = { ... } + * sint32 lte = 3 [json_name = "lte", (.buf.validate.predefined) = { ... } * @param value The lte to set. * @return This builder for chaining. */ @@ -1396,7 +1518,7 @@ public Builder setLte(int value) { * ``` * * - * sint32 lte = 3 [json_name = "lte", (.buf.validate.priv.field) = { ... } + * sint32 lte = 3 [json_name = "lte", (.buf.validate.predefined) = { ... } * @return This builder for chaining. */ public Builder clearLte() { @@ -1430,7 +1552,7 @@ public Builder clearLte() { * ``` * * - * sint32 gt = 4 [json_name = "gt", (.buf.validate.priv.field) = { ... } + * sint32 gt = 4 [json_name = "gt", (.buf.validate.predefined) = { ... } * @return Whether the gt field is set. */ public boolean hasGt() { @@ -1458,7 +1580,7 @@ public boolean hasGt() { * ``` * * - * sint32 gt = 4 [json_name = "gt", (.buf.validate.priv.field) = { ... } + * sint32 gt = 4 [json_name = "gt", (.buf.validate.predefined) = { ... } * @return The gt. */ public int getGt() { @@ -1489,7 +1611,7 @@ public int getGt() { * ``` * * - * sint32 gt = 4 [json_name = "gt", (.buf.validate.priv.field) = { ... } + * sint32 gt = 4 [json_name = "gt", (.buf.validate.predefined) = { ... } * @param value The gt to set. * @return This builder for chaining. */ @@ -1522,7 +1644,7 @@ public Builder setGt(int value) { * ``` * * - * sint32 gt = 4 [json_name = "gt", (.buf.validate.priv.field) = { ... } + * sint32 gt = 4 [json_name = "gt", (.buf.validate.predefined) = { ... } * @return This builder for chaining. */ public Builder clearGt() { @@ -1556,7 +1678,7 @@ public Builder clearGt() { * ``` * * - * sint32 gte = 5 [json_name = "gte", (.buf.validate.priv.field) = { ... } + * sint32 gte = 5 [json_name = "gte", (.buf.validate.predefined) = { ... } * @return Whether the gte field is set. */ public boolean hasGte() { @@ -1584,7 +1706,7 @@ public boolean hasGte() { * ``` * * - * sint32 gte = 5 [json_name = "gte", (.buf.validate.priv.field) = { ... } + * sint32 gte = 5 [json_name = "gte", (.buf.validate.predefined) = { ... } * @return The gte. */ public int getGte() { @@ -1615,7 +1737,7 @@ public int getGte() { * ``` * * - * sint32 gte = 5 [json_name = "gte", (.buf.validate.priv.field) = { ... } + * sint32 gte = 5 [json_name = "gte", (.buf.validate.predefined) = { ... } * @param value The gte to set. * @return This builder for chaining. */ @@ -1648,7 +1770,7 @@ public Builder setGte(int value) { * ``` * * - * sint32 gte = 5 [json_name = "gte", (.buf.validate.priv.field) = { ... } + * sint32 gte = 5 [json_name = "gte", (.buf.validate.predefined) = { ... } * @return This builder for chaining. */ public Builder clearGte() { @@ -1681,7 +1803,7 @@ private void ensureInIsMutable() { * ``` * * - * repeated sint32 in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated sint32 in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @return A list containing the in. */ public java.util.List @@ -1703,7 +1825,7 @@ private void ensureInIsMutable() { * ``` * * - * repeated sint32 in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated sint32 in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @return The count of in. */ public int getInCount() { @@ -1723,7 +1845,7 @@ public int getInCount() { * ``` * * - * repeated sint32 in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated sint32 in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @param index The index of the element to return. * @return The in at the given index. */ @@ -1744,7 +1866,7 @@ public int getIn(int index) { * ``` * * - * repeated sint32 in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated sint32 in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @param index The index to set the value at. * @param value The in to set. * @return This builder for chaining. @@ -1772,7 +1894,7 @@ public Builder setIn( * ``` * * - * repeated sint32 in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated sint32 in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @param value The in to add. * @return This builder for chaining. */ @@ -1798,7 +1920,7 @@ public Builder addIn(int value) { * ``` * * - * repeated sint32 in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated sint32 in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @param values The in to add. * @return This builder for chaining. */ @@ -1825,7 +1947,7 @@ public Builder addAllIn( * ``` * * - * repeated sint32 in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated sint32 in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @return This builder for chaining. */ public Builder clearIn() { @@ -1856,7 +1978,7 @@ private void ensureNotInIsMutable() { * ``` * * - * repeated sint32 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated sint32 not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @return A list containing the notIn. */ public java.util.List @@ -1878,7 +2000,7 @@ private void ensureNotInIsMutable() { * ``` * * - * repeated sint32 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated sint32 not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @return The count of notIn. */ public int getNotInCount() { @@ -1898,7 +2020,7 @@ public int getNotInCount() { * ``` * * - * repeated sint32 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated sint32 not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @param index The index of the element to return. * @return The notIn at the given index. */ @@ -1919,7 +2041,7 @@ public int getNotIn(int index) { * ``` * * - * repeated sint32 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated sint32 not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @param index The index to set the value at. * @param value The notIn to set. * @return This builder for chaining. @@ -1947,7 +2069,7 @@ public Builder setNotIn( * ``` * * - * repeated sint32 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated sint32 not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @param value The notIn to add. * @return This builder for chaining. */ @@ -1973,7 +2095,7 @@ public Builder addNotIn(int value) { * ``` * * - * repeated sint32 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated sint32 not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @param values The notIn to add. * @return This builder for chaining. */ @@ -2000,7 +2122,7 @@ public Builder addAllNotIn( * ``` * * - * repeated sint32 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated sint32 not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @return This builder for chaining. */ public Builder clearNotIn() { @@ -2010,6 +2132,195 @@ public Builder clearNotIn() { return this; } + private com.google.protobuf.Internal.IntList example_ = emptyIntList(); + private void ensureExampleIsMutable() { + if (!example_.isModifiable()) { + example_ = makeMutableCopy(example_); + } + bitField0_ |= 0x00000080; + } + /** + *
+     * `example` specifies values that the field may have. These values SHOULD
+     * conform to other constraints. `example` values will not impact validation
+     * but may be used as helpful guidance on how to populate the given field.
+     *
+     * ```proto
+     * message MySInt32 {
+     * sint32 value = 1 [
+     * (buf.validate.field).sint32.example = 1,
+     * (buf.validate.field).sint32.example = -10
+     * ];
+     * }
+     * ```
+     * 
+ * + * repeated sint32 example = 8 [json_name = "example", (.buf.validate.predefined) = { ... } + * @return A list containing the example. + */ + public java.util.List + getExampleList() { + example_.makeImmutable(); + return example_; + } + /** + *
+     * `example` specifies values that the field may have. These values SHOULD
+     * conform to other constraints. `example` values will not impact validation
+     * but may be used as helpful guidance on how to populate the given field.
+     *
+     * ```proto
+     * message MySInt32 {
+     * sint32 value = 1 [
+     * (buf.validate.field).sint32.example = 1,
+     * (buf.validate.field).sint32.example = -10
+     * ];
+     * }
+     * ```
+     * 
+ * + * repeated sint32 example = 8 [json_name = "example", (.buf.validate.predefined) = { ... } + * @return The count of example. + */ + public int getExampleCount() { + return example_.size(); + } + /** + *
+     * `example` specifies values that the field may have. These values SHOULD
+     * conform to other constraints. `example` values will not impact validation
+     * but may be used as helpful guidance on how to populate the given field.
+     *
+     * ```proto
+     * message MySInt32 {
+     * sint32 value = 1 [
+     * (buf.validate.field).sint32.example = 1,
+     * (buf.validate.field).sint32.example = -10
+     * ];
+     * }
+     * ```
+     * 
+ * + * repeated sint32 example = 8 [json_name = "example", (.buf.validate.predefined) = { ... } + * @param index The index of the element to return. + * @return The example at the given index. + */ + public int getExample(int index) { + return example_.getInt(index); + } + /** + *
+     * `example` specifies values that the field may have. These values SHOULD
+     * conform to other constraints. `example` values will not impact validation
+     * but may be used as helpful guidance on how to populate the given field.
+     *
+     * ```proto
+     * message MySInt32 {
+     * sint32 value = 1 [
+     * (buf.validate.field).sint32.example = 1,
+     * (buf.validate.field).sint32.example = -10
+     * ];
+     * }
+     * ```
+     * 
+ * + * repeated sint32 example = 8 [json_name = "example", (.buf.validate.predefined) = { ... } + * @param index The index to set the value at. + * @param value The example to set. + * @return This builder for chaining. + */ + public Builder setExample( + int index, int value) { + + ensureExampleIsMutable(); + example_.setInt(index, value); + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + *
+     * `example` specifies values that the field may have. These values SHOULD
+     * conform to other constraints. `example` values will not impact validation
+     * but may be used as helpful guidance on how to populate the given field.
+     *
+     * ```proto
+     * message MySInt32 {
+     * sint32 value = 1 [
+     * (buf.validate.field).sint32.example = 1,
+     * (buf.validate.field).sint32.example = -10
+     * ];
+     * }
+     * ```
+     * 
+ * + * repeated sint32 example = 8 [json_name = "example", (.buf.validate.predefined) = { ... } + * @param value The example to add. + * @return This builder for chaining. + */ + public Builder addExample(int value) { + + ensureExampleIsMutable(); + example_.addInt(value); + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + *
+     * `example` specifies values that the field may have. These values SHOULD
+     * conform to other constraints. `example` values will not impact validation
+     * but may be used as helpful guidance on how to populate the given field.
+     *
+     * ```proto
+     * message MySInt32 {
+     * sint32 value = 1 [
+     * (buf.validate.field).sint32.example = 1,
+     * (buf.validate.field).sint32.example = -10
+     * ];
+     * }
+     * ```
+     * 
+ * + * repeated sint32 example = 8 [json_name = "example", (.buf.validate.predefined) = { ... } + * @param values The example to add. + * @return This builder for chaining. + */ + public Builder addAllExample( + java.lang.Iterable values) { + ensureExampleIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, example_); + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + *
+     * `example` specifies values that the field may have. These values SHOULD
+     * conform to other constraints. `example` values will not impact validation
+     * but may be used as helpful guidance on how to populate the given field.
+     *
+     * ```proto
+     * message MySInt32 {
+     * sint32 value = 1 [
+     * (buf.validate.field).sint32.example = 1,
+     * (buf.validate.field).sint32.example = -10
+     * ];
+     * }
+     * ```
+     * 
+ * + * repeated sint32 example = 8 [json_name = "example", (.buf.validate.predefined) = { ... } + * @return This builder for chaining. + */ + public Builder clearExample() { + example_ = emptyIntList(); + bitField0_ = (bitField0_ & ~0x00000080); + onChanged(); + return this; + } + // @@protoc_insertion_point(builder_scope:buf.validate.SInt32Rules) } diff --git a/src/main/java/build/buf/validate/SInt32RulesOrBuilder.java b/src/main/java/build/buf/validate/SInt32RulesOrBuilder.java index 6d0d71c3..0eeb1cee 100644 --- a/src/main/java/build/buf/validate/SInt32RulesOrBuilder.java +++ b/src/main/java/build/buf/validate/SInt32RulesOrBuilder.java @@ -7,7 +7,8 @@ public interface SInt32RulesOrBuilder extends // @@protoc_insertion_point(interface_extends:buf.validate.SInt32Rules) - com.google.protobuf.MessageOrBuilder { + com.google.protobuf.GeneratedMessage. + ExtendableMessageOrBuilder { /** *
@@ -22,7 +23,7 @@ public interface SInt32RulesOrBuilder extends
    * ```
    * 
* - * optional sint32 const = 1 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional sint32 const = 1 [json_name = "const", (.buf.validate.predefined) = { ... } * @return Whether the const field is set. */ boolean hasConst(); @@ -39,7 +40,7 @@ public interface SInt32RulesOrBuilder extends * ``` * * - * optional sint32 const = 1 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional sint32 const = 1 [json_name = "const", (.buf.validate.predefined) = { ... } * @return The const. */ int getConst(); @@ -58,7 +59,7 @@ public interface SInt32RulesOrBuilder extends * ``` * * - * sint32 lt = 2 [json_name = "lt", (.buf.validate.priv.field) = { ... } + * sint32 lt = 2 [json_name = "lt", (.buf.validate.predefined) = { ... } * @return Whether the lt field is set. */ boolean hasLt(); @@ -76,7 +77,7 @@ public interface SInt32RulesOrBuilder extends * ``` * * - * sint32 lt = 2 [json_name = "lt", (.buf.validate.priv.field) = { ... } + * sint32 lt = 2 [json_name = "lt", (.buf.validate.predefined) = { ... } * @return The lt. */ int getLt(); @@ -95,7 +96,7 @@ public interface SInt32RulesOrBuilder extends * ``` * * - * sint32 lte = 3 [json_name = "lte", (.buf.validate.priv.field) = { ... } + * sint32 lte = 3 [json_name = "lte", (.buf.validate.predefined) = { ... } * @return Whether the lte field is set. */ boolean hasLte(); @@ -113,7 +114,7 @@ public interface SInt32RulesOrBuilder extends * ``` * * - * sint32 lte = 3 [json_name = "lte", (.buf.validate.priv.field) = { ... } + * sint32 lte = 3 [json_name = "lte", (.buf.validate.predefined) = { ... } * @return The lte. */ int getLte(); @@ -140,7 +141,7 @@ public interface SInt32RulesOrBuilder extends * ``` * * - * sint32 gt = 4 [json_name = "gt", (.buf.validate.priv.field) = { ... } + * sint32 gt = 4 [json_name = "gt", (.buf.validate.predefined) = { ... } * @return Whether the gt field is set. */ boolean hasGt(); @@ -166,7 +167,7 @@ public interface SInt32RulesOrBuilder extends * ``` * * - * sint32 gt = 4 [json_name = "gt", (.buf.validate.priv.field) = { ... } + * sint32 gt = 4 [json_name = "gt", (.buf.validate.predefined) = { ... } * @return The gt. */ int getGt(); @@ -193,7 +194,7 @@ public interface SInt32RulesOrBuilder extends * ``` * * - * sint32 gte = 5 [json_name = "gte", (.buf.validate.priv.field) = { ... } + * sint32 gte = 5 [json_name = "gte", (.buf.validate.predefined) = { ... } * @return Whether the gte field is set. */ boolean hasGte(); @@ -219,7 +220,7 @@ public interface SInt32RulesOrBuilder extends * ``` * * - * sint32 gte = 5 [json_name = "gte", (.buf.validate.priv.field) = { ... } + * sint32 gte = 5 [json_name = "gte", (.buf.validate.predefined) = { ... } * @return The gte. */ int getGte(); @@ -238,7 +239,7 @@ public interface SInt32RulesOrBuilder extends * ``` * * - * repeated sint32 in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated sint32 in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @return A list containing the in. */ java.util.List getInList(); @@ -256,7 +257,7 @@ public interface SInt32RulesOrBuilder extends * ``` * * - * repeated sint32 in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated sint32 in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @return The count of in. */ int getInCount(); @@ -274,7 +275,7 @@ public interface SInt32RulesOrBuilder extends * ``` * * - * repeated sint32 in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated sint32 in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @param index The index of the element to return. * @return The in at the given index. */ @@ -294,7 +295,7 @@ public interface SInt32RulesOrBuilder extends * ``` * * - * repeated sint32 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated sint32 not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @return A list containing the notIn. */ java.util.List getNotInList(); @@ -312,7 +313,7 @@ public interface SInt32RulesOrBuilder extends * ``` * * - * repeated sint32 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated sint32 not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @return The count of notIn. */ int getNotInCount(); @@ -330,12 +331,74 @@ public interface SInt32RulesOrBuilder extends * ``` * * - * repeated sint32 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated sint32 not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @param index The index of the element to return. * @return The notIn at the given index. */ int getNotIn(int index); + /** + *
+   * `example` specifies values that the field may have. These values SHOULD
+   * conform to other constraints. `example` values will not impact validation
+   * but may be used as helpful guidance on how to populate the given field.
+   *
+   * ```proto
+   * message MySInt32 {
+   * sint32 value = 1 [
+   * (buf.validate.field).sint32.example = 1,
+   * (buf.validate.field).sint32.example = -10
+   * ];
+   * }
+   * ```
+   * 
+ * + * repeated sint32 example = 8 [json_name = "example", (.buf.validate.predefined) = { ... } + * @return A list containing the example. + */ + java.util.List getExampleList(); + /** + *
+   * `example` specifies values that the field may have. These values SHOULD
+   * conform to other constraints. `example` values will not impact validation
+   * but may be used as helpful guidance on how to populate the given field.
+   *
+   * ```proto
+   * message MySInt32 {
+   * sint32 value = 1 [
+   * (buf.validate.field).sint32.example = 1,
+   * (buf.validate.field).sint32.example = -10
+   * ];
+   * }
+   * ```
+   * 
+ * + * repeated sint32 example = 8 [json_name = "example", (.buf.validate.predefined) = { ... } + * @return The count of example. + */ + int getExampleCount(); + /** + *
+   * `example` specifies values that the field may have. These values SHOULD
+   * conform to other constraints. `example` values will not impact validation
+   * but may be used as helpful guidance on how to populate the given field.
+   *
+   * ```proto
+   * message MySInt32 {
+   * sint32 value = 1 [
+   * (buf.validate.field).sint32.example = 1,
+   * (buf.validate.field).sint32.example = -10
+   * ];
+   * }
+   * ```
+   * 
+ * + * repeated sint32 example = 8 [json_name = "example", (.buf.validate.predefined) = { ... } + * @param index The index of the element to return. + * @return The example at the given index. + */ + int getExample(int index); + build.buf.validate.SInt32Rules.LessThanCase getLessThanCase(); build.buf.validate.SInt32Rules.GreaterThanCase getGreaterThanCase(); diff --git a/src/main/java/build/buf/validate/SInt64Rules.java b/src/main/java/build/buf/validate/SInt64Rules.java index 39fca41c..a7b3aaec 100644 --- a/src/main/java/build/buf/validate/SInt64Rules.java +++ b/src/main/java/build/buf/validate/SInt64Rules.java @@ -13,7 +13,8 @@ * Protobuf type {@code buf.validate.SInt64Rules} */ public final class SInt64Rules extends - com.google.protobuf.GeneratedMessage implements + com.google.protobuf.GeneratedMessage.ExtendableMessage< + SInt64Rules> implements // @@protoc_insertion_point(message_implements:buf.validate.SInt64Rules) SInt64RulesOrBuilder { private static final long serialVersionUID = 0L; @@ -27,12 +28,13 @@ public final class SInt64Rules extends SInt64Rules.class.getName()); } // Use SInt64Rules.newBuilder() to construct. - private SInt64Rules(com.google.protobuf.GeneratedMessage.Builder builder) { + private SInt64Rules(com.google.protobuf.GeneratedMessage.ExtendableBuilder builder) { super(builder); } private SInt64Rules() { in_ = emptyLongList(); notIn_ = emptyLongList(); + example_ = emptyLongList(); } public static final com.google.protobuf.Descriptors.Descriptor @@ -148,7 +150,7 @@ public int getNumber() { * ``` * * - * optional sint64 const = 1 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional sint64 const = 1 [json_name = "const", (.buf.validate.predefined) = { ... } * @return Whether the const field is set. */ @java.lang.Override @@ -168,7 +170,7 @@ public boolean hasConst() { * ``` * * - * optional sint64 const = 1 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional sint64 const = 1 [json_name = "const", (.buf.validate.predefined) = { ... } * @return The const. */ @java.lang.Override @@ -191,7 +193,7 @@ public long getConst() { * ``` * * - * sint64 lt = 2 [json_name = "lt", (.buf.validate.priv.field) = { ... } + * sint64 lt = 2 [json_name = "lt", (.buf.validate.predefined) = { ... } * @return Whether the lt field is set. */ @java.lang.Override @@ -212,7 +214,7 @@ public boolean hasLt() { * ``` * * - * sint64 lt = 2 [json_name = "lt", (.buf.validate.priv.field) = { ... } + * sint64 lt = 2 [json_name = "lt", (.buf.validate.predefined) = { ... } * @return The lt. */ @java.lang.Override @@ -238,7 +240,7 @@ public long getLt() { * ``` * * - * sint64 lte = 3 [json_name = "lte", (.buf.validate.priv.field) = { ... } + * sint64 lte = 3 [json_name = "lte", (.buf.validate.predefined) = { ... } * @return Whether the lte field is set. */ @java.lang.Override @@ -259,7 +261,7 @@ public boolean hasLte() { * ``` * * - * sint64 lte = 3 [json_name = "lte", (.buf.validate.priv.field) = { ... } + * sint64 lte = 3 [json_name = "lte", (.buf.validate.predefined) = { ... } * @return The lte. */ @java.lang.Override @@ -293,7 +295,7 @@ public long getLte() { * ``` * * - * sint64 gt = 4 [json_name = "gt", (.buf.validate.priv.field) = { ... } + * sint64 gt = 4 [json_name = "gt", (.buf.validate.predefined) = { ... } * @return Whether the gt field is set. */ @java.lang.Override @@ -322,7 +324,7 @@ public boolean hasGt() { * ``` * * - * sint64 gt = 4 [json_name = "gt", (.buf.validate.priv.field) = { ... } + * sint64 gt = 4 [json_name = "gt", (.buf.validate.predefined) = { ... } * @return The gt. */ @java.lang.Override @@ -356,7 +358,7 @@ public long getGt() { * ``` * * - * sint64 gte = 5 [json_name = "gte", (.buf.validate.priv.field) = { ... } + * sint64 gte = 5 [json_name = "gte", (.buf.validate.predefined) = { ... } * @return Whether the gte field is set. */ @java.lang.Override @@ -385,7 +387,7 @@ public boolean hasGte() { * ``` * * - * sint64 gte = 5 [json_name = "gte", (.buf.validate.priv.field) = { ... } + * sint64 gte = 5 [json_name = "gte", (.buf.validate.predefined) = { ... } * @return The gte. */ @java.lang.Override @@ -414,7 +416,7 @@ public long getGte() { * ``` * * - * repeated sint64 in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated sint64 in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @return A list containing the in. */ @java.lang.Override @@ -436,7 +438,7 @@ public long getGte() { * ``` * * - * repeated sint64 in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated sint64 in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @return The count of in. */ public int getInCount() { @@ -456,14 +458,13 @@ public int getInCount() { * ``` * * - * repeated sint64 in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated sint64 in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @param index The index of the element to return. * @return The in at the given index. */ public long getIn(int index) { return in_.getLong(index); } - private int inMemoizedSerializedSize = -1; public static final int NOT_IN_FIELD_NUMBER = 7; @SuppressWarnings("serial") @@ -483,7 +484,7 @@ public long getIn(int index) { * ``` * * - * repeated sint64 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated sint64 not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @return A list containing the notIn. */ @java.lang.Override @@ -505,7 +506,7 @@ public long getIn(int index) { * ``` * * - * repeated sint64 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated sint64 not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @return The count of notIn. */ public int getNotInCount() { @@ -525,14 +526,87 @@ public int getNotInCount() { * ``` * * - * repeated sint64 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated sint64 not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @param index The index of the element to return. * @return The notIn at the given index. */ public long getNotIn(int index) { return notIn_.getLong(index); } - private int notInMemoizedSerializedSize = -1; + + public static final int EXAMPLE_FIELD_NUMBER = 8; + @SuppressWarnings("serial") + private com.google.protobuf.Internal.LongList example_ = + emptyLongList(); + /** + *
+   * `example` specifies values that the field may have. These values SHOULD
+   * conform to other constraints. `example` values will not impact validation
+   * but may be used as helpful guidance on how to populate the given field.
+   *
+   * ```proto
+   * message MySInt64 {
+   * sint64 value = 1 [
+   * (buf.validate.field).sint64.example = 1,
+   * (buf.validate.field).sint64.example = -10
+   * ];
+   * }
+   * ```
+   * 
+ * + * repeated sint64 example = 8 [json_name = "example", (.buf.validate.predefined) = { ... } + * @return A list containing the example. + */ + @java.lang.Override + public java.util.List + getExampleList() { + return example_; + } + /** + *
+   * `example` specifies values that the field may have. These values SHOULD
+   * conform to other constraints. `example` values will not impact validation
+   * but may be used as helpful guidance on how to populate the given field.
+   *
+   * ```proto
+   * message MySInt64 {
+   * sint64 value = 1 [
+   * (buf.validate.field).sint64.example = 1,
+   * (buf.validate.field).sint64.example = -10
+   * ];
+   * }
+   * ```
+   * 
+ * + * repeated sint64 example = 8 [json_name = "example", (.buf.validate.predefined) = { ... } + * @return The count of example. + */ + public int getExampleCount() { + return example_.size(); + } + /** + *
+   * `example` specifies values that the field may have. These values SHOULD
+   * conform to other constraints. `example` values will not impact validation
+   * but may be used as helpful guidance on how to populate the given field.
+   *
+   * ```proto
+   * message MySInt64 {
+   * sint64 value = 1 [
+   * (buf.validate.field).sint64.example = 1,
+   * (buf.validate.field).sint64.example = -10
+   * ];
+   * }
+   * ```
+   * 
+ * + * repeated sint64 example = 8 [json_name = "example", (.buf.validate.predefined) = { ... } + * @param index The index of the element to return. + * @return The example at the given index. + */ + public long getExample(int index) { + return example_.getLong(index); + } private byte memoizedIsInitialized = -1; @java.lang.Override @@ -541,6 +615,10 @@ public final boolean isInitialized() { if (isInitialized == 1) return true; if (isInitialized == 0) return false; + if (!extensionsAreInitialized()) { + memoizedIsInitialized = 0; + return false; + } memoizedIsInitialized = 1; return true; } @@ -548,7 +626,9 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - getSerializedSize(); + com.google.protobuf.GeneratedMessage + .ExtendableMessage.ExtensionSerializer + extensionWriter = newExtensionSerializer(); if (((bitField0_ & 0x00000001) != 0)) { output.writeSInt64(1, const_); } @@ -568,20 +648,16 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) output.writeSInt64( 5, (long)((java.lang.Long) greaterThan_)); } - if (getInList().size() > 0) { - output.writeUInt32NoTag(50); - output.writeUInt32NoTag(inMemoizedSerializedSize); - } for (int i = 0; i < in_.size(); i++) { - output.writeSInt64NoTag(in_.getLong(i)); - } - if (getNotInList().size() > 0) { - output.writeUInt32NoTag(58); - output.writeUInt32NoTag(notInMemoizedSerializedSize); + output.writeSInt64(6, in_.getLong(i)); } for (int i = 0; i < notIn_.size(); i++) { - output.writeSInt64NoTag(notIn_.getLong(i)); + output.writeSInt64(7, notIn_.getLong(i)); + } + for (int i = 0; i < example_.size(); i++) { + output.writeSInt64(8, example_.getLong(i)); } + extensionWriter.writeUntil(536870912, output); getUnknownFields().writeTo(output); } @@ -622,12 +698,7 @@ public int getSerializedSize() { .computeSInt64SizeNoTag(in_.getLong(i)); } size += dataSize; - if (!getInList().isEmpty()) { - size += 1; - size += com.google.protobuf.CodedOutputStream - .computeInt32SizeNoTag(dataSize); - } - inMemoizedSerializedSize = dataSize; + size += 1 * getInList().size(); } { int dataSize = 0; @@ -636,13 +707,18 @@ public int getSerializedSize() { .computeSInt64SizeNoTag(notIn_.getLong(i)); } size += dataSize; - if (!getNotInList().isEmpty()) { - size += 1; - size += com.google.protobuf.CodedOutputStream - .computeInt32SizeNoTag(dataSize); + size += 1 * getNotInList().size(); + } + { + int dataSize = 0; + for (int i = 0; i < example_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream + .computeSInt64SizeNoTag(example_.getLong(i)); } - notInMemoizedSerializedSize = dataSize; + size += dataSize; + size += 1 * getExampleList().size(); } + size += extensionsSerializedSize(); size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -667,6 +743,8 @@ public boolean equals(final java.lang.Object obj) { .equals(other.getInList())) return false; if (!getNotInList() .equals(other.getNotInList())) return false; + if (!getExampleList() + .equals(other.getExampleList())) return false; if (!getLessThanCase().equals(other.getLessThanCase())) return false; switch (lessThanCase_) { case 2: @@ -694,6 +772,8 @@ public boolean equals(final java.lang.Object obj) { default: } if (!getUnknownFields().equals(other.getUnknownFields())) return false; + if (!getExtensionFields().equals(other.getExtensionFields())) + return false; return true; } @@ -717,6 +797,10 @@ public int hashCode() { hash = (37 * hash) + NOT_IN_FIELD_NUMBER; hash = (53 * hash) + getNotInList().hashCode(); } + if (getExampleCount() > 0) { + hash = (37 * hash) + EXAMPLE_FIELD_NUMBER; + hash = (53 * hash) + getExampleList().hashCode(); + } switch (lessThanCase_) { case 2: hash = (37 * hash) + LT_FIELD_NUMBER; @@ -745,6 +829,7 @@ public int hashCode() { case 0: default: } + hash = hashFields(hash, getExtensionFields()); hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -850,7 +935,8 @@ protected Builder newBuilderForType( * Protobuf type {@code buf.validate.SInt64Rules} */ public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder implements + com.google.protobuf.GeneratedMessage.ExtendableBuilder< + build.buf.validate.SInt64Rules, Builder> implements // @@protoc_insertion_point(builder_implements:buf.validate.SInt64Rules) build.buf.validate.SInt64RulesOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor @@ -883,6 +969,7 @@ public Builder clear() { const_ = 0L; in_ = emptyLongList(); notIn_ = emptyLongList(); + example_ = emptyLongList(); lessThanCase_ = 0; lessThan_ = null; greaterThanCase_ = 0; @@ -934,6 +1021,10 @@ private void buildPartial0(build.buf.validate.SInt64Rules result) { notIn_.makeImmutable(); result.notIn_ = notIn_; } + if (((from_bitField0_ & 0x00000080) != 0)) { + example_.makeImmutable(); + result.example_ = example_; + } result.bitField0_ |= to_bitField0_; } @@ -981,6 +1072,17 @@ public Builder mergeFrom(build.buf.validate.SInt64Rules other) { } onChanged(); } + if (!other.example_.isEmpty()) { + if (example_.isEmpty()) { + example_ = other.example_; + example_.makeImmutable(); + bitField0_ |= 0x00000080; + } else { + ensureExampleIsMutable(); + example_.addAll(other.example_); + } + onChanged(); + } switch (other.getLessThanCase()) { case LT: { setLt(other.getLt()); @@ -1007,6 +1109,7 @@ public Builder mergeFrom(build.buf.validate.SInt64Rules other) { break; } } + this.mergeExtensionFields(other); this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -1014,6 +1117,9 @@ public Builder mergeFrom(build.buf.validate.SInt64Rules other) { @java.lang.Override public final boolean isInitialized() { + if (!extensionsAreInitialized()) { + return false; + } return true; } @@ -1090,6 +1196,22 @@ public Builder mergeFrom( input.popLimit(limit); break; } // case 58 + case 64: { + long v = input.readSInt64(); + ensureExampleIsMutable(); + example_.addLong(v); + break; + } // case 64 + case 66: { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + ensureExampleIsMutable(); + while (input.getBytesUntilLimit() > 0) { + example_.addLong(input.readSInt64()); + } + input.popLimit(limit); + break; + } // case 66 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { done = true; // was an endgroup tag @@ -1151,7 +1273,7 @@ public Builder clearGreaterThan() { * ``` * * - * optional sint64 const = 1 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional sint64 const = 1 [json_name = "const", (.buf.validate.predefined) = { ... } * @return Whether the const field is set. */ @java.lang.Override @@ -1171,7 +1293,7 @@ public boolean hasConst() { * ``` * * - * optional sint64 const = 1 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional sint64 const = 1 [json_name = "const", (.buf.validate.predefined) = { ... } * @return The const. */ @java.lang.Override @@ -1191,7 +1313,7 @@ public long getConst() { * ``` * * - * optional sint64 const = 1 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional sint64 const = 1 [json_name = "const", (.buf.validate.predefined) = { ... } * @param value The const to set. * @return This builder for chaining. */ @@ -1215,7 +1337,7 @@ public Builder setConst(long value) { * ``` * * - * optional sint64 const = 1 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional sint64 const = 1 [json_name = "const", (.buf.validate.predefined) = { ... } * @return This builder for chaining. */ public Builder clearConst() { @@ -1239,7 +1361,7 @@ public Builder clearConst() { * ``` * * - * sint64 lt = 2 [json_name = "lt", (.buf.validate.priv.field) = { ... } + * sint64 lt = 2 [json_name = "lt", (.buf.validate.predefined) = { ... } * @return Whether the lt field is set. */ public boolean hasLt() { @@ -1259,7 +1381,7 @@ public boolean hasLt() { * ``` * * - * sint64 lt = 2 [json_name = "lt", (.buf.validate.priv.field) = { ... } + * sint64 lt = 2 [json_name = "lt", (.buf.validate.predefined) = { ... } * @return The lt. */ public long getLt() { @@ -1282,7 +1404,7 @@ public long getLt() { * ``` * * - * sint64 lt = 2 [json_name = "lt", (.buf.validate.priv.field) = { ... } + * sint64 lt = 2 [json_name = "lt", (.buf.validate.predefined) = { ... } * @param value The lt to set. * @return This builder for chaining. */ @@ -1307,7 +1429,7 @@ public Builder setLt(long value) { * ``` * * - * sint64 lt = 2 [json_name = "lt", (.buf.validate.priv.field) = { ... } + * sint64 lt = 2 [json_name = "lt", (.buf.validate.predefined) = { ... } * @return This builder for chaining. */ public Builder clearLt() { @@ -1333,7 +1455,7 @@ public Builder clearLt() { * ``` * * - * sint64 lte = 3 [json_name = "lte", (.buf.validate.priv.field) = { ... } + * sint64 lte = 3 [json_name = "lte", (.buf.validate.predefined) = { ... } * @return Whether the lte field is set. */ public boolean hasLte() { @@ -1353,7 +1475,7 @@ public boolean hasLte() { * ``` * * - * sint64 lte = 3 [json_name = "lte", (.buf.validate.priv.field) = { ... } + * sint64 lte = 3 [json_name = "lte", (.buf.validate.predefined) = { ... } * @return The lte. */ public long getLte() { @@ -1376,7 +1498,7 @@ public long getLte() { * ``` * * - * sint64 lte = 3 [json_name = "lte", (.buf.validate.priv.field) = { ... } + * sint64 lte = 3 [json_name = "lte", (.buf.validate.predefined) = { ... } * @param value The lte to set. * @return This builder for chaining. */ @@ -1401,7 +1523,7 @@ public Builder setLte(long value) { * ``` * * - * sint64 lte = 3 [json_name = "lte", (.buf.validate.priv.field) = { ... } + * sint64 lte = 3 [json_name = "lte", (.buf.validate.predefined) = { ... } * @return This builder for chaining. */ public Builder clearLte() { @@ -1435,7 +1557,7 @@ public Builder clearLte() { * ``` * * - * sint64 gt = 4 [json_name = "gt", (.buf.validate.priv.field) = { ... } + * sint64 gt = 4 [json_name = "gt", (.buf.validate.predefined) = { ... } * @return Whether the gt field is set. */ public boolean hasGt() { @@ -1463,7 +1585,7 @@ public boolean hasGt() { * ``` * * - * sint64 gt = 4 [json_name = "gt", (.buf.validate.priv.field) = { ... } + * sint64 gt = 4 [json_name = "gt", (.buf.validate.predefined) = { ... } * @return The gt. */ public long getGt() { @@ -1494,7 +1616,7 @@ public long getGt() { * ``` * * - * sint64 gt = 4 [json_name = "gt", (.buf.validate.priv.field) = { ... } + * sint64 gt = 4 [json_name = "gt", (.buf.validate.predefined) = { ... } * @param value The gt to set. * @return This builder for chaining. */ @@ -1527,7 +1649,7 @@ public Builder setGt(long value) { * ``` * * - * sint64 gt = 4 [json_name = "gt", (.buf.validate.priv.field) = { ... } + * sint64 gt = 4 [json_name = "gt", (.buf.validate.predefined) = { ... } * @return This builder for chaining. */ public Builder clearGt() { @@ -1561,7 +1683,7 @@ public Builder clearGt() { * ``` * * - * sint64 gte = 5 [json_name = "gte", (.buf.validate.priv.field) = { ... } + * sint64 gte = 5 [json_name = "gte", (.buf.validate.predefined) = { ... } * @return Whether the gte field is set. */ public boolean hasGte() { @@ -1589,7 +1711,7 @@ public boolean hasGte() { * ``` * * - * sint64 gte = 5 [json_name = "gte", (.buf.validate.priv.field) = { ... } + * sint64 gte = 5 [json_name = "gte", (.buf.validate.predefined) = { ... } * @return The gte. */ public long getGte() { @@ -1620,7 +1742,7 @@ public long getGte() { * ``` * * - * sint64 gte = 5 [json_name = "gte", (.buf.validate.priv.field) = { ... } + * sint64 gte = 5 [json_name = "gte", (.buf.validate.predefined) = { ... } * @param value The gte to set. * @return This builder for chaining. */ @@ -1653,7 +1775,7 @@ public Builder setGte(long value) { * ``` * * - * sint64 gte = 5 [json_name = "gte", (.buf.validate.priv.field) = { ... } + * sint64 gte = 5 [json_name = "gte", (.buf.validate.predefined) = { ... } * @return This builder for chaining. */ public Builder clearGte() { @@ -1686,7 +1808,7 @@ private void ensureInIsMutable() { * ``` * * - * repeated sint64 in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated sint64 in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @return A list containing the in. */ public java.util.List @@ -1708,7 +1830,7 @@ private void ensureInIsMutable() { * ``` * * - * repeated sint64 in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated sint64 in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @return The count of in. */ public int getInCount() { @@ -1728,7 +1850,7 @@ public int getInCount() { * ``` * * - * repeated sint64 in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated sint64 in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @param index The index of the element to return. * @return The in at the given index. */ @@ -1749,7 +1871,7 @@ public long getIn(int index) { * ``` * * - * repeated sint64 in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated sint64 in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @param index The index to set the value at. * @param value The in to set. * @return This builder for chaining. @@ -1777,7 +1899,7 @@ public Builder setIn( * ``` * * - * repeated sint64 in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated sint64 in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @param value The in to add. * @return This builder for chaining. */ @@ -1803,7 +1925,7 @@ public Builder addIn(long value) { * ``` * * - * repeated sint64 in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated sint64 in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @param values The in to add. * @return This builder for chaining. */ @@ -1830,7 +1952,7 @@ public Builder addAllIn( * ``` * * - * repeated sint64 in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated sint64 in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @return This builder for chaining. */ public Builder clearIn() { @@ -1861,7 +1983,7 @@ private void ensureNotInIsMutable() { * ``` * * - * repeated sint64 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated sint64 not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @return A list containing the notIn. */ public java.util.List @@ -1883,7 +2005,7 @@ private void ensureNotInIsMutable() { * ``` * * - * repeated sint64 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated sint64 not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @return The count of notIn. */ public int getNotInCount() { @@ -1903,7 +2025,7 @@ public int getNotInCount() { * ``` * * - * repeated sint64 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated sint64 not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @param index The index of the element to return. * @return The notIn at the given index. */ @@ -1924,7 +2046,7 @@ public long getNotIn(int index) { * ``` * * - * repeated sint64 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated sint64 not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @param index The index to set the value at. * @param value The notIn to set. * @return This builder for chaining. @@ -1952,7 +2074,7 @@ public Builder setNotIn( * ``` * * - * repeated sint64 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated sint64 not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @param value The notIn to add. * @return This builder for chaining. */ @@ -1978,7 +2100,7 @@ public Builder addNotIn(long value) { * ``` * * - * repeated sint64 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated sint64 not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @param values The notIn to add. * @return This builder for chaining. */ @@ -2005,7 +2127,7 @@ public Builder addAllNotIn( * ``` * * - * repeated sint64 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated sint64 not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @return This builder for chaining. */ public Builder clearNotIn() { @@ -2015,6 +2137,195 @@ public Builder clearNotIn() { return this; } + private com.google.protobuf.Internal.LongList example_ = emptyLongList(); + private void ensureExampleIsMutable() { + if (!example_.isModifiable()) { + example_ = makeMutableCopy(example_); + } + bitField0_ |= 0x00000080; + } + /** + *
+     * `example` specifies values that the field may have. These values SHOULD
+     * conform to other constraints. `example` values will not impact validation
+     * but may be used as helpful guidance on how to populate the given field.
+     *
+     * ```proto
+     * message MySInt64 {
+     * sint64 value = 1 [
+     * (buf.validate.field).sint64.example = 1,
+     * (buf.validate.field).sint64.example = -10
+     * ];
+     * }
+     * ```
+     * 
+ * + * repeated sint64 example = 8 [json_name = "example", (.buf.validate.predefined) = { ... } + * @return A list containing the example. + */ + public java.util.List + getExampleList() { + example_.makeImmutable(); + return example_; + } + /** + *
+     * `example` specifies values that the field may have. These values SHOULD
+     * conform to other constraints. `example` values will not impact validation
+     * but may be used as helpful guidance on how to populate the given field.
+     *
+     * ```proto
+     * message MySInt64 {
+     * sint64 value = 1 [
+     * (buf.validate.field).sint64.example = 1,
+     * (buf.validate.field).sint64.example = -10
+     * ];
+     * }
+     * ```
+     * 
+ * + * repeated sint64 example = 8 [json_name = "example", (.buf.validate.predefined) = { ... } + * @return The count of example. + */ + public int getExampleCount() { + return example_.size(); + } + /** + *
+     * `example` specifies values that the field may have. These values SHOULD
+     * conform to other constraints. `example` values will not impact validation
+     * but may be used as helpful guidance on how to populate the given field.
+     *
+     * ```proto
+     * message MySInt64 {
+     * sint64 value = 1 [
+     * (buf.validate.field).sint64.example = 1,
+     * (buf.validate.field).sint64.example = -10
+     * ];
+     * }
+     * ```
+     * 
+ * + * repeated sint64 example = 8 [json_name = "example", (.buf.validate.predefined) = { ... } + * @param index The index of the element to return. + * @return The example at the given index. + */ + public long getExample(int index) { + return example_.getLong(index); + } + /** + *
+     * `example` specifies values that the field may have. These values SHOULD
+     * conform to other constraints. `example` values will not impact validation
+     * but may be used as helpful guidance on how to populate the given field.
+     *
+     * ```proto
+     * message MySInt64 {
+     * sint64 value = 1 [
+     * (buf.validate.field).sint64.example = 1,
+     * (buf.validate.field).sint64.example = -10
+     * ];
+     * }
+     * ```
+     * 
+ * + * repeated sint64 example = 8 [json_name = "example", (.buf.validate.predefined) = { ... } + * @param index The index to set the value at. + * @param value The example to set. + * @return This builder for chaining. + */ + public Builder setExample( + int index, long value) { + + ensureExampleIsMutable(); + example_.setLong(index, value); + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + *
+     * `example` specifies values that the field may have. These values SHOULD
+     * conform to other constraints. `example` values will not impact validation
+     * but may be used as helpful guidance on how to populate the given field.
+     *
+     * ```proto
+     * message MySInt64 {
+     * sint64 value = 1 [
+     * (buf.validate.field).sint64.example = 1,
+     * (buf.validate.field).sint64.example = -10
+     * ];
+     * }
+     * ```
+     * 
+ * + * repeated sint64 example = 8 [json_name = "example", (.buf.validate.predefined) = { ... } + * @param value The example to add. + * @return This builder for chaining. + */ + public Builder addExample(long value) { + + ensureExampleIsMutable(); + example_.addLong(value); + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + *
+     * `example` specifies values that the field may have. These values SHOULD
+     * conform to other constraints. `example` values will not impact validation
+     * but may be used as helpful guidance on how to populate the given field.
+     *
+     * ```proto
+     * message MySInt64 {
+     * sint64 value = 1 [
+     * (buf.validate.field).sint64.example = 1,
+     * (buf.validate.field).sint64.example = -10
+     * ];
+     * }
+     * ```
+     * 
+ * + * repeated sint64 example = 8 [json_name = "example", (.buf.validate.predefined) = { ... } + * @param values The example to add. + * @return This builder for chaining. + */ + public Builder addAllExample( + java.lang.Iterable values) { + ensureExampleIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, example_); + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + *
+     * `example` specifies values that the field may have. These values SHOULD
+     * conform to other constraints. `example` values will not impact validation
+     * but may be used as helpful guidance on how to populate the given field.
+     *
+     * ```proto
+     * message MySInt64 {
+     * sint64 value = 1 [
+     * (buf.validate.field).sint64.example = 1,
+     * (buf.validate.field).sint64.example = -10
+     * ];
+     * }
+     * ```
+     * 
+ * + * repeated sint64 example = 8 [json_name = "example", (.buf.validate.predefined) = { ... } + * @return This builder for chaining. + */ + public Builder clearExample() { + example_ = emptyLongList(); + bitField0_ = (bitField0_ & ~0x00000080); + onChanged(); + return this; + } + // @@protoc_insertion_point(builder_scope:buf.validate.SInt64Rules) } diff --git a/src/main/java/build/buf/validate/SInt64RulesOrBuilder.java b/src/main/java/build/buf/validate/SInt64RulesOrBuilder.java index 903b8c92..09e4315e 100644 --- a/src/main/java/build/buf/validate/SInt64RulesOrBuilder.java +++ b/src/main/java/build/buf/validate/SInt64RulesOrBuilder.java @@ -7,7 +7,8 @@ public interface SInt64RulesOrBuilder extends // @@protoc_insertion_point(interface_extends:buf.validate.SInt64Rules) - com.google.protobuf.MessageOrBuilder { + com.google.protobuf.GeneratedMessage. + ExtendableMessageOrBuilder { /** *
@@ -22,7 +23,7 @@ public interface SInt64RulesOrBuilder extends
    * ```
    * 
* - * optional sint64 const = 1 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional sint64 const = 1 [json_name = "const", (.buf.validate.predefined) = { ... } * @return Whether the const field is set. */ boolean hasConst(); @@ -39,7 +40,7 @@ public interface SInt64RulesOrBuilder extends * ``` * * - * optional sint64 const = 1 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional sint64 const = 1 [json_name = "const", (.buf.validate.predefined) = { ... } * @return The const. */ long getConst(); @@ -58,7 +59,7 @@ public interface SInt64RulesOrBuilder extends * ``` * * - * sint64 lt = 2 [json_name = "lt", (.buf.validate.priv.field) = { ... } + * sint64 lt = 2 [json_name = "lt", (.buf.validate.predefined) = { ... } * @return Whether the lt field is set. */ boolean hasLt(); @@ -76,7 +77,7 @@ public interface SInt64RulesOrBuilder extends * ``` * * - * sint64 lt = 2 [json_name = "lt", (.buf.validate.priv.field) = { ... } + * sint64 lt = 2 [json_name = "lt", (.buf.validate.predefined) = { ... } * @return The lt. */ long getLt(); @@ -95,7 +96,7 @@ public interface SInt64RulesOrBuilder extends * ``` * * - * sint64 lte = 3 [json_name = "lte", (.buf.validate.priv.field) = { ... } + * sint64 lte = 3 [json_name = "lte", (.buf.validate.predefined) = { ... } * @return Whether the lte field is set. */ boolean hasLte(); @@ -113,7 +114,7 @@ public interface SInt64RulesOrBuilder extends * ``` * * - * sint64 lte = 3 [json_name = "lte", (.buf.validate.priv.field) = { ... } + * sint64 lte = 3 [json_name = "lte", (.buf.validate.predefined) = { ... } * @return The lte. */ long getLte(); @@ -140,7 +141,7 @@ public interface SInt64RulesOrBuilder extends * ``` * * - * sint64 gt = 4 [json_name = "gt", (.buf.validate.priv.field) = { ... } + * sint64 gt = 4 [json_name = "gt", (.buf.validate.predefined) = { ... } * @return Whether the gt field is set. */ boolean hasGt(); @@ -166,7 +167,7 @@ public interface SInt64RulesOrBuilder extends * ``` * * - * sint64 gt = 4 [json_name = "gt", (.buf.validate.priv.field) = { ... } + * sint64 gt = 4 [json_name = "gt", (.buf.validate.predefined) = { ... } * @return The gt. */ long getGt(); @@ -193,7 +194,7 @@ public interface SInt64RulesOrBuilder extends * ``` * * - * sint64 gte = 5 [json_name = "gte", (.buf.validate.priv.field) = { ... } + * sint64 gte = 5 [json_name = "gte", (.buf.validate.predefined) = { ... } * @return Whether the gte field is set. */ boolean hasGte(); @@ -219,7 +220,7 @@ public interface SInt64RulesOrBuilder extends * ``` * * - * sint64 gte = 5 [json_name = "gte", (.buf.validate.priv.field) = { ... } + * sint64 gte = 5 [json_name = "gte", (.buf.validate.predefined) = { ... } * @return The gte. */ long getGte(); @@ -238,7 +239,7 @@ public interface SInt64RulesOrBuilder extends * ``` * * - * repeated sint64 in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated sint64 in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @return A list containing the in. */ java.util.List getInList(); @@ -256,7 +257,7 @@ public interface SInt64RulesOrBuilder extends * ``` * * - * repeated sint64 in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated sint64 in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @return The count of in. */ int getInCount(); @@ -274,7 +275,7 @@ public interface SInt64RulesOrBuilder extends * ``` * * - * repeated sint64 in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated sint64 in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @param index The index of the element to return. * @return The in at the given index. */ @@ -294,7 +295,7 @@ public interface SInt64RulesOrBuilder extends * ``` * * - * repeated sint64 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated sint64 not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @return A list containing the notIn. */ java.util.List getNotInList(); @@ -312,7 +313,7 @@ public interface SInt64RulesOrBuilder extends * ``` * * - * repeated sint64 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated sint64 not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @return The count of notIn. */ int getNotInCount(); @@ -330,12 +331,74 @@ public interface SInt64RulesOrBuilder extends * ``` * * - * repeated sint64 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated sint64 not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @param index The index of the element to return. * @return The notIn at the given index. */ long getNotIn(int index); + /** + *
+   * `example` specifies values that the field may have. These values SHOULD
+   * conform to other constraints. `example` values will not impact validation
+   * but may be used as helpful guidance on how to populate the given field.
+   *
+   * ```proto
+   * message MySInt64 {
+   * sint64 value = 1 [
+   * (buf.validate.field).sint64.example = 1,
+   * (buf.validate.field).sint64.example = -10
+   * ];
+   * }
+   * ```
+   * 
+ * + * repeated sint64 example = 8 [json_name = "example", (.buf.validate.predefined) = { ... } + * @return A list containing the example. + */ + java.util.List getExampleList(); + /** + *
+   * `example` specifies values that the field may have. These values SHOULD
+   * conform to other constraints. `example` values will not impact validation
+   * but may be used as helpful guidance on how to populate the given field.
+   *
+   * ```proto
+   * message MySInt64 {
+   * sint64 value = 1 [
+   * (buf.validate.field).sint64.example = 1,
+   * (buf.validate.field).sint64.example = -10
+   * ];
+   * }
+   * ```
+   * 
+ * + * repeated sint64 example = 8 [json_name = "example", (.buf.validate.predefined) = { ... } + * @return The count of example. + */ + int getExampleCount(); + /** + *
+   * `example` specifies values that the field may have. These values SHOULD
+   * conform to other constraints. `example` values will not impact validation
+   * but may be used as helpful guidance on how to populate the given field.
+   *
+   * ```proto
+   * message MySInt64 {
+   * sint64 value = 1 [
+   * (buf.validate.field).sint64.example = 1,
+   * (buf.validate.field).sint64.example = -10
+   * ];
+   * }
+   * ```
+   * 
+ * + * repeated sint64 example = 8 [json_name = "example", (.buf.validate.predefined) = { ... } + * @param index The index of the element to return. + * @return The example at the given index. + */ + long getExample(int index); + build.buf.validate.SInt64Rules.LessThanCase getLessThanCase(); build.buf.validate.SInt64Rules.GreaterThanCase getGreaterThanCase(); diff --git a/src/main/java/build/buf/validate/StringRules.java b/src/main/java/build/buf/validate/StringRules.java index 19a22b11..3b7cd0d6 100644 --- a/src/main/java/build/buf/validate/StringRules.java +++ b/src/main/java/build/buf/validate/StringRules.java @@ -14,7 +14,8 @@ * Protobuf type {@code buf.validate.StringRules} */ public final class StringRules extends - com.google.protobuf.GeneratedMessage implements + com.google.protobuf.GeneratedMessage.ExtendableMessage< + StringRules> implements // @@protoc_insertion_point(message_implements:buf.validate.StringRules) StringRulesOrBuilder { private static final long serialVersionUID = 0L; @@ -28,7 +29,7 @@ public final class StringRules extends StringRules.class.getName()); } // Use StringRules.newBuilder() to construct. - private StringRules(com.google.protobuf.GeneratedMessage.Builder builder) { + private StringRules(com.google.protobuf.GeneratedMessage.ExtendableBuilder builder) { super(builder); } private StringRules() { @@ -42,6 +43,8 @@ private StringRules() { com.google.protobuf.LazyStringArrayList.emptyList(); notIn_ = com.google.protobuf.LazyStringArrayList.emptyList(); + example_ = + com.google.protobuf.LazyStringArrayList.emptyList(); } public static final com.google.protobuf.Descriptors.Descriptor @@ -148,7 +151,7 @@ public int getNumber() { * ``` * * - * optional string const = 1 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional string const = 1 [json_name = "const", (.buf.validate.predefined) = { ... } * @return Whether the const field is set. */ @java.lang.Override @@ -168,7 +171,7 @@ public boolean hasConst() { * ``` * * - * optional string const = 1 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional string const = 1 [json_name = "const", (.buf.validate.predefined) = { ... } * @return The const. */ @java.lang.Override @@ -180,7 +183,9 @@ public java.lang.String getConst() { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); - const_ = s; + if (bs.isValidUtf8()) { + const_ = s; + } return s; } } @@ -197,7 +202,7 @@ public java.lang.String getConst() { * ``` * * - * optional string const = 1 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional string const = 1 [json_name = "const", (.buf.validate.predefined) = { ... } * @return The bytes for const. */ @java.lang.Override @@ -232,7 +237,7 @@ public java.lang.String getConst() { * ``` * * - * optional uint64 len = 19 [json_name = "len", (.buf.validate.priv.field) = { ... } + * optional uint64 len = 19 [json_name = "len", (.buf.validate.predefined) = { ... } * @return Whether the len field is set. */ @java.lang.Override @@ -254,7 +259,7 @@ public boolean hasLen() { * ``` * * - * optional uint64 len = 19 [json_name = "len", (.buf.validate.priv.field) = { ... } + * optional uint64 len = 19 [json_name = "len", (.buf.validate.predefined) = { ... } * @return The len. */ @java.lang.Override @@ -279,7 +284,7 @@ public long getLen() { * ``` * * - * optional uint64 min_len = 2 [json_name = "minLen", (.buf.validate.priv.field) = { ... } + * optional uint64 min_len = 2 [json_name = "minLen", (.buf.validate.predefined) = { ... } * @return Whether the minLen field is set. */ @java.lang.Override @@ -301,7 +306,7 @@ public boolean hasMinLen() { * ``` * * - * optional uint64 min_len = 2 [json_name = "minLen", (.buf.validate.priv.field) = { ... } + * optional uint64 min_len = 2 [json_name = "minLen", (.buf.validate.predefined) = { ... } * @return The minLen. */ @java.lang.Override @@ -326,7 +331,7 @@ public long getMinLen() { * ``` * * - * optional uint64 max_len = 3 [json_name = "maxLen", (.buf.validate.priv.field) = { ... } + * optional uint64 max_len = 3 [json_name = "maxLen", (.buf.validate.predefined) = { ... } * @return Whether the maxLen field is set. */ @java.lang.Override @@ -348,7 +353,7 @@ public boolean hasMaxLen() { * ``` * * - * optional uint64 max_len = 3 [json_name = "maxLen", (.buf.validate.priv.field) = { ... } + * optional uint64 max_len = 3 [json_name = "maxLen", (.buf.validate.predefined) = { ... } * @return The maxLen. */ @java.lang.Override @@ -372,7 +377,7 @@ public long getMaxLen() { * ``` * * - * optional uint64 len_bytes = 20 [json_name = "lenBytes", (.buf.validate.priv.field) = { ... } + * optional uint64 len_bytes = 20 [json_name = "lenBytes", (.buf.validate.predefined) = { ... } * @return Whether the lenBytes field is set. */ @java.lang.Override @@ -393,7 +398,7 @@ public boolean hasLenBytes() { * ``` * * - * optional uint64 len_bytes = 20 [json_name = "lenBytes", (.buf.validate.priv.field) = { ... } + * optional uint64 len_bytes = 20 [json_name = "lenBytes", (.buf.validate.predefined) = { ... } * @return The lenBytes. */ @java.lang.Override @@ -418,7 +423,7 @@ public long getLenBytes() { * ``` * * - * optional uint64 min_bytes = 4 [json_name = "minBytes", (.buf.validate.priv.field) = { ... } + * optional uint64 min_bytes = 4 [json_name = "minBytes", (.buf.validate.predefined) = { ... } * @return Whether the minBytes field is set. */ @java.lang.Override @@ -440,7 +445,7 @@ public boolean hasMinBytes() { * ``` * * - * optional uint64 min_bytes = 4 [json_name = "minBytes", (.buf.validate.priv.field) = { ... } + * optional uint64 min_bytes = 4 [json_name = "minBytes", (.buf.validate.predefined) = { ... } * @return The minBytes. */ @java.lang.Override @@ -464,7 +469,7 @@ public long getMinBytes() { * ``` * * - * optional uint64 max_bytes = 5 [json_name = "maxBytes", (.buf.validate.priv.field) = { ... } + * optional uint64 max_bytes = 5 [json_name = "maxBytes", (.buf.validate.predefined) = { ... } * @return Whether the maxBytes field is set. */ @java.lang.Override @@ -485,7 +490,7 @@ public boolean hasMaxBytes() { * ``` * * - * optional uint64 max_bytes = 5 [json_name = "maxBytes", (.buf.validate.priv.field) = { ... } + * optional uint64 max_bytes = 5 [json_name = "maxBytes", (.buf.validate.predefined) = { ... } * @return The maxBytes. */ @java.lang.Override @@ -511,7 +516,7 @@ public long getMaxBytes() { * ``` * * - * optional string pattern = 6 [json_name = "pattern", (.buf.validate.priv.field) = { ... } + * optional string pattern = 6 [json_name = "pattern", (.buf.validate.predefined) = { ... } * @return Whether the pattern field is set. */ @java.lang.Override @@ -533,7 +538,7 @@ public boolean hasPattern() { * ``` * * - * optional string pattern = 6 [json_name = "pattern", (.buf.validate.priv.field) = { ... } + * optional string pattern = 6 [json_name = "pattern", (.buf.validate.predefined) = { ... } * @return The pattern. */ @java.lang.Override @@ -545,7 +550,9 @@ public java.lang.String getPattern() { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); - pattern_ = s; + if (bs.isValidUtf8()) { + pattern_ = s; + } return s; } } @@ -564,7 +571,7 @@ public java.lang.String getPattern() { * ``` * * - * optional string pattern = 6 [json_name = "pattern", (.buf.validate.priv.field) = { ... } + * optional string pattern = 6 [json_name = "pattern", (.buf.validate.predefined) = { ... } * @return The bytes for pattern. */ @java.lang.Override @@ -600,7 +607,7 @@ public java.lang.String getPattern() { * ``` * * - * optional string prefix = 7 [json_name = "prefix", (.buf.validate.priv.field) = { ... } + * optional string prefix = 7 [json_name = "prefix", (.buf.validate.predefined) = { ... } * @return Whether the prefix field is set. */ @java.lang.Override @@ -622,7 +629,7 @@ public boolean hasPrefix() { * ``` * * - * optional string prefix = 7 [json_name = "prefix", (.buf.validate.priv.field) = { ... } + * optional string prefix = 7 [json_name = "prefix", (.buf.validate.predefined) = { ... } * @return The prefix. */ @java.lang.Override @@ -634,7 +641,9 @@ public java.lang.String getPrefix() { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); - prefix_ = s; + if (bs.isValidUtf8()) { + prefix_ = s; + } return s; } } @@ -653,7 +662,7 @@ public java.lang.String getPrefix() { * ``` * * - * optional string prefix = 7 [json_name = "prefix", (.buf.validate.priv.field) = { ... } + * optional string prefix = 7 [json_name = "prefix", (.buf.validate.predefined) = { ... } * @return The bytes for prefix. */ @java.lang.Override @@ -688,7 +697,7 @@ public java.lang.String getPrefix() { * ``` * * - * optional string suffix = 8 [json_name = "suffix", (.buf.validate.priv.field) = { ... } + * optional string suffix = 8 [json_name = "suffix", (.buf.validate.predefined) = { ... } * @return Whether the suffix field is set. */ @java.lang.Override @@ -709,7 +718,7 @@ public boolean hasSuffix() { * ``` * * - * optional string suffix = 8 [json_name = "suffix", (.buf.validate.priv.field) = { ... } + * optional string suffix = 8 [json_name = "suffix", (.buf.validate.predefined) = { ... } * @return The suffix. */ @java.lang.Override @@ -721,7 +730,9 @@ public java.lang.String getSuffix() { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); - suffix_ = s; + if (bs.isValidUtf8()) { + suffix_ = s; + } return s; } } @@ -739,7 +750,7 @@ public java.lang.String getSuffix() { * ``` * * - * optional string suffix = 8 [json_name = "suffix", (.buf.validate.priv.field) = { ... } + * optional string suffix = 8 [json_name = "suffix", (.buf.validate.predefined) = { ... } * @return The bytes for suffix. */ @java.lang.Override @@ -774,7 +785,7 @@ public java.lang.String getSuffix() { * ``` * * - * optional string contains = 9 [json_name = "contains", (.buf.validate.priv.field) = { ... } + * optional string contains = 9 [json_name = "contains", (.buf.validate.predefined) = { ... } * @return Whether the contains field is set. */ @java.lang.Override @@ -795,7 +806,7 @@ public boolean hasContains() { * ``` * * - * optional string contains = 9 [json_name = "contains", (.buf.validate.priv.field) = { ... } + * optional string contains = 9 [json_name = "contains", (.buf.validate.predefined) = { ... } * @return The contains. */ @java.lang.Override @@ -807,7 +818,9 @@ public java.lang.String getContains() { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); - contains_ = s; + if (bs.isValidUtf8()) { + contains_ = s; + } return s; } } @@ -825,7 +838,7 @@ public java.lang.String getContains() { * ``` * * - * optional string contains = 9 [json_name = "contains", (.buf.validate.priv.field) = { ... } + * optional string contains = 9 [json_name = "contains", (.buf.validate.predefined) = { ... } * @return The bytes for contains. */ @java.lang.Override @@ -860,7 +873,7 @@ public java.lang.String getContains() { * ``` * * - * optional string not_contains = 23 [json_name = "notContains", (.buf.validate.priv.field) = { ... } + * optional string not_contains = 23 [json_name = "notContains", (.buf.validate.predefined) = { ... } * @return Whether the notContains field is set. */ @java.lang.Override @@ -881,7 +894,7 @@ public boolean hasNotContains() { * ``` * * - * optional string not_contains = 23 [json_name = "notContains", (.buf.validate.priv.field) = { ... } + * optional string not_contains = 23 [json_name = "notContains", (.buf.validate.predefined) = { ... } * @return The notContains. */ @java.lang.Override @@ -893,7 +906,9 @@ public java.lang.String getNotContains() { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); - notContains_ = s; + if (bs.isValidUtf8()) { + notContains_ = s; + } return s; } } @@ -911,7 +926,7 @@ public java.lang.String getNotContains() { * ``` * * - * optional string not_contains = 23 [json_name = "notContains", (.buf.validate.priv.field) = { ... } + * optional string not_contains = 23 [json_name = "notContains", (.buf.validate.predefined) = { ... } * @return The bytes for notContains. */ @java.lang.Override @@ -947,7 +962,7 @@ public java.lang.String getNotContains() { * ``` * * - * repeated string in = 10 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated string in = 10 [json_name = "in", (.buf.validate.predefined) = { ... } * @return A list containing the in. */ public com.google.protobuf.ProtocolStringList @@ -968,7 +983,7 @@ public java.lang.String getNotContains() { * ``` * * - * repeated string in = 10 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated string in = 10 [json_name = "in", (.buf.validate.predefined) = { ... } * @return The count of in. */ public int getInCount() { @@ -988,7 +1003,7 @@ public int getInCount() { * ``` * * - * repeated string in = 10 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated string in = 10 [json_name = "in", (.buf.validate.predefined) = { ... } * @param index The index of the element to return. * @return The in at the given index. */ @@ -1009,7 +1024,7 @@ public java.lang.String getIn(int index) { * ``` * * - * repeated string in = 10 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated string in = 10 [json_name = "in", (.buf.validate.predefined) = { ... } * @param index The index of the value to return. * @return The bytes of the in at the given index. */ @@ -1035,7 +1050,7 @@ public java.lang.String getIn(int index) { * ``` * * - * repeated string not_in = 11 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated string not_in = 11 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @return A list containing the notIn. */ public com.google.protobuf.ProtocolStringList @@ -1055,7 +1070,7 @@ public java.lang.String getIn(int index) { * ``` * * - * repeated string not_in = 11 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated string not_in = 11 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @return The count of notIn. */ public int getNotInCount() { @@ -1074,7 +1089,7 @@ public int getNotInCount() { * ``` * * - * repeated string not_in = 11 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated string not_in = 11 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @param index The index of the element to return. * @return The notIn at the given index. */ @@ -1094,7 +1109,7 @@ public java.lang.String getNotIn(int index) { * ``` * * - * repeated string not_in = 11 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated string not_in = 11 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @param index The index of the value to return. * @return The bytes of the notIn at the given index. */ @@ -1118,7 +1133,7 @@ public java.lang.String getNotIn(int index) { * ``` * * - * bool email = 12 [json_name = "email", (.buf.validate.priv.field) = { ... } + * bool email = 12 [json_name = "email", (.buf.validate.predefined) = { ... } * @return Whether the email field is set. */ @java.lang.Override @@ -1139,7 +1154,7 @@ public boolean hasEmail() { * ``` * * - * bool email = 12 [json_name = "email", (.buf.validate.priv.field) = { ... } + * bool email = 12 [json_name = "email", (.buf.validate.predefined) = { ... } * @return The email. */ @java.lang.Override @@ -1166,7 +1181,7 @@ public boolean getEmail() { * ``` * * - * bool hostname = 13 [json_name = "hostname", (.buf.validate.priv.field) = { ... } + * bool hostname = 13 [json_name = "hostname", (.buf.validate.predefined) = { ... } * @return Whether the hostname field is set. */ @java.lang.Override @@ -1188,7 +1203,7 @@ public boolean hasHostname() { * ``` * * - * bool hostname = 13 [json_name = "hostname", (.buf.validate.priv.field) = { ... } + * bool hostname = 13 [json_name = "hostname", (.buf.validate.predefined) = { ... } * @return The hostname. */ @java.lang.Override @@ -1215,7 +1230,7 @@ public boolean getHostname() { * ``` * * - * bool ip = 14 [json_name = "ip", (.buf.validate.priv.field) = { ... } + * bool ip = 14 [json_name = "ip", (.buf.validate.predefined) = { ... } * @return Whether the ip field is set. */ @java.lang.Override @@ -1237,7 +1252,7 @@ public boolean hasIp() { * ``` * * - * bool ip = 14 [json_name = "ip", (.buf.validate.priv.field) = { ... } + * bool ip = 14 [json_name = "ip", (.buf.validate.predefined) = { ... } * @return The ip. */ @java.lang.Override @@ -1263,7 +1278,7 @@ public boolean getIp() { * ``` * * - * bool ipv4 = 15 [json_name = "ipv4", (.buf.validate.priv.field) = { ... } + * bool ipv4 = 15 [json_name = "ipv4", (.buf.validate.predefined) = { ... } * @return Whether the ipv4 field is set. */ @java.lang.Override @@ -1284,7 +1299,7 @@ public boolean hasIpv4() { * ``` * * - * bool ipv4 = 15 [json_name = "ipv4", (.buf.validate.priv.field) = { ... } + * bool ipv4 = 15 [json_name = "ipv4", (.buf.validate.predefined) = { ... } * @return The ipv4. */ @java.lang.Override @@ -1310,7 +1325,7 @@ public boolean getIpv4() { * ``` * * - * bool ipv6 = 16 [json_name = "ipv6", (.buf.validate.priv.field) = { ... } + * bool ipv6 = 16 [json_name = "ipv6", (.buf.validate.predefined) = { ... } * @return Whether the ipv6 field is set. */ @java.lang.Override @@ -1331,7 +1346,7 @@ public boolean hasIpv6() { * ``` * * - * bool ipv6 = 16 [json_name = "ipv6", (.buf.validate.priv.field) = { ... } + * bool ipv6 = 16 [json_name = "ipv6", (.buf.validate.predefined) = { ... } * @return The ipv6. */ @java.lang.Override @@ -1357,7 +1372,7 @@ public boolean getIpv6() { * ``` * * - * bool uri = 17 [json_name = "uri", (.buf.validate.priv.field) = { ... } + * bool uri = 17 [json_name = "uri", (.buf.validate.predefined) = { ... } * @return Whether the uri field is set. */ @java.lang.Override @@ -1378,7 +1393,7 @@ public boolean hasUri() { * ``` * * - * bool uri = 17 [json_name = "uri", (.buf.validate.priv.field) = { ... } + * bool uri = 17 [json_name = "uri", (.buf.validate.predefined) = { ... } * @return The uri. */ @java.lang.Override @@ -1404,7 +1419,7 @@ public boolean getUri() { * ``` * * - * bool uri_ref = 18 [json_name = "uriRef", (.buf.validate.priv.field) = { ... } + * bool uri_ref = 18 [json_name = "uriRef", (.buf.validate.predefined) = { ... } * @return Whether the uriRef field is set. */ @java.lang.Override @@ -1425,7 +1440,7 @@ public boolean hasUriRef() { * ``` * * - * bool uri_ref = 18 [json_name = "uriRef", (.buf.validate.priv.field) = { ... } + * bool uri_ref = 18 [json_name = "uriRef", (.buf.validate.predefined) = { ... } * @return The uriRef. */ @java.lang.Override @@ -1453,7 +1468,7 @@ public boolean getUriRef() { * ``` * * - * bool address = 21 [json_name = "address", (.buf.validate.priv.field) = { ... } + * bool address = 21 [json_name = "address", (.buf.validate.predefined) = { ... } * @return Whether the address field is set. */ @java.lang.Override @@ -1476,7 +1491,7 @@ public boolean hasAddress() { * ``` * * - * bool address = 21 [json_name = "address", (.buf.validate.priv.field) = { ... } + * bool address = 21 [json_name = "address", (.buf.validate.predefined) = { ... } * @return The address. */ @java.lang.Override @@ -1502,7 +1517,7 @@ public boolean getAddress() { * ``` * * - * bool uuid = 22 [json_name = "uuid", (.buf.validate.priv.field) = { ... } + * bool uuid = 22 [json_name = "uuid", (.buf.validate.predefined) = { ... } * @return Whether the uuid field is set. */ @java.lang.Override @@ -1523,7 +1538,7 @@ public boolean hasUuid() { * ``` * * - * bool uuid = 22 [json_name = "uuid", (.buf.validate.priv.field) = { ... } + * bool uuid = 22 [json_name = "uuid", (.buf.validate.predefined) = { ... } * @return The uuid. */ @java.lang.Override @@ -1550,7 +1565,7 @@ public boolean getUuid() { * ``` * * - * bool tuuid = 33 [json_name = "tuuid", (.buf.validate.priv.field) = { ... } + * bool tuuid = 33 [json_name = "tuuid", (.buf.validate.predefined) = { ... } * @return Whether the tuuid field is set. */ @java.lang.Override @@ -1572,7 +1587,7 @@ public boolean hasTuuid() { * ``` * * - * bool tuuid = 33 [json_name = "tuuid", (.buf.validate.priv.field) = { ... } + * bool tuuid = 33 [json_name = "tuuid", (.buf.validate.predefined) = { ... } * @return The tuuid. */ @java.lang.Override @@ -1599,7 +1614,7 @@ public boolean getTuuid() { * ``` * * - * bool ip_with_prefixlen = 26 [json_name = "ipWithPrefixlen", (.buf.validate.priv.field) = { ... } + * bool ip_with_prefixlen = 26 [json_name = "ipWithPrefixlen", (.buf.validate.predefined) = { ... } * @return Whether the ipWithPrefixlen field is set. */ @java.lang.Override @@ -1621,7 +1636,7 @@ public boolean hasIpWithPrefixlen() { * ``` * * - * bool ip_with_prefixlen = 26 [json_name = "ipWithPrefixlen", (.buf.validate.priv.field) = { ... } + * bool ip_with_prefixlen = 26 [json_name = "ipWithPrefixlen", (.buf.validate.predefined) = { ... } * @return The ipWithPrefixlen. */ @java.lang.Override @@ -1648,7 +1663,7 @@ public boolean getIpWithPrefixlen() { * ``` * * - * bool ipv4_with_prefixlen = 27 [json_name = "ipv4WithPrefixlen", (.buf.validate.priv.field) = { ... } + * bool ipv4_with_prefixlen = 27 [json_name = "ipv4WithPrefixlen", (.buf.validate.predefined) = { ... } * @return Whether the ipv4WithPrefixlen field is set. */ @java.lang.Override @@ -1670,7 +1685,7 @@ public boolean hasIpv4WithPrefixlen() { * ``` * * - * bool ipv4_with_prefixlen = 27 [json_name = "ipv4WithPrefixlen", (.buf.validate.priv.field) = { ... } + * bool ipv4_with_prefixlen = 27 [json_name = "ipv4WithPrefixlen", (.buf.validate.predefined) = { ... } * @return The ipv4WithPrefixlen. */ @java.lang.Override @@ -1697,7 +1712,7 @@ public boolean getIpv4WithPrefixlen() { * ``` * * - * bool ipv6_with_prefixlen = 28 [json_name = "ipv6WithPrefixlen", (.buf.validate.priv.field) = { ... } + * bool ipv6_with_prefixlen = 28 [json_name = "ipv6WithPrefixlen", (.buf.validate.predefined) = { ... } * @return Whether the ipv6WithPrefixlen field is set. */ @java.lang.Override @@ -1719,7 +1734,7 @@ public boolean hasIpv6WithPrefixlen() { * ``` * * - * bool ipv6_with_prefixlen = 28 [json_name = "ipv6WithPrefixlen", (.buf.validate.priv.field) = { ... } + * bool ipv6_with_prefixlen = 28 [json_name = "ipv6WithPrefixlen", (.buf.validate.predefined) = { ... } * @return The ipv6WithPrefixlen. */ @java.lang.Override @@ -1746,7 +1761,7 @@ public boolean getIpv6WithPrefixlen() { * ``` * * - * bool ip_prefix = 29 [json_name = "ipPrefix", (.buf.validate.priv.field) = { ... } + * bool ip_prefix = 29 [json_name = "ipPrefix", (.buf.validate.predefined) = { ... } * @return Whether the ipPrefix field is set. */ @java.lang.Override @@ -1768,7 +1783,7 @@ public boolean hasIpPrefix() { * ``` * * - * bool ip_prefix = 29 [json_name = "ipPrefix", (.buf.validate.priv.field) = { ... } + * bool ip_prefix = 29 [json_name = "ipPrefix", (.buf.validate.predefined) = { ... } * @return The ipPrefix. */ @java.lang.Override @@ -1795,7 +1810,7 @@ public boolean getIpPrefix() { * ``` * * - * bool ipv4_prefix = 30 [json_name = "ipv4Prefix", (.buf.validate.priv.field) = { ... } + * bool ipv4_prefix = 30 [json_name = "ipv4Prefix", (.buf.validate.predefined) = { ... } * @return Whether the ipv4Prefix field is set. */ @java.lang.Override @@ -1817,7 +1832,7 @@ public boolean hasIpv4Prefix() { * ``` * * - * bool ipv4_prefix = 30 [json_name = "ipv4Prefix", (.buf.validate.priv.field) = { ... } + * bool ipv4_prefix = 30 [json_name = "ipv4Prefix", (.buf.validate.predefined) = { ... } * @return The ipv4Prefix. */ @java.lang.Override @@ -1844,7 +1859,7 @@ public boolean getIpv4Prefix() { * ``` * * - * bool ipv6_prefix = 31 [json_name = "ipv6Prefix", (.buf.validate.priv.field) = { ... } + * bool ipv6_prefix = 31 [json_name = "ipv6Prefix", (.buf.validate.predefined) = { ... } * @return Whether the ipv6Prefix field is set. */ @java.lang.Override @@ -1866,7 +1881,7 @@ public boolean hasIpv6Prefix() { * ``` * * - * bool ipv6_prefix = 31 [json_name = "ipv6Prefix", (.buf.validate.priv.field) = { ... } + * bool ipv6_prefix = 31 [json_name = "ipv6Prefix", (.buf.validate.predefined) = { ... } * @return The ipv6Prefix. */ @java.lang.Override @@ -1886,7 +1901,7 @@ public boolean getIpv6Prefix() { * with square brackets (e.g., `[::1]:1234`). * * - * bool host_and_port = 32 [json_name = "hostAndPort", (.buf.validate.priv.field) = { ... } + * bool host_and_port = 32 [json_name = "hostAndPort", (.buf.validate.predefined) = { ... } * @return Whether the hostAndPort field is set. */ @java.lang.Override @@ -1901,7 +1916,7 @@ public boolean hasHostAndPort() { * with square brackets (e.g., `[::1]:1234`). * * - * bool host_and_port = 32 [json_name = "hostAndPort", (.buf.validate.priv.field) = { ... } + * bool host_and_port = 32 [json_name = "hostAndPort", (.buf.validate.predefined) = { ... } * @return The hostAndPort. */ @java.lang.Override @@ -1937,7 +1952,7 @@ public boolean getHostAndPort() { * | KNOWN_REGEX_HTTP_HEADER_VALUE | 2 | HTTP header value as defined by [RFC 7230](https://tools.ietf.org/html/rfc7230#section-3.2.4) | * * - * .buf.validate.KnownRegex well_known_regex = 24 [json_name = "wellKnownRegex", (.buf.validate.priv.field) = { ... } + * .buf.validate.KnownRegex well_known_regex = 24 [json_name = "wellKnownRegex", (.buf.validate.predefined) = { ... } * @return Whether the wellKnownRegex field is set. */ public boolean hasWellKnownRegex() { @@ -1967,47 +1982,14 @@ public boolean hasWellKnownRegex() { * | KNOWN_REGEX_HTTP_HEADER_VALUE | 2 | HTTP header value as defined by [RFC 7230](https://tools.ietf.org/html/rfc7230#section-3.2.4) | * * - * .buf.validate.KnownRegex well_known_regex = 24 [json_name = "wellKnownRegex", (.buf.validate.priv.field) = { ... } - * @return The enum numeric value on the wire for wellKnownRegex. - */ - public int getWellKnownRegexValue() { - if (wellKnownCase_ == 24) { - return (java.lang.Integer) wellKnown_; - } - return 0; - } - /** - *
-   * `well_known_regex` specifies a common well-known pattern
-   * defined as a regex. If the field value doesn't match the well-known
-   * regex, an error message will be generated.
-   *
-   * ```proto
-   * message MyString {
-   * // value must be a valid HTTP header value
-   * string value = 1 [(buf.validate.field).string.well_known_regex = KNOWN_REGEX_HTTP_HEADER_VALUE];
-   * }
-   * ```
-   *
-   * #### KnownRegex
-   *
-   * `well_known_regex` contains some well-known patterns.
-   *
-   * | Name                          | Number | Description                               |
-   * |-------------------------------|--------|-------------------------------------------|
-   * | KNOWN_REGEX_UNSPECIFIED       | 0      |                                           |
-   * | KNOWN_REGEX_HTTP_HEADER_NAME  | 1      | HTTP header name as defined by [RFC 7230](https://tools.ietf.org/html/rfc7230#section-3.2)  |
-   * | KNOWN_REGEX_HTTP_HEADER_VALUE | 2      | HTTP header value as defined by [RFC 7230](https://tools.ietf.org/html/rfc7230#section-3.2.4) |
-   * 
- * - * .buf.validate.KnownRegex well_known_regex = 24 [json_name = "wellKnownRegex", (.buf.validate.priv.field) = { ... } + * .buf.validate.KnownRegex well_known_regex = 24 [json_name = "wellKnownRegex", (.buf.validate.predefined) = { ... } * @return The wellKnownRegex. */ public build.buf.validate.KnownRegex getWellKnownRegex() { if (wellKnownCase_ == 24) { build.buf.validate.KnownRegex result = build.buf.validate.KnownRegex.forNumber( (java.lang.Integer) wellKnown_); - return result == null ? build.buf.validate.KnownRegex.UNRECOGNIZED : result; + return result == null ? build.buf.validate.KnownRegex.KNOWN_REGEX_UNSPECIFIED : result; } return build.buf.validate.KnownRegex.KNOWN_REGEX_UNSPECIFIED; } @@ -2061,6 +2043,103 @@ public boolean getStrict() { return strict_; } + public static final int EXAMPLE_FIELD_NUMBER = 34; + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList example_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + *
+   * `example` specifies values that the field may have. These values SHOULD
+   * conform to other constraints. `example` values will not impact validation
+   * but may be used as helpful guidance on how to populate the given field.
+   *
+   * ```proto
+   * message MyString {
+   * string value = 1 [
+   * (buf.validate.field).string.example = 1,
+   * (buf.validate.field).string.example = 2
+   * ];
+   * }
+   * ```
+   * 
+ * + * repeated string example = 34 [json_name = "example", (.buf.validate.predefined) = { ... } + * @return A list containing the example. + */ + public com.google.protobuf.ProtocolStringList + getExampleList() { + return example_; + } + /** + *
+   * `example` specifies values that the field may have. These values SHOULD
+   * conform to other constraints. `example` values will not impact validation
+   * but may be used as helpful guidance on how to populate the given field.
+   *
+   * ```proto
+   * message MyString {
+   * string value = 1 [
+   * (buf.validate.field).string.example = 1,
+   * (buf.validate.field).string.example = 2
+   * ];
+   * }
+   * ```
+   * 
+ * + * repeated string example = 34 [json_name = "example", (.buf.validate.predefined) = { ... } + * @return The count of example. + */ + public int getExampleCount() { + return example_.size(); + } + /** + *
+   * `example` specifies values that the field may have. These values SHOULD
+   * conform to other constraints. `example` values will not impact validation
+   * but may be used as helpful guidance on how to populate the given field.
+   *
+   * ```proto
+   * message MyString {
+   * string value = 1 [
+   * (buf.validate.field).string.example = 1,
+   * (buf.validate.field).string.example = 2
+   * ];
+   * }
+   * ```
+   * 
+ * + * repeated string example = 34 [json_name = "example", (.buf.validate.predefined) = { ... } + * @param index The index of the element to return. + * @return The example at the given index. + */ + public java.lang.String getExample(int index) { + return example_.get(index); + } + /** + *
+   * `example` specifies values that the field may have. These values SHOULD
+   * conform to other constraints. `example` values will not impact validation
+   * but may be used as helpful guidance on how to populate the given field.
+   *
+   * ```proto
+   * message MyString {
+   * string value = 1 [
+   * (buf.validate.field).string.example = 1,
+   * (buf.validate.field).string.example = 2
+   * ];
+   * }
+   * ```
+   * 
+ * + * repeated string example = 34 [json_name = "example", (.buf.validate.predefined) = { ... } + * @param index The index of the value to return. + * @return The bytes of the example at the given index. + */ + public com.google.protobuf.ByteString + getExampleBytes(int index) { + return example_.getByteString(index); + } + private byte memoizedIsInitialized = -1; @java.lang.Override public final boolean isInitialized() { @@ -2068,6 +2147,10 @@ public final boolean isInitialized() { if (isInitialized == 1) return true; if (isInitialized == 0) return false; + if (!extensionsAreInitialized()) { + memoizedIsInitialized = 0; + return false; + } memoizedIsInitialized = 1; return true; } @@ -2075,6 +2158,9 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + com.google.protobuf.GeneratedMessage + .ExtendableMessage.ExtensionSerializer + extensionWriter = newExtensionSerializer(); if (((bitField0_ & 0x00000001) != 0)) { com.google.protobuf.GeneratedMessage.writeString(output, 1, const_); } @@ -2191,6 +2277,10 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) output.writeBool( 33, (boolean)((java.lang.Boolean) wellKnown_)); } + for (int i = 0; i < example_.size(); i++) { + com.google.protobuf.GeneratedMessage.writeString(output, 34, example_.getRaw(i)); + } + extensionWriter.writeUntil(536870912, output); getUnknownFields().writeTo(output); } @@ -2351,6 +2441,15 @@ public int getSerializedSize() { .computeBoolSize( 33, (boolean)((java.lang.Boolean) wellKnown_)); } + { + int dataSize = 0; + for (int i = 0; i < example_.size(); i++) { + dataSize += computeStringSizeNoTag(example_.getRaw(i)); + } + size += dataSize; + size += 2 * getExampleList().size(); + } + size += extensionsSerializedSize(); size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -2435,6 +2534,8 @@ public boolean equals(final java.lang.Object obj) { if (getStrict() != other.getStrict()) return false; } + if (!getExampleList() + .equals(other.getExampleList())) return false; if (!getWellKnownCase().equals(other.getWellKnownCase())) return false; switch (wellKnownCase_) { case 12: @@ -2506,13 +2607,15 @@ public boolean equals(final java.lang.Object obj) { != other.getHostAndPort()) return false; break; case 24: - if (getWellKnownRegexValue() - != other.getWellKnownRegexValue()) return false; + if (!getWellKnownRegex() + .equals(other.getWellKnownRegex())) return false; break; case 0: default: } if (!getUnknownFields().equals(other.getUnknownFields())) return false; + if (!getExtensionFields().equals(other.getExtensionFields())) + return false; return true; } @@ -2590,6 +2693,10 @@ public int hashCode() { hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( getStrict()); } + if (getExampleCount() > 0) { + hash = (37 * hash) + EXAMPLE_FIELD_NUMBER; + hash = (53 * hash) + getExampleList().hashCode(); + } switch (wellKnownCase_) { case 12: hash = (37 * hash) + EMAIL_FIELD_NUMBER; @@ -2678,11 +2785,12 @@ public int hashCode() { break; case 24: hash = (37 * hash) + WELL_KNOWN_REGEX_FIELD_NUMBER; - hash = (53 * hash) + getWellKnownRegexValue(); + hash = (53 * hash) + getWellKnownRegex().getNumber(); break; case 0: default: } + hash = hashFields(hash, getExtensionFields()); hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -2789,7 +2897,8 @@ protected Builder newBuilderForType( * Protobuf type {@code buf.validate.StringRules} */ public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder implements + com.google.protobuf.GeneratedMessage.ExtendableBuilder< + build.buf.validate.StringRules, Builder> implements // @@protoc_insertion_point(builder_implements:buf.validate.StringRules) build.buf.validate.StringRulesOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor @@ -2837,6 +2946,8 @@ public Builder clear() { notIn_ = com.google.protobuf.LazyStringArrayList.emptyList(); strict_ = false; + example_ = + com.google.protobuf.LazyStringArrayList.emptyList(); wellKnownCase_ = 0; wellKnown_ = null; return this; @@ -2941,6 +3052,10 @@ private void buildPartial1(build.buf.validate.StringRules result) { result.strict_ = strict_; to_bitField0_ |= 0x00001000; } + if (((from_bitField1_ & 0x00000002) != 0)) { + example_.makeImmutable(); + result.example_ = example_; + } result.bitField0_ |= to_bitField0_; } @@ -3032,6 +3147,16 @@ public Builder mergeFrom(build.buf.validate.StringRules other) { if (other.hasStrict()) { setStrict(other.getStrict()); } + if (!other.example_.isEmpty()) { + if (example_.isEmpty()) { + example_ = other.example_; + bitField1_ |= 0x00000002; + } else { + ensureExampleIsMutable(); + example_.addAll(other.example_); + } + onChanged(); + } switch (other.getWellKnownCase()) { case EMAIL: { setEmail(other.getEmail()); @@ -3102,13 +3227,14 @@ public Builder mergeFrom(build.buf.validate.StringRules other) { break; } case WELL_KNOWN_REGEX: { - setWellKnownRegexValue(other.getWellKnownRegexValue()); + setWellKnownRegex(other.getWellKnownRegex()); break; } case WELLKNOWN_NOT_SET: { break; } } + this.mergeExtensionFields(other); this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -3116,6 +3242,9 @@ public Builder mergeFrom(build.buf.validate.StringRules other) { @java.lang.Override public final boolean isInitialized() { + if (!extensionsAreInitialized()) { + return false; + } return true; } @@ -3136,7 +3265,7 @@ public Builder mergeFrom( done = true; break; case 10: { - const_ = input.readStringRequireUtf8(); + const_ = input.readBytes(); bitField0_ |= 0x00000001; break; } // case 10 @@ -3161,35 +3290,35 @@ public Builder mergeFrom( break; } // case 40 case 50: { - pattern_ = input.readStringRequireUtf8(); + pattern_ = input.readBytes(); bitField0_ |= 0x00000080; break; } // case 50 case 58: { - prefix_ = input.readStringRequireUtf8(); + prefix_ = input.readBytes(); bitField0_ |= 0x00000100; break; } // case 58 case 66: { - suffix_ = input.readStringRequireUtf8(); + suffix_ = input.readBytes(); bitField0_ |= 0x00000200; break; } // case 66 case 74: { - contains_ = input.readStringRequireUtf8(); + contains_ = input.readBytes(); bitField0_ |= 0x00000400; break; } // case 74 case 82: { - java.lang.String s = input.readStringRequireUtf8(); + com.google.protobuf.ByteString bs = input.readBytes(); ensureInIsMutable(); - in_.add(s); + in_.add(bs); break; } // case 82 case 90: { - java.lang.String s = input.readStringRequireUtf8(); + com.google.protobuf.ByteString bs = input.readBytes(); ensureNotInIsMutable(); - notIn_.add(s); + notIn_.add(bs); break; } // case 90 case 96: { @@ -3248,14 +3377,20 @@ public Builder mergeFrom( break; } // case 176 case 186: { - notContains_ = input.readStringRequireUtf8(); + notContains_ = input.readBytes(); bitField0_ |= 0x00000800; break; } // case 186 case 192: { int rawValue = input.readEnum(); - wellKnownCase_ = 24; - wellKnown_ = rawValue; + build.buf.validate.KnownRegex value = + build.buf.validate.KnownRegex.forNumber(rawValue); + if (value == null) { + mergeUnknownVarintField(24, rawValue); + } else { + wellKnownCase_ = 24; + wellKnown_ = rawValue; + } break; } // case 192 case 200: { @@ -3303,6 +3438,12 @@ public Builder mergeFrom( wellKnownCase_ = 33; break; } // case 264 + case 274: { + com.google.protobuf.ByteString bs = input.readBytes(); + ensureExampleIsMutable(); + example_.add(bs); + break; + } // case 274 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { done = true; // was an endgroup tag @@ -3350,7 +3491,7 @@ public Builder clearWellKnown() { * ``` * * - * optional string const = 1 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional string const = 1 [json_name = "const", (.buf.validate.predefined) = { ... } * @return Whether the const field is set. */ public boolean hasConst() { @@ -3369,7 +3510,7 @@ public boolean hasConst() { * ``` * * - * optional string const = 1 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional string const = 1 [json_name = "const", (.buf.validate.predefined) = { ... } * @return The const. */ public java.lang.String getConst() { @@ -3378,7 +3519,9 @@ public java.lang.String getConst() { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); - const_ = s; + if (bs.isValidUtf8()) { + const_ = s; + } return s; } else { return (java.lang.String) ref; @@ -3397,7 +3540,7 @@ public java.lang.String getConst() { * ``` * * - * optional string const = 1 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional string const = 1 [json_name = "const", (.buf.validate.predefined) = { ... } * @return The bytes for const. */ public com.google.protobuf.ByteString @@ -3426,7 +3569,7 @@ public java.lang.String getConst() { * ``` * * - * optional string const = 1 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional string const = 1 [json_name = "const", (.buf.validate.predefined) = { ... } * @param value The const to set. * @return This builder for chaining. */ @@ -3451,7 +3594,7 @@ public Builder setConst( * ``` * * - * optional string const = 1 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional string const = 1 [json_name = "const", (.buf.validate.predefined) = { ... } * @return This builder for chaining. */ public Builder clearConst() { @@ -3473,14 +3616,13 @@ public Builder clearConst() { * ``` * * - * optional string const = 1 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional string const = 1 [json_name = "const", (.buf.validate.predefined) = { ... } * @param value The bytes for const to set. * @return This builder for chaining. */ public Builder setConstBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } - checkByteStringIsUtf8(value); const_ = value; bitField0_ |= 0x00000001; onChanged(); @@ -3503,7 +3645,7 @@ public Builder setConstBytes( * ``` * * - * optional uint64 len = 19 [json_name = "len", (.buf.validate.priv.field) = { ... } + * optional uint64 len = 19 [json_name = "len", (.buf.validate.predefined) = { ... } * @return Whether the len field is set. */ @java.lang.Override @@ -3525,7 +3667,7 @@ public boolean hasLen() { * ``` * * - * optional uint64 len = 19 [json_name = "len", (.buf.validate.priv.field) = { ... } + * optional uint64 len = 19 [json_name = "len", (.buf.validate.predefined) = { ... } * @return The len. */ @java.lang.Override @@ -3547,7 +3689,7 @@ public long getLen() { * ``` * * - * optional uint64 len = 19 [json_name = "len", (.buf.validate.priv.field) = { ... } + * optional uint64 len = 19 [json_name = "len", (.buf.validate.predefined) = { ... } * @param value The len to set. * @return This builder for chaining. */ @@ -3573,7 +3715,7 @@ public Builder setLen(long value) { * ``` * * - * optional uint64 len = 19 [json_name = "len", (.buf.validate.priv.field) = { ... } + * optional uint64 len = 19 [json_name = "len", (.buf.validate.predefined) = { ... } * @return This builder for chaining. */ public Builder clearLen() { @@ -3599,7 +3741,7 @@ public Builder clearLen() { * ``` * * - * optional uint64 min_len = 2 [json_name = "minLen", (.buf.validate.priv.field) = { ... } + * optional uint64 min_len = 2 [json_name = "minLen", (.buf.validate.predefined) = { ... } * @return Whether the minLen field is set. */ @java.lang.Override @@ -3621,7 +3763,7 @@ public boolean hasMinLen() { * ``` * * - * optional uint64 min_len = 2 [json_name = "minLen", (.buf.validate.priv.field) = { ... } + * optional uint64 min_len = 2 [json_name = "minLen", (.buf.validate.predefined) = { ... } * @return The minLen. */ @java.lang.Override @@ -3643,7 +3785,7 @@ public long getMinLen() { * ``` * * - * optional uint64 min_len = 2 [json_name = "minLen", (.buf.validate.priv.field) = { ... } + * optional uint64 min_len = 2 [json_name = "minLen", (.buf.validate.predefined) = { ... } * @param value The minLen to set. * @return This builder for chaining. */ @@ -3669,7 +3811,7 @@ public Builder setMinLen(long value) { * ``` * * - * optional uint64 min_len = 2 [json_name = "minLen", (.buf.validate.priv.field) = { ... } + * optional uint64 min_len = 2 [json_name = "minLen", (.buf.validate.predefined) = { ... } * @return This builder for chaining. */ public Builder clearMinLen() { @@ -3695,7 +3837,7 @@ public Builder clearMinLen() { * ``` * * - * optional uint64 max_len = 3 [json_name = "maxLen", (.buf.validate.priv.field) = { ... } + * optional uint64 max_len = 3 [json_name = "maxLen", (.buf.validate.predefined) = { ... } * @return Whether the maxLen field is set. */ @java.lang.Override @@ -3717,7 +3859,7 @@ public boolean hasMaxLen() { * ``` * * - * optional uint64 max_len = 3 [json_name = "maxLen", (.buf.validate.priv.field) = { ... } + * optional uint64 max_len = 3 [json_name = "maxLen", (.buf.validate.predefined) = { ... } * @return The maxLen. */ @java.lang.Override @@ -3739,7 +3881,7 @@ public long getMaxLen() { * ``` * * - * optional uint64 max_len = 3 [json_name = "maxLen", (.buf.validate.priv.field) = { ... } + * optional uint64 max_len = 3 [json_name = "maxLen", (.buf.validate.predefined) = { ... } * @param value The maxLen to set. * @return This builder for chaining. */ @@ -3765,7 +3907,7 @@ public Builder setMaxLen(long value) { * ``` * * - * optional uint64 max_len = 3 [json_name = "maxLen", (.buf.validate.priv.field) = { ... } + * optional uint64 max_len = 3 [json_name = "maxLen", (.buf.validate.predefined) = { ... } * @return This builder for chaining. */ public Builder clearMaxLen() { @@ -3790,7 +3932,7 @@ public Builder clearMaxLen() { * ``` * * - * optional uint64 len_bytes = 20 [json_name = "lenBytes", (.buf.validate.priv.field) = { ... } + * optional uint64 len_bytes = 20 [json_name = "lenBytes", (.buf.validate.predefined) = { ... } * @return Whether the lenBytes field is set. */ @java.lang.Override @@ -3811,7 +3953,7 @@ public boolean hasLenBytes() { * ``` * * - * optional uint64 len_bytes = 20 [json_name = "lenBytes", (.buf.validate.priv.field) = { ... } + * optional uint64 len_bytes = 20 [json_name = "lenBytes", (.buf.validate.predefined) = { ... } * @return The lenBytes. */ @java.lang.Override @@ -3832,7 +3974,7 @@ public long getLenBytes() { * ``` * * - * optional uint64 len_bytes = 20 [json_name = "lenBytes", (.buf.validate.priv.field) = { ... } + * optional uint64 len_bytes = 20 [json_name = "lenBytes", (.buf.validate.predefined) = { ... } * @param value The lenBytes to set. * @return This builder for chaining. */ @@ -3857,7 +3999,7 @@ public Builder setLenBytes(long value) { * ``` * * - * optional uint64 len_bytes = 20 [json_name = "lenBytes", (.buf.validate.priv.field) = { ... } + * optional uint64 len_bytes = 20 [json_name = "lenBytes", (.buf.validate.predefined) = { ... } * @return This builder for chaining. */ public Builder clearLenBytes() { @@ -3883,7 +4025,7 @@ public Builder clearLenBytes() { * ``` * * - * optional uint64 min_bytes = 4 [json_name = "minBytes", (.buf.validate.priv.field) = { ... } + * optional uint64 min_bytes = 4 [json_name = "minBytes", (.buf.validate.predefined) = { ... } * @return Whether the minBytes field is set. */ @java.lang.Override @@ -3905,7 +4047,7 @@ public boolean hasMinBytes() { * ``` * * - * optional uint64 min_bytes = 4 [json_name = "minBytes", (.buf.validate.priv.field) = { ... } + * optional uint64 min_bytes = 4 [json_name = "minBytes", (.buf.validate.predefined) = { ... } * @return The minBytes. */ @java.lang.Override @@ -3927,7 +4069,7 @@ public long getMinBytes() { * ``` * * - * optional uint64 min_bytes = 4 [json_name = "minBytes", (.buf.validate.priv.field) = { ... } + * optional uint64 min_bytes = 4 [json_name = "minBytes", (.buf.validate.predefined) = { ... } * @param value The minBytes to set. * @return This builder for chaining. */ @@ -3953,7 +4095,7 @@ public Builder setMinBytes(long value) { * ``` * * - * optional uint64 min_bytes = 4 [json_name = "minBytes", (.buf.validate.priv.field) = { ... } + * optional uint64 min_bytes = 4 [json_name = "minBytes", (.buf.validate.predefined) = { ... } * @return This builder for chaining. */ public Builder clearMinBytes() { @@ -3978,7 +4120,7 @@ public Builder clearMinBytes() { * ``` * * - * optional uint64 max_bytes = 5 [json_name = "maxBytes", (.buf.validate.priv.field) = { ... } + * optional uint64 max_bytes = 5 [json_name = "maxBytes", (.buf.validate.predefined) = { ... } * @return Whether the maxBytes field is set. */ @java.lang.Override @@ -3999,7 +4141,7 @@ public boolean hasMaxBytes() { * ``` * * - * optional uint64 max_bytes = 5 [json_name = "maxBytes", (.buf.validate.priv.field) = { ... } + * optional uint64 max_bytes = 5 [json_name = "maxBytes", (.buf.validate.predefined) = { ... } * @return The maxBytes. */ @java.lang.Override @@ -4020,7 +4162,7 @@ public long getMaxBytes() { * ``` * * - * optional uint64 max_bytes = 5 [json_name = "maxBytes", (.buf.validate.priv.field) = { ... } + * optional uint64 max_bytes = 5 [json_name = "maxBytes", (.buf.validate.predefined) = { ... } * @param value The maxBytes to set. * @return This builder for chaining. */ @@ -4045,7 +4187,7 @@ public Builder setMaxBytes(long value) { * ``` * * - * optional uint64 max_bytes = 5 [json_name = "maxBytes", (.buf.validate.priv.field) = { ... } + * optional uint64 max_bytes = 5 [json_name = "maxBytes", (.buf.validate.predefined) = { ... } * @return This builder for chaining. */ public Builder clearMaxBytes() { @@ -4071,7 +4213,7 @@ public Builder clearMaxBytes() { * ``` * * - * optional string pattern = 6 [json_name = "pattern", (.buf.validate.priv.field) = { ... } + * optional string pattern = 6 [json_name = "pattern", (.buf.validate.predefined) = { ... } * @return Whether the pattern field is set. */ public boolean hasPattern() { @@ -4092,7 +4234,7 @@ public boolean hasPattern() { * ``` * * - * optional string pattern = 6 [json_name = "pattern", (.buf.validate.priv.field) = { ... } + * optional string pattern = 6 [json_name = "pattern", (.buf.validate.predefined) = { ... } * @return The pattern. */ public java.lang.String getPattern() { @@ -4101,7 +4243,9 @@ public java.lang.String getPattern() { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); - pattern_ = s; + if (bs.isValidUtf8()) { + pattern_ = s; + } return s; } else { return (java.lang.String) ref; @@ -4122,7 +4266,7 @@ public java.lang.String getPattern() { * ``` * * - * optional string pattern = 6 [json_name = "pattern", (.buf.validate.priv.field) = { ... } + * optional string pattern = 6 [json_name = "pattern", (.buf.validate.predefined) = { ... } * @return The bytes for pattern. */ public com.google.protobuf.ByteString @@ -4153,7 +4297,7 @@ public java.lang.String getPattern() { * ``` * * - * optional string pattern = 6 [json_name = "pattern", (.buf.validate.priv.field) = { ... } + * optional string pattern = 6 [json_name = "pattern", (.buf.validate.predefined) = { ... } * @param value The pattern to set. * @return This builder for chaining. */ @@ -4180,7 +4324,7 @@ public Builder setPattern( * ``` * * - * optional string pattern = 6 [json_name = "pattern", (.buf.validate.priv.field) = { ... } + * optional string pattern = 6 [json_name = "pattern", (.buf.validate.predefined) = { ... } * @return This builder for chaining. */ public Builder clearPattern() { @@ -4204,14 +4348,13 @@ public Builder clearPattern() { * ``` * * - * optional string pattern = 6 [json_name = "pattern", (.buf.validate.priv.field) = { ... } + * optional string pattern = 6 [json_name = "pattern", (.buf.validate.predefined) = { ... } * @param value The bytes for pattern to set. * @return This builder for chaining. */ public Builder setPatternBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } - checkByteStringIsUtf8(value); pattern_ = value; bitField0_ |= 0x00000080; onChanged(); @@ -4234,7 +4377,7 @@ public Builder setPatternBytes( * ``` * * - * optional string prefix = 7 [json_name = "prefix", (.buf.validate.priv.field) = { ... } + * optional string prefix = 7 [json_name = "prefix", (.buf.validate.predefined) = { ... } * @return Whether the prefix field is set. */ public boolean hasPrefix() { @@ -4255,7 +4398,7 @@ public boolean hasPrefix() { * ``` * * - * optional string prefix = 7 [json_name = "prefix", (.buf.validate.priv.field) = { ... } + * optional string prefix = 7 [json_name = "prefix", (.buf.validate.predefined) = { ... } * @return The prefix. */ public java.lang.String getPrefix() { @@ -4264,7 +4407,9 @@ public java.lang.String getPrefix() { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); - prefix_ = s; + if (bs.isValidUtf8()) { + prefix_ = s; + } return s; } else { return (java.lang.String) ref; @@ -4285,7 +4430,7 @@ public java.lang.String getPrefix() { * ``` * * - * optional string prefix = 7 [json_name = "prefix", (.buf.validate.priv.field) = { ... } + * optional string prefix = 7 [json_name = "prefix", (.buf.validate.predefined) = { ... } * @return The bytes for prefix. */ public com.google.protobuf.ByteString @@ -4316,7 +4461,7 @@ public java.lang.String getPrefix() { * ``` * * - * optional string prefix = 7 [json_name = "prefix", (.buf.validate.priv.field) = { ... } + * optional string prefix = 7 [json_name = "prefix", (.buf.validate.predefined) = { ... } * @param value The prefix to set. * @return This builder for chaining. */ @@ -4343,7 +4488,7 @@ public Builder setPrefix( * ``` * * - * optional string prefix = 7 [json_name = "prefix", (.buf.validate.priv.field) = { ... } + * optional string prefix = 7 [json_name = "prefix", (.buf.validate.predefined) = { ... } * @return This builder for chaining. */ public Builder clearPrefix() { @@ -4367,14 +4512,13 @@ public Builder clearPrefix() { * ``` * * - * optional string prefix = 7 [json_name = "prefix", (.buf.validate.priv.field) = { ... } + * optional string prefix = 7 [json_name = "prefix", (.buf.validate.predefined) = { ... } * @param value The bytes for prefix to set. * @return This builder for chaining. */ public Builder setPrefixBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } - checkByteStringIsUtf8(value); prefix_ = value; bitField0_ |= 0x00000100; onChanged(); @@ -4396,7 +4540,7 @@ public Builder setPrefixBytes( * ``` * * - * optional string suffix = 8 [json_name = "suffix", (.buf.validate.priv.field) = { ... } + * optional string suffix = 8 [json_name = "suffix", (.buf.validate.predefined) = { ... } * @return Whether the suffix field is set. */ public boolean hasSuffix() { @@ -4416,7 +4560,7 @@ public boolean hasSuffix() { * ``` * * - * optional string suffix = 8 [json_name = "suffix", (.buf.validate.priv.field) = { ... } + * optional string suffix = 8 [json_name = "suffix", (.buf.validate.predefined) = { ... } * @return The suffix. */ public java.lang.String getSuffix() { @@ -4425,7 +4569,9 @@ public java.lang.String getSuffix() { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); - suffix_ = s; + if (bs.isValidUtf8()) { + suffix_ = s; + } return s; } else { return (java.lang.String) ref; @@ -4445,7 +4591,7 @@ public java.lang.String getSuffix() { * ``` * * - * optional string suffix = 8 [json_name = "suffix", (.buf.validate.priv.field) = { ... } + * optional string suffix = 8 [json_name = "suffix", (.buf.validate.predefined) = { ... } * @return The bytes for suffix. */ public com.google.protobuf.ByteString @@ -4475,7 +4621,7 @@ public java.lang.String getSuffix() { * ``` * * - * optional string suffix = 8 [json_name = "suffix", (.buf.validate.priv.field) = { ... } + * optional string suffix = 8 [json_name = "suffix", (.buf.validate.predefined) = { ... } * @param value The suffix to set. * @return This builder for chaining. */ @@ -4501,7 +4647,7 @@ public Builder setSuffix( * ``` * * - * optional string suffix = 8 [json_name = "suffix", (.buf.validate.priv.field) = { ... } + * optional string suffix = 8 [json_name = "suffix", (.buf.validate.predefined) = { ... } * @return This builder for chaining. */ public Builder clearSuffix() { @@ -4524,14 +4670,13 @@ public Builder clearSuffix() { * ``` * * - * optional string suffix = 8 [json_name = "suffix", (.buf.validate.priv.field) = { ... } + * optional string suffix = 8 [json_name = "suffix", (.buf.validate.predefined) = { ... } * @param value The bytes for suffix to set. * @return This builder for chaining. */ public Builder setSuffixBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } - checkByteStringIsUtf8(value); suffix_ = value; bitField0_ |= 0x00000200; onChanged(); @@ -4553,7 +4698,7 @@ public Builder setSuffixBytes( * ``` * * - * optional string contains = 9 [json_name = "contains", (.buf.validate.priv.field) = { ... } + * optional string contains = 9 [json_name = "contains", (.buf.validate.predefined) = { ... } * @return Whether the contains field is set. */ public boolean hasContains() { @@ -4573,7 +4718,7 @@ public boolean hasContains() { * ``` * * - * optional string contains = 9 [json_name = "contains", (.buf.validate.priv.field) = { ... } + * optional string contains = 9 [json_name = "contains", (.buf.validate.predefined) = { ... } * @return The contains. */ public java.lang.String getContains() { @@ -4582,7 +4727,9 @@ public java.lang.String getContains() { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); - contains_ = s; + if (bs.isValidUtf8()) { + contains_ = s; + } return s; } else { return (java.lang.String) ref; @@ -4602,7 +4749,7 @@ public java.lang.String getContains() { * ``` * * - * optional string contains = 9 [json_name = "contains", (.buf.validate.priv.field) = { ... } + * optional string contains = 9 [json_name = "contains", (.buf.validate.predefined) = { ... } * @return The bytes for contains. */ public com.google.protobuf.ByteString @@ -4632,7 +4779,7 @@ public java.lang.String getContains() { * ``` * * - * optional string contains = 9 [json_name = "contains", (.buf.validate.priv.field) = { ... } + * optional string contains = 9 [json_name = "contains", (.buf.validate.predefined) = { ... } * @param value The contains to set. * @return This builder for chaining. */ @@ -4658,7 +4805,7 @@ public Builder setContains( * ``` * * - * optional string contains = 9 [json_name = "contains", (.buf.validate.priv.field) = { ... } + * optional string contains = 9 [json_name = "contains", (.buf.validate.predefined) = { ... } * @return This builder for chaining. */ public Builder clearContains() { @@ -4681,14 +4828,13 @@ public Builder clearContains() { * ``` * * - * optional string contains = 9 [json_name = "contains", (.buf.validate.priv.field) = { ... } + * optional string contains = 9 [json_name = "contains", (.buf.validate.predefined) = { ... } * @param value The bytes for contains to set. * @return This builder for chaining. */ public Builder setContainsBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } - checkByteStringIsUtf8(value); contains_ = value; bitField0_ |= 0x00000400; onChanged(); @@ -4710,7 +4856,7 @@ public Builder setContainsBytes( * ``` * * - * optional string not_contains = 23 [json_name = "notContains", (.buf.validate.priv.field) = { ... } + * optional string not_contains = 23 [json_name = "notContains", (.buf.validate.predefined) = { ... } * @return Whether the notContains field is set. */ public boolean hasNotContains() { @@ -4730,7 +4876,7 @@ public boolean hasNotContains() { * ``` * * - * optional string not_contains = 23 [json_name = "notContains", (.buf.validate.priv.field) = { ... } + * optional string not_contains = 23 [json_name = "notContains", (.buf.validate.predefined) = { ... } * @return The notContains. */ public java.lang.String getNotContains() { @@ -4739,7 +4885,9 @@ public java.lang.String getNotContains() { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); - notContains_ = s; + if (bs.isValidUtf8()) { + notContains_ = s; + } return s; } else { return (java.lang.String) ref; @@ -4759,7 +4907,7 @@ public java.lang.String getNotContains() { * ``` * * - * optional string not_contains = 23 [json_name = "notContains", (.buf.validate.priv.field) = { ... } + * optional string not_contains = 23 [json_name = "notContains", (.buf.validate.predefined) = { ... } * @return The bytes for notContains. */ public com.google.protobuf.ByteString @@ -4789,7 +4937,7 @@ public java.lang.String getNotContains() { * ``` * * - * optional string not_contains = 23 [json_name = "notContains", (.buf.validate.priv.field) = { ... } + * optional string not_contains = 23 [json_name = "notContains", (.buf.validate.predefined) = { ... } * @param value The notContains to set. * @return This builder for chaining. */ @@ -4815,7 +4963,7 @@ public Builder setNotContains( * ``` * * - * optional string not_contains = 23 [json_name = "notContains", (.buf.validate.priv.field) = { ... } + * optional string not_contains = 23 [json_name = "notContains", (.buf.validate.predefined) = { ... } * @return This builder for chaining. */ public Builder clearNotContains() { @@ -4838,14 +4986,13 @@ public Builder clearNotContains() { * ``` * * - * optional string not_contains = 23 [json_name = "notContains", (.buf.validate.priv.field) = { ... } + * optional string not_contains = 23 [json_name = "notContains", (.buf.validate.predefined) = { ... } * @param value The bytes for notContains to set. * @return This builder for chaining. */ public Builder setNotContainsBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } - checkByteStringIsUtf8(value); notContains_ = value; bitField0_ |= 0x00000800; onChanged(); @@ -4874,7 +5021,7 @@ private void ensureInIsMutable() { * ``` * * - * repeated string in = 10 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated string in = 10 [json_name = "in", (.buf.validate.predefined) = { ... } * @return A list containing the in. */ public com.google.protobuf.ProtocolStringList @@ -4896,7 +5043,7 @@ private void ensureInIsMutable() { * ``` * * - * repeated string in = 10 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated string in = 10 [json_name = "in", (.buf.validate.predefined) = { ... } * @return The count of in. */ public int getInCount() { @@ -4916,7 +5063,7 @@ public int getInCount() { * ``` * * - * repeated string in = 10 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated string in = 10 [json_name = "in", (.buf.validate.predefined) = { ... } * @param index The index of the element to return. * @return The in at the given index. */ @@ -4937,7 +5084,7 @@ public java.lang.String getIn(int index) { * ``` * * - * repeated string in = 10 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated string in = 10 [json_name = "in", (.buf.validate.predefined) = { ... } * @param index The index of the value to return. * @return The bytes of the in at the given index. */ @@ -4959,7 +5106,7 @@ public java.lang.String getIn(int index) { * ``` * * - * repeated string in = 10 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated string in = 10 [json_name = "in", (.buf.validate.predefined) = { ... } * @param index The index to set the value at. * @param value The in to set. * @return This builder for chaining. @@ -4987,7 +5134,7 @@ public Builder setIn( * ``` * * - * repeated string in = 10 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated string in = 10 [json_name = "in", (.buf.validate.predefined) = { ... } * @param value The in to add. * @return This builder for chaining. */ @@ -5014,7 +5161,7 @@ public Builder addIn( * ``` * * - * repeated string in = 10 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated string in = 10 [json_name = "in", (.buf.validate.predefined) = { ... } * @param values The in to add. * @return This builder for chaining. */ @@ -5041,7 +5188,7 @@ public Builder addAllIn( * ``` * * - * repeated string in = 10 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated string in = 10 [json_name = "in", (.buf.validate.predefined) = { ... } * @return This builder for chaining. */ public Builder clearIn() { @@ -5065,14 +5212,13 @@ public Builder clearIn() { * ``` * * - * repeated string in = 10 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated string in = 10 [json_name = "in", (.buf.validate.predefined) = { ... } * @param value The bytes of the in to add. * @return This builder for chaining. */ public Builder addInBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } - checkByteStringIsUtf8(value); ensureInIsMutable(); in_.add(value); bitField0_ |= 0x00001000; @@ -5101,7 +5247,7 @@ private void ensureNotInIsMutable() { * ``` * * - * repeated string not_in = 11 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated string not_in = 11 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @return A list containing the notIn. */ public com.google.protobuf.ProtocolStringList @@ -5122,7 +5268,7 @@ private void ensureNotInIsMutable() { * ``` * * - * repeated string not_in = 11 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated string not_in = 11 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @return The count of notIn. */ public int getNotInCount() { @@ -5141,7 +5287,7 @@ public int getNotInCount() { * ``` * * - * repeated string not_in = 11 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated string not_in = 11 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @param index The index of the element to return. * @return The notIn at the given index. */ @@ -5161,7 +5307,7 @@ public java.lang.String getNotIn(int index) { * ``` * * - * repeated string not_in = 11 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated string not_in = 11 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @param index The index of the value to return. * @return The bytes of the notIn at the given index. */ @@ -5182,7 +5328,7 @@ public java.lang.String getNotIn(int index) { * ``` * * - * repeated string not_in = 11 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated string not_in = 11 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @param index The index to set the value at. * @param value The notIn to set. * @return This builder for chaining. @@ -5209,7 +5355,7 @@ public Builder setNotIn( * ``` * * - * repeated string not_in = 11 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated string not_in = 11 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @param value The notIn to add. * @return This builder for chaining. */ @@ -5235,7 +5381,7 @@ public Builder addNotIn( * ``` * * - * repeated string not_in = 11 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated string not_in = 11 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @param values The notIn to add. * @return This builder for chaining. */ @@ -5261,7 +5407,7 @@ public Builder addAllNotIn( * ``` * * - * repeated string not_in = 11 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated string not_in = 11 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @return This builder for chaining. */ public Builder clearNotIn() { @@ -5284,14 +5430,13 @@ public Builder clearNotIn() { * ``` * * - * repeated string not_in = 11 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated string not_in = 11 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @param value The bytes of the notIn to add. * @return This builder for chaining. */ public Builder addNotInBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } - checkByteStringIsUtf8(value); ensureNotInIsMutable(); notIn_.add(value); bitField0_ |= 0x00002000; @@ -5313,7 +5458,7 @@ public Builder addNotInBytes( * ``` * * - * bool email = 12 [json_name = "email", (.buf.validate.priv.field) = { ... } + * bool email = 12 [json_name = "email", (.buf.validate.predefined) = { ... } * @return Whether the email field is set. */ public boolean hasEmail() { @@ -5333,7 +5478,7 @@ public boolean hasEmail() { * ``` * * - * bool email = 12 [json_name = "email", (.buf.validate.priv.field) = { ... } + * bool email = 12 [json_name = "email", (.buf.validate.predefined) = { ... } * @return The email. */ public boolean getEmail() { @@ -5356,7 +5501,7 @@ public boolean getEmail() { * ``` * * - * bool email = 12 [json_name = "email", (.buf.validate.priv.field) = { ... } + * bool email = 12 [json_name = "email", (.buf.validate.predefined) = { ... } * @param value The email to set. * @return This builder for chaining. */ @@ -5381,7 +5526,7 @@ public Builder setEmail(boolean value) { * ``` * * - * bool email = 12 [json_name = "email", (.buf.validate.priv.field) = { ... } + * bool email = 12 [json_name = "email", (.buf.validate.predefined) = { ... } * @return This builder for chaining. */ public Builder clearEmail() { @@ -5408,7 +5553,7 @@ public Builder clearEmail() { * ``` * * - * bool hostname = 13 [json_name = "hostname", (.buf.validate.priv.field) = { ... } + * bool hostname = 13 [json_name = "hostname", (.buf.validate.predefined) = { ... } * @return Whether the hostname field is set. */ public boolean hasHostname() { @@ -5429,7 +5574,7 @@ public boolean hasHostname() { * ``` * * - * bool hostname = 13 [json_name = "hostname", (.buf.validate.priv.field) = { ... } + * bool hostname = 13 [json_name = "hostname", (.buf.validate.predefined) = { ... } * @return The hostname. */ public boolean getHostname() { @@ -5453,7 +5598,7 @@ public boolean getHostname() { * ``` * * - * bool hostname = 13 [json_name = "hostname", (.buf.validate.priv.field) = { ... } + * bool hostname = 13 [json_name = "hostname", (.buf.validate.predefined) = { ... } * @param value The hostname to set. * @return This builder for chaining. */ @@ -5479,7 +5624,7 @@ public Builder setHostname(boolean value) { * ``` * * - * bool hostname = 13 [json_name = "hostname", (.buf.validate.priv.field) = { ... } + * bool hostname = 13 [json_name = "hostname", (.buf.validate.predefined) = { ... } * @return This builder for chaining. */ public Builder clearHostname() { @@ -5506,7 +5651,7 @@ public Builder clearHostname() { * ``` * * - * bool ip = 14 [json_name = "ip", (.buf.validate.priv.field) = { ... } + * bool ip = 14 [json_name = "ip", (.buf.validate.predefined) = { ... } * @return Whether the ip field is set. */ public boolean hasIp() { @@ -5527,7 +5672,7 @@ public boolean hasIp() { * ``` * * - * bool ip = 14 [json_name = "ip", (.buf.validate.priv.field) = { ... } + * bool ip = 14 [json_name = "ip", (.buf.validate.predefined) = { ... } * @return The ip. */ public boolean getIp() { @@ -5551,7 +5696,7 @@ public boolean getIp() { * ``` * * - * bool ip = 14 [json_name = "ip", (.buf.validate.priv.field) = { ... } + * bool ip = 14 [json_name = "ip", (.buf.validate.predefined) = { ... } * @param value The ip to set. * @return This builder for chaining. */ @@ -5577,7 +5722,7 @@ public Builder setIp(boolean value) { * ``` * * - * bool ip = 14 [json_name = "ip", (.buf.validate.priv.field) = { ... } + * bool ip = 14 [json_name = "ip", (.buf.validate.predefined) = { ... } * @return This builder for chaining. */ public Builder clearIp() { @@ -5603,7 +5748,7 @@ public Builder clearIp() { * ``` * * - * bool ipv4 = 15 [json_name = "ipv4", (.buf.validate.priv.field) = { ... } + * bool ipv4 = 15 [json_name = "ipv4", (.buf.validate.predefined) = { ... } * @return Whether the ipv4 field is set. */ public boolean hasIpv4() { @@ -5623,7 +5768,7 @@ public boolean hasIpv4() { * ``` * * - * bool ipv4 = 15 [json_name = "ipv4", (.buf.validate.priv.field) = { ... } + * bool ipv4 = 15 [json_name = "ipv4", (.buf.validate.predefined) = { ... } * @return The ipv4. */ public boolean getIpv4() { @@ -5646,7 +5791,7 @@ public boolean getIpv4() { * ``` * * - * bool ipv4 = 15 [json_name = "ipv4", (.buf.validate.priv.field) = { ... } + * bool ipv4 = 15 [json_name = "ipv4", (.buf.validate.predefined) = { ... } * @param value The ipv4 to set. * @return This builder for chaining. */ @@ -5671,7 +5816,7 @@ public Builder setIpv4(boolean value) { * ``` * * - * bool ipv4 = 15 [json_name = "ipv4", (.buf.validate.priv.field) = { ... } + * bool ipv4 = 15 [json_name = "ipv4", (.buf.validate.predefined) = { ... } * @return This builder for chaining. */ public Builder clearIpv4() { @@ -5697,7 +5842,7 @@ public Builder clearIpv4() { * ``` * * - * bool ipv6 = 16 [json_name = "ipv6", (.buf.validate.priv.field) = { ... } + * bool ipv6 = 16 [json_name = "ipv6", (.buf.validate.predefined) = { ... } * @return Whether the ipv6 field is set. */ public boolean hasIpv6() { @@ -5717,7 +5862,7 @@ public boolean hasIpv6() { * ``` * * - * bool ipv6 = 16 [json_name = "ipv6", (.buf.validate.priv.field) = { ... } + * bool ipv6 = 16 [json_name = "ipv6", (.buf.validate.predefined) = { ... } * @return The ipv6. */ public boolean getIpv6() { @@ -5740,7 +5885,7 @@ public boolean getIpv6() { * ``` * * - * bool ipv6 = 16 [json_name = "ipv6", (.buf.validate.priv.field) = { ... } + * bool ipv6 = 16 [json_name = "ipv6", (.buf.validate.predefined) = { ... } * @param value The ipv6 to set. * @return This builder for chaining. */ @@ -5765,7 +5910,7 @@ public Builder setIpv6(boolean value) { * ``` * * - * bool ipv6 = 16 [json_name = "ipv6", (.buf.validate.priv.field) = { ... } + * bool ipv6 = 16 [json_name = "ipv6", (.buf.validate.predefined) = { ... } * @return This builder for chaining. */ public Builder clearIpv6() { @@ -5791,7 +5936,7 @@ public Builder clearIpv6() { * ``` * * - * bool uri = 17 [json_name = "uri", (.buf.validate.priv.field) = { ... } + * bool uri = 17 [json_name = "uri", (.buf.validate.predefined) = { ... } * @return Whether the uri field is set. */ public boolean hasUri() { @@ -5811,7 +5956,7 @@ public boolean hasUri() { * ``` * * - * bool uri = 17 [json_name = "uri", (.buf.validate.priv.field) = { ... } + * bool uri = 17 [json_name = "uri", (.buf.validate.predefined) = { ... } * @return The uri. */ public boolean getUri() { @@ -5834,7 +5979,7 @@ public boolean getUri() { * ``` * * - * bool uri = 17 [json_name = "uri", (.buf.validate.priv.field) = { ... } + * bool uri = 17 [json_name = "uri", (.buf.validate.predefined) = { ... } * @param value The uri to set. * @return This builder for chaining. */ @@ -5859,7 +6004,7 @@ public Builder setUri(boolean value) { * ``` * * - * bool uri = 17 [json_name = "uri", (.buf.validate.priv.field) = { ... } + * bool uri = 17 [json_name = "uri", (.buf.validate.predefined) = { ... } * @return This builder for chaining. */ public Builder clearUri() { @@ -5885,7 +6030,7 @@ public Builder clearUri() { * ``` * * - * bool uri_ref = 18 [json_name = "uriRef", (.buf.validate.priv.field) = { ... } + * bool uri_ref = 18 [json_name = "uriRef", (.buf.validate.predefined) = { ... } * @return Whether the uriRef field is set. */ public boolean hasUriRef() { @@ -5905,7 +6050,7 @@ public boolean hasUriRef() { * ``` * * - * bool uri_ref = 18 [json_name = "uriRef", (.buf.validate.priv.field) = { ... } + * bool uri_ref = 18 [json_name = "uriRef", (.buf.validate.predefined) = { ... } * @return The uriRef. */ public boolean getUriRef() { @@ -5928,7 +6073,7 @@ public boolean getUriRef() { * ``` * * - * bool uri_ref = 18 [json_name = "uriRef", (.buf.validate.priv.field) = { ... } + * bool uri_ref = 18 [json_name = "uriRef", (.buf.validate.predefined) = { ... } * @param value The uriRef to set. * @return This builder for chaining. */ @@ -5953,7 +6098,7 @@ public Builder setUriRef(boolean value) { * ``` * * - * bool uri_ref = 18 [json_name = "uriRef", (.buf.validate.priv.field) = { ... } + * bool uri_ref = 18 [json_name = "uriRef", (.buf.validate.predefined) = { ... } * @return This builder for chaining. */ public Builder clearUriRef() { @@ -5981,7 +6126,7 @@ public Builder clearUriRef() { * ``` * * - * bool address = 21 [json_name = "address", (.buf.validate.priv.field) = { ... } + * bool address = 21 [json_name = "address", (.buf.validate.predefined) = { ... } * @return Whether the address field is set. */ public boolean hasAddress() { @@ -6003,7 +6148,7 @@ public boolean hasAddress() { * ``` * * - * bool address = 21 [json_name = "address", (.buf.validate.priv.field) = { ... } + * bool address = 21 [json_name = "address", (.buf.validate.predefined) = { ... } * @return The address. */ public boolean getAddress() { @@ -6028,7 +6173,7 @@ public boolean getAddress() { * ``` * * - * bool address = 21 [json_name = "address", (.buf.validate.priv.field) = { ... } + * bool address = 21 [json_name = "address", (.buf.validate.predefined) = { ... } * @param value The address to set. * @return This builder for chaining. */ @@ -6055,7 +6200,7 @@ public Builder setAddress(boolean value) { * ``` * * - * bool address = 21 [json_name = "address", (.buf.validate.priv.field) = { ... } + * bool address = 21 [json_name = "address", (.buf.validate.predefined) = { ... } * @return This builder for chaining. */ public Builder clearAddress() { @@ -6081,7 +6226,7 @@ public Builder clearAddress() { * ``` * * - * bool uuid = 22 [json_name = "uuid", (.buf.validate.priv.field) = { ... } + * bool uuid = 22 [json_name = "uuid", (.buf.validate.predefined) = { ... } * @return Whether the uuid field is set. */ public boolean hasUuid() { @@ -6101,7 +6246,7 @@ public boolean hasUuid() { * ``` * * - * bool uuid = 22 [json_name = "uuid", (.buf.validate.priv.field) = { ... } + * bool uuid = 22 [json_name = "uuid", (.buf.validate.predefined) = { ... } * @return The uuid. */ public boolean getUuid() { @@ -6124,7 +6269,7 @@ public boolean getUuid() { * ``` * * - * bool uuid = 22 [json_name = "uuid", (.buf.validate.priv.field) = { ... } + * bool uuid = 22 [json_name = "uuid", (.buf.validate.predefined) = { ... } * @param value The uuid to set. * @return This builder for chaining. */ @@ -6149,7 +6294,7 @@ public Builder setUuid(boolean value) { * ``` * * - * bool uuid = 22 [json_name = "uuid", (.buf.validate.priv.field) = { ... } + * bool uuid = 22 [json_name = "uuid", (.buf.validate.predefined) = { ... } * @return This builder for chaining. */ public Builder clearUuid() { @@ -6176,7 +6321,7 @@ public Builder clearUuid() { * ``` * * - * bool tuuid = 33 [json_name = "tuuid", (.buf.validate.priv.field) = { ... } + * bool tuuid = 33 [json_name = "tuuid", (.buf.validate.predefined) = { ... } * @return Whether the tuuid field is set. */ public boolean hasTuuid() { @@ -6197,7 +6342,7 @@ public boolean hasTuuid() { * ``` * * - * bool tuuid = 33 [json_name = "tuuid", (.buf.validate.priv.field) = { ... } + * bool tuuid = 33 [json_name = "tuuid", (.buf.validate.predefined) = { ... } * @return The tuuid. */ public boolean getTuuid() { @@ -6221,7 +6366,7 @@ public boolean getTuuid() { * ``` * * - * bool tuuid = 33 [json_name = "tuuid", (.buf.validate.priv.field) = { ... } + * bool tuuid = 33 [json_name = "tuuid", (.buf.validate.predefined) = { ... } * @param value The tuuid to set. * @return This builder for chaining. */ @@ -6247,7 +6392,7 @@ public Builder setTuuid(boolean value) { * ``` * * - * bool tuuid = 33 [json_name = "tuuid", (.buf.validate.priv.field) = { ... } + * bool tuuid = 33 [json_name = "tuuid", (.buf.validate.predefined) = { ... } * @return This builder for chaining. */ public Builder clearTuuid() { @@ -6274,7 +6419,7 @@ public Builder clearTuuid() { * ``` * * - * bool ip_with_prefixlen = 26 [json_name = "ipWithPrefixlen", (.buf.validate.priv.field) = { ... } + * bool ip_with_prefixlen = 26 [json_name = "ipWithPrefixlen", (.buf.validate.predefined) = { ... } * @return Whether the ipWithPrefixlen field is set. */ public boolean hasIpWithPrefixlen() { @@ -6295,7 +6440,7 @@ public boolean hasIpWithPrefixlen() { * ``` * * - * bool ip_with_prefixlen = 26 [json_name = "ipWithPrefixlen", (.buf.validate.priv.field) = { ... } + * bool ip_with_prefixlen = 26 [json_name = "ipWithPrefixlen", (.buf.validate.predefined) = { ... } * @return The ipWithPrefixlen. */ public boolean getIpWithPrefixlen() { @@ -6319,7 +6464,7 @@ public boolean getIpWithPrefixlen() { * ``` * * - * bool ip_with_prefixlen = 26 [json_name = "ipWithPrefixlen", (.buf.validate.priv.field) = { ... } + * bool ip_with_prefixlen = 26 [json_name = "ipWithPrefixlen", (.buf.validate.predefined) = { ... } * @param value The ipWithPrefixlen to set. * @return This builder for chaining. */ @@ -6345,7 +6490,7 @@ public Builder setIpWithPrefixlen(boolean value) { * ``` * * - * bool ip_with_prefixlen = 26 [json_name = "ipWithPrefixlen", (.buf.validate.priv.field) = { ... } + * bool ip_with_prefixlen = 26 [json_name = "ipWithPrefixlen", (.buf.validate.predefined) = { ... } * @return This builder for chaining. */ public Builder clearIpWithPrefixlen() { @@ -6372,7 +6517,7 @@ public Builder clearIpWithPrefixlen() { * ``` * * - * bool ipv4_with_prefixlen = 27 [json_name = "ipv4WithPrefixlen", (.buf.validate.priv.field) = { ... } + * bool ipv4_with_prefixlen = 27 [json_name = "ipv4WithPrefixlen", (.buf.validate.predefined) = { ... } * @return Whether the ipv4WithPrefixlen field is set. */ public boolean hasIpv4WithPrefixlen() { @@ -6393,7 +6538,7 @@ public boolean hasIpv4WithPrefixlen() { * ``` * * - * bool ipv4_with_prefixlen = 27 [json_name = "ipv4WithPrefixlen", (.buf.validate.priv.field) = { ... } + * bool ipv4_with_prefixlen = 27 [json_name = "ipv4WithPrefixlen", (.buf.validate.predefined) = { ... } * @return The ipv4WithPrefixlen. */ public boolean getIpv4WithPrefixlen() { @@ -6417,7 +6562,7 @@ public boolean getIpv4WithPrefixlen() { * ``` * * - * bool ipv4_with_prefixlen = 27 [json_name = "ipv4WithPrefixlen", (.buf.validate.priv.field) = { ... } + * bool ipv4_with_prefixlen = 27 [json_name = "ipv4WithPrefixlen", (.buf.validate.predefined) = { ... } * @param value The ipv4WithPrefixlen to set. * @return This builder for chaining. */ @@ -6443,7 +6588,7 @@ public Builder setIpv4WithPrefixlen(boolean value) { * ``` * * - * bool ipv4_with_prefixlen = 27 [json_name = "ipv4WithPrefixlen", (.buf.validate.priv.field) = { ... } + * bool ipv4_with_prefixlen = 27 [json_name = "ipv4WithPrefixlen", (.buf.validate.predefined) = { ... } * @return This builder for chaining. */ public Builder clearIpv4WithPrefixlen() { @@ -6470,7 +6615,7 @@ public Builder clearIpv4WithPrefixlen() { * ``` * * - * bool ipv6_with_prefixlen = 28 [json_name = "ipv6WithPrefixlen", (.buf.validate.priv.field) = { ... } + * bool ipv6_with_prefixlen = 28 [json_name = "ipv6WithPrefixlen", (.buf.validate.predefined) = { ... } * @return Whether the ipv6WithPrefixlen field is set. */ public boolean hasIpv6WithPrefixlen() { @@ -6491,7 +6636,7 @@ public boolean hasIpv6WithPrefixlen() { * ``` * * - * bool ipv6_with_prefixlen = 28 [json_name = "ipv6WithPrefixlen", (.buf.validate.priv.field) = { ... } + * bool ipv6_with_prefixlen = 28 [json_name = "ipv6WithPrefixlen", (.buf.validate.predefined) = { ... } * @return The ipv6WithPrefixlen. */ public boolean getIpv6WithPrefixlen() { @@ -6515,7 +6660,7 @@ public boolean getIpv6WithPrefixlen() { * ``` * * - * bool ipv6_with_prefixlen = 28 [json_name = "ipv6WithPrefixlen", (.buf.validate.priv.field) = { ... } + * bool ipv6_with_prefixlen = 28 [json_name = "ipv6WithPrefixlen", (.buf.validate.predefined) = { ... } * @param value The ipv6WithPrefixlen to set. * @return This builder for chaining. */ @@ -6541,7 +6686,7 @@ public Builder setIpv6WithPrefixlen(boolean value) { * ``` * * - * bool ipv6_with_prefixlen = 28 [json_name = "ipv6WithPrefixlen", (.buf.validate.priv.field) = { ... } + * bool ipv6_with_prefixlen = 28 [json_name = "ipv6WithPrefixlen", (.buf.validate.predefined) = { ... } * @return This builder for chaining. */ public Builder clearIpv6WithPrefixlen() { @@ -6568,7 +6713,7 @@ public Builder clearIpv6WithPrefixlen() { * ``` * * - * bool ip_prefix = 29 [json_name = "ipPrefix", (.buf.validate.priv.field) = { ... } + * bool ip_prefix = 29 [json_name = "ipPrefix", (.buf.validate.predefined) = { ... } * @return Whether the ipPrefix field is set. */ public boolean hasIpPrefix() { @@ -6589,7 +6734,7 @@ public boolean hasIpPrefix() { * ``` * * - * bool ip_prefix = 29 [json_name = "ipPrefix", (.buf.validate.priv.field) = { ... } + * bool ip_prefix = 29 [json_name = "ipPrefix", (.buf.validate.predefined) = { ... } * @return The ipPrefix. */ public boolean getIpPrefix() { @@ -6613,7 +6758,7 @@ public boolean getIpPrefix() { * ``` * * - * bool ip_prefix = 29 [json_name = "ipPrefix", (.buf.validate.priv.field) = { ... } + * bool ip_prefix = 29 [json_name = "ipPrefix", (.buf.validate.predefined) = { ... } * @param value The ipPrefix to set. * @return This builder for chaining. */ @@ -6639,7 +6784,7 @@ public Builder setIpPrefix(boolean value) { * ``` * * - * bool ip_prefix = 29 [json_name = "ipPrefix", (.buf.validate.priv.field) = { ... } + * bool ip_prefix = 29 [json_name = "ipPrefix", (.buf.validate.predefined) = { ... } * @return This builder for chaining. */ public Builder clearIpPrefix() { @@ -6666,7 +6811,7 @@ public Builder clearIpPrefix() { * ``` * * - * bool ipv4_prefix = 30 [json_name = "ipv4Prefix", (.buf.validate.priv.field) = { ... } + * bool ipv4_prefix = 30 [json_name = "ipv4Prefix", (.buf.validate.predefined) = { ... } * @return Whether the ipv4Prefix field is set. */ public boolean hasIpv4Prefix() { @@ -6687,7 +6832,7 @@ public boolean hasIpv4Prefix() { * ``` * * - * bool ipv4_prefix = 30 [json_name = "ipv4Prefix", (.buf.validate.priv.field) = { ... } + * bool ipv4_prefix = 30 [json_name = "ipv4Prefix", (.buf.validate.predefined) = { ... } * @return The ipv4Prefix. */ public boolean getIpv4Prefix() { @@ -6711,7 +6856,7 @@ public boolean getIpv4Prefix() { * ``` * * - * bool ipv4_prefix = 30 [json_name = "ipv4Prefix", (.buf.validate.priv.field) = { ... } + * bool ipv4_prefix = 30 [json_name = "ipv4Prefix", (.buf.validate.predefined) = { ... } * @param value The ipv4Prefix to set. * @return This builder for chaining. */ @@ -6737,7 +6882,7 @@ public Builder setIpv4Prefix(boolean value) { * ``` * * - * bool ipv4_prefix = 30 [json_name = "ipv4Prefix", (.buf.validate.priv.field) = { ... } + * bool ipv4_prefix = 30 [json_name = "ipv4Prefix", (.buf.validate.predefined) = { ... } * @return This builder for chaining. */ public Builder clearIpv4Prefix() { @@ -6764,7 +6909,7 @@ public Builder clearIpv4Prefix() { * ``` * * - * bool ipv6_prefix = 31 [json_name = "ipv6Prefix", (.buf.validate.priv.field) = { ... } + * bool ipv6_prefix = 31 [json_name = "ipv6Prefix", (.buf.validate.predefined) = { ... } * @return Whether the ipv6Prefix field is set. */ public boolean hasIpv6Prefix() { @@ -6785,7 +6930,7 @@ public boolean hasIpv6Prefix() { * ``` * * - * bool ipv6_prefix = 31 [json_name = "ipv6Prefix", (.buf.validate.priv.field) = { ... } + * bool ipv6_prefix = 31 [json_name = "ipv6Prefix", (.buf.validate.predefined) = { ... } * @return The ipv6Prefix. */ public boolean getIpv6Prefix() { @@ -6809,7 +6954,7 @@ public boolean getIpv6Prefix() { * ``` * * - * bool ipv6_prefix = 31 [json_name = "ipv6Prefix", (.buf.validate.priv.field) = { ... } + * bool ipv6_prefix = 31 [json_name = "ipv6Prefix", (.buf.validate.predefined) = { ... } * @param value The ipv6Prefix to set. * @return This builder for chaining. */ @@ -6835,7 +6980,7 @@ public Builder setIpv6Prefix(boolean value) { * ``` * * - * bool ipv6_prefix = 31 [json_name = "ipv6Prefix", (.buf.validate.priv.field) = { ... } + * bool ipv6_prefix = 31 [json_name = "ipv6Prefix", (.buf.validate.predefined) = { ... } * @return This builder for chaining. */ public Builder clearIpv6Prefix() { @@ -6855,7 +7000,7 @@ public Builder clearIpv6Prefix() { * with square brackets (e.g., `[::1]:1234`). * * - * bool host_and_port = 32 [json_name = "hostAndPort", (.buf.validate.priv.field) = { ... } + * bool host_and_port = 32 [json_name = "hostAndPort", (.buf.validate.predefined) = { ... } * @return Whether the hostAndPort field is set. */ public boolean hasHostAndPort() { @@ -6869,7 +7014,7 @@ public boolean hasHostAndPort() { * with square brackets (e.g., `[::1]:1234`). * * - * bool host_and_port = 32 [json_name = "hostAndPort", (.buf.validate.priv.field) = { ... } + * bool host_and_port = 32 [json_name = "hostAndPort", (.buf.validate.predefined) = { ... } * @return The hostAndPort. */ public boolean getHostAndPort() { @@ -6886,7 +7031,7 @@ public boolean getHostAndPort() { * with square brackets (e.g., `[::1]:1234`). * * - * bool host_and_port = 32 [json_name = "hostAndPort", (.buf.validate.priv.field) = { ... } + * bool host_and_port = 32 [json_name = "hostAndPort", (.buf.validate.predefined) = { ... } * @param value The hostAndPort to set. * @return This builder for chaining. */ @@ -6905,7 +7050,7 @@ public Builder setHostAndPort(boolean value) { * with square brackets (e.g., `[::1]:1234`). * * - * bool host_and_port = 32 [json_name = "hostAndPort", (.buf.validate.priv.field) = { ... } + * bool host_and_port = 32 [json_name = "hostAndPort", (.buf.validate.predefined) = { ... } * @return This builder for chaining. */ public Builder clearHostAndPort() { @@ -6941,7 +7086,7 @@ public Builder clearHostAndPort() { * | KNOWN_REGEX_HTTP_HEADER_VALUE | 2 | HTTP header value as defined by [RFC 7230](https://tools.ietf.org/html/rfc7230#section-3.2.4) | * * - * .buf.validate.KnownRegex well_known_regex = 24 [json_name = "wellKnownRegex", (.buf.validate.priv.field) = { ... } + * .buf.validate.KnownRegex well_known_regex = 24 [json_name = "wellKnownRegex", (.buf.validate.predefined) = { ... } * @return Whether the wellKnownRegex field is set. */ @java.lang.Override @@ -6972,75 +7117,7 @@ public boolean hasWellKnownRegex() { * | KNOWN_REGEX_HTTP_HEADER_VALUE | 2 | HTTP header value as defined by [RFC 7230](https://tools.ietf.org/html/rfc7230#section-3.2.4) | * * - * .buf.validate.KnownRegex well_known_regex = 24 [json_name = "wellKnownRegex", (.buf.validate.priv.field) = { ... } - * @return The enum numeric value on the wire for wellKnownRegex. - */ - @java.lang.Override - public int getWellKnownRegexValue() { - if (wellKnownCase_ == 24) { - return ((java.lang.Integer) wellKnown_).intValue(); - } - return 0; - } - /** - *
-     * `well_known_regex` specifies a common well-known pattern
-     * defined as a regex. If the field value doesn't match the well-known
-     * regex, an error message will be generated.
-     *
-     * ```proto
-     * message MyString {
-     * // value must be a valid HTTP header value
-     * string value = 1 [(buf.validate.field).string.well_known_regex = KNOWN_REGEX_HTTP_HEADER_VALUE];
-     * }
-     * ```
-     *
-     * #### KnownRegex
-     *
-     * `well_known_regex` contains some well-known patterns.
-     *
-     * | Name                          | Number | Description                               |
-     * |-------------------------------|--------|-------------------------------------------|
-     * | KNOWN_REGEX_UNSPECIFIED       | 0      |                                           |
-     * | KNOWN_REGEX_HTTP_HEADER_NAME  | 1      | HTTP header name as defined by [RFC 7230](https://tools.ietf.org/html/rfc7230#section-3.2)  |
-     * | KNOWN_REGEX_HTTP_HEADER_VALUE | 2      | HTTP header value as defined by [RFC 7230](https://tools.ietf.org/html/rfc7230#section-3.2.4) |
-     * 
- * - * .buf.validate.KnownRegex well_known_regex = 24 [json_name = "wellKnownRegex", (.buf.validate.priv.field) = { ... } - * @param value The enum numeric value on the wire for wellKnownRegex to set. - * @return This builder for chaining. - */ - public Builder setWellKnownRegexValue(int value) { - wellKnownCase_ = 24; - wellKnown_ = value; - onChanged(); - return this; - } - /** - *
-     * `well_known_regex` specifies a common well-known pattern
-     * defined as a regex. If the field value doesn't match the well-known
-     * regex, an error message will be generated.
-     *
-     * ```proto
-     * message MyString {
-     * // value must be a valid HTTP header value
-     * string value = 1 [(buf.validate.field).string.well_known_regex = KNOWN_REGEX_HTTP_HEADER_VALUE];
-     * }
-     * ```
-     *
-     * #### KnownRegex
-     *
-     * `well_known_regex` contains some well-known patterns.
-     *
-     * | Name                          | Number | Description                               |
-     * |-------------------------------|--------|-------------------------------------------|
-     * | KNOWN_REGEX_UNSPECIFIED       | 0      |                                           |
-     * | KNOWN_REGEX_HTTP_HEADER_NAME  | 1      | HTTP header name as defined by [RFC 7230](https://tools.ietf.org/html/rfc7230#section-3.2)  |
-     * | KNOWN_REGEX_HTTP_HEADER_VALUE | 2      | HTTP header value as defined by [RFC 7230](https://tools.ietf.org/html/rfc7230#section-3.2.4) |
-     * 
- * - * .buf.validate.KnownRegex well_known_regex = 24 [json_name = "wellKnownRegex", (.buf.validate.priv.field) = { ... } + * .buf.validate.KnownRegex well_known_regex = 24 [json_name = "wellKnownRegex", (.buf.validate.predefined) = { ... } * @return The wellKnownRegex. */ @java.lang.Override @@ -7048,7 +7125,7 @@ public build.buf.validate.KnownRegex getWellKnownRegex() { if (wellKnownCase_ == 24) { build.buf.validate.KnownRegex result = build.buf.validate.KnownRegex.forNumber( (java.lang.Integer) wellKnown_); - return result == null ? build.buf.validate.KnownRegex.UNRECOGNIZED : result; + return result == null ? build.buf.validate.KnownRegex.KNOWN_REGEX_UNSPECIFIED : result; } return build.buf.validate.KnownRegex.KNOWN_REGEX_UNSPECIFIED; } @@ -7076,7 +7153,7 @@ public build.buf.validate.KnownRegex getWellKnownRegex() { * | KNOWN_REGEX_HTTP_HEADER_VALUE | 2 | HTTP header value as defined by [RFC 7230](https://tools.ietf.org/html/rfc7230#section-3.2.4) | * * - * .buf.validate.KnownRegex well_known_regex = 24 [json_name = "wellKnownRegex", (.buf.validate.priv.field) = { ... } + * .buf.validate.KnownRegex well_known_regex = 24 [json_name = "wellKnownRegex", (.buf.validate.predefined) = { ... } * @param value The wellKnownRegex to set. * @return This builder for chaining. */ @@ -7113,7 +7190,7 @@ public Builder setWellKnownRegex(build.buf.validate.KnownRegex value) { * | KNOWN_REGEX_HTTP_HEADER_VALUE | 2 | HTTP header value as defined by [RFC 7230](https://tools.ietf.org/html/rfc7230#section-3.2.4) | * * - * .buf.validate.KnownRegex well_known_regex = 24 [json_name = "wellKnownRegex", (.buf.validate.priv.field) = { ... } + * .buf.validate.KnownRegex well_known_regex = 24 [json_name = "wellKnownRegex", (.buf.validate.predefined) = { ... } * @return This builder for chaining. */ public Builder clearWellKnownRegex() { @@ -7225,6 +7302,251 @@ public Builder clearStrict() { return this; } + private com.google.protobuf.LazyStringArrayList example_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + private void ensureExampleIsMutable() { + if (!example_.isModifiable()) { + example_ = new com.google.protobuf.LazyStringArrayList(example_); + } + bitField1_ |= 0x00000002; + } + /** + *
+     * `example` specifies values that the field may have. These values SHOULD
+     * conform to other constraints. `example` values will not impact validation
+     * but may be used as helpful guidance on how to populate the given field.
+     *
+     * ```proto
+     * message MyString {
+     * string value = 1 [
+     * (buf.validate.field).string.example = 1,
+     * (buf.validate.field).string.example = 2
+     * ];
+     * }
+     * ```
+     * 
+ * + * repeated string example = 34 [json_name = "example", (.buf.validate.predefined) = { ... } + * @return A list containing the example. + */ + public com.google.protobuf.ProtocolStringList + getExampleList() { + example_.makeImmutable(); + return example_; + } + /** + *
+     * `example` specifies values that the field may have. These values SHOULD
+     * conform to other constraints. `example` values will not impact validation
+     * but may be used as helpful guidance on how to populate the given field.
+     *
+     * ```proto
+     * message MyString {
+     * string value = 1 [
+     * (buf.validate.field).string.example = 1,
+     * (buf.validate.field).string.example = 2
+     * ];
+     * }
+     * ```
+     * 
+ * + * repeated string example = 34 [json_name = "example", (.buf.validate.predefined) = { ... } + * @return The count of example. + */ + public int getExampleCount() { + return example_.size(); + } + /** + *
+     * `example` specifies values that the field may have. These values SHOULD
+     * conform to other constraints. `example` values will not impact validation
+     * but may be used as helpful guidance on how to populate the given field.
+     *
+     * ```proto
+     * message MyString {
+     * string value = 1 [
+     * (buf.validate.field).string.example = 1,
+     * (buf.validate.field).string.example = 2
+     * ];
+     * }
+     * ```
+     * 
+ * + * repeated string example = 34 [json_name = "example", (.buf.validate.predefined) = { ... } + * @param index The index of the element to return. + * @return The example at the given index. + */ + public java.lang.String getExample(int index) { + return example_.get(index); + } + /** + *
+     * `example` specifies values that the field may have. These values SHOULD
+     * conform to other constraints. `example` values will not impact validation
+     * but may be used as helpful guidance on how to populate the given field.
+     *
+     * ```proto
+     * message MyString {
+     * string value = 1 [
+     * (buf.validate.field).string.example = 1,
+     * (buf.validate.field).string.example = 2
+     * ];
+     * }
+     * ```
+     * 
+ * + * repeated string example = 34 [json_name = "example", (.buf.validate.predefined) = { ... } + * @param index The index of the value to return. + * @return The bytes of the example at the given index. + */ + public com.google.protobuf.ByteString + getExampleBytes(int index) { + return example_.getByteString(index); + } + /** + *
+     * `example` specifies values that the field may have. These values SHOULD
+     * conform to other constraints. `example` values will not impact validation
+     * but may be used as helpful guidance on how to populate the given field.
+     *
+     * ```proto
+     * message MyString {
+     * string value = 1 [
+     * (buf.validate.field).string.example = 1,
+     * (buf.validate.field).string.example = 2
+     * ];
+     * }
+     * ```
+     * 
+ * + * repeated string example = 34 [json_name = "example", (.buf.validate.predefined) = { ... } + * @param index The index to set the value at. + * @param value The example to set. + * @return This builder for chaining. + */ + public Builder setExample( + int index, java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + ensureExampleIsMutable(); + example_.set(index, value); + bitField1_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
+     * `example` specifies values that the field may have. These values SHOULD
+     * conform to other constraints. `example` values will not impact validation
+     * but may be used as helpful guidance on how to populate the given field.
+     *
+     * ```proto
+     * message MyString {
+     * string value = 1 [
+     * (buf.validate.field).string.example = 1,
+     * (buf.validate.field).string.example = 2
+     * ];
+     * }
+     * ```
+     * 
+ * + * repeated string example = 34 [json_name = "example", (.buf.validate.predefined) = { ... } + * @param value The example to add. + * @return This builder for chaining. + */ + public Builder addExample( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + ensureExampleIsMutable(); + example_.add(value); + bitField1_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
+     * `example` specifies values that the field may have. These values SHOULD
+     * conform to other constraints. `example` values will not impact validation
+     * but may be used as helpful guidance on how to populate the given field.
+     *
+     * ```proto
+     * message MyString {
+     * string value = 1 [
+     * (buf.validate.field).string.example = 1,
+     * (buf.validate.field).string.example = 2
+     * ];
+     * }
+     * ```
+     * 
+ * + * repeated string example = 34 [json_name = "example", (.buf.validate.predefined) = { ... } + * @param values The example to add. + * @return This builder for chaining. + */ + public Builder addAllExample( + java.lang.Iterable values) { + ensureExampleIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, example_); + bitField1_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
+     * `example` specifies values that the field may have. These values SHOULD
+     * conform to other constraints. `example` values will not impact validation
+     * but may be used as helpful guidance on how to populate the given field.
+     *
+     * ```proto
+     * message MyString {
+     * string value = 1 [
+     * (buf.validate.field).string.example = 1,
+     * (buf.validate.field).string.example = 2
+     * ];
+     * }
+     * ```
+     * 
+ * + * repeated string example = 34 [json_name = "example", (.buf.validate.predefined) = { ... } + * @return This builder for chaining. + */ + public Builder clearExample() { + example_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + bitField1_ = (bitField1_ & ~0x00000002);; + onChanged(); + return this; + } + /** + *
+     * `example` specifies values that the field may have. These values SHOULD
+     * conform to other constraints. `example` values will not impact validation
+     * but may be used as helpful guidance on how to populate the given field.
+     *
+     * ```proto
+     * message MyString {
+     * string value = 1 [
+     * (buf.validate.field).string.example = 1,
+     * (buf.validate.field).string.example = 2
+     * ];
+     * }
+     * ```
+     * 
+ * + * repeated string example = 34 [json_name = "example", (.buf.validate.predefined) = { ... } + * @param value The bytes of the example to add. + * @return This builder for chaining. + */ + public Builder addExampleBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + ensureExampleIsMutable(); + example_.add(value); + bitField1_ |= 0x00000002; + onChanged(); + return this; + } + // @@protoc_insertion_point(builder_scope:buf.validate.StringRules) } diff --git a/src/main/java/build/buf/validate/StringRulesOrBuilder.java b/src/main/java/build/buf/validate/StringRulesOrBuilder.java index 95c7e873..b60d99c7 100644 --- a/src/main/java/build/buf/validate/StringRulesOrBuilder.java +++ b/src/main/java/build/buf/validate/StringRulesOrBuilder.java @@ -7,7 +7,8 @@ public interface StringRulesOrBuilder extends // @@protoc_insertion_point(interface_extends:buf.validate.StringRules) - com.google.protobuf.MessageOrBuilder { + com.google.protobuf.GeneratedMessage. + ExtendableMessageOrBuilder { /** *
@@ -22,7 +23,7 @@ public interface StringRulesOrBuilder extends
    * ```
    * 
* - * optional string const = 1 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional string const = 1 [json_name = "const", (.buf.validate.predefined) = { ... } * @return Whether the const field is set. */ boolean hasConst(); @@ -39,7 +40,7 @@ public interface StringRulesOrBuilder extends * ``` * * - * optional string const = 1 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional string const = 1 [json_name = "const", (.buf.validate.predefined) = { ... } * @return The const. */ java.lang.String getConst(); @@ -56,7 +57,7 @@ public interface StringRulesOrBuilder extends * ``` * * - * optional string const = 1 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional string const = 1 [json_name = "const", (.buf.validate.predefined) = { ... } * @return The bytes for const. */ com.google.protobuf.ByteString @@ -77,7 +78,7 @@ public interface StringRulesOrBuilder extends * ``` * * - * optional uint64 len = 19 [json_name = "len", (.buf.validate.priv.field) = { ... } + * optional uint64 len = 19 [json_name = "len", (.buf.validate.predefined) = { ... } * @return Whether the len field is set. */ boolean hasLen(); @@ -96,7 +97,7 @@ public interface StringRulesOrBuilder extends * ``` * * - * optional uint64 len = 19 [json_name = "len", (.buf.validate.priv.field) = { ... } + * optional uint64 len = 19 [json_name = "len", (.buf.validate.predefined) = { ... } * @return The len. */ long getLen(); @@ -116,7 +117,7 @@ public interface StringRulesOrBuilder extends * ``` * * - * optional uint64 min_len = 2 [json_name = "minLen", (.buf.validate.priv.field) = { ... } + * optional uint64 min_len = 2 [json_name = "minLen", (.buf.validate.predefined) = { ... } * @return Whether the minLen field is set. */ boolean hasMinLen(); @@ -135,7 +136,7 @@ public interface StringRulesOrBuilder extends * ``` * * - * optional uint64 min_len = 2 [json_name = "minLen", (.buf.validate.priv.field) = { ... } + * optional uint64 min_len = 2 [json_name = "minLen", (.buf.validate.predefined) = { ... } * @return The minLen. */ long getMinLen(); @@ -155,7 +156,7 @@ public interface StringRulesOrBuilder extends * ``` * * - * optional uint64 max_len = 3 [json_name = "maxLen", (.buf.validate.priv.field) = { ... } + * optional uint64 max_len = 3 [json_name = "maxLen", (.buf.validate.predefined) = { ... } * @return Whether the maxLen field is set. */ boolean hasMaxLen(); @@ -174,7 +175,7 @@ public interface StringRulesOrBuilder extends * ``` * * - * optional uint64 max_len = 3 [json_name = "maxLen", (.buf.validate.priv.field) = { ... } + * optional uint64 max_len = 3 [json_name = "maxLen", (.buf.validate.predefined) = { ... } * @return The maxLen. */ long getMaxLen(); @@ -193,7 +194,7 @@ public interface StringRulesOrBuilder extends * ``` * * - * optional uint64 len_bytes = 20 [json_name = "lenBytes", (.buf.validate.priv.field) = { ... } + * optional uint64 len_bytes = 20 [json_name = "lenBytes", (.buf.validate.predefined) = { ... } * @return Whether the lenBytes field is set. */ boolean hasLenBytes(); @@ -211,7 +212,7 @@ public interface StringRulesOrBuilder extends * ``` * * - * optional uint64 len_bytes = 20 [json_name = "lenBytes", (.buf.validate.priv.field) = { ... } + * optional uint64 len_bytes = 20 [json_name = "lenBytes", (.buf.validate.predefined) = { ... } * @return The lenBytes. */ long getLenBytes(); @@ -231,7 +232,7 @@ public interface StringRulesOrBuilder extends * ``` * * - * optional uint64 min_bytes = 4 [json_name = "minBytes", (.buf.validate.priv.field) = { ... } + * optional uint64 min_bytes = 4 [json_name = "minBytes", (.buf.validate.predefined) = { ... } * @return Whether the minBytes field is set. */ boolean hasMinBytes(); @@ -250,7 +251,7 @@ public interface StringRulesOrBuilder extends * ``` * * - * optional uint64 min_bytes = 4 [json_name = "minBytes", (.buf.validate.priv.field) = { ... } + * optional uint64 min_bytes = 4 [json_name = "minBytes", (.buf.validate.predefined) = { ... } * @return The minBytes. */ long getMinBytes(); @@ -269,7 +270,7 @@ public interface StringRulesOrBuilder extends * ``` * * - * optional uint64 max_bytes = 5 [json_name = "maxBytes", (.buf.validate.priv.field) = { ... } + * optional uint64 max_bytes = 5 [json_name = "maxBytes", (.buf.validate.predefined) = { ... } * @return Whether the maxBytes field is set. */ boolean hasMaxBytes(); @@ -287,7 +288,7 @@ public interface StringRulesOrBuilder extends * ``` * * - * optional uint64 max_bytes = 5 [json_name = "maxBytes", (.buf.validate.priv.field) = { ... } + * optional uint64 max_bytes = 5 [json_name = "maxBytes", (.buf.validate.predefined) = { ... } * @return The maxBytes. */ long getMaxBytes(); @@ -307,7 +308,7 @@ public interface StringRulesOrBuilder extends * ``` * * - * optional string pattern = 6 [json_name = "pattern", (.buf.validate.priv.field) = { ... } + * optional string pattern = 6 [json_name = "pattern", (.buf.validate.predefined) = { ... } * @return Whether the pattern field is set. */ boolean hasPattern(); @@ -326,7 +327,7 @@ public interface StringRulesOrBuilder extends * ``` * * - * optional string pattern = 6 [json_name = "pattern", (.buf.validate.priv.field) = { ... } + * optional string pattern = 6 [json_name = "pattern", (.buf.validate.predefined) = { ... } * @return The pattern. */ java.lang.String getPattern(); @@ -345,7 +346,7 @@ public interface StringRulesOrBuilder extends * ``` * * - * optional string pattern = 6 [json_name = "pattern", (.buf.validate.priv.field) = { ... } + * optional string pattern = 6 [json_name = "pattern", (.buf.validate.predefined) = { ... } * @return The bytes for pattern. */ com.google.protobuf.ByteString @@ -366,7 +367,7 @@ public interface StringRulesOrBuilder extends * ``` * * - * optional string prefix = 7 [json_name = "prefix", (.buf.validate.priv.field) = { ... } + * optional string prefix = 7 [json_name = "prefix", (.buf.validate.predefined) = { ... } * @return Whether the prefix field is set. */ boolean hasPrefix(); @@ -385,7 +386,7 @@ public interface StringRulesOrBuilder extends * ``` * * - * optional string prefix = 7 [json_name = "prefix", (.buf.validate.priv.field) = { ... } + * optional string prefix = 7 [json_name = "prefix", (.buf.validate.predefined) = { ... } * @return The prefix. */ java.lang.String getPrefix(); @@ -404,7 +405,7 @@ public interface StringRulesOrBuilder extends * ``` * * - * optional string prefix = 7 [json_name = "prefix", (.buf.validate.priv.field) = { ... } + * optional string prefix = 7 [json_name = "prefix", (.buf.validate.predefined) = { ... } * @return The bytes for prefix. */ com.google.protobuf.ByteString @@ -424,7 +425,7 @@ public interface StringRulesOrBuilder extends * ``` * * - * optional string suffix = 8 [json_name = "suffix", (.buf.validate.priv.field) = { ... } + * optional string suffix = 8 [json_name = "suffix", (.buf.validate.predefined) = { ... } * @return Whether the suffix field is set. */ boolean hasSuffix(); @@ -442,7 +443,7 @@ public interface StringRulesOrBuilder extends * ``` * * - * optional string suffix = 8 [json_name = "suffix", (.buf.validate.priv.field) = { ... } + * optional string suffix = 8 [json_name = "suffix", (.buf.validate.predefined) = { ... } * @return The suffix. */ java.lang.String getSuffix(); @@ -460,7 +461,7 @@ public interface StringRulesOrBuilder extends * ``` * * - * optional string suffix = 8 [json_name = "suffix", (.buf.validate.priv.field) = { ... } + * optional string suffix = 8 [json_name = "suffix", (.buf.validate.predefined) = { ... } * @return The bytes for suffix. */ com.google.protobuf.ByteString @@ -480,7 +481,7 @@ public interface StringRulesOrBuilder extends * ``` * * - * optional string contains = 9 [json_name = "contains", (.buf.validate.priv.field) = { ... } + * optional string contains = 9 [json_name = "contains", (.buf.validate.predefined) = { ... } * @return Whether the contains field is set. */ boolean hasContains(); @@ -498,7 +499,7 @@ public interface StringRulesOrBuilder extends * ``` * * - * optional string contains = 9 [json_name = "contains", (.buf.validate.priv.field) = { ... } + * optional string contains = 9 [json_name = "contains", (.buf.validate.predefined) = { ... } * @return The contains. */ java.lang.String getContains(); @@ -516,7 +517,7 @@ public interface StringRulesOrBuilder extends * ``` * * - * optional string contains = 9 [json_name = "contains", (.buf.validate.priv.field) = { ... } + * optional string contains = 9 [json_name = "contains", (.buf.validate.predefined) = { ... } * @return The bytes for contains. */ com.google.protobuf.ByteString @@ -536,7 +537,7 @@ public interface StringRulesOrBuilder extends * ``` * * - * optional string not_contains = 23 [json_name = "notContains", (.buf.validate.priv.field) = { ... } + * optional string not_contains = 23 [json_name = "notContains", (.buf.validate.predefined) = { ... } * @return Whether the notContains field is set. */ boolean hasNotContains(); @@ -554,7 +555,7 @@ public interface StringRulesOrBuilder extends * ``` * * - * optional string not_contains = 23 [json_name = "notContains", (.buf.validate.priv.field) = { ... } + * optional string not_contains = 23 [json_name = "notContains", (.buf.validate.predefined) = { ... } * @return The notContains. */ java.lang.String getNotContains(); @@ -572,7 +573,7 @@ public interface StringRulesOrBuilder extends * ``` * * - * optional string not_contains = 23 [json_name = "notContains", (.buf.validate.priv.field) = { ... } + * optional string not_contains = 23 [json_name = "notContains", (.buf.validate.predefined) = { ... } * @return The bytes for notContains. */ com.google.protobuf.ByteString @@ -592,7 +593,7 @@ public interface StringRulesOrBuilder extends * ``` * * - * repeated string in = 10 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated string in = 10 [json_name = "in", (.buf.validate.predefined) = { ... } * @return A list containing the in. */ java.util.List @@ -611,7 +612,7 @@ public interface StringRulesOrBuilder extends * ``` * * - * repeated string in = 10 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated string in = 10 [json_name = "in", (.buf.validate.predefined) = { ... } * @return The count of in. */ int getInCount(); @@ -629,7 +630,7 @@ public interface StringRulesOrBuilder extends * ``` * * - * repeated string in = 10 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated string in = 10 [json_name = "in", (.buf.validate.predefined) = { ... } * @param index The index of the element to return. * @return The in at the given index. */ @@ -648,7 +649,7 @@ public interface StringRulesOrBuilder extends * ``` * * - * repeated string in = 10 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated string in = 10 [json_name = "in", (.buf.validate.predefined) = { ... } * @param index The index of the value to return. * @return The bytes of the in at the given index. */ @@ -668,7 +669,7 @@ public interface StringRulesOrBuilder extends * ``` * * - * repeated string not_in = 11 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated string not_in = 11 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @return A list containing the notIn. */ java.util.List @@ -686,7 +687,7 @@ public interface StringRulesOrBuilder extends * ``` * * - * repeated string not_in = 11 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated string not_in = 11 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @return The count of notIn. */ int getNotInCount(); @@ -703,7 +704,7 @@ public interface StringRulesOrBuilder extends * ``` * * - * repeated string not_in = 11 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated string not_in = 11 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @param index The index of the element to return. * @return The notIn at the given index. */ @@ -721,7 +722,7 @@ public interface StringRulesOrBuilder extends * ``` * * - * repeated string not_in = 11 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated string not_in = 11 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @param index The index of the value to return. * @return The bytes of the notIn at the given index. */ @@ -742,7 +743,7 @@ public interface StringRulesOrBuilder extends * ``` * * - * bool email = 12 [json_name = "email", (.buf.validate.priv.field) = { ... } + * bool email = 12 [json_name = "email", (.buf.validate.predefined) = { ... } * @return Whether the email field is set. */ boolean hasEmail(); @@ -760,7 +761,7 @@ public interface StringRulesOrBuilder extends * ``` * * - * bool email = 12 [json_name = "email", (.buf.validate.priv.field) = { ... } + * bool email = 12 [json_name = "email", (.buf.validate.predefined) = { ... } * @return The email. */ boolean getEmail(); @@ -780,7 +781,7 @@ public interface StringRulesOrBuilder extends * ``` * * - * bool hostname = 13 [json_name = "hostname", (.buf.validate.priv.field) = { ... } + * bool hostname = 13 [json_name = "hostname", (.buf.validate.predefined) = { ... } * @return Whether the hostname field is set. */ boolean hasHostname(); @@ -799,7 +800,7 @@ public interface StringRulesOrBuilder extends * ``` * * - * bool hostname = 13 [json_name = "hostname", (.buf.validate.priv.field) = { ... } + * bool hostname = 13 [json_name = "hostname", (.buf.validate.predefined) = { ... } * @return The hostname. */ boolean getHostname(); @@ -819,7 +820,7 @@ public interface StringRulesOrBuilder extends * ``` * * - * bool ip = 14 [json_name = "ip", (.buf.validate.priv.field) = { ... } + * bool ip = 14 [json_name = "ip", (.buf.validate.predefined) = { ... } * @return Whether the ip field is set. */ boolean hasIp(); @@ -838,7 +839,7 @@ public interface StringRulesOrBuilder extends * ``` * * - * bool ip = 14 [json_name = "ip", (.buf.validate.priv.field) = { ... } + * bool ip = 14 [json_name = "ip", (.buf.validate.predefined) = { ... } * @return The ip. */ boolean getIp(); @@ -857,7 +858,7 @@ public interface StringRulesOrBuilder extends * ``` * * - * bool ipv4 = 15 [json_name = "ipv4", (.buf.validate.priv.field) = { ... } + * bool ipv4 = 15 [json_name = "ipv4", (.buf.validate.predefined) = { ... } * @return Whether the ipv4 field is set. */ boolean hasIpv4(); @@ -875,7 +876,7 @@ public interface StringRulesOrBuilder extends * ``` * * - * bool ipv4 = 15 [json_name = "ipv4", (.buf.validate.priv.field) = { ... } + * bool ipv4 = 15 [json_name = "ipv4", (.buf.validate.predefined) = { ... } * @return The ipv4. */ boolean getIpv4(); @@ -894,7 +895,7 @@ public interface StringRulesOrBuilder extends * ``` * * - * bool ipv6 = 16 [json_name = "ipv6", (.buf.validate.priv.field) = { ... } + * bool ipv6 = 16 [json_name = "ipv6", (.buf.validate.predefined) = { ... } * @return Whether the ipv6 field is set. */ boolean hasIpv6(); @@ -912,7 +913,7 @@ public interface StringRulesOrBuilder extends * ``` * * - * bool ipv6 = 16 [json_name = "ipv6", (.buf.validate.priv.field) = { ... } + * bool ipv6 = 16 [json_name = "ipv6", (.buf.validate.predefined) = { ... } * @return The ipv6. */ boolean getIpv6(); @@ -931,7 +932,7 @@ public interface StringRulesOrBuilder extends * ``` * * - * bool uri = 17 [json_name = "uri", (.buf.validate.priv.field) = { ... } + * bool uri = 17 [json_name = "uri", (.buf.validate.predefined) = { ... } * @return Whether the uri field is set. */ boolean hasUri(); @@ -949,7 +950,7 @@ public interface StringRulesOrBuilder extends * ``` * * - * bool uri = 17 [json_name = "uri", (.buf.validate.priv.field) = { ... } + * bool uri = 17 [json_name = "uri", (.buf.validate.predefined) = { ... } * @return The uri. */ boolean getUri(); @@ -968,7 +969,7 @@ public interface StringRulesOrBuilder extends * ``` * * - * bool uri_ref = 18 [json_name = "uriRef", (.buf.validate.priv.field) = { ... } + * bool uri_ref = 18 [json_name = "uriRef", (.buf.validate.predefined) = { ... } * @return Whether the uriRef field is set. */ boolean hasUriRef(); @@ -986,7 +987,7 @@ public interface StringRulesOrBuilder extends * ``` * * - * bool uri_ref = 18 [json_name = "uriRef", (.buf.validate.priv.field) = { ... } + * bool uri_ref = 18 [json_name = "uriRef", (.buf.validate.predefined) = { ... } * @return The uriRef. */ boolean getUriRef(); @@ -1007,7 +1008,7 @@ public interface StringRulesOrBuilder extends * ``` * * - * bool address = 21 [json_name = "address", (.buf.validate.priv.field) = { ... } + * bool address = 21 [json_name = "address", (.buf.validate.predefined) = { ... } * @return Whether the address field is set. */ boolean hasAddress(); @@ -1027,7 +1028,7 @@ public interface StringRulesOrBuilder extends * ``` * * - * bool address = 21 [json_name = "address", (.buf.validate.priv.field) = { ... } + * bool address = 21 [json_name = "address", (.buf.validate.predefined) = { ... } * @return The address. */ boolean getAddress(); @@ -1046,7 +1047,7 @@ public interface StringRulesOrBuilder extends * ``` * * - * bool uuid = 22 [json_name = "uuid", (.buf.validate.priv.field) = { ... } + * bool uuid = 22 [json_name = "uuid", (.buf.validate.predefined) = { ... } * @return Whether the uuid field is set. */ boolean hasUuid(); @@ -1064,7 +1065,7 @@ public interface StringRulesOrBuilder extends * ``` * * - * bool uuid = 22 [json_name = "uuid", (.buf.validate.priv.field) = { ... } + * bool uuid = 22 [json_name = "uuid", (.buf.validate.predefined) = { ... } * @return The uuid. */ boolean getUuid(); @@ -1084,7 +1085,7 @@ public interface StringRulesOrBuilder extends * ``` * * - * bool tuuid = 33 [json_name = "tuuid", (.buf.validate.priv.field) = { ... } + * bool tuuid = 33 [json_name = "tuuid", (.buf.validate.predefined) = { ... } * @return Whether the tuuid field is set. */ boolean hasTuuid(); @@ -1103,7 +1104,7 @@ public interface StringRulesOrBuilder extends * ``` * * - * bool tuuid = 33 [json_name = "tuuid", (.buf.validate.priv.field) = { ... } + * bool tuuid = 33 [json_name = "tuuid", (.buf.validate.predefined) = { ... } * @return The tuuid. */ boolean getTuuid(); @@ -1123,7 +1124,7 @@ public interface StringRulesOrBuilder extends * ``` * * - * bool ip_with_prefixlen = 26 [json_name = "ipWithPrefixlen", (.buf.validate.priv.field) = { ... } + * bool ip_with_prefixlen = 26 [json_name = "ipWithPrefixlen", (.buf.validate.predefined) = { ... } * @return Whether the ipWithPrefixlen field is set. */ boolean hasIpWithPrefixlen(); @@ -1142,7 +1143,7 @@ public interface StringRulesOrBuilder extends * ``` * * - * bool ip_with_prefixlen = 26 [json_name = "ipWithPrefixlen", (.buf.validate.priv.field) = { ... } + * bool ip_with_prefixlen = 26 [json_name = "ipWithPrefixlen", (.buf.validate.predefined) = { ... } * @return The ipWithPrefixlen. */ boolean getIpWithPrefixlen(); @@ -1162,7 +1163,7 @@ public interface StringRulesOrBuilder extends * ``` * * - * bool ipv4_with_prefixlen = 27 [json_name = "ipv4WithPrefixlen", (.buf.validate.priv.field) = { ... } + * bool ipv4_with_prefixlen = 27 [json_name = "ipv4WithPrefixlen", (.buf.validate.predefined) = { ... } * @return Whether the ipv4WithPrefixlen field is set. */ boolean hasIpv4WithPrefixlen(); @@ -1181,7 +1182,7 @@ public interface StringRulesOrBuilder extends * ``` * * - * bool ipv4_with_prefixlen = 27 [json_name = "ipv4WithPrefixlen", (.buf.validate.priv.field) = { ... } + * bool ipv4_with_prefixlen = 27 [json_name = "ipv4WithPrefixlen", (.buf.validate.predefined) = { ... } * @return The ipv4WithPrefixlen. */ boolean getIpv4WithPrefixlen(); @@ -1201,7 +1202,7 @@ public interface StringRulesOrBuilder extends * ``` * * - * bool ipv6_with_prefixlen = 28 [json_name = "ipv6WithPrefixlen", (.buf.validate.priv.field) = { ... } + * bool ipv6_with_prefixlen = 28 [json_name = "ipv6WithPrefixlen", (.buf.validate.predefined) = { ... } * @return Whether the ipv6WithPrefixlen field is set. */ boolean hasIpv6WithPrefixlen(); @@ -1220,7 +1221,7 @@ public interface StringRulesOrBuilder extends * ``` * * - * bool ipv6_with_prefixlen = 28 [json_name = "ipv6WithPrefixlen", (.buf.validate.priv.field) = { ... } + * bool ipv6_with_prefixlen = 28 [json_name = "ipv6WithPrefixlen", (.buf.validate.predefined) = { ... } * @return The ipv6WithPrefixlen. */ boolean getIpv6WithPrefixlen(); @@ -1240,7 +1241,7 @@ public interface StringRulesOrBuilder extends * ``` * * - * bool ip_prefix = 29 [json_name = "ipPrefix", (.buf.validate.priv.field) = { ... } + * bool ip_prefix = 29 [json_name = "ipPrefix", (.buf.validate.predefined) = { ... } * @return Whether the ipPrefix field is set. */ boolean hasIpPrefix(); @@ -1259,7 +1260,7 @@ public interface StringRulesOrBuilder extends * ``` * * - * bool ip_prefix = 29 [json_name = "ipPrefix", (.buf.validate.priv.field) = { ... } + * bool ip_prefix = 29 [json_name = "ipPrefix", (.buf.validate.predefined) = { ... } * @return The ipPrefix. */ boolean getIpPrefix(); @@ -1279,7 +1280,7 @@ public interface StringRulesOrBuilder extends * ``` * * - * bool ipv4_prefix = 30 [json_name = "ipv4Prefix", (.buf.validate.priv.field) = { ... } + * bool ipv4_prefix = 30 [json_name = "ipv4Prefix", (.buf.validate.predefined) = { ... } * @return Whether the ipv4Prefix field is set. */ boolean hasIpv4Prefix(); @@ -1298,7 +1299,7 @@ public interface StringRulesOrBuilder extends * ``` * * - * bool ipv4_prefix = 30 [json_name = "ipv4Prefix", (.buf.validate.priv.field) = { ... } + * bool ipv4_prefix = 30 [json_name = "ipv4Prefix", (.buf.validate.predefined) = { ... } * @return The ipv4Prefix. */ boolean getIpv4Prefix(); @@ -1318,7 +1319,7 @@ public interface StringRulesOrBuilder extends * ``` * * - * bool ipv6_prefix = 31 [json_name = "ipv6Prefix", (.buf.validate.priv.field) = { ... } + * bool ipv6_prefix = 31 [json_name = "ipv6Prefix", (.buf.validate.predefined) = { ... } * @return Whether the ipv6Prefix field is set. */ boolean hasIpv6Prefix(); @@ -1337,7 +1338,7 @@ public interface StringRulesOrBuilder extends * ``` * * - * bool ipv6_prefix = 31 [json_name = "ipv6Prefix", (.buf.validate.priv.field) = { ... } + * bool ipv6_prefix = 31 [json_name = "ipv6Prefix", (.buf.validate.predefined) = { ... } * @return The ipv6Prefix. */ boolean getIpv6Prefix(); @@ -1350,7 +1351,7 @@ public interface StringRulesOrBuilder extends * with square brackets (e.g., `[::1]:1234`). * * - * bool host_and_port = 32 [json_name = "hostAndPort", (.buf.validate.priv.field) = { ... } + * bool host_and_port = 32 [json_name = "hostAndPort", (.buf.validate.predefined) = { ... } * @return Whether the hostAndPort field is set. */ boolean hasHostAndPort(); @@ -1362,7 +1363,7 @@ public interface StringRulesOrBuilder extends * with square brackets (e.g., `[::1]:1234`). * * - * bool host_and_port = 32 [json_name = "hostAndPort", (.buf.validate.priv.field) = { ... } + * bool host_and_port = 32 [json_name = "hostAndPort", (.buf.validate.predefined) = { ... } * @return The hostAndPort. */ boolean getHostAndPort(); @@ -1391,7 +1392,7 @@ public interface StringRulesOrBuilder extends * | KNOWN_REGEX_HTTP_HEADER_VALUE | 2 | HTTP header value as defined by [RFC 7230](https://tools.ietf.org/html/rfc7230#section-3.2.4) | * * - * .buf.validate.KnownRegex well_known_regex = 24 [json_name = "wellKnownRegex", (.buf.validate.priv.field) = { ... } + * .buf.validate.KnownRegex well_known_regex = 24 [json_name = "wellKnownRegex", (.buf.validate.predefined) = { ... } * @return Whether the wellKnownRegex field is set. */ boolean hasWellKnownRegex(); @@ -1419,35 +1420,7 @@ public interface StringRulesOrBuilder extends * | KNOWN_REGEX_HTTP_HEADER_VALUE | 2 | HTTP header value as defined by [RFC 7230](https://tools.ietf.org/html/rfc7230#section-3.2.4) | * * - * .buf.validate.KnownRegex well_known_regex = 24 [json_name = "wellKnownRegex", (.buf.validate.priv.field) = { ... } - * @return The enum numeric value on the wire for wellKnownRegex. - */ - int getWellKnownRegexValue(); - /** - *
-   * `well_known_regex` specifies a common well-known pattern
-   * defined as a regex. If the field value doesn't match the well-known
-   * regex, an error message will be generated.
-   *
-   * ```proto
-   * message MyString {
-   * // value must be a valid HTTP header value
-   * string value = 1 [(buf.validate.field).string.well_known_regex = KNOWN_REGEX_HTTP_HEADER_VALUE];
-   * }
-   * ```
-   *
-   * #### KnownRegex
-   *
-   * `well_known_regex` contains some well-known patterns.
-   *
-   * | Name                          | Number | Description                               |
-   * |-------------------------------|--------|-------------------------------------------|
-   * | KNOWN_REGEX_UNSPECIFIED       | 0      |                                           |
-   * | KNOWN_REGEX_HTTP_HEADER_NAME  | 1      | HTTP header name as defined by [RFC 7230](https://tools.ietf.org/html/rfc7230#section-3.2)  |
-   * | KNOWN_REGEX_HTTP_HEADER_VALUE | 2      | HTTP header value as defined by [RFC 7230](https://tools.ietf.org/html/rfc7230#section-3.2.4) |
-   * 
- * - * .buf.validate.KnownRegex well_known_regex = 24 [json_name = "wellKnownRegex", (.buf.validate.priv.field) = { ... } + * .buf.validate.KnownRegex well_known_regex = 24 [json_name = "wellKnownRegex", (.buf.validate.predefined) = { ... } * @return The wellKnownRegex. */ build.buf.validate.KnownRegex getWellKnownRegex(); @@ -1493,5 +1466,90 @@ public interface StringRulesOrBuilder extends */ boolean getStrict(); + /** + *
+   * `example` specifies values that the field may have. These values SHOULD
+   * conform to other constraints. `example` values will not impact validation
+   * but may be used as helpful guidance on how to populate the given field.
+   *
+   * ```proto
+   * message MyString {
+   * string value = 1 [
+   * (buf.validate.field).string.example = 1,
+   * (buf.validate.field).string.example = 2
+   * ];
+   * }
+   * ```
+   * 
+ * + * repeated string example = 34 [json_name = "example", (.buf.validate.predefined) = { ... } + * @return A list containing the example. + */ + java.util.List + getExampleList(); + /** + *
+   * `example` specifies values that the field may have. These values SHOULD
+   * conform to other constraints. `example` values will not impact validation
+   * but may be used as helpful guidance on how to populate the given field.
+   *
+   * ```proto
+   * message MyString {
+   * string value = 1 [
+   * (buf.validate.field).string.example = 1,
+   * (buf.validate.field).string.example = 2
+   * ];
+   * }
+   * ```
+   * 
+ * + * repeated string example = 34 [json_name = "example", (.buf.validate.predefined) = { ... } + * @return The count of example. + */ + int getExampleCount(); + /** + *
+   * `example` specifies values that the field may have. These values SHOULD
+   * conform to other constraints. `example` values will not impact validation
+   * but may be used as helpful guidance on how to populate the given field.
+   *
+   * ```proto
+   * message MyString {
+   * string value = 1 [
+   * (buf.validate.field).string.example = 1,
+   * (buf.validate.field).string.example = 2
+   * ];
+   * }
+   * ```
+   * 
+ * + * repeated string example = 34 [json_name = "example", (.buf.validate.predefined) = { ... } + * @param index The index of the element to return. + * @return The example at the given index. + */ + java.lang.String getExample(int index); + /** + *
+   * `example` specifies values that the field may have. These values SHOULD
+   * conform to other constraints. `example` values will not impact validation
+   * but may be used as helpful guidance on how to populate the given field.
+   *
+   * ```proto
+   * message MyString {
+   * string value = 1 [
+   * (buf.validate.field).string.example = 1,
+   * (buf.validate.field).string.example = 2
+   * ];
+   * }
+   * ```
+   * 
+ * + * repeated string example = 34 [json_name = "example", (.buf.validate.predefined) = { ... } + * @param index The index of the value to return. + * @return The bytes of the example at the given index. + */ + com.google.protobuf.ByteString + getExampleBytes(int index); + build.buf.validate.StringRules.WellKnownCase getWellKnownCase(); } diff --git a/src/main/java/build/buf/validate/TimestampRules.java b/src/main/java/build/buf/validate/TimestampRules.java index 542cf87f..7004fb23 100644 --- a/src/main/java/build/buf/validate/TimestampRules.java +++ b/src/main/java/build/buf/validate/TimestampRules.java @@ -13,7 +13,8 @@ * Protobuf type {@code buf.validate.TimestampRules} */ public final class TimestampRules extends - com.google.protobuf.GeneratedMessage implements + com.google.protobuf.GeneratedMessage.ExtendableMessage< + TimestampRules> implements // @@protoc_insertion_point(message_implements:buf.validate.TimestampRules) TimestampRulesOrBuilder { private static final long serialVersionUID = 0L; @@ -27,10 +28,11 @@ public final class TimestampRules extends TimestampRules.class.getName()); } // Use TimestampRules.newBuilder() to construct. - private TimestampRules(com.google.protobuf.GeneratedMessage.Builder builder) { + private TimestampRules(com.google.protobuf.GeneratedMessage.ExtendableBuilder builder) { super(builder); } private TimestampRules() { + example_ = java.util.Collections.emptyList(); } public static final com.google.protobuf.Descriptors.Descriptor @@ -149,7 +151,7 @@ public int getNumber() { * ``` * * - * optional .google.protobuf.Timestamp const = 2 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional .google.protobuf.Timestamp const = 2 [json_name = "const", (.buf.validate.predefined) = { ... } * @return Whether the const field is set. */ @java.lang.Override @@ -168,7 +170,7 @@ public boolean hasConst() { * ``` * * - * optional .google.protobuf.Timestamp const = 2 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional .google.protobuf.Timestamp const = 2 [json_name = "const", (.buf.validate.predefined) = { ... } * @return The const. */ @java.lang.Override @@ -187,7 +189,7 @@ public com.google.protobuf.Timestamp getConst() { * ``` * * - * optional .google.protobuf.Timestamp const = 2 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional .google.protobuf.Timestamp const = 2 [json_name = "const", (.buf.validate.predefined) = { ... } */ @java.lang.Override public com.google.protobuf.TimestampOrBuilder getConstOrBuilder() { @@ -207,7 +209,7 @@ public com.google.protobuf.TimestampOrBuilder getConstOrBuilder() { * ``` * * - * .google.protobuf.Timestamp lt = 3 [json_name = "lt", (.buf.validate.priv.field) = { ... } + * .google.protobuf.Timestamp lt = 3 [json_name = "lt", (.buf.validate.predefined) = { ... } * @return Whether the lt field is set. */ @java.lang.Override @@ -226,7 +228,7 @@ public boolean hasLt() { * ``` * * - * .google.protobuf.Timestamp lt = 3 [json_name = "lt", (.buf.validate.priv.field) = { ... } + * .google.protobuf.Timestamp lt = 3 [json_name = "lt", (.buf.validate.predefined) = { ... } * @return The lt. */ @java.lang.Override @@ -248,7 +250,7 @@ public com.google.protobuf.Timestamp getLt() { * ``` * * - * .google.protobuf.Timestamp lt = 3 [json_name = "lt", (.buf.validate.priv.field) = { ... } + * .google.protobuf.Timestamp lt = 3 [json_name = "lt", (.buf.validate.predefined) = { ... } */ @java.lang.Override public com.google.protobuf.TimestampOrBuilder getLtOrBuilder() { @@ -271,7 +273,7 @@ public com.google.protobuf.TimestampOrBuilder getLtOrBuilder() { * ``` * * - * .google.protobuf.Timestamp lte = 4 [json_name = "lte", (.buf.validate.priv.field) = { ... } + * .google.protobuf.Timestamp lte = 4 [json_name = "lte", (.buf.validate.predefined) = { ... } * @return Whether the lte field is set. */ @java.lang.Override @@ -290,7 +292,7 @@ public boolean hasLte() { * ``` * * - * .google.protobuf.Timestamp lte = 4 [json_name = "lte", (.buf.validate.priv.field) = { ... } + * .google.protobuf.Timestamp lte = 4 [json_name = "lte", (.buf.validate.predefined) = { ... } * @return The lte. */ @java.lang.Override @@ -312,7 +314,7 @@ public com.google.protobuf.Timestamp getLte() { * ``` * * - * .google.protobuf.Timestamp lte = 4 [json_name = "lte", (.buf.validate.priv.field) = { ... } + * .google.protobuf.Timestamp lte = 4 [json_name = "lte", (.buf.validate.predefined) = { ... } */ @java.lang.Override public com.google.protobuf.TimestampOrBuilder getLteOrBuilder() { @@ -335,7 +337,7 @@ public com.google.protobuf.TimestampOrBuilder getLteOrBuilder() { * ``` * * - * bool lt_now = 7 [json_name = "ltNow", (.buf.validate.priv.field) = { ... } + * bool lt_now = 7 [json_name = "ltNow", (.buf.validate.predefined) = { ... } * @return Whether the ltNow field is set. */ @java.lang.Override @@ -354,7 +356,7 @@ public boolean hasLtNow() { * ``` * * - * bool lt_now = 7 [json_name = "ltNow", (.buf.validate.priv.field) = { ... } + * bool lt_now = 7 [json_name = "ltNow", (.buf.validate.predefined) = { ... } * @return The ltNow. */ @java.lang.Override @@ -388,7 +390,7 @@ public boolean getLtNow() { * ``` * * - * .google.protobuf.Timestamp gt = 5 [json_name = "gt", (.buf.validate.priv.field) = { ... } + * .google.protobuf.Timestamp gt = 5 [json_name = "gt", (.buf.validate.predefined) = { ... } * @return Whether the gt field is set. */ @java.lang.Override @@ -417,7 +419,7 @@ public boolean hasGt() { * ``` * * - * .google.protobuf.Timestamp gt = 5 [json_name = "gt", (.buf.validate.priv.field) = { ... } + * .google.protobuf.Timestamp gt = 5 [json_name = "gt", (.buf.validate.predefined) = { ... } * @return The gt. */ @java.lang.Override @@ -449,7 +451,7 @@ public com.google.protobuf.Timestamp getGt() { * ``` * * - * .google.protobuf.Timestamp gt = 5 [json_name = "gt", (.buf.validate.priv.field) = { ... } + * .google.protobuf.Timestamp gt = 5 [json_name = "gt", (.buf.validate.predefined) = { ... } */ @java.lang.Override public com.google.protobuf.TimestampOrBuilder getGtOrBuilder() { @@ -482,7 +484,7 @@ public com.google.protobuf.TimestampOrBuilder getGtOrBuilder() { * ``` * * - * .google.protobuf.Timestamp gte = 6 [json_name = "gte", (.buf.validate.priv.field) = { ... } + * .google.protobuf.Timestamp gte = 6 [json_name = "gte", (.buf.validate.predefined) = { ... } * @return Whether the gte field is set. */ @java.lang.Override @@ -511,7 +513,7 @@ public boolean hasGte() { * ``` * * - * .google.protobuf.Timestamp gte = 6 [json_name = "gte", (.buf.validate.priv.field) = { ... } + * .google.protobuf.Timestamp gte = 6 [json_name = "gte", (.buf.validate.predefined) = { ... } * @return The gte. */ @java.lang.Override @@ -543,7 +545,7 @@ public com.google.protobuf.Timestamp getGte() { * ``` * * - * .google.protobuf.Timestamp gte = 6 [json_name = "gte", (.buf.validate.priv.field) = { ... } + * .google.protobuf.Timestamp gte = 6 [json_name = "gte", (.buf.validate.predefined) = { ... } */ @java.lang.Override public com.google.protobuf.TimestampOrBuilder getGteOrBuilder() { @@ -566,7 +568,7 @@ public com.google.protobuf.TimestampOrBuilder getGteOrBuilder() { * ``` * * - * bool gt_now = 8 [json_name = "gtNow", (.buf.validate.priv.field) = { ... } + * bool gt_now = 8 [json_name = "gtNow", (.buf.validate.predefined) = { ... } * @return Whether the gtNow field is set. */ @java.lang.Override @@ -585,7 +587,7 @@ public boolean hasGtNow() { * ``` * * - * bool gt_now = 8 [json_name = "gtNow", (.buf.validate.priv.field) = { ... } + * bool gt_now = 8 [json_name = "gtNow", (.buf.validate.predefined) = { ... } * @return The gtNow. */ @java.lang.Override @@ -610,7 +612,7 @@ public boolean getGtNow() { * ``` * * - * optional .google.protobuf.Duration within = 9 [json_name = "within", (.buf.validate.priv.field) = { ... } + * optional .google.protobuf.Duration within = 9 [json_name = "within", (.buf.validate.predefined) = { ... } * @return Whether the within field is set. */ @java.lang.Override @@ -629,7 +631,7 @@ public boolean hasWithin() { * ``` * * - * optional .google.protobuf.Duration within = 9 [json_name = "within", (.buf.validate.priv.field) = { ... } + * optional .google.protobuf.Duration within = 9 [json_name = "within", (.buf.validate.predefined) = { ... } * @return The within. */ @java.lang.Override @@ -648,13 +650,54 @@ public com.google.protobuf.Duration getWithin() { * ``` * * - * optional .google.protobuf.Duration within = 9 [json_name = "within", (.buf.validate.priv.field) = { ... } + * optional .google.protobuf.Duration within = 9 [json_name = "within", (.buf.validate.predefined) = { ... } */ @java.lang.Override public com.google.protobuf.DurationOrBuilder getWithinOrBuilder() { return within_ == null ? com.google.protobuf.Duration.getDefaultInstance() : within_; } + public static final int EXAMPLE_FIELD_NUMBER = 10; + @SuppressWarnings("serial") + private java.util.List example_; + /** + * repeated .google.protobuf.Timestamp example = 10 [json_name = "example", (.buf.validate.predefined) = { ... } + */ + @java.lang.Override + public java.util.List getExampleList() { + return example_; + } + /** + * repeated .google.protobuf.Timestamp example = 10 [json_name = "example", (.buf.validate.predefined) = { ... } + */ + @java.lang.Override + public java.util.List + getExampleOrBuilderList() { + return example_; + } + /** + * repeated .google.protobuf.Timestamp example = 10 [json_name = "example", (.buf.validate.predefined) = { ... } + */ + @java.lang.Override + public int getExampleCount() { + return example_.size(); + } + /** + * repeated .google.protobuf.Timestamp example = 10 [json_name = "example", (.buf.validate.predefined) = { ... } + */ + @java.lang.Override + public com.google.protobuf.Timestamp getExample(int index) { + return example_.get(index); + } + /** + * repeated .google.protobuf.Timestamp example = 10 [json_name = "example", (.buf.validate.predefined) = { ... } + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getExampleOrBuilder( + int index) { + return example_.get(index); + } + private byte memoizedIsInitialized = -1; @java.lang.Override public final boolean isInitialized() { @@ -662,6 +705,10 @@ public final boolean isInitialized() { if (isInitialized == 1) return true; if (isInitialized == 0) return false; + if (!extensionsAreInitialized()) { + memoizedIsInitialized = 0; + return false; + } memoizedIsInitialized = 1; return true; } @@ -669,6 +716,9 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + com.google.protobuf.GeneratedMessage + .ExtendableMessage.ExtensionSerializer + extensionWriter = newExtensionSerializer(); if (((bitField0_ & 0x00000001) != 0)) { output.writeMessage(2, getConst()); } @@ -695,6 +745,10 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) if (((bitField0_ & 0x00000002) != 0)) { output.writeMessage(9, getWithin()); } + for (int i = 0; i < example_.size(); i++) { + output.writeMessage(10, example_.get(i)); + } + extensionWriter.writeUntil(536870912, output); getUnknownFields().writeTo(output); } @@ -738,6 +792,11 @@ public int getSerializedSize() { size += com.google.protobuf.CodedOutputStream .computeMessageSize(9, getWithin()); } + for (int i = 0; i < example_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(10, example_.get(i)); + } + size += extensionsSerializedSize(); size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -763,6 +822,8 @@ public boolean equals(final java.lang.Object obj) { if (!getWithin() .equals(other.getWithin())) return false; } + if (!getExampleList() + .equals(other.getExampleList())) return false; if (!getLessThanCase().equals(other.getLessThanCase())) return false; switch (lessThanCase_) { case 3: @@ -798,6 +859,8 @@ public boolean equals(final java.lang.Object obj) { default: } if (!getUnknownFields().equals(other.getUnknownFields())) return false; + if (!getExtensionFields().equals(other.getExtensionFields())) + return false; return true; } @@ -816,6 +879,10 @@ public int hashCode() { hash = (37 * hash) + WITHIN_FIELD_NUMBER; hash = (53 * hash) + getWithin().hashCode(); } + if (getExampleCount() > 0) { + hash = (37 * hash) + EXAMPLE_FIELD_NUMBER; + hash = (53 * hash) + getExampleList().hashCode(); + } switch (lessThanCase_) { case 3: hash = (37 * hash) + LT_FIELD_NUMBER; @@ -850,6 +917,7 @@ public int hashCode() { case 0: default: } + hash = hashFields(hash, getExtensionFields()); hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -955,7 +1023,8 @@ protected Builder newBuilderForType( * Protobuf type {@code buf.validate.TimestampRules} */ public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder implements + com.google.protobuf.GeneratedMessage.ExtendableBuilder< + build.buf.validate.TimestampRules, Builder> implements // @@protoc_insertion_point(builder_implements:buf.validate.TimestampRules) build.buf.validate.TimestampRulesOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor @@ -986,6 +1055,7 @@ private void maybeForceBuilderInitialization() { .alwaysUseFieldBuilders) { getConstFieldBuilder(); getWithinFieldBuilder(); + getExampleFieldBuilder(); } } @java.lang.Override @@ -1014,6 +1084,13 @@ public Builder clear() { withinBuilder_.dispose(); withinBuilder_ = null; } + if (exampleBuilder_ == null) { + example_ = java.util.Collections.emptyList(); + } else { + example_ = null; + exampleBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000100); lessThanCase_ = 0; lessThan_ = null; greaterThanCase_ = 0; @@ -1044,12 +1121,25 @@ public build.buf.validate.TimestampRules build() { @java.lang.Override public build.buf.validate.TimestampRules buildPartial() { build.buf.validate.TimestampRules result = new build.buf.validate.TimestampRules(this); + buildPartialRepeatedFields(result); if (bitField0_ != 0) { buildPartial0(result); } buildPartialOneofs(result); onBuilt(); return result; } + private void buildPartialRepeatedFields(build.buf.validate.TimestampRules result) { + if (exampleBuilder_ == null) { + if (((bitField0_ & 0x00000100) != 0)) { + example_ = java.util.Collections.unmodifiableList(example_); + bitField0_ = (bitField0_ & ~0x00000100); + } + result.example_ = example_; + } else { + result.example_ = exampleBuilder_.build(); + } + } + private void buildPartial0(build.buf.validate.TimestampRules result) { int from_bitField0_ = bitField0_; int to_bitField0_ = 0; @@ -1109,6 +1199,32 @@ public Builder mergeFrom(build.buf.validate.TimestampRules other) { if (other.hasWithin()) { mergeWithin(other.getWithin()); } + if (exampleBuilder_ == null) { + if (!other.example_.isEmpty()) { + if (example_.isEmpty()) { + example_ = other.example_; + bitField0_ = (bitField0_ & ~0x00000100); + } else { + ensureExampleIsMutable(); + example_.addAll(other.example_); + } + onChanged(); + } + } else { + if (!other.example_.isEmpty()) { + if (exampleBuilder_.isEmpty()) { + exampleBuilder_.dispose(); + exampleBuilder_ = null; + example_ = other.example_; + bitField0_ = (bitField0_ & ~0x00000100); + exampleBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getExampleFieldBuilder() : null; + } else { + exampleBuilder_.addAllMessages(other.example_); + } + } + } switch (other.getLessThanCase()) { case LT: { mergeLt(other.getLt()); @@ -1143,6 +1259,7 @@ public Builder mergeFrom(build.buf.validate.TimestampRules other) { break; } } + this.mergeExtensionFields(other); this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -1150,6 +1267,9 @@ public Builder mergeFrom(build.buf.validate.TimestampRules other) { @java.lang.Override public final boolean isInitialized() { + if (!extensionsAreInitialized()) { + return false; + } return true; } @@ -1221,6 +1341,19 @@ public Builder mergeFrom( bitField0_ |= 0x00000080; break; } // case 74 + case 82: { + com.google.protobuf.Timestamp m = + input.readMessage( + com.google.protobuf.Timestamp.parser(), + extensionRegistry); + if (exampleBuilder_ == null) { + ensureExampleIsMutable(); + example_.add(m); + } else { + exampleBuilder_.addMessage(m); + } + break; + } // case 82 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { done = true; // was an endgroup tag @@ -1283,7 +1416,7 @@ public Builder clearGreaterThan() { * ``` * * - * optional .google.protobuf.Timestamp const = 2 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional .google.protobuf.Timestamp const = 2 [json_name = "const", (.buf.validate.predefined) = { ... } * @return Whether the const field is set. */ public boolean hasConst() { @@ -1301,7 +1434,7 @@ public boolean hasConst() { * ``` * * - * optional .google.protobuf.Timestamp const = 2 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional .google.protobuf.Timestamp const = 2 [json_name = "const", (.buf.validate.predefined) = { ... } * @return The const. */ public com.google.protobuf.Timestamp getConst() { @@ -1323,7 +1456,7 @@ public com.google.protobuf.Timestamp getConst() { * ``` * * - * optional .google.protobuf.Timestamp const = 2 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional .google.protobuf.Timestamp const = 2 [json_name = "const", (.buf.validate.predefined) = { ... } */ public Builder setConst(com.google.protobuf.Timestamp value) { if (constBuilder_ == null) { @@ -1350,7 +1483,7 @@ public Builder setConst(com.google.protobuf.Timestamp value) { * ``` * * - * optional .google.protobuf.Timestamp const = 2 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional .google.protobuf.Timestamp const = 2 [json_name = "const", (.buf.validate.predefined) = { ... } */ public Builder setConst( com.google.protobuf.Timestamp.Builder builderForValue) { @@ -1375,7 +1508,7 @@ public Builder setConst( * ``` * * - * optional .google.protobuf.Timestamp const = 2 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional .google.protobuf.Timestamp const = 2 [json_name = "const", (.buf.validate.predefined) = { ... } */ public Builder mergeConst(com.google.protobuf.Timestamp value) { if (constBuilder_ == null) { @@ -1407,7 +1540,7 @@ public Builder mergeConst(com.google.protobuf.Timestamp value) { * ``` * * - * optional .google.protobuf.Timestamp const = 2 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional .google.protobuf.Timestamp const = 2 [json_name = "const", (.buf.validate.predefined) = { ... } */ public Builder clearConst() { bitField0_ = (bitField0_ & ~0x00000001); @@ -1431,7 +1564,7 @@ public Builder clearConst() { * ``` * * - * optional .google.protobuf.Timestamp const = 2 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional .google.protobuf.Timestamp const = 2 [json_name = "const", (.buf.validate.predefined) = { ... } */ public com.google.protobuf.Timestamp.Builder getConstBuilder() { bitField0_ |= 0x00000001; @@ -1450,7 +1583,7 @@ public com.google.protobuf.Timestamp.Builder getConstBuilder() { * ``` * * - * optional .google.protobuf.Timestamp const = 2 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional .google.protobuf.Timestamp const = 2 [json_name = "const", (.buf.validate.predefined) = { ... } */ public com.google.protobuf.TimestampOrBuilder getConstOrBuilder() { if (constBuilder_ != null) { @@ -1472,7 +1605,7 @@ public com.google.protobuf.TimestampOrBuilder getConstOrBuilder() { * ``` * * - * optional .google.protobuf.Timestamp const = 2 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional .google.protobuf.Timestamp const = 2 [json_name = "const", (.buf.validate.predefined) = { ... } */ private com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> @@ -1502,7 +1635,7 @@ public com.google.protobuf.TimestampOrBuilder getConstOrBuilder() { * ``` * * - * .google.protobuf.Timestamp lt = 3 [json_name = "lt", (.buf.validate.priv.field) = { ... } + * .google.protobuf.Timestamp lt = 3 [json_name = "lt", (.buf.validate.predefined) = { ... } * @return Whether the lt field is set. */ @java.lang.Override @@ -1521,7 +1654,7 @@ public boolean hasLt() { * ``` * * - * .google.protobuf.Timestamp lt = 3 [json_name = "lt", (.buf.validate.priv.field) = { ... } + * .google.protobuf.Timestamp lt = 3 [json_name = "lt", (.buf.validate.predefined) = { ... } * @return The lt. */ @java.lang.Override @@ -1550,7 +1683,7 @@ public com.google.protobuf.Timestamp getLt() { * ``` * * - * .google.protobuf.Timestamp lt = 3 [json_name = "lt", (.buf.validate.priv.field) = { ... } + * .google.protobuf.Timestamp lt = 3 [json_name = "lt", (.buf.validate.predefined) = { ... } */ public Builder setLt(com.google.protobuf.Timestamp value) { if (ltBuilder_ == null) { @@ -1577,7 +1710,7 @@ public Builder setLt(com.google.protobuf.Timestamp value) { * ``` * * - * .google.protobuf.Timestamp lt = 3 [json_name = "lt", (.buf.validate.priv.field) = { ... } + * .google.protobuf.Timestamp lt = 3 [json_name = "lt", (.buf.validate.predefined) = { ... } */ public Builder setLt( com.google.protobuf.Timestamp.Builder builderForValue) { @@ -1602,7 +1735,7 @@ public Builder setLt( * ``` * * - * .google.protobuf.Timestamp lt = 3 [json_name = "lt", (.buf.validate.priv.field) = { ... } + * .google.protobuf.Timestamp lt = 3 [json_name = "lt", (.buf.validate.predefined) = { ... } */ public Builder mergeLt(com.google.protobuf.Timestamp value) { if (ltBuilder_ == null) { @@ -1636,7 +1769,7 @@ public Builder mergeLt(com.google.protobuf.Timestamp value) { * ``` * * - * .google.protobuf.Timestamp lt = 3 [json_name = "lt", (.buf.validate.priv.field) = { ... } + * .google.protobuf.Timestamp lt = 3 [json_name = "lt", (.buf.validate.predefined) = { ... } */ public Builder clearLt() { if (ltBuilder_ == null) { @@ -1666,7 +1799,7 @@ public Builder clearLt() { * ``` * * - * .google.protobuf.Timestamp lt = 3 [json_name = "lt", (.buf.validate.priv.field) = { ... } + * .google.protobuf.Timestamp lt = 3 [json_name = "lt", (.buf.validate.predefined) = { ... } */ public com.google.protobuf.Timestamp.Builder getLtBuilder() { return getLtFieldBuilder().getBuilder(); @@ -1683,7 +1816,7 @@ public com.google.protobuf.Timestamp.Builder getLtBuilder() { * ``` * * - * .google.protobuf.Timestamp lt = 3 [json_name = "lt", (.buf.validate.priv.field) = { ... } + * .google.protobuf.Timestamp lt = 3 [json_name = "lt", (.buf.validate.predefined) = { ... } */ @java.lang.Override public com.google.protobuf.TimestampOrBuilder getLtOrBuilder() { @@ -1708,7 +1841,7 @@ public com.google.protobuf.TimestampOrBuilder getLtOrBuilder() { * ``` * * - * .google.protobuf.Timestamp lt = 3 [json_name = "lt", (.buf.validate.priv.field) = { ... } + * .google.protobuf.Timestamp lt = 3 [json_name = "lt", (.buf.validate.predefined) = { ... } */ private com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> @@ -1743,7 +1876,7 @@ public com.google.protobuf.TimestampOrBuilder getLtOrBuilder() { * ``` * * - * .google.protobuf.Timestamp lte = 4 [json_name = "lte", (.buf.validate.priv.field) = { ... } + * .google.protobuf.Timestamp lte = 4 [json_name = "lte", (.buf.validate.predefined) = { ... } * @return Whether the lte field is set. */ @java.lang.Override @@ -1762,7 +1895,7 @@ public boolean hasLte() { * ``` * * - * .google.protobuf.Timestamp lte = 4 [json_name = "lte", (.buf.validate.priv.field) = { ... } + * .google.protobuf.Timestamp lte = 4 [json_name = "lte", (.buf.validate.predefined) = { ... } * @return The lte. */ @java.lang.Override @@ -1791,7 +1924,7 @@ public com.google.protobuf.Timestamp getLte() { * ``` * * - * .google.protobuf.Timestamp lte = 4 [json_name = "lte", (.buf.validate.priv.field) = { ... } + * .google.protobuf.Timestamp lte = 4 [json_name = "lte", (.buf.validate.predefined) = { ... } */ public Builder setLte(com.google.protobuf.Timestamp value) { if (lteBuilder_ == null) { @@ -1818,7 +1951,7 @@ public Builder setLte(com.google.protobuf.Timestamp value) { * ``` * * - * .google.protobuf.Timestamp lte = 4 [json_name = "lte", (.buf.validate.priv.field) = { ... } + * .google.protobuf.Timestamp lte = 4 [json_name = "lte", (.buf.validate.predefined) = { ... } */ public Builder setLte( com.google.protobuf.Timestamp.Builder builderForValue) { @@ -1843,7 +1976,7 @@ public Builder setLte( * ``` * * - * .google.protobuf.Timestamp lte = 4 [json_name = "lte", (.buf.validate.priv.field) = { ... } + * .google.protobuf.Timestamp lte = 4 [json_name = "lte", (.buf.validate.predefined) = { ... } */ public Builder mergeLte(com.google.protobuf.Timestamp value) { if (lteBuilder_ == null) { @@ -1877,7 +2010,7 @@ public Builder mergeLte(com.google.protobuf.Timestamp value) { * ``` * * - * .google.protobuf.Timestamp lte = 4 [json_name = "lte", (.buf.validate.priv.field) = { ... } + * .google.protobuf.Timestamp lte = 4 [json_name = "lte", (.buf.validate.predefined) = { ... } */ public Builder clearLte() { if (lteBuilder_ == null) { @@ -1907,7 +2040,7 @@ public Builder clearLte() { * ``` * * - * .google.protobuf.Timestamp lte = 4 [json_name = "lte", (.buf.validate.priv.field) = { ... } + * .google.protobuf.Timestamp lte = 4 [json_name = "lte", (.buf.validate.predefined) = { ... } */ public com.google.protobuf.Timestamp.Builder getLteBuilder() { return getLteFieldBuilder().getBuilder(); @@ -1924,7 +2057,7 @@ public com.google.protobuf.Timestamp.Builder getLteBuilder() { * ``` * * - * .google.protobuf.Timestamp lte = 4 [json_name = "lte", (.buf.validate.priv.field) = { ... } + * .google.protobuf.Timestamp lte = 4 [json_name = "lte", (.buf.validate.predefined) = { ... } */ @java.lang.Override public com.google.protobuf.TimestampOrBuilder getLteOrBuilder() { @@ -1949,7 +2082,7 @@ public com.google.protobuf.TimestampOrBuilder getLteOrBuilder() { * ``` * * - * .google.protobuf.Timestamp lte = 4 [json_name = "lte", (.buf.validate.priv.field) = { ... } + * .google.protobuf.Timestamp lte = 4 [json_name = "lte", (.buf.validate.predefined) = { ... } */ private com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> @@ -1982,7 +2115,7 @@ public com.google.protobuf.TimestampOrBuilder getLteOrBuilder() { * ``` * * - * bool lt_now = 7 [json_name = "ltNow", (.buf.validate.priv.field) = { ... } + * bool lt_now = 7 [json_name = "ltNow", (.buf.validate.predefined) = { ... } * @return Whether the ltNow field is set. */ public boolean hasLtNow() { @@ -2000,7 +2133,7 @@ public boolean hasLtNow() { * ``` * * - * bool lt_now = 7 [json_name = "ltNow", (.buf.validate.priv.field) = { ... } + * bool lt_now = 7 [json_name = "ltNow", (.buf.validate.predefined) = { ... } * @return The ltNow. */ public boolean getLtNow() { @@ -2021,7 +2154,7 @@ public boolean getLtNow() { * ``` * * - * bool lt_now = 7 [json_name = "ltNow", (.buf.validate.priv.field) = { ... } + * bool lt_now = 7 [json_name = "ltNow", (.buf.validate.predefined) = { ... } * @param value The ltNow to set. * @return This builder for chaining. */ @@ -2044,7 +2177,7 @@ public Builder setLtNow(boolean value) { * ``` * * - * bool lt_now = 7 [json_name = "ltNow", (.buf.validate.priv.field) = { ... } + * bool lt_now = 7 [json_name = "ltNow", (.buf.validate.predefined) = { ... } * @return This builder for chaining. */ public Builder clearLtNow() { @@ -2080,7 +2213,7 @@ public Builder clearLtNow() { * ``` * * - * .google.protobuf.Timestamp gt = 5 [json_name = "gt", (.buf.validate.priv.field) = { ... } + * .google.protobuf.Timestamp gt = 5 [json_name = "gt", (.buf.validate.predefined) = { ... } * @return Whether the gt field is set. */ @java.lang.Override @@ -2109,7 +2242,7 @@ public boolean hasGt() { * ``` * * - * .google.protobuf.Timestamp gt = 5 [json_name = "gt", (.buf.validate.priv.field) = { ... } + * .google.protobuf.Timestamp gt = 5 [json_name = "gt", (.buf.validate.predefined) = { ... } * @return The gt. */ @java.lang.Override @@ -2148,7 +2281,7 @@ public com.google.protobuf.Timestamp getGt() { * ``` * * - * .google.protobuf.Timestamp gt = 5 [json_name = "gt", (.buf.validate.priv.field) = { ... } + * .google.protobuf.Timestamp gt = 5 [json_name = "gt", (.buf.validate.predefined) = { ... } */ public Builder setGt(com.google.protobuf.Timestamp value) { if (gtBuilder_ == null) { @@ -2185,7 +2318,7 @@ public Builder setGt(com.google.protobuf.Timestamp value) { * ``` * * - * .google.protobuf.Timestamp gt = 5 [json_name = "gt", (.buf.validate.priv.field) = { ... } + * .google.protobuf.Timestamp gt = 5 [json_name = "gt", (.buf.validate.predefined) = { ... } */ public Builder setGt( com.google.protobuf.Timestamp.Builder builderForValue) { @@ -2220,7 +2353,7 @@ public Builder setGt( * ``` * * - * .google.protobuf.Timestamp gt = 5 [json_name = "gt", (.buf.validate.priv.field) = { ... } + * .google.protobuf.Timestamp gt = 5 [json_name = "gt", (.buf.validate.predefined) = { ... } */ public Builder mergeGt(com.google.protobuf.Timestamp value) { if (gtBuilder_ == null) { @@ -2264,7 +2397,7 @@ public Builder mergeGt(com.google.protobuf.Timestamp value) { * ``` * * - * .google.protobuf.Timestamp gt = 5 [json_name = "gt", (.buf.validate.priv.field) = { ... } + * .google.protobuf.Timestamp gt = 5 [json_name = "gt", (.buf.validate.predefined) = { ... } */ public Builder clearGt() { if (gtBuilder_ == null) { @@ -2304,7 +2437,7 @@ public Builder clearGt() { * ``` * * - * .google.protobuf.Timestamp gt = 5 [json_name = "gt", (.buf.validate.priv.field) = { ... } + * .google.protobuf.Timestamp gt = 5 [json_name = "gt", (.buf.validate.predefined) = { ... } */ public com.google.protobuf.Timestamp.Builder getGtBuilder() { return getGtFieldBuilder().getBuilder(); @@ -2331,7 +2464,7 @@ public com.google.protobuf.Timestamp.Builder getGtBuilder() { * ``` * * - * .google.protobuf.Timestamp gt = 5 [json_name = "gt", (.buf.validate.priv.field) = { ... } + * .google.protobuf.Timestamp gt = 5 [json_name = "gt", (.buf.validate.predefined) = { ... } */ @java.lang.Override public com.google.protobuf.TimestampOrBuilder getGtOrBuilder() { @@ -2366,7 +2499,7 @@ public com.google.protobuf.TimestampOrBuilder getGtOrBuilder() { * ``` * * - * .google.protobuf.Timestamp gt = 5 [json_name = "gt", (.buf.validate.priv.field) = { ... } + * .google.protobuf.Timestamp gt = 5 [json_name = "gt", (.buf.validate.predefined) = { ... } */ private com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> @@ -2411,7 +2544,7 @@ public com.google.protobuf.TimestampOrBuilder getGtOrBuilder() { * ``` * * - * .google.protobuf.Timestamp gte = 6 [json_name = "gte", (.buf.validate.priv.field) = { ... } + * .google.protobuf.Timestamp gte = 6 [json_name = "gte", (.buf.validate.predefined) = { ... } * @return Whether the gte field is set. */ @java.lang.Override @@ -2440,7 +2573,7 @@ public boolean hasGte() { * ``` * * - * .google.protobuf.Timestamp gte = 6 [json_name = "gte", (.buf.validate.priv.field) = { ... } + * .google.protobuf.Timestamp gte = 6 [json_name = "gte", (.buf.validate.predefined) = { ... } * @return The gte. */ @java.lang.Override @@ -2479,7 +2612,7 @@ public com.google.protobuf.Timestamp getGte() { * ``` * * - * .google.protobuf.Timestamp gte = 6 [json_name = "gte", (.buf.validate.priv.field) = { ... } + * .google.protobuf.Timestamp gte = 6 [json_name = "gte", (.buf.validate.predefined) = { ... } */ public Builder setGte(com.google.protobuf.Timestamp value) { if (gteBuilder_ == null) { @@ -2516,7 +2649,7 @@ public Builder setGte(com.google.protobuf.Timestamp value) { * ``` * * - * .google.protobuf.Timestamp gte = 6 [json_name = "gte", (.buf.validate.priv.field) = { ... } + * .google.protobuf.Timestamp gte = 6 [json_name = "gte", (.buf.validate.predefined) = { ... } */ public Builder setGte( com.google.protobuf.Timestamp.Builder builderForValue) { @@ -2551,7 +2684,7 @@ public Builder setGte( * ``` * * - * .google.protobuf.Timestamp gte = 6 [json_name = "gte", (.buf.validate.priv.field) = { ... } + * .google.protobuf.Timestamp gte = 6 [json_name = "gte", (.buf.validate.predefined) = { ... } */ public Builder mergeGte(com.google.protobuf.Timestamp value) { if (gteBuilder_ == null) { @@ -2595,7 +2728,7 @@ public Builder mergeGte(com.google.protobuf.Timestamp value) { * ``` * * - * .google.protobuf.Timestamp gte = 6 [json_name = "gte", (.buf.validate.priv.field) = { ... } + * .google.protobuf.Timestamp gte = 6 [json_name = "gte", (.buf.validate.predefined) = { ... } */ public Builder clearGte() { if (gteBuilder_ == null) { @@ -2635,7 +2768,7 @@ public Builder clearGte() { * ``` * * - * .google.protobuf.Timestamp gte = 6 [json_name = "gte", (.buf.validate.priv.field) = { ... } + * .google.protobuf.Timestamp gte = 6 [json_name = "gte", (.buf.validate.predefined) = { ... } */ public com.google.protobuf.Timestamp.Builder getGteBuilder() { return getGteFieldBuilder().getBuilder(); @@ -2662,7 +2795,7 @@ public com.google.protobuf.Timestamp.Builder getGteBuilder() { * ``` * * - * .google.protobuf.Timestamp gte = 6 [json_name = "gte", (.buf.validate.priv.field) = { ... } + * .google.protobuf.Timestamp gte = 6 [json_name = "gte", (.buf.validate.predefined) = { ... } */ @java.lang.Override public com.google.protobuf.TimestampOrBuilder getGteOrBuilder() { @@ -2697,7 +2830,7 @@ public com.google.protobuf.TimestampOrBuilder getGteOrBuilder() { * ``` * * - * .google.protobuf.Timestamp gte = 6 [json_name = "gte", (.buf.validate.priv.field) = { ... } + * .google.protobuf.Timestamp gte = 6 [json_name = "gte", (.buf.validate.predefined) = { ... } */ private com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> @@ -2730,7 +2863,7 @@ public com.google.protobuf.TimestampOrBuilder getGteOrBuilder() { * ``` * * - * bool gt_now = 8 [json_name = "gtNow", (.buf.validate.priv.field) = { ... } + * bool gt_now = 8 [json_name = "gtNow", (.buf.validate.predefined) = { ... } * @return Whether the gtNow field is set. */ public boolean hasGtNow() { @@ -2748,7 +2881,7 @@ public boolean hasGtNow() { * ``` * * - * bool gt_now = 8 [json_name = "gtNow", (.buf.validate.priv.field) = { ... } + * bool gt_now = 8 [json_name = "gtNow", (.buf.validate.predefined) = { ... } * @return The gtNow. */ public boolean getGtNow() { @@ -2769,7 +2902,7 @@ public boolean getGtNow() { * ``` * * - * bool gt_now = 8 [json_name = "gtNow", (.buf.validate.priv.field) = { ... } + * bool gt_now = 8 [json_name = "gtNow", (.buf.validate.predefined) = { ... } * @param value The gtNow to set. * @return This builder for chaining. */ @@ -2792,7 +2925,7 @@ public Builder setGtNow(boolean value) { * ``` * * - * bool gt_now = 8 [json_name = "gtNow", (.buf.validate.priv.field) = { ... } + * bool gt_now = 8 [json_name = "gtNow", (.buf.validate.predefined) = { ... } * @return This builder for chaining. */ public Builder clearGtNow() { @@ -2819,7 +2952,7 @@ public Builder clearGtNow() { * ``` * * - * optional .google.protobuf.Duration within = 9 [json_name = "within", (.buf.validate.priv.field) = { ... } + * optional .google.protobuf.Duration within = 9 [json_name = "within", (.buf.validate.predefined) = { ... } * @return Whether the within field is set. */ public boolean hasWithin() { @@ -2837,7 +2970,7 @@ public boolean hasWithin() { * ``` * * - * optional .google.protobuf.Duration within = 9 [json_name = "within", (.buf.validate.priv.field) = { ... } + * optional .google.protobuf.Duration within = 9 [json_name = "within", (.buf.validate.predefined) = { ... } * @return The within. */ public com.google.protobuf.Duration getWithin() { @@ -2859,7 +2992,7 @@ public com.google.protobuf.Duration getWithin() { * ``` * * - * optional .google.protobuf.Duration within = 9 [json_name = "within", (.buf.validate.priv.field) = { ... } + * optional .google.protobuf.Duration within = 9 [json_name = "within", (.buf.validate.predefined) = { ... } */ public Builder setWithin(com.google.protobuf.Duration value) { if (withinBuilder_ == null) { @@ -2886,7 +3019,7 @@ public Builder setWithin(com.google.protobuf.Duration value) { * ``` * * - * optional .google.protobuf.Duration within = 9 [json_name = "within", (.buf.validate.priv.field) = { ... } + * optional .google.protobuf.Duration within = 9 [json_name = "within", (.buf.validate.predefined) = { ... } */ public Builder setWithin( com.google.protobuf.Duration.Builder builderForValue) { @@ -2911,7 +3044,7 @@ public Builder setWithin( * ``` * * - * optional .google.protobuf.Duration within = 9 [json_name = "within", (.buf.validate.priv.field) = { ... } + * optional .google.protobuf.Duration within = 9 [json_name = "within", (.buf.validate.predefined) = { ... } */ public Builder mergeWithin(com.google.protobuf.Duration value) { if (withinBuilder_ == null) { @@ -2943,7 +3076,7 @@ public Builder mergeWithin(com.google.protobuf.Duration value) { * ``` * * - * optional .google.protobuf.Duration within = 9 [json_name = "within", (.buf.validate.priv.field) = { ... } + * optional .google.protobuf.Duration within = 9 [json_name = "within", (.buf.validate.predefined) = { ... } */ public Builder clearWithin() { bitField0_ = (bitField0_ & ~0x00000080); @@ -2967,7 +3100,7 @@ public Builder clearWithin() { * ``` * * - * optional .google.protobuf.Duration within = 9 [json_name = "within", (.buf.validate.priv.field) = { ... } + * optional .google.protobuf.Duration within = 9 [json_name = "within", (.buf.validate.predefined) = { ... } */ public com.google.protobuf.Duration.Builder getWithinBuilder() { bitField0_ |= 0x00000080; @@ -2986,7 +3119,7 @@ public com.google.protobuf.Duration.Builder getWithinBuilder() { * ``` * * - * optional .google.protobuf.Duration within = 9 [json_name = "within", (.buf.validate.priv.field) = { ... } + * optional .google.protobuf.Duration within = 9 [json_name = "within", (.buf.validate.predefined) = { ... } */ public com.google.protobuf.DurationOrBuilder getWithinOrBuilder() { if (withinBuilder_ != null) { @@ -3008,7 +3141,7 @@ public com.google.protobuf.DurationOrBuilder getWithinOrBuilder() { * ``` * * - * optional .google.protobuf.Duration within = 9 [json_name = "within", (.buf.validate.priv.field) = { ... } + * optional .google.protobuf.Duration within = 9 [json_name = "within", (.buf.validate.predefined) = { ... } */ private com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> @@ -3024,6 +3157,246 @@ public com.google.protobuf.DurationOrBuilder getWithinOrBuilder() { return withinBuilder_; } + private java.util.List example_ = + java.util.Collections.emptyList(); + private void ensureExampleIsMutable() { + if (!((bitField0_ & 0x00000100) != 0)) { + example_ = new java.util.ArrayList(example_); + bitField0_ |= 0x00000100; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> exampleBuilder_; + + /** + * repeated .google.protobuf.Timestamp example = 10 [json_name = "example", (.buf.validate.predefined) = { ... } + */ + public java.util.List getExampleList() { + if (exampleBuilder_ == null) { + return java.util.Collections.unmodifiableList(example_); + } else { + return exampleBuilder_.getMessageList(); + } + } + /** + * repeated .google.protobuf.Timestamp example = 10 [json_name = "example", (.buf.validate.predefined) = { ... } + */ + public int getExampleCount() { + if (exampleBuilder_ == null) { + return example_.size(); + } else { + return exampleBuilder_.getCount(); + } + } + /** + * repeated .google.protobuf.Timestamp example = 10 [json_name = "example", (.buf.validate.predefined) = { ... } + */ + public com.google.protobuf.Timestamp getExample(int index) { + if (exampleBuilder_ == null) { + return example_.get(index); + } else { + return exampleBuilder_.getMessage(index); + } + } + /** + * repeated .google.protobuf.Timestamp example = 10 [json_name = "example", (.buf.validate.predefined) = { ... } + */ + public Builder setExample( + int index, com.google.protobuf.Timestamp value) { + if (exampleBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureExampleIsMutable(); + example_.set(index, value); + onChanged(); + } else { + exampleBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .google.protobuf.Timestamp example = 10 [json_name = "example", (.buf.validate.predefined) = { ... } + */ + public Builder setExample( + int index, com.google.protobuf.Timestamp.Builder builderForValue) { + if (exampleBuilder_ == null) { + ensureExampleIsMutable(); + example_.set(index, builderForValue.build()); + onChanged(); + } else { + exampleBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .google.protobuf.Timestamp example = 10 [json_name = "example", (.buf.validate.predefined) = { ... } + */ + public Builder addExample(com.google.protobuf.Timestamp value) { + if (exampleBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureExampleIsMutable(); + example_.add(value); + onChanged(); + } else { + exampleBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .google.protobuf.Timestamp example = 10 [json_name = "example", (.buf.validate.predefined) = { ... } + */ + public Builder addExample( + int index, com.google.protobuf.Timestamp value) { + if (exampleBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureExampleIsMutable(); + example_.add(index, value); + onChanged(); + } else { + exampleBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .google.protobuf.Timestamp example = 10 [json_name = "example", (.buf.validate.predefined) = { ... } + */ + public Builder addExample( + com.google.protobuf.Timestamp.Builder builderForValue) { + if (exampleBuilder_ == null) { + ensureExampleIsMutable(); + example_.add(builderForValue.build()); + onChanged(); + } else { + exampleBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .google.protobuf.Timestamp example = 10 [json_name = "example", (.buf.validate.predefined) = { ... } + */ + public Builder addExample( + int index, com.google.protobuf.Timestamp.Builder builderForValue) { + if (exampleBuilder_ == null) { + ensureExampleIsMutable(); + example_.add(index, builderForValue.build()); + onChanged(); + } else { + exampleBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .google.protobuf.Timestamp example = 10 [json_name = "example", (.buf.validate.predefined) = { ... } + */ + public Builder addAllExample( + java.lang.Iterable values) { + if (exampleBuilder_ == null) { + ensureExampleIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, example_); + onChanged(); + } else { + exampleBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .google.protobuf.Timestamp example = 10 [json_name = "example", (.buf.validate.predefined) = { ... } + */ + public Builder clearExample() { + if (exampleBuilder_ == null) { + example_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000100); + onChanged(); + } else { + exampleBuilder_.clear(); + } + return this; + } + /** + * repeated .google.protobuf.Timestamp example = 10 [json_name = "example", (.buf.validate.predefined) = { ... } + */ + public Builder removeExample(int index) { + if (exampleBuilder_ == null) { + ensureExampleIsMutable(); + example_.remove(index); + onChanged(); + } else { + exampleBuilder_.remove(index); + } + return this; + } + /** + * repeated .google.protobuf.Timestamp example = 10 [json_name = "example", (.buf.validate.predefined) = { ... } + */ + public com.google.protobuf.Timestamp.Builder getExampleBuilder( + int index) { + return getExampleFieldBuilder().getBuilder(index); + } + /** + * repeated .google.protobuf.Timestamp example = 10 [json_name = "example", (.buf.validate.predefined) = { ... } + */ + public com.google.protobuf.TimestampOrBuilder getExampleOrBuilder( + int index) { + if (exampleBuilder_ == null) { + return example_.get(index); } else { + return exampleBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .google.protobuf.Timestamp example = 10 [json_name = "example", (.buf.validate.predefined) = { ... } + */ + public java.util.List + getExampleOrBuilderList() { + if (exampleBuilder_ != null) { + return exampleBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(example_); + } + } + /** + * repeated .google.protobuf.Timestamp example = 10 [json_name = "example", (.buf.validate.predefined) = { ... } + */ + public com.google.protobuf.Timestamp.Builder addExampleBuilder() { + return getExampleFieldBuilder().addBuilder( + com.google.protobuf.Timestamp.getDefaultInstance()); + } + /** + * repeated .google.protobuf.Timestamp example = 10 [json_name = "example", (.buf.validate.predefined) = { ... } + */ + public com.google.protobuf.Timestamp.Builder addExampleBuilder( + int index) { + return getExampleFieldBuilder().addBuilder( + index, com.google.protobuf.Timestamp.getDefaultInstance()); + } + /** + * repeated .google.protobuf.Timestamp example = 10 [json_name = "example", (.buf.validate.predefined) = { ... } + */ + public java.util.List + getExampleBuilderList() { + return getExampleFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> + getExampleFieldBuilder() { + if (exampleBuilder_ == null) { + exampleBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>( + example_, + ((bitField0_ & 0x00000100) != 0), + getParentForChildren(), + isClean()); + example_ = null; + } + return exampleBuilder_; + } + // @@protoc_insertion_point(builder_scope:buf.validate.TimestampRules) } diff --git a/src/main/java/build/buf/validate/TimestampRulesOrBuilder.java b/src/main/java/build/buf/validate/TimestampRulesOrBuilder.java index 763d854d..fb233a33 100644 --- a/src/main/java/build/buf/validate/TimestampRulesOrBuilder.java +++ b/src/main/java/build/buf/validate/TimestampRulesOrBuilder.java @@ -7,7 +7,8 @@ public interface TimestampRulesOrBuilder extends // @@protoc_insertion_point(interface_extends:buf.validate.TimestampRules) - com.google.protobuf.MessageOrBuilder { + com.google.protobuf.GeneratedMessage. + ExtendableMessageOrBuilder { /** *
@@ -21,7 +22,7 @@ public interface TimestampRulesOrBuilder extends
    * ```
    * 
* - * optional .google.protobuf.Timestamp const = 2 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional .google.protobuf.Timestamp const = 2 [json_name = "const", (.buf.validate.predefined) = { ... } * @return Whether the const field is set. */ boolean hasConst(); @@ -37,7 +38,7 @@ public interface TimestampRulesOrBuilder extends * ``` * * - * optional .google.protobuf.Timestamp const = 2 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional .google.protobuf.Timestamp const = 2 [json_name = "const", (.buf.validate.predefined) = { ... } * @return The const. */ com.google.protobuf.Timestamp getConst(); @@ -53,7 +54,7 @@ public interface TimestampRulesOrBuilder extends * ``` * * - * optional .google.protobuf.Timestamp const = 2 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional .google.protobuf.Timestamp const = 2 [json_name = "const", (.buf.validate.predefined) = { ... } */ com.google.protobuf.TimestampOrBuilder getConstOrBuilder(); @@ -69,7 +70,7 @@ public interface TimestampRulesOrBuilder extends * ``` * * - * .google.protobuf.Timestamp lt = 3 [json_name = "lt", (.buf.validate.priv.field) = { ... } + * .google.protobuf.Timestamp lt = 3 [json_name = "lt", (.buf.validate.predefined) = { ... } * @return Whether the lt field is set. */ boolean hasLt(); @@ -85,7 +86,7 @@ public interface TimestampRulesOrBuilder extends * ``` * * - * .google.protobuf.Timestamp lt = 3 [json_name = "lt", (.buf.validate.priv.field) = { ... } + * .google.protobuf.Timestamp lt = 3 [json_name = "lt", (.buf.validate.predefined) = { ... } * @return The lt. */ com.google.protobuf.Timestamp getLt(); @@ -101,7 +102,7 @@ public interface TimestampRulesOrBuilder extends * ``` * * - * .google.protobuf.Timestamp lt = 3 [json_name = "lt", (.buf.validate.priv.field) = { ... } + * .google.protobuf.Timestamp lt = 3 [json_name = "lt", (.buf.validate.predefined) = { ... } */ com.google.protobuf.TimestampOrBuilder getLtOrBuilder(); @@ -117,7 +118,7 @@ public interface TimestampRulesOrBuilder extends * ``` * * - * .google.protobuf.Timestamp lte = 4 [json_name = "lte", (.buf.validate.priv.field) = { ... } + * .google.protobuf.Timestamp lte = 4 [json_name = "lte", (.buf.validate.predefined) = { ... } * @return Whether the lte field is set. */ boolean hasLte(); @@ -133,7 +134,7 @@ public interface TimestampRulesOrBuilder extends * ``` * * - * .google.protobuf.Timestamp lte = 4 [json_name = "lte", (.buf.validate.priv.field) = { ... } + * .google.protobuf.Timestamp lte = 4 [json_name = "lte", (.buf.validate.predefined) = { ... } * @return The lte. */ com.google.protobuf.Timestamp getLte(); @@ -149,7 +150,7 @@ public interface TimestampRulesOrBuilder extends * ``` * * - * .google.protobuf.Timestamp lte = 4 [json_name = "lte", (.buf.validate.priv.field) = { ... } + * .google.protobuf.Timestamp lte = 4 [json_name = "lte", (.buf.validate.predefined) = { ... } */ com.google.protobuf.TimestampOrBuilder getLteOrBuilder(); @@ -165,7 +166,7 @@ public interface TimestampRulesOrBuilder extends * ``` * * - * bool lt_now = 7 [json_name = "ltNow", (.buf.validate.priv.field) = { ... } + * bool lt_now = 7 [json_name = "ltNow", (.buf.validate.predefined) = { ... } * @return Whether the ltNow field is set. */ boolean hasLtNow(); @@ -181,7 +182,7 @@ public interface TimestampRulesOrBuilder extends * ``` * * - * bool lt_now = 7 [json_name = "ltNow", (.buf.validate.priv.field) = { ... } + * bool lt_now = 7 [json_name = "ltNow", (.buf.validate.predefined) = { ... } * @return The ltNow. */ boolean getLtNow(); @@ -208,7 +209,7 @@ public interface TimestampRulesOrBuilder extends * ``` * * - * .google.protobuf.Timestamp gt = 5 [json_name = "gt", (.buf.validate.priv.field) = { ... } + * .google.protobuf.Timestamp gt = 5 [json_name = "gt", (.buf.validate.predefined) = { ... } * @return Whether the gt field is set. */ boolean hasGt(); @@ -234,7 +235,7 @@ public interface TimestampRulesOrBuilder extends * ``` * * - * .google.protobuf.Timestamp gt = 5 [json_name = "gt", (.buf.validate.priv.field) = { ... } + * .google.protobuf.Timestamp gt = 5 [json_name = "gt", (.buf.validate.predefined) = { ... } * @return The gt. */ com.google.protobuf.Timestamp getGt(); @@ -260,7 +261,7 @@ public interface TimestampRulesOrBuilder extends * ``` * * - * .google.protobuf.Timestamp gt = 5 [json_name = "gt", (.buf.validate.priv.field) = { ... } + * .google.protobuf.Timestamp gt = 5 [json_name = "gt", (.buf.validate.predefined) = { ... } */ com.google.protobuf.TimestampOrBuilder getGtOrBuilder(); @@ -286,7 +287,7 @@ public interface TimestampRulesOrBuilder extends * ``` * * - * .google.protobuf.Timestamp gte = 6 [json_name = "gte", (.buf.validate.priv.field) = { ... } + * .google.protobuf.Timestamp gte = 6 [json_name = "gte", (.buf.validate.predefined) = { ... } * @return Whether the gte field is set. */ boolean hasGte(); @@ -312,7 +313,7 @@ public interface TimestampRulesOrBuilder extends * ``` * * - * .google.protobuf.Timestamp gte = 6 [json_name = "gte", (.buf.validate.priv.field) = { ... } + * .google.protobuf.Timestamp gte = 6 [json_name = "gte", (.buf.validate.predefined) = { ... } * @return The gte. */ com.google.protobuf.Timestamp getGte(); @@ -338,7 +339,7 @@ public interface TimestampRulesOrBuilder extends * ``` * * - * .google.protobuf.Timestamp gte = 6 [json_name = "gte", (.buf.validate.priv.field) = { ... } + * .google.protobuf.Timestamp gte = 6 [json_name = "gte", (.buf.validate.predefined) = { ... } */ com.google.protobuf.TimestampOrBuilder getGteOrBuilder(); @@ -354,7 +355,7 @@ public interface TimestampRulesOrBuilder extends * ``` * * - * bool gt_now = 8 [json_name = "gtNow", (.buf.validate.priv.field) = { ... } + * bool gt_now = 8 [json_name = "gtNow", (.buf.validate.predefined) = { ... } * @return Whether the gtNow field is set. */ boolean hasGtNow(); @@ -370,7 +371,7 @@ public interface TimestampRulesOrBuilder extends * ``` * * - * bool gt_now = 8 [json_name = "gtNow", (.buf.validate.priv.field) = { ... } + * bool gt_now = 8 [json_name = "gtNow", (.buf.validate.predefined) = { ... } * @return The gtNow. */ boolean getGtNow(); @@ -387,7 +388,7 @@ public interface TimestampRulesOrBuilder extends * ``` * * - * optional .google.protobuf.Duration within = 9 [json_name = "within", (.buf.validate.priv.field) = { ... } + * optional .google.protobuf.Duration within = 9 [json_name = "within", (.buf.validate.predefined) = { ... } * @return Whether the within field is set. */ boolean hasWithin(); @@ -403,7 +404,7 @@ public interface TimestampRulesOrBuilder extends * ``` * * - * optional .google.protobuf.Duration within = 9 [json_name = "within", (.buf.validate.priv.field) = { ... } + * optional .google.protobuf.Duration within = 9 [json_name = "within", (.buf.validate.predefined) = { ... } * @return The within. */ com.google.protobuf.Duration getWithin(); @@ -419,10 +420,34 @@ public interface TimestampRulesOrBuilder extends * ``` * * - * optional .google.protobuf.Duration within = 9 [json_name = "within", (.buf.validate.priv.field) = { ... } + * optional .google.protobuf.Duration within = 9 [json_name = "within", (.buf.validate.predefined) = { ... } */ com.google.protobuf.DurationOrBuilder getWithinOrBuilder(); + /** + * repeated .google.protobuf.Timestamp example = 10 [json_name = "example", (.buf.validate.predefined) = { ... } + */ + java.util.List + getExampleList(); + /** + * repeated .google.protobuf.Timestamp example = 10 [json_name = "example", (.buf.validate.predefined) = { ... } + */ + com.google.protobuf.Timestamp getExample(int index); + /** + * repeated .google.protobuf.Timestamp example = 10 [json_name = "example", (.buf.validate.predefined) = { ... } + */ + int getExampleCount(); + /** + * repeated .google.protobuf.Timestamp example = 10 [json_name = "example", (.buf.validate.predefined) = { ... } + */ + java.util.List + getExampleOrBuilderList(); + /** + * repeated .google.protobuf.Timestamp example = 10 [json_name = "example", (.buf.validate.predefined) = { ... } + */ + com.google.protobuf.TimestampOrBuilder getExampleOrBuilder( + int index); + build.buf.validate.TimestampRules.LessThanCase getLessThanCase(); build.buf.validate.TimestampRules.GreaterThanCase getGreaterThanCase(); diff --git a/src/main/java/build/buf/validate/UInt32Rules.java b/src/main/java/build/buf/validate/UInt32Rules.java index e8cd0571..b54ea628 100644 --- a/src/main/java/build/buf/validate/UInt32Rules.java +++ b/src/main/java/build/buf/validate/UInt32Rules.java @@ -14,7 +14,8 @@ * Protobuf type {@code buf.validate.UInt32Rules} */ public final class UInt32Rules extends - com.google.protobuf.GeneratedMessage implements + com.google.protobuf.GeneratedMessage.ExtendableMessage< + UInt32Rules> implements // @@protoc_insertion_point(message_implements:buf.validate.UInt32Rules) UInt32RulesOrBuilder { private static final long serialVersionUID = 0L; @@ -28,12 +29,13 @@ public final class UInt32Rules extends UInt32Rules.class.getName()); } // Use UInt32Rules.newBuilder() to construct. - private UInt32Rules(com.google.protobuf.GeneratedMessage.Builder builder) { + private UInt32Rules(com.google.protobuf.GeneratedMessage.ExtendableBuilder builder) { super(builder); } private UInt32Rules() { in_ = emptyIntList(); notIn_ = emptyIntList(); + example_ = emptyIntList(); } public static final com.google.protobuf.Descriptors.Descriptor @@ -149,7 +151,7 @@ public int getNumber() { * ``` * * - * optional uint32 const = 1 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional uint32 const = 1 [json_name = "const", (.buf.validate.predefined) = { ... } * @return Whether the const field is set. */ @java.lang.Override @@ -169,7 +171,7 @@ public boolean hasConst() { * ``` * * - * optional uint32 const = 1 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional uint32 const = 1 [json_name = "const", (.buf.validate.predefined) = { ... } * @return The const. */ @java.lang.Override @@ -192,7 +194,7 @@ public int getConst() { * ``` * * - * uint32 lt = 2 [json_name = "lt", (.buf.validate.priv.field) = { ... } + * uint32 lt = 2 [json_name = "lt", (.buf.validate.predefined) = { ... } * @return Whether the lt field is set. */ @java.lang.Override @@ -213,7 +215,7 @@ public boolean hasLt() { * ``` * * - * uint32 lt = 2 [json_name = "lt", (.buf.validate.priv.field) = { ... } + * uint32 lt = 2 [json_name = "lt", (.buf.validate.predefined) = { ... } * @return The lt. */ @java.lang.Override @@ -239,7 +241,7 @@ public int getLt() { * ``` * * - * uint32 lte = 3 [json_name = "lte", (.buf.validate.priv.field) = { ... } + * uint32 lte = 3 [json_name = "lte", (.buf.validate.predefined) = { ... } * @return Whether the lte field is set. */ @java.lang.Override @@ -260,7 +262,7 @@ public boolean hasLte() { * ``` * * - * uint32 lte = 3 [json_name = "lte", (.buf.validate.priv.field) = { ... } + * uint32 lte = 3 [json_name = "lte", (.buf.validate.predefined) = { ... } * @return The lte. */ @java.lang.Override @@ -294,7 +296,7 @@ public int getLte() { * ``` * * - * uint32 gt = 4 [json_name = "gt", (.buf.validate.priv.field) = { ... } + * uint32 gt = 4 [json_name = "gt", (.buf.validate.predefined) = { ... } * @return Whether the gt field is set. */ @java.lang.Override @@ -323,7 +325,7 @@ public boolean hasGt() { * ``` * * - * uint32 gt = 4 [json_name = "gt", (.buf.validate.priv.field) = { ... } + * uint32 gt = 4 [json_name = "gt", (.buf.validate.predefined) = { ... } * @return The gt. */ @java.lang.Override @@ -357,7 +359,7 @@ public int getGt() { * ``` * * - * uint32 gte = 5 [json_name = "gte", (.buf.validate.priv.field) = { ... } + * uint32 gte = 5 [json_name = "gte", (.buf.validate.predefined) = { ... } * @return Whether the gte field is set. */ @java.lang.Override @@ -386,7 +388,7 @@ public boolean hasGte() { * ``` * * - * uint32 gte = 5 [json_name = "gte", (.buf.validate.priv.field) = { ... } + * uint32 gte = 5 [json_name = "gte", (.buf.validate.predefined) = { ... } * @return The gte. */ @java.lang.Override @@ -415,7 +417,7 @@ public int getGte() { * ``` * * - * repeated uint32 in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated uint32 in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @return A list containing the in. */ @java.lang.Override @@ -437,7 +439,7 @@ public int getGte() { * ``` * * - * repeated uint32 in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated uint32 in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @return The count of in. */ public int getInCount() { @@ -457,14 +459,13 @@ public int getInCount() { * ``` * * - * repeated uint32 in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated uint32 in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @param index The index of the element to return. * @return The in at the given index. */ public int getIn(int index) { return in_.getInt(index); } - private int inMemoizedSerializedSize = -1; public static final int NOT_IN_FIELD_NUMBER = 7; @SuppressWarnings("serial") @@ -484,7 +485,7 @@ public int getIn(int index) { * ``` * * - * repeated uint32 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated uint32 not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @return A list containing the notIn. */ @java.lang.Override @@ -506,7 +507,7 @@ public int getIn(int index) { * ``` * * - * repeated uint32 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated uint32 not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @return The count of notIn. */ public int getNotInCount() { @@ -526,14 +527,87 @@ public int getNotInCount() { * ``` * * - * repeated uint32 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated uint32 not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @param index The index of the element to return. * @return The notIn at the given index. */ public int getNotIn(int index) { return notIn_.getInt(index); } - private int notInMemoizedSerializedSize = -1; + + public static final int EXAMPLE_FIELD_NUMBER = 8; + @SuppressWarnings("serial") + private com.google.protobuf.Internal.IntList example_ = + emptyIntList(); + /** + *
+   * `example` specifies values that the field may have. These values SHOULD
+   * conform to other constraints. `example` values will not impact validation
+   * but may be used as helpful guidance on how to populate the given field.
+   *
+   * ```proto
+   * message MyUInt32 {
+   * uint32 value = 1 [
+   * (buf.validate.field).uint32.example = 1,
+   * (buf.validate.field).uint32.example = 10
+   * ];
+   * }
+   * ```
+   * 
+ * + * repeated uint32 example = 8 [json_name = "example", (.buf.validate.predefined) = { ... } + * @return A list containing the example. + */ + @java.lang.Override + public java.util.List + getExampleList() { + return example_; + } + /** + *
+   * `example` specifies values that the field may have. These values SHOULD
+   * conform to other constraints. `example` values will not impact validation
+   * but may be used as helpful guidance on how to populate the given field.
+   *
+   * ```proto
+   * message MyUInt32 {
+   * uint32 value = 1 [
+   * (buf.validate.field).uint32.example = 1,
+   * (buf.validate.field).uint32.example = 10
+   * ];
+   * }
+   * ```
+   * 
+ * + * repeated uint32 example = 8 [json_name = "example", (.buf.validate.predefined) = { ... } + * @return The count of example. + */ + public int getExampleCount() { + return example_.size(); + } + /** + *
+   * `example` specifies values that the field may have. These values SHOULD
+   * conform to other constraints. `example` values will not impact validation
+   * but may be used as helpful guidance on how to populate the given field.
+   *
+   * ```proto
+   * message MyUInt32 {
+   * uint32 value = 1 [
+   * (buf.validate.field).uint32.example = 1,
+   * (buf.validate.field).uint32.example = 10
+   * ];
+   * }
+   * ```
+   * 
+ * + * repeated uint32 example = 8 [json_name = "example", (.buf.validate.predefined) = { ... } + * @param index The index of the element to return. + * @return The example at the given index. + */ + public int getExample(int index) { + return example_.getInt(index); + } private byte memoizedIsInitialized = -1; @java.lang.Override @@ -542,6 +616,10 @@ public final boolean isInitialized() { if (isInitialized == 1) return true; if (isInitialized == 0) return false; + if (!extensionsAreInitialized()) { + memoizedIsInitialized = 0; + return false; + } memoizedIsInitialized = 1; return true; } @@ -549,7 +627,9 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - getSerializedSize(); + com.google.protobuf.GeneratedMessage + .ExtendableMessage.ExtensionSerializer + extensionWriter = newExtensionSerializer(); if (((bitField0_ & 0x00000001) != 0)) { output.writeUInt32(1, const_); } @@ -569,20 +649,16 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) output.writeUInt32( 5, (int)((java.lang.Integer) greaterThan_)); } - if (getInList().size() > 0) { - output.writeUInt32NoTag(50); - output.writeUInt32NoTag(inMemoizedSerializedSize); - } for (int i = 0; i < in_.size(); i++) { - output.writeUInt32NoTag(in_.getInt(i)); - } - if (getNotInList().size() > 0) { - output.writeUInt32NoTag(58); - output.writeUInt32NoTag(notInMemoizedSerializedSize); + output.writeUInt32(6, in_.getInt(i)); } for (int i = 0; i < notIn_.size(); i++) { - output.writeUInt32NoTag(notIn_.getInt(i)); + output.writeUInt32(7, notIn_.getInt(i)); + } + for (int i = 0; i < example_.size(); i++) { + output.writeUInt32(8, example_.getInt(i)); } + extensionWriter.writeUntil(536870912, output); getUnknownFields().writeTo(output); } @@ -623,12 +699,7 @@ public int getSerializedSize() { .computeUInt32SizeNoTag(in_.getInt(i)); } size += dataSize; - if (!getInList().isEmpty()) { - size += 1; - size += com.google.protobuf.CodedOutputStream - .computeInt32SizeNoTag(dataSize); - } - inMemoizedSerializedSize = dataSize; + size += 1 * getInList().size(); } { int dataSize = 0; @@ -637,13 +708,18 @@ public int getSerializedSize() { .computeUInt32SizeNoTag(notIn_.getInt(i)); } size += dataSize; - if (!getNotInList().isEmpty()) { - size += 1; - size += com.google.protobuf.CodedOutputStream - .computeInt32SizeNoTag(dataSize); + size += 1 * getNotInList().size(); + } + { + int dataSize = 0; + for (int i = 0; i < example_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream + .computeUInt32SizeNoTag(example_.getInt(i)); } - notInMemoizedSerializedSize = dataSize; + size += dataSize; + size += 1 * getExampleList().size(); } + size += extensionsSerializedSize(); size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -668,6 +744,8 @@ public boolean equals(final java.lang.Object obj) { .equals(other.getInList())) return false; if (!getNotInList() .equals(other.getNotInList())) return false; + if (!getExampleList() + .equals(other.getExampleList())) return false; if (!getLessThanCase().equals(other.getLessThanCase())) return false; switch (lessThanCase_) { case 2: @@ -695,6 +773,8 @@ public boolean equals(final java.lang.Object obj) { default: } if (!getUnknownFields().equals(other.getUnknownFields())) return false; + if (!getExtensionFields().equals(other.getExtensionFields())) + return false; return true; } @@ -717,6 +797,10 @@ public int hashCode() { hash = (37 * hash) + NOT_IN_FIELD_NUMBER; hash = (53 * hash) + getNotInList().hashCode(); } + if (getExampleCount() > 0) { + hash = (37 * hash) + EXAMPLE_FIELD_NUMBER; + hash = (53 * hash) + getExampleList().hashCode(); + } switch (lessThanCase_) { case 2: hash = (37 * hash) + LT_FIELD_NUMBER; @@ -741,6 +825,7 @@ public int hashCode() { case 0: default: } + hash = hashFields(hash, getExtensionFields()); hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -847,7 +932,8 @@ protected Builder newBuilderForType( * Protobuf type {@code buf.validate.UInt32Rules} */ public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder implements + com.google.protobuf.GeneratedMessage.ExtendableBuilder< + build.buf.validate.UInt32Rules, Builder> implements // @@protoc_insertion_point(builder_implements:buf.validate.UInt32Rules) build.buf.validate.UInt32RulesOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor @@ -880,6 +966,7 @@ public Builder clear() { const_ = 0; in_ = emptyIntList(); notIn_ = emptyIntList(); + example_ = emptyIntList(); lessThanCase_ = 0; lessThan_ = null; greaterThanCase_ = 0; @@ -931,6 +1018,10 @@ private void buildPartial0(build.buf.validate.UInt32Rules result) { notIn_.makeImmutable(); result.notIn_ = notIn_; } + if (((from_bitField0_ & 0x00000080) != 0)) { + example_.makeImmutable(); + result.example_ = example_; + } result.bitField0_ |= to_bitField0_; } @@ -978,6 +1069,17 @@ public Builder mergeFrom(build.buf.validate.UInt32Rules other) { } onChanged(); } + if (!other.example_.isEmpty()) { + if (example_.isEmpty()) { + example_ = other.example_; + example_.makeImmutable(); + bitField0_ |= 0x00000080; + } else { + ensureExampleIsMutable(); + example_.addAll(other.example_); + } + onChanged(); + } switch (other.getLessThanCase()) { case LT: { setLt(other.getLt()); @@ -1004,6 +1106,7 @@ public Builder mergeFrom(build.buf.validate.UInt32Rules other) { break; } } + this.mergeExtensionFields(other); this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -1011,6 +1114,9 @@ public Builder mergeFrom(build.buf.validate.UInt32Rules other) { @java.lang.Override public final boolean isInitialized() { + if (!extensionsAreInitialized()) { + return false; + } return true; } @@ -1087,6 +1193,22 @@ public Builder mergeFrom( input.popLimit(limit); break; } // case 58 + case 64: { + int v = input.readUInt32(); + ensureExampleIsMutable(); + example_.addInt(v); + break; + } // case 64 + case 66: { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + ensureExampleIsMutable(); + while (input.getBytesUntilLimit() > 0) { + example_.addInt(input.readUInt32()); + } + input.popLimit(limit); + break; + } // case 66 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { done = true; // was an endgroup tag @@ -1148,7 +1270,7 @@ public Builder clearGreaterThan() { * ``` * * - * optional uint32 const = 1 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional uint32 const = 1 [json_name = "const", (.buf.validate.predefined) = { ... } * @return Whether the const field is set. */ @java.lang.Override @@ -1168,7 +1290,7 @@ public boolean hasConst() { * ``` * * - * optional uint32 const = 1 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional uint32 const = 1 [json_name = "const", (.buf.validate.predefined) = { ... } * @return The const. */ @java.lang.Override @@ -1188,7 +1310,7 @@ public int getConst() { * ``` * * - * optional uint32 const = 1 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional uint32 const = 1 [json_name = "const", (.buf.validate.predefined) = { ... } * @param value The const to set. * @return This builder for chaining. */ @@ -1212,7 +1334,7 @@ public Builder setConst(int value) { * ``` * * - * optional uint32 const = 1 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional uint32 const = 1 [json_name = "const", (.buf.validate.predefined) = { ... } * @return This builder for chaining. */ public Builder clearConst() { @@ -1236,7 +1358,7 @@ public Builder clearConst() { * ``` * * - * uint32 lt = 2 [json_name = "lt", (.buf.validate.priv.field) = { ... } + * uint32 lt = 2 [json_name = "lt", (.buf.validate.predefined) = { ... } * @return Whether the lt field is set. */ public boolean hasLt() { @@ -1256,7 +1378,7 @@ public boolean hasLt() { * ``` * * - * uint32 lt = 2 [json_name = "lt", (.buf.validate.priv.field) = { ... } + * uint32 lt = 2 [json_name = "lt", (.buf.validate.predefined) = { ... } * @return The lt. */ public int getLt() { @@ -1279,7 +1401,7 @@ public int getLt() { * ``` * * - * uint32 lt = 2 [json_name = "lt", (.buf.validate.priv.field) = { ... } + * uint32 lt = 2 [json_name = "lt", (.buf.validate.predefined) = { ... } * @param value The lt to set. * @return This builder for chaining. */ @@ -1304,7 +1426,7 @@ public Builder setLt(int value) { * ``` * * - * uint32 lt = 2 [json_name = "lt", (.buf.validate.priv.field) = { ... } + * uint32 lt = 2 [json_name = "lt", (.buf.validate.predefined) = { ... } * @return This builder for chaining. */ public Builder clearLt() { @@ -1330,7 +1452,7 @@ public Builder clearLt() { * ``` * * - * uint32 lte = 3 [json_name = "lte", (.buf.validate.priv.field) = { ... } + * uint32 lte = 3 [json_name = "lte", (.buf.validate.predefined) = { ... } * @return Whether the lte field is set. */ public boolean hasLte() { @@ -1350,7 +1472,7 @@ public boolean hasLte() { * ``` * * - * uint32 lte = 3 [json_name = "lte", (.buf.validate.priv.field) = { ... } + * uint32 lte = 3 [json_name = "lte", (.buf.validate.predefined) = { ... } * @return The lte. */ public int getLte() { @@ -1373,7 +1495,7 @@ public int getLte() { * ``` * * - * uint32 lte = 3 [json_name = "lte", (.buf.validate.priv.field) = { ... } + * uint32 lte = 3 [json_name = "lte", (.buf.validate.predefined) = { ... } * @param value The lte to set. * @return This builder for chaining. */ @@ -1398,7 +1520,7 @@ public Builder setLte(int value) { * ``` * * - * uint32 lte = 3 [json_name = "lte", (.buf.validate.priv.field) = { ... } + * uint32 lte = 3 [json_name = "lte", (.buf.validate.predefined) = { ... } * @return This builder for chaining. */ public Builder clearLte() { @@ -1432,7 +1554,7 @@ public Builder clearLte() { * ``` * * - * uint32 gt = 4 [json_name = "gt", (.buf.validate.priv.field) = { ... } + * uint32 gt = 4 [json_name = "gt", (.buf.validate.predefined) = { ... } * @return Whether the gt field is set. */ public boolean hasGt() { @@ -1460,7 +1582,7 @@ public boolean hasGt() { * ``` * * - * uint32 gt = 4 [json_name = "gt", (.buf.validate.priv.field) = { ... } + * uint32 gt = 4 [json_name = "gt", (.buf.validate.predefined) = { ... } * @return The gt. */ public int getGt() { @@ -1491,7 +1613,7 @@ public int getGt() { * ``` * * - * uint32 gt = 4 [json_name = "gt", (.buf.validate.priv.field) = { ... } + * uint32 gt = 4 [json_name = "gt", (.buf.validate.predefined) = { ... } * @param value The gt to set. * @return This builder for chaining. */ @@ -1524,7 +1646,7 @@ public Builder setGt(int value) { * ``` * * - * uint32 gt = 4 [json_name = "gt", (.buf.validate.priv.field) = { ... } + * uint32 gt = 4 [json_name = "gt", (.buf.validate.predefined) = { ... } * @return This builder for chaining. */ public Builder clearGt() { @@ -1558,7 +1680,7 @@ public Builder clearGt() { * ``` * * - * uint32 gte = 5 [json_name = "gte", (.buf.validate.priv.field) = { ... } + * uint32 gte = 5 [json_name = "gte", (.buf.validate.predefined) = { ... } * @return Whether the gte field is set. */ public boolean hasGte() { @@ -1586,7 +1708,7 @@ public boolean hasGte() { * ``` * * - * uint32 gte = 5 [json_name = "gte", (.buf.validate.priv.field) = { ... } + * uint32 gte = 5 [json_name = "gte", (.buf.validate.predefined) = { ... } * @return The gte. */ public int getGte() { @@ -1617,7 +1739,7 @@ public int getGte() { * ``` * * - * uint32 gte = 5 [json_name = "gte", (.buf.validate.priv.field) = { ... } + * uint32 gte = 5 [json_name = "gte", (.buf.validate.predefined) = { ... } * @param value The gte to set. * @return This builder for chaining. */ @@ -1650,7 +1772,7 @@ public Builder setGte(int value) { * ``` * * - * uint32 gte = 5 [json_name = "gte", (.buf.validate.priv.field) = { ... } + * uint32 gte = 5 [json_name = "gte", (.buf.validate.predefined) = { ... } * @return This builder for chaining. */ public Builder clearGte() { @@ -1683,7 +1805,7 @@ private void ensureInIsMutable() { * ``` * * - * repeated uint32 in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated uint32 in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @return A list containing the in. */ public java.util.List @@ -1705,7 +1827,7 @@ private void ensureInIsMutable() { * ``` * * - * repeated uint32 in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated uint32 in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @return The count of in. */ public int getInCount() { @@ -1725,7 +1847,7 @@ public int getInCount() { * ``` * * - * repeated uint32 in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated uint32 in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @param index The index of the element to return. * @return The in at the given index. */ @@ -1746,7 +1868,7 @@ public int getIn(int index) { * ``` * * - * repeated uint32 in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated uint32 in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @param index The index to set the value at. * @param value The in to set. * @return This builder for chaining. @@ -1774,7 +1896,7 @@ public Builder setIn( * ``` * * - * repeated uint32 in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated uint32 in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @param value The in to add. * @return This builder for chaining. */ @@ -1800,7 +1922,7 @@ public Builder addIn(int value) { * ``` * * - * repeated uint32 in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated uint32 in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @param values The in to add. * @return This builder for chaining. */ @@ -1827,7 +1949,7 @@ public Builder addAllIn( * ``` * * - * repeated uint32 in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated uint32 in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @return This builder for chaining. */ public Builder clearIn() { @@ -1858,7 +1980,7 @@ private void ensureNotInIsMutable() { * ``` * * - * repeated uint32 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated uint32 not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @return A list containing the notIn. */ public java.util.List @@ -1880,7 +2002,7 @@ private void ensureNotInIsMutable() { * ``` * * - * repeated uint32 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated uint32 not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @return The count of notIn. */ public int getNotInCount() { @@ -1900,7 +2022,7 @@ public int getNotInCount() { * ``` * * - * repeated uint32 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated uint32 not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @param index The index of the element to return. * @return The notIn at the given index. */ @@ -1921,7 +2043,7 @@ public int getNotIn(int index) { * ``` * * - * repeated uint32 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated uint32 not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @param index The index to set the value at. * @param value The notIn to set. * @return This builder for chaining. @@ -1949,7 +2071,7 @@ public Builder setNotIn( * ``` * * - * repeated uint32 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated uint32 not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @param value The notIn to add. * @return This builder for chaining. */ @@ -1975,7 +2097,7 @@ public Builder addNotIn(int value) { * ``` * * - * repeated uint32 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated uint32 not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @param values The notIn to add. * @return This builder for chaining. */ @@ -2002,7 +2124,7 @@ public Builder addAllNotIn( * ``` * * - * repeated uint32 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated uint32 not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @return This builder for chaining. */ public Builder clearNotIn() { @@ -2012,6 +2134,195 @@ public Builder clearNotIn() { return this; } + private com.google.protobuf.Internal.IntList example_ = emptyIntList(); + private void ensureExampleIsMutable() { + if (!example_.isModifiable()) { + example_ = makeMutableCopy(example_); + } + bitField0_ |= 0x00000080; + } + /** + *
+     * `example` specifies values that the field may have. These values SHOULD
+     * conform to other constraints. `example` values will not impact validation
+     * but may be used as helpful guidance on how to populate the given field.
+     *
+     * ```proto
+     * message MyUInt32 {
+     * uint32 value = 1 [
+     * (buf.validate.field).uint32.example = 1,
+     * (buf.validate.field).uint32.example = 10
+     * ];
+     * }
+     * ```
+     * 
+ * + * repeated uint32 example = 8 [json_name = "example", (.buf.validate.predefined) = { ... } + * @return A list containing the example. + */ + public java.util.List + getExampleList() { + example_.makeImmutable(); + return example_; + } + /** + *
+     * `example` specifies values that the field may have. These values SHOULD
+     * conform to other constraints. `example` values will not impact validation
+     * but may be used as helpful guidance on how to populate the given field.
+     *
+     * ```proto
+     * message MyUInt32 {
+     * uint32 value = 1 [
+     * (buf.validate.field).uint32.example = 1,
+     * (buf.validate.field).uint32.example = 10
+     * ];
+     * }
+     * ```
+     * 
+ * + * repeated uint32 example = 8 [json_name = "example", (.buf.validate.predefined) = { ... } + * @return The count of example. + */ + public int getExampleCount() { + return example_.size(); + } + /** + *
+     * `example` specifies values that the field may have. These values SHOULD
+     * conform to other constraints. `example` values will not impact validation
+     * but may be used as helpful guidance on how to populate the given field.
+     *
+     * ```proto
+     * message MyUInt32 {
+     * uint32 value = 1 [
+     * (buf.validate.field).uint32.example = 1,
+     * (buf.validate.field).uint32.example = 10
+     * ];
+     * }
+     * ```
+     * 
+ * + * repeated uint32 example = 8 [json_name = "example", (.buf.validate.predefined) = { ... } + * @param index The index of the element to return. + * @return The example at the given index. + */ + public int getExample(int index) { + return example_.getInt(index); + } + /** + *
+     * `example` specifies values that the field may have. These values SHOULD
+     * conform to other constraints. `example` values will not impact validation
+     * but may be used as helpful guidance on how to populate the given field.
+     *
+     * ```proto
+     * message MyUInt32 {
+     * uint32 value = 1 [
+     * (buf.validate.field).uint32.example = 1,
+     * (buf.validate.field).uint32.example = 10
+     * ];
+     * }
+     * ```
+     * 
+ * + * repeated uint32 example = 8 [json_name = "example", (.buf.validate.predefined) = { ... } + * @param index The index to set the value at. + * @param value The example to set. + * @return This builder for chaining. + */ + public Builder setExample( + int index, int value) { + + ensureExampleIsMutable(); + example_.setInt(index, value); + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + *
+     * `example` specifies values that the field may have. These values SHOULD
+     * conform to other constraints. `example` values will not impact validation
+     * but may be used as helpful guidance on how to populate the given field.
+     *
+     * ```proto
+     * message MyUInt32 {
+     * uint32 value = 1 [
+     * (buf.validate.field).uint32.example = 1,
+     * (buf.validate.field).uint32.example = 10
+     * ];
+     * }
+     * ```
+     * 
+ * + * repeated uint32 example = 8 [json_name = "example", (.buf.validate.predefined) = { ... } + * @param value The example to add. + * @return This builder for chaining. + */ + public Builder addExample(int value) { + + ensureExampleIsMutable(); + example_.addInt(value); + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + *
+     * `example` specifies values that the field may have. These values SHOULD
+     * conform to other constraints. `example` values will not impact validation
+     * but may be used as helpful guidance on how to populate the given field.
+     *
+     * ```proto
+     * message MyUInt32 {
+     * uint32 value = 1 [
+     * (buf.validate.field).uint32.example = 1,
+     * (buf.validate.field).uint32.example = 10
+     * ];
+     * }
+     * ```
+     * 
+ * + * repeated uint32 example = 8 [json_name = "example", (.buf.validate.predefined) = { ... } + * @param values The example to add. + * @return This builder for chaining. + */ + public Builder addAllExample( + java.lang.Iterable values) { + ensureExampleIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, example_); + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + *
+     * `example` specifies values that the field may have. These values SHOULD
+     * conform to other constraints. `example` values will not impact validation
+     * but may be used as helpful guidance on how to populate the given field.
+     *
+     * ```proto
+     * message MyUInt32 {
+     * uint32 value = 1 [
+     * (buf.validate.field).uint32.example = 1,
+     * (buf.validate.field).uint32.example = 10
+     * ];
+     * }
+     * ```
+     * 
+ * + * repeated uint32 example = 8 [json_name = "example", (.buf.validate.predefined) = { ... } + * @return This builder for chaining. + */ + public Builder clearExample() { + example_ = emptyIntList(); + bitField0_ = (bitField0_ & ~0x00000080); + onChanged(); + return this; + } + // @@protoc_insertion_point(builder_scope:buf.validate.UInt32Rules) } diff --git a/src/main/java/build/buf/validate/UInt32RulesOrBuilder.java b/src/main/java/build/buf/validate/UInt32RulesOrBuilder.java index bcedc4b1..f523e181 100644 --- a/src/main/java/build/buf/validate/UInt32RulesOrBuilder.java +++ b/src/main/java/build/buf/validate/UInt32RulesOrBuilder.java @@ -7,7 +7,8 @@ public interface UInt32RulesOrBuilder extends // @@protoc_insertion_point(interface_extends:buf.validate.UInt32Rules) - com.google.protobuf.MessageOrBuilder { + com.google.protobuf.GeneratedMessage. + ExtendableMessageOrBuilder { /** *
@@ -22,7 +23,7 @@ public interface UInt32RulesOrBuilder extends
    * ```
    * 
* - * optional uint32 const = 1 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional uint32 const = 1 [json_name = "const", (.buf.validate.predefined) = { ... } * @return Whether the const field is set. */ boolean hasConst(); @@ -39,7 +40,7 @@ public interface UInt32RulesOrBuilder extends * ``` * * - * optional uint32 const = 1 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional uint32 const = 1 [json_name = "const", (.buf.validate.predefined) = { ... } * @return The const. */ int getConst(); @@ -58,7 +59,7 @@ public interface UInt32RulesOrBuilder extends * ``` * * - * uint32 lt = 2 [json_name = "lt", (.buf.validate.priv.field) = { ... } + * uint32 lt = 2 [json_name = "lt", (.buf.validate.predefined) = { ... } * @return Whether the lt field is set. */ boolean hasLt(); @@ -76,7 +77,7 @@ public interface UInt32RulesOrBuilder extends * ``` * * - * uint32 lt = 2 [json_name = "lt", (.buf.validate.priv.field) = { ... } + * uint32 lt = 2 [json_name = "lt", (.buf.validate.predefined) = { ... } * @return The lt. */ int getLt(); @@ -95,7 +96,7 @@ public interface UInt32RulesOrBuilder extends * ``` * * - * uint32 lte = 3 [json_name = "lte", (.buf.validate.priv.field) = { ... } + * uint32 lte = 3 [json_name = "lte", (.buf.validate.predefined) = { ... } * @return Whether the lte field is set. */ boolean hasLte(); @@ -113,7 +114,7 @@ public interface UInt32RulesOrBuilder extends * ``` * * - * uint32 lte = 3 [json_name = "lte", (.buf.validate.priv.field) = { ... } + * uint32 lte = 3 [json_name = "lte", (.buf.validate.predefined) = { ... } * @return The lte. */ int getLte(); @@ -140,7 +141,7 @@ public interface UInt32RulesOrBuilder extends * ``` * * - * uint32 gt = 4 [json_name = "gt", (.buf.validate.priv.field) = { ... } + * uint32 gt = 4 [json_name = "gt", (.buf.validate.predefined) = { ... } * @return Whether the gt field is set. */ boolean hasGt(); @@ -166,7 +167,7 @@ public interface UInt32RulesOrBuilder extends * ``` * * - * uint32 gt = 4 [json_name = "gt", (.buf.validate.priv.field) = { ... } + * uint32 gt = 4 [json_name = "gt", (.buf.validate.predefined) = { ... } * @return The gt. */ int getGt(); @@ -193,7 +194,7 @@ public interface UInt32RulesOrBuilder extends * ``` * * - * uint32 gte = 5 [json_name = "gte", (.buf.validate.priv.field) = { ... } + * uint32 gte = 5 [json_name = "gte", (.buf.validate.predefined) = { ... } * @return Whether the gte field is set. */ boolean hasGte(); @@ -219,7 +220,7 @@ public interface UInt32RulesOrBuilder extends * ``` * * - * uint32 gte = 5 [json_name = "gte", (.buf.validate.priv.field) = { ... } + * uint32 gte = 5 [json_name = "gte", (.buf.validate.predefined) = { ... } * @return The gte. */ int getGte(); @@ -238,7 +239,7 @@ public interface UInt32RulesOrBuilder extends * ``` * * - * repeated uint32 in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated uint32 in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @return A list containing the in. */ java.util.List getInList(); @@ -256,7 +257,7 @@ public interface UInt32RulesOrBuilder extends * ``` * * - * repeated uint32 in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated uint32 in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @return The count of in. */ int getInCount(); @@ -274,7 +275,7 @@ public interface UInt32RulesOrBuilder extends * ``` * * - * repeated uint32 in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated uint32 in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @param index The index of the element to return. * @return The in at the given index. */ @@ -294,7 +295,7 @@ public interface UInt32RulesOrBuilder extends * ``` * * - * repeated uint32 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated uint32 not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @return A list containing the notIn. */ java.util.List getNotInList(); @@ -312,7 +313,7 @@ public interface UInt32RulesOrBuilder extends * ``` * * - * repeated uint32 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated uint32 not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @return The count of notIn. */ int getNotInCount(); @@ -330,12 +331,74 @@ public interface UInt32RulesOrBuilder extends * ``` * * - * repeated uint32 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated uint32 not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @param index The index of the element to return. * @return The notIn at the given index. */ int getNotIn(int index); + /** + *
+   * `example` specifies values that the field may have. These values SHOULD
+   * conform to other constraints. `example` values will not impact validation
+   * but may be used as helpful guidance on how to populate the given field.
+   *
+   * ```proto
+   * message MyUInt32 {
+   * uint32 value = 1 [
+   * (buf.validate.field).uint32.example = 1,
+   * (buf.validate.field).uint32.example = 10
+   * ];
+   * }
+   * ```
+   * 
+ * + * repeated uint32 example = 8 [json_name = "example", (.buf.validate.predefined) = { ... } + * @return A list containing the example. + */ + java.util.List getExampleList(); + /** + *
+   * `example` specifies values that the field may have. These values SHOULD
+   * conform to other constraints. `example` values will not impact validation
+   * but may be used as helpful guidance on how to populate the given field.
+   *
+   * ```proto
+   * message MyUInt32 {
+   * uint32 value = 1 [
+   * (buf.validate.field).uint32.example = 1,
+   * (buf.validate.field).uint32.example = 10
+   * ];
+   * }
+   * ```
+   * 
+ * + * repeated uint32 example = 8 [json_name = "example", (.buf.validate.predefined) = { ... } + * @return The count of example. + */ + int getExampleCount(); + /** + *
+   * `example` specifies values that the field may have. These values SHOULD
+   * conform to other constraints. `example` values will not impact validation
+   * but may be used as helpful guidance on how to populate the given field.
+   *
+   * ```proto
+   * message MyUInt32 {
+   * uint32 value = 1 [
+   * (buf.validate.field).uint32.example = 1,
+   * (buf.validate.field).uint32.example = 10
+   * ];
+   * }
+   * ```
+   * 
+ * + * repeated uint32 example = 8 [json_name = "example", (.buf.validate.predefined) = { ... } + * @param index The index of the element to return. + * @return The example at the given index. + */ + int getExample(int index); + build.buf.validate.UInt32Rules.LessThanCase getLessThanCase(); build.buf.validate.UInt32Rules.GreaterThanCase getGreaterThanCase(); diff --git a/src/main/java/build/buf/validate/UInt64Rules.java b/src/main/java/build/buf/validate/UInt64Rules.java index fa685296..6ae32a5e 100644 --- a/src/main/java/build/buf/validate/UInt64Rules.java +++ b/src/main/java/build/buf/validate/UInt64Rules.java @@ -14,7 +14,8 @@ * Protobuf type {@code buf.validate.UInt64Rules} */ public final class UInt64Rules extends - com.google.protobuf.GeneratedMessage implements + com.google.protobuf.GeneratedMessage.ExtendableMessage< + UInt64Rules> implements // @@protoc_insertion_point(message_implements:buf.validate.UInt64Rules) UInt64RulesOrBuilder { private static final long serialVersionUID = 0L; @@ -28,12 +29,13 @@ public final class UInt64Rules extends UInt64Rules.class.getName()); } // Use UInt64Rules.newBuilder() to construct. - private UInt64Rules(com.google.protobuf.GeneratedMessage.Builder builder) { + private UInt64Rules(com.google.protobuf.GeneratedMessage.ExtendableBuilder builder) { super(builder); } private UInt64Rules() { in_ = emptyLongList(); notIn_ = emptyLongList(); + example_ = emptyLongList(); } public static final com.google.protobuf.Descriptors.Descriptor @@ -149,7 +151,7 @@ public int getNumber() { * ``` * * - * optional uint64 const = 1 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional uint64 const = 1 [json_name = "const", (.buf.validate.predefined) = { ... } * @return Whether the const field is set. */ @java.lang.Override @@ -169,7 +171,7 @@ public boolean hasConst() { * ``` * * - * optional uint64 const = 1 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional uint64 const = 1 [json_name = "const", (.buf.validate.predefined) = { ... } * @return The const. */ @java.lang.Override @@ -192,7 +194,7 @@ public long getConst() { * ``` * * - * uint64 lt = 2 [json_name = "lt", (.buf.validate.priv.field) = { ... } + * uint64 lt = 2 [json_name = "lt", (.buf.validate.predefined) = { ... } * @return Whether the lt field is set. */ @java.lang.Override @@ -213,7 +215,7 @@ public boolean hasLt() { * ``` * * - * uint64 lt = 2 [json_name = "lt", (.buf.validate.priv.field) = { ... } + * uint64 lt = 2 [json_name = "lt", (.buf.validate.predefined) = { ... } * @return The lt. */ @java.lang.Override @@ -239,7 +241,7 @@ public long getLt() { * ``` * * - * uint64 lte = 3 [json_name = "lte", (.buf.validate.priv.field) = { ... } + * uint64 lte = 3 [json_name = "lte", (.buf.validate.predefined) = { ... } * @return Whether the lte field is set. */ @java.lang.Override @@ -260,7 +262,7 @@ public boolean hasLte() { * ``` * * - * uint64 lte = 3 [json_name = "lte", (.buf.validate.priv.field) = { ... } + * uint64 lte = 3 [json_name = "lte", (.buf.validate.predefined) = { ... } * @return The lte. */ @java.lang.Override @@ -294,7 +296,7 @@ public long getLte() { * ``` * * - * uint64 gt = 4 [json_name = "gt", (.buf.validate.priv.field) = { ... } + * uint64 gt = 4 [json_name = "gt", (.buf.validate.predefined) = { ... } * @return Whether the gt field is set. */ @java.lang.Override @@ -323,7 +325,7 @@ public boolean hasGt() { * ``` * * - * uint64 gt = 4 [json_name = "gt", (.buf.validate.priv.field) = { ... } + * uint64 gt = 4 [json_name = "gt", (.buf.validate.predefined) = { ... } * @return The gt. */ @java.lang.Override @@ -357,7 +359,7 @@ public long getGt() { * ``` * * - * uint64 gte = 5 [json_name = "gte", (.buf.validate.priv.field) = { ... } + * uint64 gte = 5 [json_name = "gte", (.buf.validate.predefined) = { ... } * @return Whether the gte field is set. */ @java.lang.Override @@ -386,7 +388,7 @@ public boolean hasGte() { * ``` * * - * uint64 gte = 5 [json_name = "gte", (.buf.validate.priv.field) = { ... } + * uint64 gte = 5 [json_name = "gte", (.buf.validate.predefined) = { ... } * @return The gte. */ @java.lang.Override @@ -415,7 +417,7 @@ public long getGte() { * ``` * * - * repeated uint64 in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated uint64 in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @return A list containing the in. */ @java.lang.Override @@ -437,7 +439,7 @@ public long getGte() { * ``` * * - * repeated uint64 in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated uint64 in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @return The count of in. */ public int getInCount() { @@ -457,14 +459,13 @@ public int getInCount() { * ``` * * - * repeated uint64 in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated uint64 in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @param index The index of the element to return. * @return The in at the given index. */ public long getIn(int index) { return in_.getLong(index); } - private int inMemoizedSerializedSize = -1; public static final int NOT_IN_FIELD_NUMBER = 7; @SuppressWarnings("serial") @@ -484,7 +485,7 @@ public long getIn(int index) { * ``` * * - * repeated uint64 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated uint64 not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @return A list containing the notIn. */ @java.lang.Override @@ -506,7 +507,7 @@ public long getIn(int index) { * ``` * * - * repeated uint64 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated uint64 not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @return The count of notIn. */ public int getNotInCount() { @@ -526,14 +527,87 @@ public int getNotInCount() { * ``` * * - * repeated uint64 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated uint64 not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @param index The index of the element to return. * @return The notIn at the given index. */ public long getNotIn(int index) { return notIn_.getLong(index); } - private int notInMemoizedSerializedSize = -1; + + public static final int EXAMPLE_FIELD_NUMBER = 8; + @SuppressWarnings("serial") + private com.google.protobuf.Internal.LongList example_ = + emptyLongList(); + /** + *
+   * `example` specifies values that the field may have. These values SHOULD
+   * conform to other constraints. `example` values will not impact validation
+   * but may be used as helpful guidance on how to populate the given field.
+   *
+   * ```proto
+   * message MyUInt64 {
+   * uint64 value = 1 [
+   * (buf.validate.field).uint64.example = 1,
+   * (buf.validate.field).uint64.example = -10
+   * ];
+   * }
+   * ```
+   * 
+ * + * repeated uint64 example = 8 [json_name = "example", (.buf.validate.predefined) = { ... } + * @return A list containing the example. + */ + @java.lang.Override + public java.util.List + getExampleList() { + return example_; + } + /** + *
+   * `example` specifies values that the field may have. These values SHOULD
+   * conform to other constraints. `example` values will not impact validation
+   * but may be used as helpful guidance on how to populate the given field.
+   *
+   * ```proto
+   * message MyUInt64 {
+   * uint64 value = 1 [
+   * (buf.validate.field).uint64.example = 1,
+   * (buf.validate.field).uint64.example = -10
+   * ];
+   * }
+   * ```
+   * 
+ * + * repeated uint64 example = 8 [json_name = "example", (.buf.validate.predefined) = { ... } + * @return The count of example. + */ + public int getExampleCount() { + return example_.size(); + } + /** + *
+   * `example` specifies values that the field may have. These values SHOULD
+   * conform to other constraints. `example` values will not impact validation
+   * but may be used as helpful guidance on how to populate the given field.
+   *
+   * ```proto
+   * message MyUInt64 {
+   * uint64 value = 1 [
+   * (buf.validate.field).uint64.example = 1,
+   * (buf.validate.field).uint64.example = -10
+   * ];
+   * }
+   * ```
+   * 
+ * + * repeated uint64 example = 8 [json_name = "example", (.buf.validate.predefined) = { ... } + * @param index The index of the element to return. + * @return The example at the given index. + */ + public long getExample(int index) { + return example_.getLong(index); + } private byte memoizedIsInitialized = -1; @java.lang.Override @@ -542,6 +616,10 @@ public final boolean isInitialized() { if (isInitialized == 1) return true; if (isInitialized == 0) return false; + if (!extensionsAreInitialized()) { + memoizedIsInitialized = 0; + return false; + } memoizedIsInitialized = 1; return true; } @@ -549,7 +627,9 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - getSerializedSize(); + com.google.protobuf.GeneratedMessage + .ExtendableMessage.ExtensionSerializer + extensionWriter = newExtensionSerializer(); if (((bitField0_ & 0x00000001) != 0)) { output.writeUInt64(1, const_); } @@ -569,20 +649,16 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) output.writeUInt64( 5, (long)((java.lang.Long) greaterThan_)); } - if (getInList().size() > 0) { - output.writeUInt32NoTag(50); - output.writeUInt32NoTag(inMemoizedSerializedSize); - } for (int i = 0; i < in_.size(); i++) { - output.writeUInt64NoTag(in_.getLong(i)); - } - if (getNotInList().size() > 0) { - output.writeUInt32NoTag(58); - output.writeUInt32NoTag(notInMemoizedSerializedSize); + output.writeUInt64(6, in_.getLong(i)); } for (int i = 0; i < notIn_.size(); i++) { - output.writeUInt64NoTag(notIn_.getLong(i)); + output.writeUInt64(7, notIn_.getLong(i)); + } + for (int i = 0; i < example_.size(); i++) { + output.writeUInt64(8, example_.getLong(i)); } + extensionWriter.writeUntil(536870912, output); getUnknownFields().writeTo(output); } @@ -623,12 +699,7 @@ public int getSerializedSize() { .computeUInt64SizeNoTag(in_.getLong(i)); } size += dataSize; - if (!getInList().isEmpty()) { - size += 1; - size += com.google.protobuf.CodedOutputStream - .computeInt32SizeNoTag(dataSize); - } - inMemoizedSerializedSize = dataSize; + size += 1 * getInList().size(); } { int dataSize = 0; @@ -637,13 +708,18 @@ public int getSerializedSize() { .computeUInt64SizeNoTag(notIn_.getLong(i)); } size += dataSize; - if (!getNotInList().isEmpty()) { - size += 1; - size += com.google.protobuf.CodedOutputStream - .computeInt32SizeNoTag(dataSize); + size += 1 * getNotInList().size(); + } + { + int dataSize = 0; + for (int i = 0; i < example_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream + .computeUInt64SizeNoTag(example_.getLong(i)); } - notInMemoizedSerializedSize = dataSize; + size += dataSize; + size += 1 * getExampleList().size(); } + size += extensionsSerializedSize(); size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -668,6 +744,8 @@ public boolean equals(final java.lang.Object obj) { .equals(other.getInList())) return false; if (!getNotInList() .equals(other.getNotInList())) return false; + if (!getExampleList() + .equals(other.getExampleList())) return false; if (!getLessThanCase().equals(other.getLessThanCase())) return false; switch (lessThanCase_) { case 2: @@ -695,6 +773,8 @@ public boolean equals(final java.lang.Object obj) { default: } if (!getUnknownFields().equals(other.getUnknownFields())) return false; + if (!getExtensionFields().equals(other.getExtensionFields())) + return false; return true; } @@ -718,6 +798,10 @@ public int hashCode() { hash = (37 * hash) + NOT_IN_FIELD_NUMBER; hash = (53 * hash) + getNotInList().hashCode(); } + if (getExampleCount() > 0) { + hash = (37 * hash) + EXAMPLE_FIELD_NUMBER; + hash = (53 * hash) + getExampleList().hashCode(); + } switch (lessThanCase_) { case 2: hash = (37 * hash) + LT_FIELD_NUMBER; @@ -746,6 +830,7 @@ public int hashCode() { case 0: default: } + hash = hashFields(hash, getExtensionFields()); hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -852,7 +937,8 @@ protected Builder newBuilderForType( * Protobuf type {@code buf.validate.UInt64Rules} */ public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder implements + com.google.protobuf.GeneratedMessage.ExtendableBuilder< + build.buf.validate.UInt64Rules, Builder> implements // @@protoc_insertion_point(builder_implements:buf.validate.UInt64Rules) build.buf.validate.UInt64RulesOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor @@ -885,6 +971,7 @@ public Builder clear() { const_ = 0L; in_ = emptyLongList(); notIn_ = emptyLongList(); + example_ = emptyLongList(); lessThanCase_ = 0; lessThan_ = null; greaterThanCase_ = 0; @@ -936,6 +1023,10 @@ private void buildPartial0(build.buf.validate.UInt64Rules result) { notIn_.makeImmutable(); result.notIn_ = notIn_; } + if (((from_bitField0_ & 0x00000080) != 0)) { + example_.makeImmutable(); + result.example_ = example_; + } result.bitField0_ |= to_bitField0_; } @@ -983,6 +1074,17 @@ public Builder mergeFrom(build.buf.validate.UInt64Rules other) { } onChanged(); } + if (!other.example_.isEmpty()) { + if (example_.isEmpty()) { + example_ = other.example_; + example_.makeImmutable(); + bitField0_ |= 0x00000080; + } else { + ensureExampleIsMutable(); + example_.addAll(other.example_); + } + onChanged(); + } switch (other.getLessThanCase()) { case LT: { setLt(other.getLt()); @@ -1009,6 +1111,7 @@ public Builder mergeFrom(build.buf.validate.UInt64Rules other) { break; } } + this.mergeExtensionFields(other); this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -1016,6 +1119,9 @@ public Builder mergeFrom(build.buf.validate.UInt64Rules other) { @java.lang.Override public final boolean isInitialized() { + if (!extensionsAreInitialized()) { + return false; + } return true; } @@ -1092,6 +1198,22 @@ public Builder mergeFrom( input.popLimit(limit); break; } // case 58 + case 64: { + long v = input.readUInt64(); + ensureExampleIsMutable(); + example_.addLong(v); + break; + } // case 64 + case 66: { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + ensureExampleIsMutable(); + while (input.getBytesUntilLimit() > 0) { + example_.addLong(input.readUInt64()); + } + input.popLimit(limit); + break; + } // case 66 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { done = true; // was an endgroup tag @@ -1153,7 +1275,7 @@ public Builder clearGreaterThan() { * ``` * * - * optional uint64 const = 1 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional uint64 const = 1 [json_name = "const", (.buf.validate.predefined) = { ... } * @return Whether the const field is set. */ @java.lang.Override @@ -1173,7 +1295,7 @@ public boolean hasConst() { * ``` * * - * optional uint64 const = 1 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional uint64 const = 1 [json_name = "const", (.buf.validate.predefined) = { ... } * @return The const. */ @java.lang.Override @@ -1193,7 +1315,7 @@ public long getConst() { * ``` * * - * optional uint64 const = 1 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional uint64 const = 1 [json_name = "const", (.buf.validate.predefined) = { ... } * @param value The const to set. * @return This builder for chaining. */ @@ -1217,7 +1339,7 @@ public Builder setConst(long value) { * ``` * * - * optional uint64 const = 1 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional uint64 const = 1 [json_name = "const", (.buf.validate.predefined) = { ... } * @return This builder for chaining. */ public Builder clearConst() { @@ -1241,7 +1363,7 @@ public Builder clearConst() { * ``` * * - * uint64 lt = 2 [json_name = "lt", (.buf.validate.priv.field) = { ... } + * uint64 lt = 2 [json_name = "lt", (.buf.validate.predefined) = { ... } * @return Whether the lt field is set. */ public boolean hasLt() { @@ -1261,7 +1383,7 @@ public boolean hasLt() { * ``` * * - * uint64 lt = 2 [json_name = "lt", (.buf.validate.priv.field) = { ... } + * uint64 lt = 2 [json_name = "lt", (.buf.validate.predefined) = { ... } * @return The lt. */ public long getLt() { @@ -1284,7 +1406,7 @@ public long getLt() { * ``` * * - * uint64 lt = 2 [json_name = "lt", (.buf.validate.priv.field) = { ... } + * uint64 lt = 2 [json_name = "lt", (.buf.validate.predefined) = { ... } * @param value The lt to set. * @return This builder for chaining. */ @@ -1309,7 +1431,7 @@ public Builder setLt(long value) { * ``` * * - * uint64 lt = 2 [json_name = "lt", (.buf.validate.priv.field) = { ... } + * uint64 lt = 2 [json_name = "lt", (.buf.validate.predefined) = { ... } * @return This builder for chaining. */ public Builder clearLt() { @@ -1335,7 +1457,7 @@ public Builder clearLt() { * ``` * * - * uint64 lte = 3 [json_name = "lte", (.buf.validate.priv.field) = { ... } + * uint64 lte = 3 [json_name = "lte", (.buf.validate.predefined) = { ... } * @return Whether the lte field is set. */ public boolean hasLte() { @@ -1355,7 +1477,7 @@ public boolean hasLte() { * ``` * * - * uint64 lte = 3 [json_name = "lte", (.buf.validate.priv.field) = { ... } + * uint64 lte = 3 [json_name = "lte", (.buf.validate.predefined) = { ... } * @return The lte. */ public long getLte() { @@ -1378,7 +1500,7 @@ public long getLte() { * ``` * * - * uint64 lte = 3 [json_name = "lte", (.buf.validate.priv.field) = { ... } + * uint64 lte = 3 [json_name = "lte", (.buf.validate.predefined) = { ... } * @param value The lte to set. * @return This builder for chaining. */ @@ -1403,7 +1525,7 @@ public Builder setLte(long value) { * ``` * * - * uint64 lte = 3 [json_name = "lte", (.buf.validate.priv.field) = { ... } + * uint64 lte = 3 [json_name = "lte", (.buf.validate.predefined) = { ... } * @return This builder for chaining. */ public Builder clearLte() { @@ -1437,7 +1559,7 @@ public Builder clearLte() { * ``` * * - * uint64 gt = 4 [json_name = "gt", (.buf.validate.priv.field) = { ... } + * uint64 gt = 4 [json_name = "gt", (.buf.validate.predefined) = { ... } * @return Whether the gt field is set. */ public boolean hasGt() { @@ -1465,7 +1587,7 @@ public boolean hasGt() { * ``` * * - * uint64 gt = 4 [json_name = "gt", (.buf.validate.priv.field) = { ... } + * uint64 gt = 4 [json_name = "gt", (.buf.validate.predefined) = { ... } * @return The gt. */ public long getGt() { @@ -1496,7 +1618,7 @@ public long getGt() { * ``` * * - * uint64 gt = 4 [json_name = "gt", (.buf.validate.priv.field) = { ... } + * uint64 gt = 4 [json_name = "gt", (.buf.validate.predefined) = { ... } * @param value The gt to set. * @return This builder for chaining. */ @@ -1529,7 +1651,7 @@ public Builder setGt(long value) { * ``` * * - * uint64 gt = 4 [json_name = "gt", (.buf.validate.priv.field) = { ... } + * uint64 gt = 4 [json_name = "gt", (.buf.validate.predefined) = { ... } * @return This builder for chaining. */ public Builder clearGt() { @@ -1563,7 +1685,7 @@ public Builder clearGt() { * ``` * * - * uint64 gte = 5 [json_name = "gte", (.buf.validate.priv.field) = { ... } + * uint64 gte = 5 [json_name = "gte", (.buf.validate.predefined) = { ... } * @return Whether the gte field is set. */ public boolean hasGte() { @@ -1591,7 +1713,7 @@ public boolean hasGte() { * ``` * * - * uint64 gte = 5 [json_name = "gte", (.buf.validate.priv.field) = { ... } + * uint64 gte = 5 [json_name = "gte", (.buf.validate.predefined) = { ... } * @return The gte. */ public long getGte() { @@ -1622,7 +1744,7 @@ public long getGte() { * ``` * * - * uint64 gte = 5 [json_name = "gte", (.buf.validate.priv.field) = { ... } + * uint64 gte = 5 [json_name = "gte", (.buf.validate.predefined) = { ... } * @param value The gte to set. * @return This builder for chaining. */ @@ -1655,7 +1777,7 @@ public Builder setGte(long value) { * ``` * * - * uint64 gte = 5 [json_name = "gte", (.buf.validate.priv.field) = { ... } + * uint64 gte = 5 [json_name = "gte", (.buf.validate.predefined) = { ... } * @return This builder for chaining. */ public Builder clearGte() { @@ -1688,7 +1810,7 @@ private void ensureInIsMutable() { * ``` * * - * repeated uint64 in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated uint64 in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @return A list containing the in. */ public java.util.List @@ -1710,7 +1832,7 @@ private void ensureInIsMutable() { * ``` * * - * repeated uint64 in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated uint64 in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @return The count of in. */ public int getInCount() { @@ -1730,7 +1852,7 @@ public int getInCount() { * ``` * * - * repeated uint64 in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated uint64 in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @param index The index of the element to return. * @return The in at the given index. */ @@ -1751,7 +1873,7 @@ public long getIn(int index) { * ``` * * - * repeated uint64 in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated uint64 in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @param index The index to set the value at. * @param value The in to set. * @return This builder for chaining. @@ -1779,7 +1901,7 @@ public Builder setIn( * ``` * * - * repeated uint64 in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated uint64 in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @param value The in to add. * @return This builder for chaining. */ @@ -1805,7 +1927,7 @@ public Builder addIn(long value) { * ``` * * - * repeated uint64 in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated uint64 in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @param values The in to add. * @return This builder for chaining. */ @@ -1832,7 +1954,7 @@ public Builder addAllIn( * ``` * * - * repeated uint64 in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated uint64 in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @return This builder for chaining. */ public Builder clearIn() { @@ -1863,7 +1985,7 @@ private void ensureNotInIsMutable() { * ``` * * - * repeated uint64 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated uint64 not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @return A list containing the notIn. */ public java.util.List @@ -1885,7 +2007,7 @@ private void ensureNotInIsMutable() { * ``` * * - * repeated uint64 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated uint64 not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @return The count of notIn. */ public int getNotInCount() { @@ -1905,7 +2027,7 @@ public int getNotInCount() { * ``` * * - * repeated uint64 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated uint64 not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @param index The index of the element to return. * @return The notIn at the given index. */ @@ -1926,7 +2048,7 @@ public long getNotIn(int index) { * ``` * * - * repeated uint64 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated uint64 not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @param index The index to set the value at. * @param value The notIn to set. * @return This builder for chaining. @@ -1954,7 +2076,7 @@ public Builder setNotIn( * ``` * * - * repeated uint64 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated uint64 not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @param value The notIn to add. * @return This builder for chaining. */ @@ -1980,7 +2102,7 @@ public Builder addNotIn(long value) { * ``` * * - * repeated uint64 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated uint64 not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @param values The notIn to add. * @return This builder for chaining. */ @@ -2007,7 +2129,7 @@ public Builder addAllNotIn( * ``` * * - * repeated uint64 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated uint64 not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @return This builder for chaining. */ public Builder clearNotIn() { @@ -2017,6 +2139,195 @@ public Builder clearNotIn() { return this; } + private com.google.protobuf.Internal.LongList example_ = emptyLongList(); + private void ensureExampleIsMutable() { + if (!example_.isModifiable()) { + example_ = makeMutableCopy(example_); + } + bitField0_ |= 0x00000080; + } + /** + *
+     * `example` specifies values that the field may have. These values SHOULD
+     * conform to other constraints. `example` values will not impact validation
+     * but may be used as helpful guidance on how to populate the given field.
+     *
+     * ```proto
+     * message MyUInt64 {
+     * uint64 value = 1 [
+     * (buf.validate.field).uint64.example = 1,
+     * (buf.validate.field).uint64.example = -10
+     * ];
+     * }
+     * ```
+     * 
+ * + * repeated uint64 example = 8 [json_name = "example", (.buf.validate.predefined) = { ... } + * @return A list containing the example. + */ + public java.util.List + getExampleList() { + example_.makeImmutable(); + return example_; + } + /** + *
+     * `example` specifies values that the field may have. These values SHOULD
+     * conform to other constraints. `example` values will not impact validation
+     * but may be used as helpful guidance on how to populate the given field.
+     *
+     * ```proto
+     * message MyUInt64 {
+     * uint64 value = 1 [
+     * (buf.validate.field).uint64.example = 1,
+     * (buf.validate.field).uint64.example = -10
+     * ];
+     * }
+     * ```
+     * 
+ * + * repeated uint64 example = 8 [json_name = "example", (.buf.validate.predefined) = { ... } + * @return The count of example. + */ + public int getExampleCount() { + return example_.size(); + } + /** + *
+     * `example` specifies values that the field may have. These values SHOULD
+     * conform to other constraints. `example` values will not impact validation
+     * but may be used as helpful guidance on how to populate the given field.
+     *
+     * ```proto
+     * message MyUInt64 {
+     * uint64 value = 1 [
+     * (buf.validate.field).uint64.example = 1,
+     * (buf.validate.field).uint64.example = -10
+     * ];
+     * }
+     * ```
+     * 
+ * + * repeated uint64 example = 8 [json_name = "example", (.buf.validate.predefined) = { ... } + * @param index The index of the element to return. + * @return The example at the given index. + */ + public long getExample(int index) { + return example_.getLong(index); + } + /** + *
+     * `example` specifies values that the field may have. These values SHOULD
+     * conform to other constraints. `example` values will not impact validation
+     * but may be used as helpful guidance on how to populate the given field.
+     *
+     * ```proto
+     * message MyUInt64 {
+     * uint64 value = 1 [
+     * (buf.validate.field).uint64.example = 1,
+     * (buf.validate.field).uint64.example = -10
+     * ];
+     * }
+     * ```
+     * 
+ * + * repeated uint64 example = 8 [json_name = "example", (.buf.validate.predefined) = { ... } + * @param index The index to set the value at. + * @param value The example to set. + * @return This builder for chaining. + */ + public Builder setExample( + int index, long value) { + + ensureExampleIsMutable(); + example_.setLong(index, value); + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + *
+     * `example` specifies values that the field may have. These values SHOULD
+     * conform to other constraints. `example` values will not impact validation
+     * but may be used as helpful guidance on how to populate the given field.
+     *
+     * ```proto
+     * message MyUInt64 {
+     * uint64 value = 1 [
+     * (buf.validate.field).uint64.example = 1,
+     * (buf.validate.field).uint64.example = -10
+     * ];
+     * }
+     * ```
+     * 
+ * + * repeated uint64 example = 8 [json_name = "example", (.buf.validate.predefined) = { ... } + * @param value The example to add. + * @return This builder for chaining. + */ + public Builder addExample(long value) { + + ensureExampleIsMutable(); + example_.addLong(value); + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + *
+     * `example` specifies values that the field may have. These values SHOULD
+     * conform to other constraints. `example` values will not impact validation
+     * but may be used as helpful guidance on how to populate the given field.
+     *
+     * ```proto
+     * message MyUInt64 {
+     * uint64 value = 1 [
+     * (buf.validate.field).uint64.example = 1,
+     * (buf.validate.field).uint64.example = -10
+     * ];
+     * }
+     * ```
+     * 
+ * + * repeated uint64 example = 8 [json_name = "example", (.buf.validate.predefined) = { ... } + * @param values The example to add. + * @return This builder for chaining. + */ + public Builder addAllExample( + java.lang.Iterable values) { + ensureExampleIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, example_); + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + *
+     * `example` specifies values that the field may have. These values SHOULD
+     * conform to other constraints. `example` values will not impact validation
+     * but may be used as helpful guidance on how to populate the given field.
+     *
+     * ```proto
+     * message MyUInt64 {
+     * uint64 value = 1 [
+     * (buf.validate.field).uint64.example = 1,
+     * (buf.validate.field).uint64.example = -10
+     * ];
+     * }
+     * ```
+     * 
+ * + * repeated uint64 example = 8 [json_name = "example", (.buf.validate.predefined) = { ... } + * @return This builder for chaining. + */ + public Builder clearExample() { + example_ = emptyLongList(); + bitField0_ = (bitField0_ & ~0x00000080); + onChanged(); + return this; + } + // @@protoc_insertion_point(builder_scope:buf.validate.UInt64Rules) } diff --git a/src/main/java/build/buf/validate/UInt64RulesOrBuilder.java b/src/main/java/build/buf/validate/UInt64RulesOrBuilder.java index c49b9591..92a5567e 100644 --- a/src/main/java/build/buf/validate/UInt64RulesOrBuilder.java +++ b/src/main/java/build/buf/validate/UInt64RulesOrBuilder.java @@ -7,7 +7,8 @@ public interface UInt64RulesOrBuilder extends // @@protoc_insertion_point(interface_extends:buf.validate.UInt64Rules) - com.google.protobuf.MessageOrBuilder { + com.google.protobuf.GeneratedMessage. + ExtendableMessageOrBuilder { /** *
@@ -22,7 +23,7 @@ public interface UInt64RulesOrBuilder extends
    * ```
    * 
* - * optional uint64 const = 1 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional uint64 const = 1 [json_name = "const", (.buf.validate.predefined) = { ... } * @return Whether the const field is set. */ boolean hasConst(); @@ -39,7 +40,7 @@ public interface UInt64RulesOrBuilder extends * ``` * * - * optional uint64 const = 1 [json_name = "const", (.buf.validate.priv.field) = { ... } + * optional uint64 const = 1 [json_name = "const", (.buf.validate.predefined) = { ... } * @return The const. */ long getConst(); @@ -58,7 +59,7 @@ public interface UInt64RulesOrBuilder extends * ``` * * - * uint64 lt = 2 [json_name = "lt", (.buf.validate.priv.field) = { ... } + * uint64 lt = 2 [json_name = "lt", (.buf.validate.predefined) = { ... } * @return Whether the lt field is set. */ boolean hasLt(); @@ -76,7 +77,7 @@ public interface UInt64RulesOrBuilder extends * ``` * * - * uint64 lt = 2 [json_name = "lt", (.buf.validate.priv.field) = { ... } + * uint64 lt = 2 [json_name = "lt", (.buf.validate.predefined) = { ... } * @return The lt. */ long getLt(); @@ -95,7 +96,7 @@ public interface UInt64RulesOrBuilder extends * ``` * * - * uint64 lte = 3 [json_name = "lte", (.buf.validate.priv.field) = { ... } + * uint64 lte = 3 [json_name = "lte", (.buf.validate.predefined) = { ... } * @return Whether the lte field is set. */ boolean hasLte(); @@ -113,7 +114,7 @@ public interface UInt64RulesOrBuilder extends * ``` * * - * uint64 lte = 3 [json_name = "lte", (.buf.validate.priv.field) = { ... } + * uint64 lte = 3 [json_name = "lte", (.buf.validate.predefined) = { ... } * @return The lte. */ long getLte(); @@ -140,7 +141,7 @@ public interface UInt64RulesOrBuilder extends * ``` * * - * uint64 gt = 4 [json_name = "gt", (.buf.validate.priv.field) = { ... } + * uint64 gt = 4 [json_name = "gt", (.buf.validate.predefined) = { ... } * @return Whether the gt field is set. */ boolean hasGt(); @@ -166,7 +167,7 @@ public interface UInt64RulesOrBuilder extends * ``` * * - * uint64 gt = 4 [json_name = "gt", (.buf.validate.priv.field) = { ... } + * uint64 gt = 4 [json_name = "gt", (.buf.validate.predefined) = { ... } * @return The gt. */ long getGt(); @@ -193,7 +194,7 @@ public interface UInt64RulesOrBuilder extends * ``` * * - * uint64 gte = 5 [json_name = "gte", (.buf.validate.priv.field) = { ... } + * uint64 gte = 5 [json_name = "gte", (.buf.validate.predefined) = { ... } * @return Whether the gte field is set. */ boolean hasGte(); @@ -219,7 +220,7 @@ public interface UInt64RulesOrBuilder extends * ``` * * - * uint64 gte = 5 [json_name = "gte", (.buf.validate.priv.field) = { ... } + * uint64 gte = 5 [json_name = "gte", (.buf.validate.predefined) = { ... } * @return The gte. */ long getGte(); @@ -238,7 +239,7 @@ public interface UInt64RulesOrBuilder extends * ``` * * - * repeated uint64 in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated uint64 in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @return A list containing the in. */ java.util.List getInList(); @@ -256,7 +257,7 @@ public interface UInt64RulesOrBuilder extends * ``` * * - * repeated uint64 in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated uint64 in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @return The count of in. */ int getInCount(); @@ -274,7 +275,7 @@ public interface UInt64RulesOrBuilder extends * ``` * * - * repeated uint64 in = 6 [json_name = "in", (.buf.validate.priv.field) = { ... } + * repeated uint64 in = 6 [json_name = "in", (.buf.validate.predefined) = { ... } * @param index The index of the element to return. * @return The in at the given index. */ @@ -294,7 +295,7 @@ public interface UInt64RulesOrBuilder extends * ``` * * - * repeated uint64 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated uint64 not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @return A list containing the notIn. */ java.util.List getNotInList(); @@ -312,7 +313,7 @@ public interface UInt64RulesOrBuilder extends * ``` * * - * repeated uint64 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated uint64 not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @return The count of notIn. */ int getNotInCount(); @@ -330,12 +331,74 @@ public interface UInt64RulesOrBuilder extends * ``` * * - * repeated uint64 not_in = 7 [json_name = "notIn", (.buf.validate.priv.field) = { ... } + * repeated uint64 not_in = 7 [json_name = "notIn", (.buf.validate.predefined) = { ... } * @param index The index of the element to return. * @return The notIn at the given index. */ long getNotIn(int index); + /** + *
+   * `example` specifies values that the field may have. These values SHOULD
+   * conform to other constraints. `example` values will not impact validation
+   * but may be used as helpful guidance on how to populate the given field.
+   *
+   * ```proto
+   * message MyUInt64 {
+   * uint64 value = 1 [
+   * (buf.validate.field).uint64.example = 1,
+   * (buf.validate.field).uint64.example = -10
+   * ];
+   * }
+   * ```
+   * 
+ * + * repeated uint64 example = 8 [json_name = "example", (.buf.validate.predefined) = { ... } + * @return A list containing the example. + */ + java.util.List getExampleList(); + /** + *
+   * `example` specifies values that the field may have. These values SHOULD
+   * conform to other constraints. `example` values will not impact validation
+   * but may be used as helpful guidance on how to populate the given field.
+   *
+   * ```proto
+   * message MyUInt64 {
+   * uint64 value = 1 [
+   * (buf.validate.field).uint64.example = 1,
+   * (buf.validate.field).uint64.example = -10
+   * ];
+   * }
+   * ```
+   * 
+ * + * repeated uint64 example = 8 [json_name = "example", (.buf.validate.predefined) = { ... } + * @return The count of example. + */ + int getExampleCount(); + /** + *
+   * `example` specifies values that the field may have. These values SHOULD
+   * conform to other constraints. `example` values will not impact validation
+   * but may be used as helpful guidance on how to populate the given field.
+   *
+   * ```proto
+   * message MyUInt64 {
+   * uint64 value = 1 [
+   * (buf.validate.field).uint64.example = 1,
+   * (buf.validate.field).uint64.example = -10
+   * ];
+   * }
+   * ```
+   * 
+ * + * repeated uint64 example = 8 [json_name = "example", (.buf.validate.predefined) = { ... } + * @param index The index of the element to return. + * @return The example at the given index. + */ + long getExample(int index); + build.buf.validate.UInt64Rules.LessThanCase getLessThanCase(); build.buf.validate.UInt64Rules.GreaterThanCase getGreaterThanCase(); diff --git a/src/main/java/build/buf/validate/ValidateProto.java b/src/main/java/build/buf/validate/ValidateProto.java index 6a05272c..038156dd 100644 --- a/src/main/java/build/buf/validate/ValidateProto.java +++ b/src/main/java/build/buf/validate/ValidateProto.java @@ -21,6 +21,7 @@ public static void registerAllExtensions( registry.add(build.buf.validate.ValidateProto.message); registry.add(build.buf.validate.ValidateProto.oneof); registry.add(build.buf.validate.ValidateProto.field); + registry.add(build.buf.validate.ValidateProto.predefined); } public static void registerAllExtensions( @@ -76,6 +77,41 @@ public static void registerAllExtensions( .newFileScopedGeneratedExtension( build.buf.validate.FieldConstraints.class, build.buf.validate.FieldConstraints.getDefaultInstance()); + public static final int PREDEFINED_FIELD_NUMBER = 1160; + /** + *
+   * Specifies predefined rules. When extending a standard constraint message,
+   * this adds additional CEL expressions that apply when the extension is used.
+   *
+   * ```proto
+   * extend buf.validate.Int32Rules {
+   * bool is_zero [(buf.validate.predefined).cel = {
+   * id: "int32.is_zero",
+   * message: "value must be zero",
+   * expression: "!rule || this == 0",
+   * }];
+   * }
+   *
+   * message Foo {
+   * int32 reserved = 1 [(buf.validate.field).int32.(is_zero) = true];
+   * }
+   * ```
+   * 
+ * + * extend .google.protobuf.FieldOptions { ... } + */ + public static final + com.google.protobuf.GeneratedMessage.GeneratedExtension< + com.google.protobuf.DescriptorProtos.FieldOptions, + build.buf.validate.PredefinedConstraints> predefined = com.google.protobuf.GeneratedMessage + .newFileScopedGeneratedExtension( + build.buf.validate.PredefinedConstraints.class, + build.buf.validate.PredefinedConstraints.getDefaultInstance()); + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_Constraint_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_Constraint_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_buf_validate_MessageConstraints_descriptor; static final @@ -91,6 +127,11 @@ public static void registerAllExtensions( static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_buf_validate_FieldConstraints_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_PredefinedConstraints_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_PredefinedConstraints_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_buf_validate_FloatRules_descriptor; static final @@ -196,6 +237,16 @@ public static void registerAllExtensions( static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_buf_validate_TimestampRules_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_Violations_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_Violations_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_Violation_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_Violation_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { @@ -206,1468 +257,1531 @@ public static void registerAllExtensions( static { java.lang.String[] descriptorData = { "\n\033buf/validate/validate.proto\022\014buf.valid" + - "ate\032\035buf/validate/expression.proto\032\037buf/" + - "validate/priv/private.proto\032 google/prot" + - "obuf/descriptor.proto\032\036google/protobuf/d" + - "uration.proto\032\037google/protobuf/timestamp" + - ".proto\"n\n\022MessageConstraints\022\037\n\010disabled" + - "\030\001 \001(\010H\000R\010disabled\210\001\001\022*\n\003cel\030\003 \003(\0132\030.buf" + - ".validate.ConstraintR\003celB\013\n\t_disabled\"@" + - "\n\020OneofConstraints\022\037\n\010required\030\001 \001(\010H\000R\010" + - "required\210\001\001B\013\n\t_required\"\253\n\n\020FieldConstr" + - "aints\022*\n\003cel\030\027 \003(\0132\030.buf.validate.Constr" + - "aintR\003cel\022\032\n\010required\030\031 \001(\010R\010required\022,\n" + - "\006ignore\030\033 \001(\0162\024.buf.validate.IgnoreR\006ign" + - "ore\0220\n\005float\030\001 \001(\0132\030.buf.validate.FloatR" + - "ulesH\000R\005float\0223\n\006double\030\002 \001(\0132\031.buf.vali" + - "date.DoubleRulesH\000R\006double\0220\n\005int32\030\003 \001(" + - "\0132\030.buf.validate.Int32RulesH\000R\005int32\0220\n\005" + - "int64\030\004 \001(\0132\030.buf.validate.Int64RulesH\000R" + - "\005int64\0223\n\006uint32\030\005 \001(\0132\031.buf.validate.UI" + - "nt32RulesH\000R\006uint32\0223\n\006uint64\030\006 \001(\0132\031.bu" + - "f.validate.UInt64RulesH\000R\006uint64\0223\n\006sint" + - "32\030\007 \001(\0132\031.buf.validate.SInt32RulesH\000R\006s" + - "int32\0223\n\006sint64\030\010 \001(\0132\031.buf.validate.SIn" + - "t64RulesH\000R\006sint64\0226\n\007fixed32\030\t \001(\0132\032.bu" + - "f.validate.Fixed32RulesH\000R\007fixed32\0226\n\007fi" + - "xed64\030\n \001(\0132\032.buf.validate.Fixed64RulesH" + - "\000R\007fixed64\0229\n\010sfixed32\030\013 \001(\0132\033.buf.valid" + - "ate.SFixed32RulesH\000R\010sfixed32\0229\n\010sfixed6" + - "4\030\014 \001(\0132\033.buf.validate.SFixed64RulesH\000R\010" + - "sfixed64\022-\n\004bool\030\r \001(\0132\027.buf.validate.Bo" + - "olRulesH\000R\004bool\0223\n\006string\030\016 \001(\0132\031.buf.va" + - "lidate.StringRulesH\000R\006string\0220\n\005bytes\030\017 " + - "\001(\0132\030.buf.validate.BytesRulesH\000R\005bytes\022-" + - "\n\004enum\030\020 \001(\0132\027.buf.validate.EnumRulesH\000R" + - "\004enum\0229\n\010repeated\030\022 \001(\0132\033.buf.validate.R" + - "epeatedRulesH\000R\010repeated\022*\n\003map\030\023 \001(\0132\026." + - "buf.validate.MapRulesH\000R\003map\022*\n\003any\030\024 \001(" + - "\0132\026.buf.validate.AnyRulesH\000R\003any\0229\n\010dura" + - "tion\030\025 \001(\0132\033.buf.validate.DurationRulesH" + - "\000R\010duration\022<\n\ttimestamp\030\026 \001(\0132\034.buf.val" + - "idate.TimestampRulesH\000R\ttimestamp\022\034\n\007ski" + - "pped\030\030 \001(\010B\002\030\001R\007skipped\022%\n\014ignore_empty\030" + - "\032 \001(\010B\002\030\001R\013ignoreEmptyB\006\n\004type\"\242\027\n\nFloat" + - "Rules\022u\n\005const\030\001 \001(\002BZ\302HW\nU\n\013float.const" + - "\032Fthis != rules.const ? \'value must equa" + - "l %s\'.format([rules.const]) : \'\'H\002R\005cons" + - "t\210\001\001\022\243\001\n\002lt\030\002 \001(\002B\220\001\302H\214\001\n\211\001\n\010float.lt\032}!" + - "has(rules.gte) && !has(rules.gt) && (thi" + - "s.isNan() || this >= rules.lt)? \'value m" + - "ust be less than %s\'.format([rules.lt]) " + - ": \'\'H\000R\002lt\022\264\001\n\003lte\030\003 \001(\002B\237\001\302H\233\001\n\230\001\n\tfloa" + - "t.lte\032\212\001!has(rules.gte) && !has(rules.gt" + - ") && (this.isNan() || this > rules.lte)?" + - " \'value must be less than or equal to %s" + - "\'.format([rules.lte]) : \'\'H\000R\003lte\022\363\007\n\002gt" + - "\030\004 \001(\002B\340\007\302H\334\007\n\215\001\n\010float.gt\032\200\001!has(rules." + - "lt) && !has(rules.lte) && (this.isNan() " + - "|| this <= rules.gt)? \'value must be gre" + - "ater than %s\'.format([rules.gt]) : \'\'\n\303\001" + - "\n\013float.gt_lt\032\263\001has(rules.lt) && rules.l" + - "t >= rules.gt && (this.isNan() || this >" + - "= rules.lt || this <= rules.gt)? \'value " + - "must be greater than %s and less than %s" + - "\'.format([rules.gt, rules.lt]) : \'\'\n\315\001\n\025" + - "float.gt_lt_exclusive\032\263\001has(rules.lt) &&" + - " rules.lt < rules.gt && (this.isNan() ||" + - " (rules.lt <= this && this <= rules.gt))" + - "? \'value must be greater than %s or less" + - " than %s\'.format([rules.gt, rules.lt]) :" + - " \'\'\n\323\001\n\014float.gt_lte\032\302\001has(rules.lte) &&" + - " rules.lte >= rules.gt && (this.isNan() " + - "|| this > rules.lte || this <= rules.gt)" + - "? \'value must be greater than %s and les" + - "s than or equal to %s\'.format([rules.gt," + - " rules.lte]) : \'\'\n\335\001\n\026float.gt_lte_exclu" + - "sive\032\302\001has(rules.lte) && rules.lte < rul" + - "es.gt && (this.isNan() || (rules.lte < t" + - "his && this <= rules.gt))? \'value must b" + - "e greater than %s or less than or equal " + - "to %s\'.format([rules.gt, rules.lte]) : \'" + - "\'H\001R\002gt\022\277\010\n\003gte\030\005 \001(\002B\252\010\302H\246\010\n\233\001\n\tfloat.g" + - "te\032\215\001!has(rules.lt) && !has(rules.lte) &" + - "& (this.isNan() || this < rules.gte)? \'v" + - "alue must be greater than or equal to %s" + - "\'.format([rules.gte]) : \'\'\n\322\001\n\014float.gte" + - "_lt\032\301\001has(rules.lt) && rules.lt >= rules" + - ".gte && (this.isNan() || this >= rules.l" + - "t || this < rules.gte)? \'value must be g" + - "reater than or equal to %s and less than" + - " %s\'.format([rules.gte, rules.lt]) : \'\'\n" + - "\334\001\n\026float.gte_lt_exclusive\032\301\001has(rules.l" + - "t) && rules.lt < rules.gte && (this.isNa" + - "n() || (rules.lt <= this && this < rules" + - ".gte))? \'value must be greater than or e" + - "qual to %s or less than %s\'.format([rule" + - "s.gte, rules.lt]) : \'\'\n\342\001\n\rfloat.gte_lte" + - "\032\320\001has(rules.lte) && rules.lte >= rules." + - "gte && (this.isNan() || this > rules.lte" + - " || this < rules.gte)? \'value must be gr" + - "eater than or equal to %s and less than " + - "or equal to %s\'.format([rules.gte, rules" + - ".lte]) : \'\'\n\354\001\n\027float.gte_lte_exclusive\032" + - "\320\001has(rules.lte) && rules.lte < rules.gt" + - "e && (this.isNan() || (rules.lte < this " + - "&& this < rules.gte))? \'value must be gr" + - "eater than or equal to %s or less than o" + - "r equal to %s\'.format([rules.gte, rules." + - "lte]) : \'\'H\001R\003gte\022y\n\002in\030\006 \003(\002Bi\302Hf\nd\n\010fl" + - "oat.in\032X!(this in dyn(rules)[\'in\']) ? \'v" + - "alue must be in list %s\'.format([dyn(rul" + - "es)[\'in\']]) : \'\'R\002in\022}\n\006not_in\030\007 \003(\002Bf\302H" + - "c\na\n\014float.not_in\032Qthis in rules.not_in " + - "? \'value must not be in list %s\'.format(" + - "[rules.not_in]) : \'\'R\005notIn\022g\n\006finite\030\010 " + - "\001(\010BO\302HL\nJ\n\014float.finite\032:this.isNan() |" + - "| this.isInf() ? \'value must be finite\' " + - ": \'\'R\006finiteB\013\n\tless_thanB\016\n\014greater_tha" + - "nB\010\n\006_const\"\263\027\n\013DoubleRules\022v\n\005const\030\001 \001" + - "(\001B[\302HX\nV\n\014double.const\032Fthis != rules.c" + - "onst ? \'value must equal %s\'.format([rul" + - "es.const]) : \'\'H\002R\005const\210\001\001\022\244\001\n\002lt\030\002 \001(\001" + - "B\221\001\302H\215\001\n\212\001\n\tdouble.lt\032}!has(rules.gte) &" + - "& !has(rules.gt) && (this.isNan() || thi" + - "s >= rules.lt)? \'value must be less than" + - " %s\'.format([rules.lt]) : \'\'H\000R\002lt\022\265\001\n\003l" + - "te\030\003 \001(\001B\240\001\302H\234\001\n\231\001\n\ndouble.lte\032\212\001!has(ru" + - "les.gte) && !has(rules.gt) && (this.isNa" + - "n() || this > rules.lte)? \'value must be" + + "ate\032 google/protobuf/descriptor.proto\032\036g" + + "oogle/protobuf/duration.proto\032\037google/pr" + + "otobuf/timestamp.proto\"V\n\nConstraint\022\016\n\002" + + "id\030\001 \001(\tR\002id\022\030\n\007message\030\002 \001(\tR\007message\022\036" + + "\n\nexpression\030\003 \001(\tR\nexpression\"\\\n\022Messag" + + "eConstraints\022\032\n\010disabled\030\001 \001(\010R\010disabled" + + "\022*\n\003cel\030\003 \003(\0132\030.buf.validate.ConstraintR" + + "\003cel\".\n\020OneofConstraints\022\032\n\010required\030\001 \001" + + "(\010R\010required\"\253\n\n\020FieldConstraints\022*\n\003cel" + + "\030\027 \003(\0132\030.buf.validate.ConstraintR\003cel\022\032\n" + + "\010required\030\031 \001(\010R\010required\022,\n\006ignore\030\033 \001(" + + "\0162\024.buf.validate.IgnoreR\006ignore\0220\n\005float" + + "\030\001 \001(\0132\030.buf.validate.FloatRulesH\000R\005floa" + + "t\0223\n\006double\030\002 \001(\0132\031.buf.validate.DoubleR" + + "ulesH\000R\006double\0220\n\005int32\030\003 \001(\0132\030.buf.vali" + + "date.Int32RulesH\000R\005int32\0220\n\005int64\030\004 \001(\0132" + + "\030.buf.validate.Int64RulesH\000R\005int64\0223\n\006ui" + + "nt32\030\005 \001(\0132\031.buf.validate.UInt32RulesH\000R" + + "\006uint32\0223\n\006uint64\030\006 \001(\0132\031.buf.validate.U" + + "Int64RulesH\000R\006uint64\0223\n\006sint32\030\007 \001(\0132\031.b" + + "uf.validate.SInt32RulesH\000R\006sint32\0223\n\006sin" + + "t64\030\010 \001(\0132\031.buf.validate.SInt64RulesH\000R\006" + + "sint64\0226\n\007fixed32\030\t \001(\0132\032.buf.validate.F" + + "ixed32RulesH\000R\007fixed32\0226\n\007fixed64\030\n \001(\0132" + + "\032.buf.validate.Fixed64RulesH\000R\007fixed64\0229" + + "\n\010sfixed32\030\013 \001(\0132\033.buf.validate.SFixed32" + + "RulesH\000R\010sfixed32\0229\n\010sfixed64\030\014 \001(\0132\033.bu" + + "f.validate.SFixed64RulesH\000R\010sfixed64\022-\n\004" + + "bool\030\r \001(\0132\027.buf.validate.BoolRulesH\000R\004b" + + "ool\0223\n\006string\030\016 \001(\0132\031.buf.validate.Strin" + + "gRulesH\000R\006string\0220\n\005bytes\030\017 \001(\0132\030.buf.va" + + "lidate.BytesRulesH\000R\005bytes\022-\n\004enum\030\020 \001(\013" + + "2\027.buf.validate.EnumRulesH\000R\004enum\0229\n\010rep" + + "eated\030\022 \001(\0132\033.buf.validate.RepeatedRules" + + "H\000R\010repeated\022*\n\003map\030\023 \001(\0132\026.buf.validate" + + ".MapRulesH\000R\003map\022*\n\003any\030\024 \001(\0132\026.buf.vali" + + "date.AnyRulesH\000R\003any\0229\n\010duration\030\025 \001(\0132\033" + + ".buf.validate.DurationRulesH\000R\010duration\022" + + "<\n\ttimestamp\030\026 \001(\0132\034.buf.validate.Timest" + + "ampRulesH\000R\ttimestamp\022\034\n\007skipped\030\030 \001(\010B\002" + + "\030\001R\007skipped\022%\n\014ignore_empty\030\032 \001(\010B\002\030\001R\013i" + + "gnoreEmptyB\006\n\004type\"C\n\025PredefinedConstrai" + + "nts\022*\n\003cel\030\001 \003(\0132\030.buf.validate.Constrai" + + "ntR\003cel\"\352\027\n\nFloatRules\022p\n\005const\030\001 \001(\002BZ\302" + + "HW\nU\n\013float.const\032Fthis != rules.const ?" + + " \'value must equal %s\'.format([rules.con" + + "st]) : \'\'R\005const\022\243\001\n\002lt\030\002 \001(\002B\220\001\302H\214\001\n\211\001\n" + + "\010float.lt\032}!has(rules.gte) && !has(rules" + + ".gt) && (this.isNan() || this >= rules.l" + + "t)? \'value must be less than %s\'.format(" + + "[rules.lt]) : \'\'H\000R\002lt\022\264\001\n\003lte\030\003 \001(\002B\237\001\302" + + "H\233\001\n\230\001\n\tfloat.lte\032\212\001!has(rules.gte) && !" + + "has(rules.gt) && (this.isNan() || this >" + + " rules.lte)? \'value must be less than or" + + " equal to %s\'.format([rules.lte]) : \'\'H\000" + + "R\003lte\022\363\007\n\002gt\030\004 \001(\002B\340\007\302H\334\007\n\215\001\n\010float.gt\032\200" + + "\001!has(rules.lt) && !has(rules.lte) && (t" + + "his.isNan() || this <= rules.gt)? \'value" + + " must be greater than %s\'.format([rules." + + "gt]) : \'\'\n\303\001\n\013float.gt_lt\032\263\001has(rules.lt" + + ") && rules.lt >= rules.gt && (this.isNan" + + "() || this >= rules.lt || this <= rules." + + "gt)? \'value must be greater than %s and " + + "less than %s\'.format([rules.gt, rules.lt" + + "]) : \'\'\n\315\001\n\025float.gt_lt_exclusive\032\263\001has(" + + "rules.lt) && rules.lt < rules.gt && (thi" + + "s.isNan() || (rules.lt <= this && this <" + + "= rules.gt))? \'value must be greater tha" + + "n %s or less than %s\'.format([rules.gt, " + + "rules.lt]) : \'\'\n\323\001\n\014float.gt_lte\032\302\001has(r" + + "ules.lte) && rules.lte >= rules.gt && (t" + + "his.isNan() || this > rules.lte || this " + + "<= rules.gt)? \'value must be greater tha" + + "n %s and less than or equal to %s\'.forma" + + "t([rules.gt, rules.lte]) : \'\'\n\335\001\n\026float." + + "gt_lte_exclusive\032\302\001has(rules.lte) && rul" + + "es.lte < rules.gt && (this.isNan() || (r" + + "ules.lte < this && this <= rules.gt))? \'" + + "value must be greater than %s or less th" + + "an or equal to %s\'.format([rules.gt, rul" + + "es.lte]) : \'\'H\001R\002gt\022\277\010\n\003gte\030\005 \001(\002B\252\010\302H\246\010" + + "\n\233\001\n\tfloat.gte\032\215\001!has(rules.lt) && !has(" + + "rules.lte) && (this.isNan() || this < ru" + + "les.gte)? \'value must be greater than or" + + " equal to %s\'.format([rules.gte]) : \'\'\n\322" + + "\001\n\014float.gte_lt\032\301\001has(rules.lt) && rules" + + ".lt >= rules.gte && (this.isNan() || thi" + + "s >= rules.lt || this < rules.gte)? \'val" + + "ue must be greater than or equal to %s a" + + "nd less than %s\'.format([rules.gte, rule" + + "s.lt]) : \'\'\n\334\001\n\026float.gte_lt_exclusive\032\301" + + "\001has(rules.lt) && rules.lt < rules.gte &" + + "& (this.isNan() || (rules.lt <= this && " + + "this < rules.gte))? \'value must be great" + + "er than or equal to %s or less than %s\'." + + "format([rules.gte, rules.lt]) : \'\'\n\342\001\n\rf" + + "loat.gte_lte\032\320\001has(rules.lte) && rules.l" + + "te >= rules.gte && (this.isNan() || this" + + " > rules.lte || this < rules.gte)? \'valu" + + "e must be greater than or equal to %s an" + + "d less than or equal to %s\'.format([rule" + + "s.gte, rules.lte]) : \'\'\n\354\001\n\027float.gte_lt" + + "e_exclusive\032\320\001has(rules.lte) && rules.lt" + + "e < rules.gte && (this.isNan() || (rules" + + ".lte < this && this < rules.gte))? \'valu" + + "e must be greater than or equal to %s or" + " less than or equal to %s\'.format([rules" + - ".lte]) : \'\'H\000R\003lte\022\370\007\n\002gt\030\004 \001(\001B\345\007\302H\341\007\n\216" + - "\001\n\tdouble.gt\032\200\001!has(rules.lt) && !has(ru" + - "les.lte) && (this.isNan() || this <= rul" + - "es.gt)? \'value must be greater than %s\'." + - "format([rules.gt]) : \'\'\n\304\001\n\014double.gt_lt" + - "\032\263\001has(rules.lt) && rules.lt >= rules.gt" + - " && (this.isNan() || this >= rules.lt ||" + - " this <= rules.gt)? \'value must be great" + - "er than %s and less than %s\'.format([rul" + - "es.gt, rules.lt]) : \'\'\n\316\001\n\026double.gt_lt_" + - "exclusive\032\263\001has(rules.lt) && rules.lt < " + - "rules.gt && (this.isNan() || (rules.lt <" + - "= this && this <= rules.gt))? \'value mus" + - "t be greater than %s or less than %s\'.fo" + - "rmat([rules.gt, rules.lt]) : \'\'\n\324\001\n\rdoub" + - "le.gt_lte\032\302\001has(rules.lte) && rules.lte " + - ">= rules.gt && (this.isNan() || this > r" + - "ules.lte || this <= rules.gt)? \'value mu" + - "st be greater than %s and less than or e" + - "qual to %s\'.format([rules.gt, rules.lte]" + - ") : \'\'\n\336\001\n\027double.gt_lte_exclusive\032\302\001has" + - "(rules.lte) && rules.lte < rules.gt && (" + - "this.isNan() || (rules.lte < this && thi" + - "s <= rules.gt))? \'value must be greater " + - "than %s or less than or equal to %s\'.for" + - "mat([rules.gt, rules.lte]) : \'\'H\001R\002gt\022\304\010" + - "\n\003gte\030\005 \001(\001B\257\010\302H\253\010\n\234\001\n\ndouble.gte\032\215\001!has" + - "(rules.lt) && !has(rules.lte) && (this.i" + - "sNan() || this < rules.gte)? \'value must" + - " be greater than or equal to %s\'.format(" + - "[rules.gte]) : \'\'\n\323\001\n\rdouble.gte_lt\032\301\001ha" + - "s(rules.lt) && rules.lt >= rules.gte && " + - "(this.isNan() || this >= rules.lt || thi" + - "s < rules.gte)? \'value must be greater t" + - "han or equal to %s and less than %s\'.for" + - "mat([rules.gte, rules.lt]) : \'\'\n\335\001\n\027doub" + - "le.gte_lt_exclusive\032\301\001has(rules.lt) && r" + - "ules.lt < rules.gte && (this.isNan() || " + - "(rules.lt <= this && this < rules.gte))?" + - " \'value must be greater than or equal to" + - " %s or less than %s\'.format([rules.gte, " + - "rules.lt]) : \'\'\n\343\001\n\016double.gte_lte\032\320\001has" + - "(rules.lte) && rules.lte >= rules.gte &&" + - " (this.isNan() || this > rules.lte || th" + - "is < rules.gte)? \'value must be greater " + - "than or equal to %s and less than or equ" + - "al to %s\'.format([rules.gte, rules.lte])" + - " : \'\'\n\355\001\n\030double.gte_lte_exclusive\032\320\001has" + - "(rules.lte) && rules.lte < rules.gte && " + - "(this.isNan() || (rules.lte < this && th" + - "is < rules.gte))? \'value must be greater" + - " than or equal to %s or less than or equ" + - "al to %s\'.format([rules.gte, rules.lte])" + - " : \'\'H\001R\003gte\022z\n\002in\030\006 \003(\001Bj\302Hg\ne\n\tdouble." + - "in\032X!(this in dyn(rules)[\'in\']) ? \'value" + - " must be in list %s\'.format([dyn(rules)[" + - "\'in\']]) : \'\'R\002in\022~\n\006not_in\030\007 \003(\001Bg\302Hd\nb\n" + - "\rdouble.not_in\032Qthis in rules.not_in ? \'" + - "value must not be in list %s\'.format([ru" + - "les.not_in]) : \'\'R\005notIn\022h\n\006finite\030\010 \001(\010" + - "BP\302HM\nK\n\rdouble.finite\032:this.isNan() || " + - "this.isInf() ? \'value must be finite\' : " + - "\'\'R\006finiteB\013\n\tless_thanB\016\n\014greater_thanB" + - "\010\n\006_const\"\342\024\n\nInt32Rules\022u\n\005const\030\001 \001(\005B" + - "Z\302HW\nU\n\013int32.const\032Fthis != rules.const" + - " ? \'value must equal %s\'.format([rules.c" + - "onst]) : \'\'H\002R\005const\210\001\001\022\216\001\n\002lt\030\002 \001(\005B|\302H" + - "y\nw\n\010int32.lt\032k!has(rules.gte) && !has(r" + - "ules.gt) && this >= rules.lt? \'value mus" + - "t be less than %s\'.format([rules.lt]) : " + - "\'\'H\000R\002lt\022\241\001\n\003lte\030\003 \001(\005B\214\001\302H\210\001\n\205\001\n\tint32." + - "lte\032x!has(rules.gte) && !has(rules.gt) &" + - "& this > rules.lte? \'value must be less " + - "than or equal to %s\'.format([rules.lte])" + - " : \'\'H\000R\003lte\022\233\007\n\002gt\030\004 \001(\005B\210\007\302H\204\007\nz\n\010int3" + - "2.gt\032n!has(rules.lt) && !has(rules.lte) " + - "&& this <= rules.gt? \'value must be grea" + - "ter than %s\'.format([rules.gt]) : \'\'\n\263\001\n" + - "\013int32.gt_lt\032\243\001has(rules.lt) && rules.lt" + - " >= rules.gt && (this >= rules.lt || thi" + - "s <= rules.gt)? \'value must be greater t" + - "han %s and less than %s\'.format([rules.g" + - "t, rules.lt]) : \'\'\n\273\001\n\025int32.gt_lt_exclu" + - "sive\032\241\001has(rules.lt) && rules.lt < rules" + - ".gt && (rules.lt <= this && this <= rule" + - "s.gt)? \'value must be greater than %s or" + - " less than %s\'.format([rules.gt, rules.l" + - "t]) : \'\'\n\303\001\n\014int32.gt_lte\032\262\001has(rules.lt" + - "e) && rules.lte >= rules.gt && (this > r" + - "ules.lte || this <= rules.gt)? \'value mu" + - "st be greater than %s and less than or e" + - "qual to %s\'.format([rules.gt, rules.lte]" + - ") : \'\'\n\313\001\n\026int32.gt_lte_exclusive\032\260\001has(" + - "rules.lte) && rules.lte < rules.gt && (r" + - "ules.lte < this && this <= rules.gt)? \'v" + - "alue must be greater than %s or less tha" + - "n or equal to %s\'.format([rules.gt, rule" + - "s.lte]) : \'\'H\001R\002gt\022\350\007\n\003gte\030\005 \001(\005B\323\007\302H\317\007\n" + - "\210\001\n\tint32.gte\032{!has(rules.lt) && !has(ru" + - "les.lte) && this < rules.gte? \'value mus" + - "t be greater than or equal to %s\'.format" + - "([rules.gte]) : \'\'\n\302\001\n\014int32.gte_lt\032\261\001ha" + - "s(rules.lt) && rules.lt >= rules.gte && " + - "(this >= rules.lt || this < rules.gte)? " + - "\'value must be greater than or equal to " + - "%s and less than %s\'.format([rules.gte, " + - "rules.lt]) : \'\'\n\312\001\n\026int32.gte_lt_exclusi" + - "ve\032\257\001has(rules.lt) && rules.lt < rules.g" + - "te && (rules.lt <= this && this < rules." + - "gte)? \'value must be greater than or equ" + - "al to %s or less than %s\'.format([rules." + - "gte, rules.lt]) : \'\'\n\322\001\n\rint32.gte_lte\032\300" + - "\001has(rules.lte) && rules.lte >= rules.gt" + - "e && (this > rules.lte || this < rules.g" + - "te)? \'value must be greater than or equa" + - "l to %s and less than or equal to %s\'.fo" + - "rmat([rules.gte, rules.lte]) : \'\'\n\332\001\n\027in" + - "t32.gte_lte_exclusive\032\276\001has(rules.lte) &" + - "& rules.lte < rules.gte && (rules.lte < " + - "this && this < rules.gte)? \'value must b" + - "e greater than or equal to %s or less th" + - "an or equal to %s\'.format([rules.gte, ru" + - "les.lte]) : \'\'H\001R\003gte\022y\n\002in\030\006 \003(\005Bi\302Hf\nd" + - "\n\010int32.in\032X!(this in dyn(rules)[\'in\']) " + - "? \'value must be in list %s\'.format([dyn" + - "(rules)[\'in\']]) : \'\'R\002in\022}\n\006not_in\030\007 \003(\005" + - "Bf\302Hc\na\n\014int32.not_in\032Qthis in rules.not" + - "_in ? \'value must not be in list %s\'.for" + - "mat([rules.not_in]) : \'\'R\005notInB\013\n\tless_" + - "thanB\016\n\014greater_thanB\010\n\006_const\"\342\024\n\nInt64" + - "Rules\022u\n\005const\030\001 \001(\003BZ\302HW\nU\n\013int64.const" + - "\032Fthis != rules.const ? \'value must equa" + - "l %s\'.format([rules.const]) : \'\'H\002R\005cons" + - "t\210\001\001\022\216\001\n\002lt\030\002 \001(\003B|\302Hy\nw\n\010int64.lt\032k!has" + - "(rules.gte) && !has(rules.gt) && this >=" + - " rules.lt? \'value must be less than %s\'." + - "format([rules.lt]) : \'\'H\000R\002lt\022\241\001\n\003lte\030\003 " + - "\001(\003B\214\001\302H\210\001\n\205\001\n\tint64.lte\032x!has(rules.gte" + - ") && !has(rules.gt) && this > rules.lte?" + - " \'value must be less than or equal to %s" + - "\'.format([rules.lte]) : \'\'H\000R\003lte\022\233\007\n\002gt" + - "\030\004 \001(\003B\210\007\302H\204\007\nz\n\010int64.gt\032n!has(rules.lt" + - ") && !has(rules.lte) && this <= rules.gt" + - "? \'value must be greater than %s\'.format" + - "([rules.gt]) : \'\'\n\263\001\n\013int64.gt_lt\032\243\001has(" + - "rules.lt) && rules.lt >= rules.gt && (th" + - "is >= rules.lt || this <= rules.gt)? \'va" + - "lue must be greater than %s and less tha" + - "n %s\'.format([rules.gt, rules.lt]) : \'\'\n" + - "\273\001\n\025int64.gt_lt_exclusive\032\241\001has(rules.lt" + - ") && rules.lt < rules.gt && (rules.lt <=" + - " this && this <= rules.gt)? \'value must " + - "be greater than %s or less than %s\'.form" + - "at([rules.gt, rules.lt]) : \'\'\n\303\001\n\014int64." + - "gt_lte\032\262\001has(rules.lte) && rules.lte >= " + - "rules.gt && (this > rules.lte || this <=" + + ".gte, rules.lte]) : \'\'H\001R\003gte\022y\n\002in\030\006 \003(" + + "\002Bi\302Hf\nd\n\010float.in\032X!(this in dyn(rules)" + + "[\'in\']) ? \'value must be in list %s\'.for" + + "mat([dyn(rules)[\'in\']]) : \'\'R\002in\022}\n\006not_" + + "in\030\007 \003(\002Bf\302Hc\na\n\014float.not_in\032Qthis in r" + + "ules.not_in ? \'value must not be in list" + + " %s\'.format([rules.not_in]) : \'\'R\005notIn\022" + + "}\n\006finite\030\010 \001(\010Be\302Hb\n`\n\014float.finite\032Pru" + + "les.finite ? (this.isNan() || this.isInf" + + "() ? \'value must be finite\' : \'\') : \'\'R\006" + + "finite\0224\n\007example\030\t \003(\002B\032\302H\027\n\025\n\rfloat.ex" + + "ample\032\004trueR\007example*\t\010\350\007\020\200\200\200\200\002B\013\n\tless_" + + "thanB\016\n\014greater_than\"\374\027\n\013DoubleRules\022q\n\005" + + "const\030\001 \001(\001B[\302HX\nV\n\014double.const\032Fthis !" + + "= rules.const ? \'value must equal %s\'.fo" + + "rmat([rules.const]) : \'\'R\005const\022\244\001\n\002lt\030\002" + + " \001(\001B\221\001\302H\215\001\n\212\001\n\tdouble.lt\032}!has(rules.gt" + + "e) && !has(rules.gt) && (this.isNan() ||" + + " this >= rules.lt)? \'value must be less " + + "than %s\'.format([rules.lt]) : \'\'H\000R\002lt\022\265" + + "\001\n\003lte\030\003 \001(\001B\240\001\302H\234\001\n\231\001\n\ndouble.lte\032\212\001!ha" + + "s(rules.gte) && !has(rules.gt) && (this." + + "isNan() || this > rules.lte)? \'value mus" + + "t be less than or equal to %s\'.format([r" + + "ules.lte]) : \'\'H\000R\003lte\022\370\007\n\002gt\030\004 \001(\001B\345\007\302H" + + "\341\007\n\216\001\n\tdouble.gt\032\200\001!has(rules.lt) && !ha" + + "s(rules.lte) && (this.isNan() || this <=" + " rules.gt)? \'value must be greater than " + - "%s and less than or equal to %s\'.format(" + - "[rules.gt, rules.lte]) : \'\'\n\313\001\n\026int64.gt" + - "_lte_exclusive\032\260\001has(rules.lte) && rules" + - ".lte < rules.gt && (rules.lte < this && " + - "this <= rules.gt)? \'value must be greate" + - "r than %s or less than or equal to %s\'.f" + - "ormat([rules.gt, rules.lte]) : \'\'H\001R\002gt\022" + - "\350\007\n\003gte\030\005 \001(\003B\323\007\302H\317\007\n\210\001\n\tint64.gte\032{!has" + - "(rules.lt) && !has(rules.lte) && this < " + - "rules.gte? \'value must be greater than o" + - "r equal to %s\'.format([rules.gte]) : \'\'\n" + - "\302\001\n\014int64.gte_lt\032\261\001has(rules.lt) && rule" + - "s.lt >= rules.gte && (this >= rules.lt |" + - "| this < rules.gte)? \'value must be grea" + - "ter than or equal to %s and less than %s" + - "\'.format([rules.gte, rules.lt]) : \'\'\n\312\001\n" + - "\026int64.gte_lt_exclusive\032\257\001has(rules.lt) " + - "&& rules.lt < rules.gte && (rules.lt <= " + - "this && this < rules.gte)? \'value must b" + - "e greater than or equal to %s or less th" + - "an %s\'.format([rules.gte, rules.lt]) : \'" + - "\'\n\322\001\n\rint64.gte_lte\032\300\001has(rules.lte) && " + - "rules.lte >= rules.gte && (this > rules." + - "lte || this < rules.gte)? \'value must be" + - " greater than or equal to %s and less th" + - "an or equal to %s\'.format([rules.gte, ru" + - "les.lte]) : \'\'\n\332\001\n\027int64.gte_lte_exclusi" + - "ve\032\276\001has(rules.lte) && rules.lte < rules" + - ".gte && (rules.lte < this && this < rule" + - "s.gte)? \'value must be greater than or e" + - "qual to %s or less than or equal to %s\'." + - "format([rules.gte, rules.lte]) : \'\'H\001R\003g" + - "te\022y\n\002in\030\006 \003(\003Bi\302Hf\nd\n\010int64.in\032X!(this " + - "in dyn(rules)[\'in\']) ? \'value must be in" + - " list %s\'.format([dyn(rules)[\'in\']]) : \'" + - "\'R\002in\022}\n\006not_in\030\007 \003(\003Bf\302Hc\na\n\014int64.not_" + - "in\032Qthis in rules.not_in ? \'value must n" + - "ot be in list %s\'.format([rules.not_in])" + - " : \'\'R\005notInB\013\n\tless_thanB\016\n\014greater_tha" + - "nB\010\n\006_const\"\362\024\n\013UInt32Rules\022v\n\005const\030\001 \001" + - "(\rB[\302HX\nV\n\014uint32.const\032Fthis != rules.c" + - "onst ? \'value must equal %s\'.format([rul" + - "es.const]) : \'\'H\002R\005const\210\001\001\022\217\001\n\002lt\030\002 \001(\r" + - "B}\302Hz\nx\n\tuint32.lt\032k!has(rules.gte) && !" + - "has(rules.gt) && this >= rules.lt? \'valu" + - "e must be less than %s\'.format([rules.lt" + - "]) : \'\'H\000R\002lt\022\242\001\n\003lte\030\003 \001(\rB\215\001\302H\211\001\n\206\001\n\nu" + - "int32.lte\032x!has(rules.gte) && !has(rules" + - ".gt) && this > rules.lte? \'value must be" + - " less than or equal to %s\'.format([rules" + - ".lte]) : \'\'H\000R\003lte\022\240\007\n\002gt\030\004 \001(\rB\215\007\302H\211\007\n{" + - "\n\tuint32.gt\032n!has(rules.lt) && !has(rule" + - "s.lte) && this <= rules.gt? \'value must " + - "be greater than %s\'.format([rules.gt]) :" + - " \'\'\n\264\001\n\014uint32.gt_lt\032\243\001has(rules.lt) && " + - "rules.lt >= rules.gt && (this >= rules.l" + + "%s\'.format([rules.gt]) : \'\'\n\304\001\n\014double.g" + + "t_lt\032\263\001has(rules.lt) && rules.lt >= rule" + + "s.gt && (this.isNan() || this >= rules.l" + "t || this <= rules.gt)? \'value must be g" + "reater than %s and less than %s\'.format(" + - "[rules.gt, rules.lt]) : \'\'\n\274\001\n\026uint32.gt" + - "_lt_exclusive\032\241\001has(rules.lt) && rules.l" + - "t < rules.gt && (rules.lt <= this && thi" + - "s <= rules.gt)? \'value must be greater t" + - "han %s or less than %s\'.format([rules.gt" + - ", rules.lt]) : \'\'\n\304\001\n\ruint32.gt_lte\032\262\001ha" + - "s(rules.lte) && rules.lte >= rules.gt &&" + - " (this > rules.lte || this <= rules.gt)?" + - " \'value must be greater than %s and less" + - " than or equal to %s\'.format([rules.gt, " + - "rules.lte]) : \'\'\n\314\001\n\027uint32.gt_lte_exclu" + - "sive\032\260\001has(rules.lte) && rules.lte < rul" + - "es.gt && (rules.lte < this && this <= ru" + - "les.gt)? \'value must be greater than %s " + - "or less than or equal to %s\'.format([rul" + - "es.gt, rules.lte]) : \'\'H\001R\002gt\022\355\007\n\003gte\030\005 " + - "\001(\rB\330\007\302H\324\007\n\211\001\n\nuint32.gte\032{!has(rules.lt" + - ") && !has(rules.lte) && this < rules.gte" + - "? \'value must be greater than or equal t" + - "o %s\'.format([rules.gte]) : \'\'\n\303\001\n\ruint3" + - "2.gte_lt\032\261\001has(rules.lt) && rules.lt >= " + - "rules.gte && (this >= rules.lt || this <" + - " rules.gte)? \'value must be greater than" + - " or equal to %s and less than %s\'.format" + - "([rules.gte, rules.lt]) : \'\'\n\313\001\n\027uint32." + - "gte_lt_exclusive\032\257\001has(rules.lt) && rule" + - "s.lt < rules.gte && (rules.lt <= this &&" + - " this < rules.gte)? \'value must be great" + - "er than or equal to %s or less than %s\'." + - "format([rules.gte, rules.lt]) : \'\'\n\323\001\n\016u" + - "int32.gte_lte\032\300\001has(rules.lte) && rules." + - "lte >= rules.gte && (this > rules.lte ||" + - " this < rules.gte)? \'value must be great" + - "er than or equal to %s and less than or " + - "equal to %s\'.format([rules.gte, rules.lt" + - "e]) : \'\'\n\333\001\n\030uint32.gte_lte_exclusive\032\276\001" + - "has(rules.lte) && rules.lte < rules.gte " + - "&& (rules.lte < this && this < rules.gte" + - ")? \'value must be greater than or equal " + - "to %s or less than or equal to %s\'.forma" + - "t([rules.gte, rules.lte]) : \'\'H\001R\003gte\022z\n" + - "\002in\030\006 \003(\rBj\302Hg\ne\n\tuint32.in\032X!(this in d" + - "yn(rules)[\'in\']) ? \'value must be in lis" + - "t %s\'.format([dyn(rules)[\'in\']]) : \'\'R\002i" + - "n\022~\n\006not_in\030\007 \003(\rBg\302Hd\nb\n\ruint32.not_in\032" + - "Qthis in rules.not_in ? \'value must not " + - "be in list %s\'.format([rules.not_in]) : " + - "\'\'R\005notInB\013\n\tless_thanB\016\n\014greater_thanB\010" + - "\n\006_const\"\362\024\n\013UInt64Rules\022v\n\005const\030\001 \001(\004B" + - "[\302HX\nV\n\014uint64.const\032Fthis != rules.cons" + - "t ? \'value must equal %s\'.format([rules." + - "const]) : \'\'H\002R\005const\210\001\001\022\217\001\n\002lt\030\002 \001(\004B}\302" + - "Hz\nx\n\tuint64.lt\032k!has(rules.gte) && !has" + - "(rules.gt) && this >= rules.lt? \'value m" + - "ust be less than %s\'.format([rules.lt]) " + - ": \'\'H\000R\002lt\022\242\001\n\003lte\030\003 \001(\004B\215\001\302H\211\001\n\206\001\n\nuint", - "64.lte\032x!has(rules.gte) && !has(rules.gt" + - ") && this > rules.lte? \'value must be le" + - "ss than or equal to %s\'.format([rules.lt" + - "e]) : \'\'H\000R\003lte\022\240\007\n\002gt\030\004 \001(\004B\215\007\302H\211\007\n{\n\tu" + - "int64.gt\032n!has(rules.lt) && !has(rules.l" + - "te) && this <= rules.gt? \'value must be " + - "greater than %s\'.format([rules.gt]) : \'\'" + - "\n\264\001\n\014uint64.gt_lt\032\243\001has(rules.lt) && rul" + - "es.lt >= rules.gt && (this >= rules.lt |" + - "| this <= rules.gt)? \'value must be grea" + - "ter than %s and less than %s\'.format([ru" + - "les.gt, rules.lt]) : \'\'\n\274\001\n\026uint64.gt_lt" + - "_exclusive\032\241\001has(rules.lt) && rules.lt <" + - " rules.gt && (rules.lt <= this && this <" + - "= rules.gt)? \'value must be greater than" + - " %s or less than %s\'.format([rules.gt, r" + - "ules.lt]) : \'\'\n\304\001\n\ruint64.gt_lte\032\262\001has(r" + - "ules.lte) && rules.lte >= rules.gt && (t" + - "his > rules.lte || this <= rules.gt)? \'v" + - "alue must be greater than %s and less th" + - "an or equal to %s\'.format([rules.gt, rul" + - "es.lte]) : \'\'\n\314\001\n\027uint64.gt_lte_exclusiv" + - "e\032\260\001has(rules.lte) && rules.lte < rules." + - "gt && (rules.lte < this && this <= rules" + - ".gt)? \'value must be greater than %s or " + - "less than or equal to %s\'.format([rules." + - "gt, rules.lte]) : \'\'H\001R\002gt\022\355\007\n\003gte\030\005 \001(\004" + - "B\330\007\302H\324\007\n\211\001\n\nuint64.gte\032{!has(rules.lt) &" + - "& !has(rules.lte) && this < rules.gte? \'" + - "value must be greater than or equal to %" + - "s\'.format([rules.gte]) : \'\'\n\303\001\n\ruint64.g" + - "te_lt\032\261\001has(rules.lt) && rules.lt >= rul" + - "es.gte && (this >= rules.lt || this < ru" + - "les.gte)? \'value must be greater than or" + - " equal to %s and less than %s\'.format([r" + - "ules.gte, rules.lt]) : \'\'\n\313\001\n\027uint64.gte" + - "_lt_exclusive\032\257\001has(rules.lt) && rules.l" + - "t < rules.gte && (rules.lt <= this && th" + - "is < rules.gte)? \'value must be greater " + - "than or equal to %s or less than %s\'.for" + - "mat([rules.gte, rules.lt]) : \'\'\n\323\001\n\016uint" + - "64.gte_lte\032\300\001has(rules.lte) && rules.lte" + - " >= rules.gte && (this > rules.lte || th" + - "is < rules.gte)? \'value must be greater " + - "than or equal to %s and less than or equ" + - "al to %s\'.format([rules.gte, rules.lte])" + - " : \'\'\n\333\001\n\030uint64.gte_lte_exclusive\032\276\001has" + - "(rules.lte) && rules.lte < rules.gte && " + - "(rules.lte < this && this < rules.gte)? " + - "\'value must be greater than or equal to " + - "%s or less than or equal to %s\'.format([" + - "rules.gte, rules.lte]) : \'\'H\001R\003gte\022z\n\002in" + - "\030\006 \003(\004Bj\302Hg\ne\n\tuint64.in\032X!(this in dyn(" + - "rules)[\'in\']) ? \'value must be in list %" + - "s\'.format([dyn(rules)[\'in\']]) : \'\'R\002in\022~" + - "\n\006not_in\030\007 \003(\004Bg\302Hd\nb\n\ruint64.not_in\032Qth" + - "is in rules.not_in ? \'value must not be " + - "in list %s\'.format([rules.not_in]) : \'\'R" + - "\005notInB\013\n\tless_thanB\016\n\014greater_thanB\010\n\006_" + - "const\"\362\024\n\013SInt32Rules\022v\n\005const\030\001 \001(\021B[\302H" + - "X\nV\n\014sint32.const\032Fthis != rules.const ?" + - " \'value must equal %s\'.format([rules.con" + - "st]) : \'\'H\002R\005const\210\001\001\022\217\001\n\002lt\030\002 \001(\021B}\302Hz\n" + - "x\n\tsint32.lt\032k!has(rules.gte) && !has(ru" + - "les.gt) && this >= rules.lt? \'value must" + - " be less than %s\'.format([rules.lt]) : \'" + - "\'H\000R\002lt\022\242\001\n\003lte\030\003 \001(\021B\215\001\302H\211\001\n\206\001\n\nsint32." + - "lte\032x!has(rules.gte) && !has(rules.gt) &" + - "& this > rules.lte? \'value must be less " + - "than or equal to %s\'.format([rules.lte])" + - " : \'\'H\000R\003lte\022\240\007\n\002gt\030\004 \001(\021B\215\007\302H\211\007\n{\n\tsint" + - "32.gt\032n!has(rules.lt) && !has(rules.lte)" + - " && this <= rules.gt? \'value must be gre" + - "ater than %s\'.format([rules.gt]) : \'\'\n\264\001" + - "\n\014sint32.gt_lt\032\243\001has(rules.lt) && rules." + - "lt >= rules.gt && (this >= rules.lt || t" + - "his <= rules.gt)? \'value must be greater" + - " than %s and less than %s\'.format([rules" + - ".gt, rules.lt]) : \'\'\n\274\001\n\026sint32.gt_lt_ex" + - "clusive\032\241\001has(rules.lt) && rules.lt < ru" + - "les.gt && (rules.lt <= this && this <= r" + - "ules.gt)? \'value must be greater than %s" + - " or less than %s\'.format([rules.gt, rule" + - "s.lt]) : \'\'\n\304\001\n\rsint32.gt_lte\032\262\001has(rule" + - "s.lte) && rules.lte >= rules.gt && (this" + + "[rules.gt, rules.lt]) : \'\'\n\316\001\n\026double.gt" + + "_lt_exclusive\032\263\001has(rules.lt) && rules.l" + + "t < rules.gt && (this.isNan() || (rules." + + "lt <= this && this <= rules.gt))? \'value" + + " must be greater than %s or less than %s" + + "\'.format([rules.gt, rules.lt]) : \'\'\n\324\001\n\r" + + "double.gt_lte\032\302\001has(rules.lte) && rules." + + "lte >= rules.gt && (this.isNan() || this" + " > rules.lte || this <= rules.gt)? \'valu" + "e must be greater than %s and less than " + "or equal to %s\'.format([rules.gt, rules." + - "lte]) : \'\'\n\314\001\n\027sint32.gt_lte_exclusive\032\260" + + "lte]) : \'\'\n\336\001\n\027double.gt_lte_exclusive\032\302" + "\001has(rules.lte) && rules.lte < rules.gt " + - "&& (rules.lte < this && this <= rules.gt" + - ")? \'value must be greater than %s or les" + - "s than or equal to %s\'.format([rules.gt," + - " rules.lte]) : \'\'H\001R\002gt\022\355\007\n\003gte\030\005 \001(\021B\330\007" + - "\302H\324\007\n\211\001\n\nsint32.gte\032{!has(rules.lt) && !" + - "has(rules.lte) && this < rules.gte? \'val" + - "ue must be greater than or equal to %s\'." + - "format([rules.gte]) : \'\'\n\303\001\n\rsint32.gte_" + - "lt\032\261\001has(rules.lt) && rules.lt >= rules." + - "gte && (this >= rules.lt || this < rules" + - ".gte)? \'value must be greater than or eq" + - "ual to %s and less than %s\'.format([rule" + - "s.gte, rules.lt]) : \'\'\n\313\001\n\027sint32.gte_lt" + - "_exclusive\032\257\001has(rules.lt) && rules.lt <" + - " rules.gte && (rules.lt <= this && this " + - "< rules.gte)? \'value must be greater tha" + - "n or equal to %s or less than %s\'.format" + - "([rules.gte, rules.lt]) : \'\'\n\323\001\n\016sint32." + - "gte_lte\032\300\001has(rules.lte) && rules.lte >=" + - " rules.gte && (this > rules.lte || this " + - "< rules.gte)? \'value must be greater tha" + - "n or equal to %s and less than or equal " + - "to %s\'.format([rules.gte, rules.lte]) : " + - "\'\'\n\333\001\n\030sint32.gte_lte_exclusive\032\276\001has(ru" + - "les.lte) && rules.lte < rules.gte && (ru" + - "les.lte < this && this < rules.gte)? \'va" + - "lue must be greater than or equal to %s " + - "or less than or equal to %s\'.format([rul" + - "es.gte, rules.lte]) : \'\'H\001R\003gte\022z\n\002in\030\006 " + - "\003(\021Bj\302Hg\ne\n\tsint32.in\032X!(this in dyn(rul" + - "es)[\'in\']) ? \'value must be in list %s\'." + - "format([dyn(rules)[\'in\']]) : \'\'R\002in\022~\n\006n" + - "ot_in\030\007 \003(\021Bg\302Hd\nb\n\rsint32.not_in\032Qthis " + - "in rules.not_in ? \'value must not be in " + - "list %s\'.format([rules.not_in]) : \'\'R\005no" + - "tInB\013\n\tless_thanB\016\n\014greater_thanB\010\n\006_con" + - "st\"\362\024\n\013SInt64Rules\022v\n\005const\030\001 \001(\022B[\302HX\nV" + - "\n\014sint64.const\032Fthis != rules.const ? \'v" + - "alue must equal %s\'.format([rules.const]" + - ") : \'\'H\002R\005const\210\001\001\022\217\001\n\002lt\030\002 \001(\022B}\302Hz\nx\n\t" + - "sint64.lt\032k!has(rules.gte) && !has(rules" + - ".gt) && this >= rules.lt? \'value must be" + - " less than %s\'.format([rules.lt]) : \'\'H\000" + - "R\002lt\022\242\001\n\003lte\030\003 \001(\022B\215\001\302H\211\001\n\206\001\n\nsint64.lte" + + "&& (this.isNan() || (rules.lte < this &&" + + " this <= rules.gt))? \'value must be grea" + + "ter than %s or less than or equal to %s\'" + + ".format([rules.gt, rules.lte]) : \'\'H\001R\002g" + + "t\022\304\010\n\003gte\030\005 \001(\001B\257\010\302H\253\010\n\234\001\n\ndouble.gte\032\215\001" + + "!has(rules.lt) && !has(rules.lte) && (th" + + "is.isNan() || this < rules.gte)? \'value " + + "must be greater than or equal to %s\'.for" + + "mat([rules.gte]) : \'\'\n\323\001\n\rdouble.gte_lt\032" + + "\301\001has(rules.lt) && rules.lt >= rules.gte" + + " && (this.isNan() || this >= rules.lt ||" + + " this < rules.gte)? \'value must be great" + + "er than or equal to %s and less than %s\'" + + ".format([rules.gte, rules.lt]) : \'\'\n\335\001\n\027" + + "double.gte_lt_exclusive\032\301\001has(rules.lt) " + + "&& rules.lt < rules.gte && (this.isNan()" + + " || (rules.lt <= this && this < rules.gt" + + "e))? \'value must be greater than or equa" + + "l to %s or less than %s\'.format([rules.g" + + "te, rules.lt]) : \'\'\n\343\001\n\016double.gte_lte\032\320" + + "\001has(rules.lte) && rules.lte >= rules.gt" + + "e && (this.isNan() || this > rules.lte |" + + "| this < rules.gte)? \'value must be grea" + + "ter than or equal to %s and less than or" + + " equal to %s\'.format([rules.gte, rules.l" + + "te]) : \'\'\n\355\001\n\030double.gte_lte_exclusive\032\320" + + "\001has(rules.lte) && rules.lte < rules.gte" + + " && (this.isNan() || (rules.lte < this &" + + "& this < rules.gte))? \'value must be gre" + + "ater than or equal to %s or less than or" + + " equal to %s\'.format([rules.gte, rules.l" + + "te]) : \'\'H\001R\003gte\022z\n\002in\030\006 \003(\001Bj\302Hg\ne\n\tdou" + + "ble.in\032X!(this in dyn(rules)[\'in\']) ? \'v" + + "alue must be in list %s\'.format([dyn(rul" + + "es)[\'in\']]) : \'\'R\002in\022~\n\006not_in\030\007 \003(\001Bg\302H" + + "d\nb\n\rdouble.not_in\032Qthis in rules.not_in" + + " ? \'value must not be in list %s\'.format" + + "([rules.not_in]) : \'\'R\005notIn\022~\n\006finite\030\010" + + " \001(\010Bf\302Hc\na\n\rdouble.finite\032Prules.finite" + + " ? (this.isNan() || this.isInf() ? \'valu" + + "e must be finite\' : \'\') : \'\'R\006finite\0225\n\007" + + "example\030\t \003(\001B\033\302H\030\n\026\n\016double.example\032\004tr" + + "ueR\007example*\t\010\350\007\020\200\200\200\200\002B\013\n\tless_thanB\016\n\014g" + + "reater_than\"\224\025\n\nInt32Rules\022p\n\005const\030\001 \001(" + + "\005BZ\302HW\nU\n\013int32.const\032Fthis != rules.con" + + "st ? \'value must equal %s\'.format([rules" + + ".const]) : \'\'R\005const\022\216\001\n\002lt\030\002 \001(\005B|\302Hy\nw" + + "\n\010int32.lt\032k!has(rules.gte) && !has(rule" + + "s.gt) && this >= rules.lt? \'value must b" + + "e less than %s\'.format([rules.lt]) : \'\'H" + + "\000R\002lt\022\241\001\n\003lte\030\003 \001(\005B\214\001\302H\210\001\n\205\001\n\tint32.lte" + "\032x!has(rules.gte) && !has(rules.gt) && t" + "his > rules.lte? \'value must be less tha" + "n or equal to %s\'.format([rules.lte]) : " + - "\'\'H\000R\003lte\022\240\007\n\002gt\030\004 \001(\022B\215\007\302H\211\007\n{\n\tsint64." + - "gt\032n!has(rules.lt) && !has(rules.lte) &&" + - " this <= rules.gt? \'value must be greate" + - "r than %s\'.format([rules.gt]) : \'\'\n\264\001\n\014s" + - "int64.gt_lt\032\243\001has(rules.lt) && rules.lt " + - ">= rules.gt && (this >= rules.lt || this" + - " <= rules.gt)? \'value must be greater th" + - "an %s and less than %s\'.format([rules.gt" + - ", rules.lt]) : \'\'\n\274\001\n\026sint64.gt_lt_exclu" + - "sive\032\241\001has(rules.lt) && rules.lt < rules" + - ".gt && (rules.lt <= this && this <= rule" + - "s.gt)? \'value must be greater than %s or" + - " less than %s\'.format([rules.gt, rules.l" + - "t]) : \'\'\n\304\001\n\rsint64.gt_lte\032\262\001has(rules.l" + - "te) && rules.lte >= rules.gt && (this > " + - "rules.lte || this <= rules.gt)? \'value m" + - "ust be greater than %s and less than or " + - "equal to %s\'.format([rules.gt, rules.lte" + - "]) : \'\'\n\314\001\n\027sint64.gt_lte_exclusive\032\260\001ha" + - "s(rules.lte) && rules.lte < rules.gt && " + - "(rules.lte < this && this <= rules.gt)? " + - "\'value must be greater than %s or less t" + - "han or equal to %s\'.format([rules.gt, ru" + - "les.lte]) : \'\'H\001R\002gt\022\355\007\n\003gte\030\005 \001(\022B\330\007\302H\324" + - "\007\n\211\001\n\nsint64.gte\032{!has(rules.lt) && !has" + - "(rules.lte) && this < rules.gte? \'value " + - "must be greater than or equal to %s\'.for" + - "mat([rules.gte]) : \'\'\n\303\001\n\rsint64.gte_lt\032" + - "\261\001has(rules.lt) && rules.lt >= rules.gte" + - " && (this >= rules.lt || this < rules.gt" + - "e)? \'value must be greater than or equal" + - " to %s and less than %s\'.format([rules.g" + - "te, rules.lt]) : \'\'\n\313\001\n\027sint64.gte_lt_ex" + - "clusive\032\257\001has(rules.lt) && rules.lt < ru" + - "les.gte && (rules.lt <= this && this < r" + - "ules.gte)? \'value must be greater than o" + - "r equal to %s or less than %s\'.format([r" + - "ules.gte, rules.lt]) : \'\'\n\323\001\n\016sint64.gte" + - "_lte\032\300\001has(rules.lte) && rules.lte >= ru" + - "les.gte && (this > rules.lte || this < r" + - "ules.gte)? \'value must be greater than o" + - "r equal to %s and less than or equal to " + - "%s\'.format([rules.gte, rules.lte]) : \'\'\n" + - "\333\001\n\030sint64.gte_lte_exclusive\032\276\001has(rules" + - ".lte) && rules.lte < rules.gte && (rules" + - ".lte < this && this < rules.gte)? \'value" + + "\'\'H\000R\003lte\022\233\007\n\002gt\030\004 \001(\005B\210\007\302H\204\007\nz\n\010int32.g" + + "t\032n!has(rules.lt) && !has(rules.lte) && " + + "this <= rules.gt? \'value must be greater" + + " than %s\'.format([rules.gt]) : \'\'\n\263\001\n\013in" + + "t32.gt_lt\032\243\001has(rules.lt) && rules.lt >=" + + " rules.gt && (this >= rules.lt || this <" + + "= rules.gt)? \'value must be greater than" + + " %s and less than %s\'.format([rules.gt, " + + "rules.lt]) : \'\'\n\273\001\n\025int32.gt_lt_exclusiv" + + "e\032\241\001has(rules.lt) && rules.lt < rules.gt" + + " && (rules.lt <= this && this <= rules.g" + + "t)? \'value must be greater than %s or le" + + "ss than %s\'.format([rules.gt, rules.lt])" + + " : \'\'\n\303\001\n\014int32.gt_lte\032\262\001has(rules.lte) " + + "&& rules.lte >= rules.gt && (this > rule" + + "s.lte || this <= rules.gt)? \'value must " + + "be greater than %s and less than or equa" + + "l to %s\'.format([rules.gt, rules.lte]) :" + + " \'\'\n\313\001\n\026int32.gt_lte_exclusive\032\260\001has(rul" + + "es.lte) && rules.lte < rules.gt && (rule" + + "s.lte < this && this <= rules.gt)? \'valu" + + "e must be greater than %s or less than o" + + "r equal to %s\'.format([rules.gt, rules.l" + + "te]) : \'\'H\001R\002gt\022\350\007\n\003gte\030\005 \001(\005B\323\007\302H\317\007\n\210\001\n" + + "\tint32.gte\032{!has(rules.lt) && !has(rules" + + ".lte) && this < rules.gte? \'value must b" + + "e greater than or equal to %s\'.format([r" + + "ules.gte]) : \'\'\n\302\001\n\014int32.gte_lt\032\261\001has(r" + + "ules.lt) && rules.lt >= rules.gte && (th" + + "is >= rules.lt || this < rules.gte)? \'va" + + "lue must be greater than or equal to %s " + + "and less than %s\'.format([rules.gte, rul" + + "es.lt]) : \'\'\n\312\001\n\026int32.gte_lt_exclusive\032" + + "\257\001has(rules.lt) && rules.lt < rules.gte " + + "&& (rules.lt <= this && this < rules.gte" + + ")? \'value must be greater than or equal " + + "to %s or less than %s\'.format([rules.gte" + + ", rules.lt]) : \'\'\n\322\001\n\rint32.gte_lte\032\300\001ha" + + "s(rules.lte) && rules.lte >= rules.gte &" + + "& (this > rules.lte || this < rules.gte)" + + "? \'value must be greater than or equal t" + + "o %s and less than or equal to %s\'.forma" + + "t([rules.gte, rules.lte]) : \'\'\n\332\001\n\027int32" + + ".gte_lte_exclusive\032\276\001has(rules.lte) && r" + + "ules.lte < rules.gte && (rules.lte < thi" + + "s && this < rules.gte)? \'value must be g" + + "reater than or equal to %s or less than " + + "or equal to %s\'.format([rules.gte, rules" + + ".lte]) : \'\'H\001R\003gte\022y\n\002in\030\006 \003(\005Bi\302Hf\nd\n\010i" + + "nt32.in\032X!(this in dyn(rules)[\'in\']) ? \'" + + "value must be in list %s\'.format([dyn(ru" + + "les)[\'in\']]) : \'\'R\002in\022}\n\006not_in\030\007 \003(\005Bf\302" + + "Hc\na\n\014int32.not_in\032Qthis in rules.not_in" + + " ? \'value must not be in list %s\'.format" + + "([rules.not_in]) : \'\'R\005notIn\0224\n\007example\030" + + "\010 \003(\005B\032\302H\027\n\025\n\rint32.example\032\004trueR\007examp" + + "le*\t\010\350\007\020\200\200\200\200\002B\013\n\tless_thanB\016\n\014greater_th" + + "an\"\224\025\n\nInt64Rules\022p\n\005const\030\001 \001(\003BZ\302HW\nU\n" + + "\013int64.const\032Fthis != rules.const ? \'val" + + "ue must equal %s\'.format([rules.const]) " + + ": \'\'R\005const\022\216\001\n\002lt\030\002 \001(\003B|\302Hy\nw\n\010int64.l" + + "t\032k!has(rules.gte) && !has(rules.gt) && " + + "this >= rules.lt? \'value must be less th" + + "an %s\'.format([rules.lt]) : \'\'H\000R\002lt\022\241\001\n" + + "\003lte\030\003 \001(\003B\214\001\302H\210\001\n\205\001\n\tint64.lte\032x!has(ru" + + "les.gte) && !has(rules.gt) && this > rul" + + "es.lte? \'value must be less than or equa" + + "l to %s\'.format([rules.lte]) : \'\'H\000R\003lte" + + "\022\233\007\n\002gt\030\004 \001(\003B\210\007\302H\204\007\nz\n\010int64.gt\032n!has(r" + + "ules.lt) && !has(rules.lte) && this <= r" + + "ules.gt? \'value must be greater than %s\'" + + ".format([rules.gt]) : \'\'\n\263\001\n\013int64.gt_lt" + + "\032\243\001has(rules.lt) && rules.lt >= rules.gt" + + " && (this >= rules.lt || this <= rules.g" + + "t)? \'value must be greater than %s and l" + + "ess than %s\'.format([rules.gt, rules.lt]" + + ") : \'\'\n\273\001\n\025int64.gt_lt_exclusive\032\241\001has(r" + + "ules.lt) && rules.lt < rules.gt && (rule" + + "s.lt <= this && this <= rules.gt)? \'valu" + + "e must be greater than %s or less than %" + + "s\'.format([rules.gt, rules.lt]) : \'\'\n\303\001\n" + + "\014int64.gt_lte\032\262\001has(rules.lte) && rules." + + "lte >= rules.gt && (this > rules.lte || " + + "this <= rules.gt)? \'value must be greate" + + "r than %s and less than or equal to %s\'." + + "format([rules.gt, rules.lte]) : \'\'\n\313\001\n\026i" + + "nt64.gt_lte_exclusive\032\260\001has(rules.lte) &" + + "& rules.lte < rules.gt && (rules.lte < t" + + "his && this <= rules.gt)? \'value must be" + + " greater than %s or less than or equal t" + + "o %s\'.format([rules.gt, rules.lte]) : \'\'" + + "H\001R\002gt\022\350\007\n\003gte\030\005 \001(\003B\323\007\302H\317\007\n\210\001\n\tint64.gt" + + "e\032{!has(rules.lt) && !has(rules.lte) && " + + "this < rules.gte? \'value must be greater" + + " than or equal to %s\'.format([rules.gte]" + + ") : \'\'\n\302\001\n\014int64.gte_lt\032\261\001has(rules.lt) " + + "&& rules.lt >= rules.gte && (this >= rul" + + "es.lt || this < rules.gte)? \'value must " + + "be greater than or equal to %s and less " + + "than %s\'.format([rules.gte, rules.lt]) :" + + " \'\'\n\312\001\n\026int64.gte_lt_exclusive\032\257\001has(rul" + + "es.lt) && rules.lt < rules.gte && (rules" + + ".lt <= this && this < rules.gte)? \'value" + " must be greater than or equal to %s or " + + "less than %s\'.format([rules.gte, rules.l" + + "t]) : \'\'\n\322\001\n\rint64.gte_lte\032\300\001has(rules.l" + + "te) && rules.lte >= rules.gte && (this >" + + " rules.lte || this < rules.gte)? \'value " + + "must be greater than or equal to %s and " + "less than or equal to %s\'.format([rules." + - "gte, rules.lte]) : \'\'H\001R\003gte\022z\n\002in\030\006 \003(\022" + - "Bj\302Hg\ne\n\tsint64.in\032X!(this in dyn(rules)" + - "[\'in\']) ? \'value must be in list %s\'.for" + - "mat([dyn(rules)[\'in\']]) : \'\'R\002in\022~\n\006not_" + - "in\030\007 \003(\022Bg\302Hd\nb\n\rsint64.not_in\032Qthis in " + - "rules.not_in ? \'value must not be in lis" + - "t %s\'.format([rules.not_in]) : \'\'R\005notIn" + - "B\013\n\tless_thanB\016\n\014greater_thanB\010\n\006_const\"" + - "\202\025\n\014Fixed32Rules\022w\n\005const\030\001 \001(\007B\\\302HY\nW\n\r" + - "fixed32.const\032Fthis != rules.const ? \'va" + + "gte, rules.lte]) : \'\'\n\332\001\n\027int64.gte_lte_" + + "exclusive\032\276\001has(rules.lte) && rules.lte " + + "< rules.gte && (rules.lte < this && this" + + " < rules.gte)? \'value must be greater th" + + "an or equal to %s or less than or equal " + + "to %s\'.format([rules.gte, rules.lte]) : " + + "\'\'H\001R\003gte\022y\n\002in\030\006 \003(\003Bi\302Hf\nd\n\010int64.in\032X" + + "!(this in dyn(rules)[\'in\']) ? \'value mus" + + "t be in list %s\'.format([dyn(rules)[\'in\'" + + "]]) : \'\'R\002in\022}\n\006not_in\030\007 \003(\003Bf\302Hc\na\n\014int" + + "64.not_in\032Qthis in rules.not_in ? \'value" + + " must not be in list %s\'.format([rules.n" + + "ot_in]) : \'\'R\005notIn\0224\n\007example\030\t \003(\003B\032\302H" + + "\027\n\025\n\rint64.example\032\004trueR\007example*\t\010\350\007\020\200" + + "\200\200\200\002B\013\n\tless_thanB\016\n\014greater_than\"\245\025\n\013UI" + + "nt32Rules\022q\n\005const\030\001 \001(\rB[\302HX\nV\n\014uint32." + + "const\032Fthis != rules.const ? \'value must" + + " equal %s\'.format([rules.const]) : \'\'R\005c" + + "onst\022\217\001\n\002lt\030\002 \001(\rB}\302Hz\nx\n\tuint32.lt\032k!ha" + + "s(rules.gte) && !has(rules.gt) && this >" + + "= rules.lt? \'value must be less than %s\'" + + ".format([rules.lt]) : \'\'H\000R\002lt\022\242\001\n\003lte\030\003" + + " \001(\rB\215\001\302H\211\001\n\206\001\n\nuint32.lte\032x!has(rules.g" + + "te) && !has(rules.gt) && this > rules.lt" + + "e? \'value must be less than or equal to " + + "%s\'.format([rules.lte]) : \'\'H\000R\003lte\022\240\007\n\002" + + "gt\030\004 \001(\rB\215\007\302H\211\007\n{\n\tuint32.gt\032n!has(rules" + + ".lt) && !has(rules.lte) && this <= rules" + + ".gt? \'value must be greater than %s\'.for" + + "mat([rules.gt]) : \'\'\n\264\001\n\014uint32.gt_lt\032\243\001" + + "has(rules.lt) && rules.lt >= rules.gt &&" + + " (this >= rules.lt || this <= rules.gt)?" + + " \'value must be greater than %s and less" + + " than %s\'.format([rules.gt, rules.lt]) :" + + " \'\'\n\274\001\n\026uint32.gt_lt_exclusive\032\241\001has(rul" + + "es.lt) && rules.lt < rules.gt && (rules." + + "lt <= this && this <= rules.gt)? \'value " + + "must be greater than %s or less than %s\'" + + ".format([rules.gt, rules.lt]) : \'\'\n\304\001\n\ru" + + "int32.gt_lte\032\262\001has(rules.lte) && rules.l" + + "te >= rules.gt && (this > rules.lte || t" + + "his <= rules.gt)? \'value must be greater" + + " than %s and less than or equal to %s\'.f" + + "ormat([rules.gt, rules.lte]) : \'\'\n\314\001\n\027ui" + + "nt32.gt_lte_exclusive\032\260\001has(rules.lte) &" + + "& rules.lte < rules.gt && (rules.lte < t" + + "his && this <= rules.gt)? \'value must be" + + " greater than %s or less than or equal t" + + "o %s\'.format([rules.gt, rules.lte]) : \'\'" + + "H\001R\002gt\022\355\007\n\003gte\030\005 \001(\rB\330\007\302H\324\007\n\211\001\n\nuint32.g" + + "te\032{!has(rules.lt) && !has(rules.lte) &&" + + " this < rules.gte? \'value must be greate" + + "r than or equal to %s\'.format([rules.gte" + + "]) : \'\'\n\303\001\n\ruint32.gte_lt\032\261\001has(rules.lt" + + ") && rules.lt >= rules.gte && (this >= r" + + "ules.lt || this < rules.gte)? \'value mus" + + "t be greater than or equal to %s and les" + + "s than %s\'.format([rules.gte, rules.lt])" + + " : \'\'\n\313\001\n\027uint32.gte_lt_exclusive\032\257\001has(" + + "rules.lt) && rules.lt < rules.gte && (ru" + + "les.lt <= this && this < rules.gte)? \'va" + + "lue must be greater than or equal to %s " + + "or less than %s\'.format([rules.gte, rule" + + "s.lt]) : \'\'\n\323\001\n\016uint32.gte_lte\032\300\001has(rul" + + "es.lte) && rules.lte >= rules.gte && (th" + + "is > rules.lte || this < rules.gte)? \'va" + + "lue must be greater than or equal to %s " + + "and less than or equal to %s\'.format([ru" + + "les.gte, rules.lte]) : \'\'\n\333\001\n\030uint32.gte" + + "_lte_exclusive\032\276\001has(rules.lte) && rules" + + ".lte < rules.gte && (rules.lte < this &&" + + " this < rules.gte)? \'value must be great" + + "er than or equal to %s or less than or e" + + "qual to %s\'.format([rules.gte, rules.lte" + + "]) : \'\'H\001R\003gte\022z\n\002in\030\006 \003(\rBj\302Hg\ne\n\tuint3" + + "2.in\032X!(this in dyn(rules)[\'in\']) ? \'val" + + "ue must be in list %s\'.format([dyn(rules" + + ")[\'in\']]) : \'\'R\002in\022~\n\006not_in\030\007 \003(\rBg\302Hd\n" + + "b\n\ruint32.not_in\032Qthis in rules.not_in ?" + + " \'value must not be in list %s\'.format([" + + "rules.not_in]) : \'\'R\005notIn\0225\n\007example\030\010 " + + "\003(\rB\033\302H\030\n\026\n\016uint32.example\032\004trueR\007exampl", + "e*\t\010\350\007\020\200\200\200\200\002B\013\n\tless_thanB\016\n\014greater_tha" + + "n\"\245\025\n\013UInt64Rules\022q\n\005const\030\001 \001(\004B[\302HX\nV\n" + + "\014uint64.const\032Fthis != rules.const ? \'va" + "lue must equal %s\'.format([rules.const])" + - " : \'\'H\002R\005const\210\001\001\022\220\001\n\002lt\030\002 \001(\007B~\302H{\ny\n\nf" + - "ixed32.lt\032k!has(rules.gte) && !has(rules" + - ".gt) && this >= rules.lt? \'value must be" + - " less than %s\'.format([rules.lt]) : \'\'H\000" + - "R\002lt\022\243\001\n\003lte\030\003 \001(\007B\216\001\302H\212\001\n\207\001\n\013fixed32.lt" + - "e\032x!has(rules.gte) && !has(rules.gt) && " + - "this > rules.lte? \'value must be less th" + - "an or equal to %s\'.format([rules.lte]) :" + - " \'\'H\000R\003lte\022\245\007\n\002gt\030\004 \001(\007B\222\007\302H\216\007\n|\n\nfixed3" + + " : \'\'R\005const\022\217\001\n\002lt\030\002 \001(\004B}\302Hz\nx\n\tuint64" + + ".lt\032k!has(rules.gte) && !has(rules.gt) &" + + "& this >= rules.lt? \'value must be less " + + "than %s\'.format([rules.lt]) : \'\'H\000R\002lt\022\242" + + "\001\n\003lte\030\003 \001(\004B\215\001\302H\211\001\n\206\001\n\nuint64.lte\032x!has" + + "(rules.gte) && !has(rules.gt) && this > " + + "rules.lte? \'value must be less than or e" + + "qual to %s\'.format([rules.lte]) : \'\'H\000R\003" + + "lte\022\240\007\n\002gt\030\004 \001(\004B\215\007\302H\211\007\n{\n\tuint64.gt\032n!h" + + "as(rules.lt) && !has(rules.lte) && this " + + "<= rules.gt? \'value must be greater than" + + " %s\'.format([rules.gt]) : \'\'\n\264\001\n\014uint64." + + "gt_lt\032\243\001has(rules.lt) && rules.lt >= rul" + + "es.gt && (this >= rules.lt || this <= ru" + + "les.gt)? \'value must be greater than %s " + + "and less than %s\'.format([rules.gt, rule" + + "s.lt]) : \'\'\n\274\001\n\026uint64.gt_lt_exclusive\032\241" + + "\001has(rules.lt) && rules.lt < rules.gt &&" + + " (rules.lt <= this && this <= rules.gt)?" + + " \'value must be greater than %s or less " + + "than %s\'.format([rules.gt, rules.lt]) : " + + "\'\'\n\304\001\n\ruint64.gt_lte\032\262\001has(rules.lte) &&" + + " rules.lte >= rules.gt && (this > rules." + + "lte || this <= rules.gt)? \'value must be" + + " greater than %s and less than or equal " + + "to %s\'.format([rules.gt, rules.lte]) : \'" + + "\'\n\314\001\n\027uint64.gt_lte_exclusive\032\260\001has(rule" + + "s.lte) && rules.lte < rules.gt && (rules" + + ".lte < this && this <= rules.gt)? \'value" + + " must be greater than %s or less than or" + + " equal to %s\'.format([rules.gt, rules.lt" + + "e]) : \'\'H\001R\002gt\022\355\007\n\003gte\030\005 \001(\004B\330\007\302H\324\007\n\211\001\n\n" + + "uint64.gte\032{!has(rules.lt) && !has(rules" + + ".lte) && this < rules.gte? \'value must b" + + "e greater than or equal to %s\'.format([r" + + "ules.gte]) : \'\'\n\303\001\n\ruint64.gte_lt\032\261\001has(" + + "rules.lt) && rules.lt >= rules.gte && (t" + + "his >= rules.lt || this < rules.gte)? \'v" + + "alue must be greater than or equal to %s" + + " and less than %s\'.format([rules.gte, ru" + + "les.lt]) : \'\'\n\313\001\n\027uint64.gte_lt_exclusiv" + + "e\032\257\001has(rules.lt) && rules.lt < rules.gt" + + "e && (rules.lt <= this && this < rules.g" + + "te)? \'value must be greater than or equa" + + "l to %s or less than %s\'.format([rules.g" + + "te, rules.lt]) : \'\'\n\323\001\n\016uint64.gte_lte\032\300" + + "\001has(rules.lte) && rules.lte >= rules.gt" + + "e && (this > rules.lte || this < rules.g" + + "te)? \'value must be greater than or equa" + + "l to %s and less than or equal to %s\'.fo" + + "rmat([rules.gte, rules.lte]) : \'\'\n\333\001\n\030ui" + + "nt64.gte_lte_exclusive\032\276\001has(rules.lte) " + + "&& rules.lte < rules.gte && (rules.lte <" + + " this && this < rules.gte)? \'value must " + + "be greater than or equal to %s or less t" + + "han or equal to %s\'.format([rules.gte, r" + + "ules.lte]) : \'\'H\001R\003gte\022z\n\002in\030\006 \003(\004Bj\302Hg\n" + + "e\n\tuint64.in\032X!(this in dyn(rules)[\'in\']" + + ") ? \'value must be in list %s\'.format([d" + + "yn(rules)[\'in\']]) : \'\'R\002in\022~\n\006not_in\030\007 \003" + + "(\004Bg\302Hd\nb\n\ruint64.not_in\032Qthis in rules." + + "not_in ? \'value must not be in list %s\'." + + "format([rules.not_in]) : \'\'R\005notIn\0225\n\007ex" + + "ample\030\010 \003(\004B\033\302H\030\n\026\n\016uint64.example\032\004true" + + "R\007example*\t\010\350\007\020\200\200\200\200\002B\013\n\tless_thanB\016\n\014gre" + + "ater_than\"\245\025\n\013SInt32Rules\022q\n\005const\030\001 \001(\021" + + "B[\302HX\nV\n\014sint32.const\032Fthis != rules.con" + + "st ? \'value must equal %s\'.format([rules" + + ".const]) : \'\'R\005const\022\217\001\n\002lt\030\002 \001(\021B}\302Hz\nx" + + "\n\tsint32.lt\032k!has(rules.gte) && !has(rul" + + "es.gt) && this >= rules.lt? \'value must " + + "be less than %s\'.format([rules.lt]) : \'\'" + + "H\000R\002lt\022\242\001\n\003lte\030\003 \001(\021B\215\001\302H\211\001\n\206\001\n\nsint32.l" + + "te\032x!has(rules.gte) && !has(rules.gt) &&" + + " this > rules.lte? \'value must be less t" + + "han or equal to %s\'.format([rules.lte]) " + + ": \'\'H\000R\003lte\022\240\007\n\002gt\030\004 \001(\021B\215\007\302H\211\007\n{\n\tsint3" + "2.gt\032n!has(rules.lt) && !has(rules.lte) " + "&& this <= rules.gt? \'value must be grea" + - "ter than %s\'.format([rules.gt]) : \'\'\n\265\001\n" + - "\rfixed32.gt_lt\032\243\001has(rules.lt) && rules." + - "lt >= rules.gt && (this >= rules.lt || t" + - "his <= rules.gt)? \'value must be greater" + - " than %s and less than %s\'.format([rules" + - ".gt, rules.lt]) : \'\'\n\275\001\n\027fixed32.gt_lt_e" + - "xclusive\032\241\001has(rules.lt) && rules.lt < r" + - "ules.gt && (rules.lt <= this && this <= " + - "rules.gt)? \'value must be greater than %" + - "s or less than %s\'.format([rules.gt, rul" + - "es.lt]) : \'\'\n\305\001\n\016fixed32.gt_lte\032\262\001has(ru" + - "les.lte) && rules.lte >= rules.gt && (th" + - "is > rules.lte || this <= rules.gt)? \'va" + - "lue must be greater than %s and less tha" + - "n or equal to %s\'.format([rules.gt, rule" + - "s.lte]) : \'\'\n\315\001\n\030fixed32.gt_lte_exclusiv" + - "e\032\260\001has(rules.lte) && rules.lte < rules." + - "gt && (rules.lte < this && this <= rules" + - ".gt)? \'value must be greater than %s or " + - "less than or equal to %s\'.format([rules." + - "gt, rules.lte]) : \'\'H\001R\002gt\022\362\007\n\003gte\030\005 \001(\007" + - "B\335\007\302H\331\007\n\212\001\n\013fixed32.gte\032{!has(rules.lt) " + - "&& !has(rules.lte) && this < rules.gte? " + - "\'value must be greater than or equal to " + - "%s\'.format([rules.gte]) : \'\'\n\304\001\n\016fixed32" + - ".gte_lt\032\261\001has(rules.lt) && rules.lt >= r" + - "ules.gte && (this >= rules.lt || this < " + - "rules.gte)? \'value must be greater than " + - "or equal to %s and less than %s\'.format(" + - "[rules.gte, rules.lt]) : \'\'\n\314\001\n\030fixed32." + - "gte_lt_exclusive\032\257\001has(rules.lt) && rule" + - "s.lt < rules.gte && (rules.lt <= this &&" + - " this < rules.gte)? \'value must be great" + - "er than or equal to %s or less than %s\'." + - "format([rules.gte, rules.lt]) : \'\'\n\324\001\n\017f" + - "ixed32.gte_lte\032\300\001has(rules.lte) && rules" + + "ter than %s\'.format([rules.gt]) : \'\'\n\264\001\n" + + "\014sint32.gt_lt\032\243\001has(rules.lt) && rules.l" + + "t >= rules.gt && (this >= rules.lt || th" + + "is <= rules.gt)? \'value must be greater " + + "than %s and less than %s\'.format([rules." + + "gt, rules.lt]) : \'\'\n\274\001\n\026sint32.gt_lt_exc" + + "lusive\032\241\001has(rules.lt) && rules.lt < rul" + + "es.gt && (rules.lt <= this && this <= ru" + + "les.gt)? \'value must be greater than %s " + + "or less than %s\'.format([rules.gt, rules" + + ".lt]) : \'\'\n\304\001\n\rsint32.gt_lte\032\262\001has(rules" + + ".lte) && rules.lte >= rules.gt && (this " + + "> rules.lte || this <= rules.gt)? \'value" + + " must be greater than %s and less than o" + + "r equal to %s\'.format([rules.gt, rules.l" + + "te]) : \'\'\n\314\001\n\027sint32.gt_lte_exclusive\032\260\001" + + "has(rules.lte) && rules.lte < rules.gt &" + + "& (rules.lte < this && this <= rules.gt)" + + "? \'value must be greater than %s or less" + + " than or equal to %s\'.format([rules.gt, " + + "rules.lte]) : \'\'H\001R\002gt\022\355\007\n\003gte\030\005 \001(\021B\330\007\302" + + "H\324\007\n\211\001\n\nsint32.gte\032{!has(rules.lt) && !h" + + "as(rules.lte) && this < rules.gte? \'valu" + + "e must be greater than or equal to %s\'.f" + + "ormat([rules.gte]) : \'\'\n\303\001\n\rsint32.gte_l" + + "t\032\261\001has(rules.lt) && rules.lt >= rules.g" + + "te && (this >= rules.lt || this < rules." + + "gte)? \'value must be greater than or equ" + + "al to %s and less than %s\'.format([rules" + + ".gte, rules.lt]) : \'\'\n\313\001\n\027sint32.gte_lt_" + + "exclusive\032\257\001has(rules.lt) && rules.lt < " + + "rules.gte && (rules.lt <= this && this <" + + " rules.gte)? \'value must be greater than" + + " or equal to %s or less than %s\'.format(" + + "[rules.gte, rules.lt]) : \'\'\n\323\001\n\016sint32.g" + + "te_lte\032\300\001has(rules.lte) && rules.lte >= " + + "rules.gte && (this > rules.lte || this <" + + " rules.gte)? \'value must be greater than" + + " or equal to %s and less than or equal t" + + "o %s\'.format([rules.gte, rules.lte]) : \'" + + "\'\n\333\001\n\030sint32.gte_lte_exclusive\032\276\001has(rul" + + "es.lte) && rules.lte < rules.gte && (rul" + + "es.lte < this && this < rules.gte)? \'val" + + "ue must be greater than or equal to %s o" + + "r less than or equal to %s\'.format([rule" + + "s.gte, rules.lte]) : \'\'H\001R\003gte\022z\n\002in\030\006 \003" + + "(\021Bj\302Hg\ne\n\tsint32.in\032X!(this in dyn(rule" + + "s)[\'in\']) ? \'value must be in list %s\'.f" + + "ormat([dyn(rules)[\'in\']]) : \'\'R\002in\022~\n\006no" + + "t_in\030\007 \003(\021Bg\302Hd\nb\n\rsint32.not_in\032Qthis i" + + "n rules.not_in ? \'value must not be in l" + + "ist %s\'.format([rules.not_in]) : \'\'R\005not" + + "In\0225\n\007example\030\010 \003(\021B\033\302H\030\n\026\n\016sint32.examp" + + "le\032\004trueR\007example*\t\010\350\007\020\200\200\200\200\002B\013\n\tless_tha" + + "nB\016\n\014greater_than\"\245\025\n\013SInt64Rules\022q\n\005con" + + "st\030\001 \001(\022B[\302HX\nV\n\014sint64.const\032Fthis != r" + + "ules.const ? \'value must equal %s\'.forma" + + "t([rules.const]) : \'\'R\005const\022\217\001\n\002lt\030\002 \001(" + + "\022B}\302Hz\nx\n\tsint64.lt\032k!has(rules.gte) && " + + "!has(rules.gt) && this >= rules.lt? \'val" + + "ue must be less than %s\'.format([rules.l" + + "t]) : \'\'H\000R\002lt\022\242\001\n\003lte\030\003 \001(\022B\215\001\302H\211\001\n\206\001\n\n" + + "sint64.lte\032x!has(rules.gte) && !has(rule" + + "s.gt) && this > rules.lte? \'value must b" + + "e less than or equal to %s\'.format([rule" + + "s.lte]) : \'\'H\000R\003lte\022\240\007\n\002gt\030\004 \001(\022B\215\007\302H\211\007\n" + + "{\n\tsint64.gt\032n!has(rules.lt) && !has(rul" + + "es.lte) && this <= rules.gt? \'value must" + + " be greater than %s\'.format([rules.gt]) " + + ": \'\'\n\264\001\n\014sint64.gt_lt\032\243\001has(rules.lt) &&" + + " rules.lt >= rules.gt && (this >= rules." + + "lt || this <= rules.gt)? \'value must be " + + "greater than %s and less than %s\'.format" + + "([rules.gt, rules.lt]) : \'\'\n\274\001\n\026sint64.g" + + "t_lt_exclusive\032\241\001has(rules.lt) && rules." + + "lt < rules.gt && (rules.lt <= this && th" + + "is <= rules.gt)? \'value must be greater " + + "than %s or less than %s\'.format([rules.g" + + "t, rules.lt]) : \'\'\n\304\001\n\rsint64.gt_lte\032\262\001h" + + "as(rules.lte) && rules.lte >= rules.gt &" + + "& (this > rules.lte || this <= rules.gt)" + + "? \'value must be greater than %s and les" + + "s than or equal to %s\'.format([rules.gt," + + " rules.lte]) : \'\'\n\314\001\n\027sint64.gt_lte_excl" + + "usive\032\260\001has(rules.lte) && rules.lte < ru" + + "les.gt && (rules.lte < this && this <= r" + + "ules.gt)? \'value must be greater than %s" + + " or less than or equal to %s\'.format([ru" + + "les.gt, rules.lte]) : \'\'H\001R\002gt\022\355\007\n\003gte\030\005" + + " \001(\022B\330\007\302H\324\007\n\211\001\n\nsint64.gte\032{!has(rules.l" + + "t) && !has(rules.lte) && this < rules.gt" + + "e? \'value must be greater than or equal " + + "to %s\'.format([rules.gte]) : \'\'\n\303\001\n\rsint" + + "64.gte_lt\032\261\001has(rules.lt) && rules.lt >=" + + " rules.gte && (this >= rules.lt || this " + + "< rules.gte)? \'value must be greater tha" + + "n or equal to %s and less than %s\'.forma" + + "t([rules.gte, rules.lt]) : \'\'\n\313\001\n\027sint64" + + ".gte_lt_exclusive\032\257\001has(rules.lt) && rul" + + "es.lt < rules.gte && (rules.lt <= this &" + + "& this < rules.gte)? \'value must be grea" + + "ter than or equal to %s or less than %s\'" + + ".format([rules.gte, rules.lt]) : \'\'\n\323\001\n\016" + + "sint64.gte_lte\032\300\001has(rules.lte) && rules" + ".lte >= rules.gte && (this > rules.lte |" + "| this < rules.gte)? \'value must be grea" + "ter than or equal to %s and less than or" + " equal to %s\'.format([rules.gte, rules.l" + - "te]) : \'\'\n\334\001\n\031fixed32.gte_lte_exclusive\032" + - "\276\001has(rules.lte) && rules.lte < rules.gt" + - "e && (rules.lte < this && this < rules.g" + - "te)? \'value must be greater than or equa" + - "l to %s or less than or equal to %s\'.for" + - "mat([rules.gte, rules.lte]) : \'\'H\001R\003gte\022" + - "{\n\002in\030\006 \003(\007Bk\302Hh\nf\n\nfixed32.in\032X!(this i" + - "n dyn(rules)[\'in\']) ? \'value must be in " + - "list %s\'.format([dyn(rules)[\'in\']]) : \'\'" + - "R\002in\022\177\n\006not_in\030\007 \003(\007Bh\302He\nc\n\016fixed32.not" + - "_in\032Qthis in rules.not_in ? \'value must " + - "not be in list %s\'.format([rules.not_in]" + - ") : \'\'R\005notInB\013\n\tless_thanB\016\n\014greater_th" + - "anB\010\n\006_const\"\202\025\n\014Fixed64Rules\022w\n\005const\030\001" + - " \001(\006B\\\302HY\nW\n\rfixed64.const\032Fthis != rule" + - "s.const ? \'value must equal %s\'.format([" + - "rules.const]) : \'\'H\002R\005const\210\001\001\022\220\001\n\002lt\030\002 " + - "\001(\006B~\302H{\ny\n\nfixed64.lt\032k!has(rules.gte) " + - "&& !has(rules.gt) && this >= rules.lt? \'" + - "value must be less than %s\'.format([rule" + - "s.lt]) : \'\'H\000R\002lt\022\243\001\n\003lte\030\003 \001(\006B\216\001\302H\212\001\n\207" + - "\001\n\013fixed64.lte\032x!has(rules.gte) && !has(" + - "rules.gt) && this > rules.lte? \'value mu" + - "st be less than or equal to %s\'.format([" + - "rules.lte]) : \'\'H\000R\003lte\022\245\007\n\002gt\030\004 \001(\006B\222\007\302" + - "H\216\007\n|\n\nfixed64.gt\032n!has(rules.lt) && !ha" + - "s(rules.lte) && this <= rules.gt? \'value" + - " must be greater than %s\'.format([rules." + - "gt]) : \'\'\n\265\001\n\rfixed64.gt_lt\032\243\001has(rules." + - "lt) && rules.lt >= rules.gt && (this >= " + - "rules.lt || this <= rules.gt)? \'value mu" + - "st be greater than %s and less than %s\'." + - "format([rules.gt, rules.lt]) : \'\'\n\275\001\n\027fi" + - "xed64.gt_lt_exclusive\032\241\001has(rules.lt) &&" + - " rules.lt < rules.gt && (rules.lt <= thi" + - "s && this <= rules.gt)? \'value must be g" + - "reater than %s or less than %s\'.format([" + - "rules.gt, rules.lt]) : \'\'\n\305\001\n\016fixed64.gt" + - "_lte\032\262\001has(rules.lte) && rules.lte >= ru" + - "les.gt && (this > rules.lte || this <= r" + - "ules.gt)? \'value must be greater than %s" + - " and less than or equal to %s\'.format([r" + - "ules.gt, rules.lte]) : \'\'\n\315\001\n\030fixed64.gt" + - "_lte_exclusive\032\260\001has(rules.lte) && rules" + - ".lte < rules.gt && (rules.lte < this && " + - "this <= rules.gt)? \'value must be greate" + - "r than %s or less than or equal to %s\'.f" + - "ormat([rules.gt, rules.lte]) : \'\'H\001R\002gt\022" + - "\362\007\n\003gte\030\005 \001(\006B\335\007\302H\331\007\n\212\001\n\013fixed64.gte\032{!h" + - "as(rules.lt) && !has(rules.lte) && this " + - "< rules.gte? \'value must be greater than" + - " or equal to %s\'.format([rules.gte]) : \'" + - "\'\n\304\001\n\016fixed64.gte_lt\032\261\001has(rules.lt) && " + - "rules.lt >= rules.gte && (this >= rules." + - "lt || this < rules.gte)? \'value must be " + - "greater than or equal to %s and less tha" + - "n %s\'.format([rules.gte, rules.lt]) : \'\'" + - "\n\314\001\n\030fixed64.gte_lt_exclusive\032\257\001has(rule" + - "s.lt) && rules.lt < rules.gte && (rules." + - "lt <= this && this < rules.gte)? \'value " + - "must be greater than or equal to %s or l" + - "ess than %s\'.format([rules.gte, rules.lt" + - "]) : \'\'\n\324\001\n\017fixed64.gte_lte\032\300\001has(rules." + - "lte) && rules.lte >= rules.gte && (this " + - "> rules.lte || this < rules.gte)? \'value" + - " must be greater than or equal to %s and" + - " less than or equal to %s\'.format([rules" + - ".gte, rules.lte]) : \'\'\n\334\001\n\031fixed64.gte_l" + - "te_exclusive\032\276\001has(rules.lte) && rules.l" + - "te < rules.gte && (rules.lte < this && t" + - "his < rules.gte)? \'value must be greater" + - " than or equal to %s or less than or equ" + - "al to %s\'.format([rules.gte, rules.lte])" + - " : \'\'H\001R\003gte\022{\n\002in\030\006 \003(\006Bk\302Hh\nf\n\nfixed64" + - ".in\032X!(this in dyn(rules)[\'in\']) ? \'valu" + - "e must be in list %s\'.format([dyn(rules)" + - "[\'in\']]) : \'\'R\002in\022\177\n\006not_in\030\007 \003(\006Bh\302He\nc" + - "\n\016fixed64.not_in\032Qthis in rules.not_in ?" + - " \'value must not be in list %s\'.format([" + - "rules.not_in]) : \'\'R\005notInB\013\n\tless_thanB" + - "\016\n\014greater_thanB\010\n\006_const\"\223\025\n\rSFixed32Ru" + - "les\022x\n\005const\030\001 \001(\017B]\302HZ\nX\n\016sfixed32.cons" + - "t\032Fthis != rules.const ? \'value must equ" + - "al %s\'.format([rules.const]) : \'\'H\002R\005con" + - "st\210\001\001\022\221\001\n\002lt\030\002 \001(\017B\177\302H|\nz\n\013sfixed32.lt\032k" + - "!has(rules.gte) && !has(rules.gt) && thi" + - "s >= rules.lt? \'value must be less than " + - "%s\'.format([rules.lt]) : \'\'H\000R\002lt\022\244\001\n\003lt" + - "e\030\003 \001(\017B\217\001\302H\213\001\n\210\001\n\014sfixed32.lte\032x!has(ru" + - "les.gte) && !has(rules.gt) && this > rul" + - "es.lte? \'value must be less than or equa" + - "l to %s\'.format([rules.lte]) : \'\'H\000R\003lte" + - "\022\252\007\n\002gt\030\004 \001(\017B\227\007\302H\223\007\n}\n\013sfixed32.gt\032n!ha" + - "s(rules.lt) && !has(rules.lte) && this <" + - "= rules.gt? \'value must be greater than " + - "%s\'.format([rules.gt]) : \'\'\n\266\001\n\016sfixed32" + - ".gt_lt\032\243\001has(rules.lt) && rules.lt >= ru" + - "les.gt && (this >= rules.lt || this <= r" + - "ules.gt)? \'value must be greater than %s" + - " and less than %s\'.format([rules.gt, rul" + - "es.lt]) : \'\'\n\276\001\n\030sfixed32.gt_lt_exclusiv" + - "e\032\241\001has(rules.lt) && rules.lt < rules.gt" + - " && (rules.lt <= this && this <= rules.g" + - "t)? \'value must be greater than %s or le" + - "ss than %s\'.format([rules.gt, rules.lt])" + - " : \'\'\n\306\001\n\017sfixed32.gt_lte\032\262\001has(rules.lt" + - "e) && rules.lte >= rules.gt && (this > r" + - "ules.lte || this <= rules.gt)? \'value mu" + - "st be greater than %s and less than or e" + - "qual to %s\'.format([rules.gt, rules.lte]" + - ") : \'\'\n\316\001\n\031sfixed32.gt_lte_exclusive\032\260\001h" + - "as(rules.lte) && rules.lte < rules.gt &&" + - " (rules.lte < this && this <= rules.gt)?" + - " \'value must be greater than %s or less " + - "than or equal to %s\'.format([rules.gt, r" + - "ules.lte]) : \'\'H\001R\002gt\022\367\007\n\003gte\030\005 \001(\017B\342\007\302H" + - "\336\007\n\213\001\n\014sfixed32.gte\032{!has(rules.lt) && !" + - "has(rules.lte) && this < rules.gte? \'val" + - "ue must be greater than or equal to %s\'." + - "format([rules.gte]) : \'\'\n\305\001\n\017sfixed32.gt" + - "e_lt\032\261\001has(rules.lt) && rules.lt >= rule" + - "s.gte && (this >= rules.lt || this < rul" + - "es.gte)? \'value must be greater than or " + - "equal to %s and less than %s\'.format([ru" + - "les.gte, rules.lt]) : \'\'\n\315\001\n\031sfixed32.gt" + - "e_lt_exclusive\032\257\001has(rules.lt) && rules." + - "lt < rules.gte && (rules.lt <= this && t" + - "his < rules.gte)? \'value must be greater" + - " than or equal to %s or less than %s\'.fo" + - "rmat([rules.gte, rules.lt]) : \'\'\n\325\001\n\020sfi" + - "xed32.gte_lte\032\300\001has(rules.lte) && rules." + - "lte >= rules.gte && (this > rules.lte ||" + - " this < rules.gte)? \'value must be great" + - "er than or equal to %s and less than or " + - "equal to %s\'.format([rules.gte, rules.lt" + - "e]) : \'\'\n\335\001\n\032sfixed32.gte_lte_exclusive\032" + - "\276\001has(rules.lte) && rules.lte < rules.gt" + - "e && (rules.lte < this && this < rules.g" + - "te)? \'value must be greater than or equa" + - "l to %s or less than or equal to %s\'.for" + - "mat([rules.gte, rules.lte]) : \'\'H\001R\003gte\022" + - "|\n\002in\030\006 \003(\017Bl\302Hi\ng\n\013sfixed32.in\032X!(this " + - "in dyn(rules)[\'in\']) ? \'value must be in" + - " list %s\'.format([dyn(rules)[\'in\']]) : \'" + - "\'R\002in\022\200\001\n\006not_in\030\007 \003(\017Bi\302Hf\nd\n\017sfixed32." + - "not_in\032Qthis in rules.not_in ? \'value mu" + - "st not be in list %s\'.format([rules.not_" + - "in]) : \'\'R\005notInB\013\n\tless_thanB\016\n\014greater" + - "_thanB\010\n\006_const\"\223\025\n\rSFixed64Rules\022x\n\005con" + - "st\030\001 \001(\020B]\302HZ\nX\n\016sfixed64.const\032Fthis !=" + - " rules.const ? \'value must equal %s\'.for" + - "mat([rules.const]) : \'\'H\002R\005const\210\001\001\022\221\001\n\002" + - "lt\030\002 \001(\020B\177\302H|\nz\n\013sfixed64.lt\032k!has(rules", - ".gte) && !has(rules.gt) && this >= rules" + - ".lt? \'value must be less than %s\'.format" + - "([rules.lt]) : \'\'H\000R\002lt\022\244\001\n\003lte\030\003 \001(\020B\217\001" + - "\302H\213\001\n\210\001\n\014sfixed64.lte\032x!has(rules.gte) &" + - "& !has(rules.gt) && this > rules.lte? \'v" + - "alue must be less than or equal to %s\'.f" + - "ormat([rules.lte]) : \'\'H\000R\003lte\022\252\007\n\002gt\030\004 " + - "\001(\020B\227\007\302H\223\007\n}\n\013sfixed64.gt\032n!has(rules.lt" + + "te]) : \'\'\n\333\001\n\030sint64.gte_lte_exclusive\032\276" + + "\001has(rules.lte) && rules.lte < rules.gte" + + " && (rules.lte < this && this < rules.gt" + + "e)? \'value must be greater than or equal" + + " to %s or less than or equal to %s\'.form" + + "at([rules.gte, rules.lte]) : \'\'H\001R\003gte\022z" + + "\n\002in\030\006 \003(\022Bj\302Hg\ne\n\tsint64.in\032X!(this in " + + "dyn(rules)[\'in\']) ? \'value must be in li" + + "st %s\'.format([dyn(rules)[\'in\']]) : \'\'R\002" + + "in\022~\n\006not_in\030\007 \003(\022Bg\302Hd\nb\n\rsint64.not_in" + + "\032Qthis in rules.not_in ? \'value must not" + + " be in list %s\'.format([rules.not_in]) :" + + " \'\'R\005notIn\0225\n\007example\030\010 \003(\022B\033\302H\030\n\026\n\016sint" + + "64.example\032\004trueR\007example*\t\010\350\007\020\200\200\200\200\002B\013\n\t" + + "less_thanB\016\n\014greater_than\"\266\025\n\014Fixed32Rul" + + "es\022r\n\005const\030\001 \001(\007B\\\302HY\nW\n\rfixed32.const\032" + + "Fthis != rules.const ? \'value must equal" + + " %s\'.format([rules.const]) : \'\'R\005const\022\220" + + "\001\n\002lt\030\002 \001(\007B~\302H{\ny\n\nfixed32.lt\032k!has(rul" + + "es.gte) && !has(rules.gt) && this >= rul" + + "es.lt? \'value must be less than %s\'.form" + + "at([rules.lt]) : \'\'H\000R\002lt\022\243\001\n\003lte\030\003 \001(\007B" + + "\216\001\302H\212\001\n\207\001\n\013fixed32.lte\032x!has(rules.gte) " + + "&& !has(rules.gt) && this > rules.lte? \'" + + "value must be less than or equal to %s\'." + + "format([rules.lte]) : \'\'H\000R\003lte\022\245\007\n\002gt\030\004" + + " \001(\007B\222\007\302H\216\007\n|\n\nfixed32.gt\032n!has(rules.lt" + ") && !has(rules.lte) && this <= rules.gt" + "? \'value must be greater than %s\'.format" + - "([rules.gt]) : \'\'\n\266\001\n\016sfixed64.gt_lt\032\243\001h" + - "as(rules.lt) && rules.lt >= rules.gt && " + - "(this >= rules.lt || this <= rules.gt)? " + - "\'value must be greater than %s and less " + - "than %s\'.format([rules.gt, rules.lt]) : " + - "\'\'\n\276\001\n\030sfixed64.gt_lt_exclusive\032\241\001has(ru" + - "les.lt) && rules.lt < rules.gt && (rules" + - ".lt <= this && this <= rules.gt)? \'value" + - " must be greater than %s or less than %s" + - "\'.format([rules.gt, rules.lt]) : \'\'\n\306\001\n\017" + - "sfixed64.gt_lte\032\262\001has(rules.lte) && rule" + - "s.lte >= rules.gt && (this > rules.lte |" + - "| this <= rules.gt)? \'value must be grea" + - "ter than %s and less than or equal to %s" + - "\'.format([rules.gt, rules.lte]) : \'\'\n\316\001\n" + - "\031sfixed64.gt_lte_exclusive\032\260\001has(rules.l" + - "te) && rules.lte < rules.gt && (rules.lt" + - "e < this && this <= rules.gt)? \'value mu" + - "st be greater than %s or less than or eq" + - "ual to %s\'.format([rules.gt, rules.lte])" + - " : \'\'H\001R\002gt\022\367\007\n\003gte\030\005 \001(\020B\342\007\302H\336\007\n\213\001\n\014sfi" + - "xed64.gte\032{!has(rules.lt) && !has(rules." + - "lte) && this < rules.gte? \'value must be" + - " greater than or equal to %s\'.format([ru" + - "les.gte]) : \'\'\n\305\001\n\017sfixed64.gte_lt\032\261\001has" + - "(rules.lt) && rules.lt >= rules.gte && (" + - "this >= rules.lt || this < rules.gte)? \'" + - "value must be greater than or equal to %" + - "s and less than %s\'.format([rules.gte, r" + - "ules.lt]) : \'\'\n\315\001\n\031sfixed64.gte_lt_exclu" + - "sive\032\257\001has(rules.lt) && rules.lt < rules" + - ".gte && (rules.lt <= this && this < rule" + - "s.gte)? \'value must be greater than or e" + - "qual to %s or less than %s\'.format([rule" + - "s.gte, rules.lt]) : \'\'\n\325\001\n\020sfixed64.gte_" + - "lte\032\300\001has(rules.lte) && rules.lte >= rul" + - "es.gte && (this > rules.lte || this < ru" + + "([rules.gt]) : \'\'\n\265\001\n\rfixed32.gt_lt\032\243\001ha" + + "s(rules.lt) && rules.lt >= rules.gt && (" + + "this >= rules.lt || this <= rules.gt)? \'" + + "value must be greater than %s and less t" + + "han %s\'.format([rules.gt, rules.lt]) : \'" + + "\'\n\275\001\n\027fixed32.gt_lt_exclusive\032\241\001has(rule" + + "s.lt) && rules.lt < rules.gt && (rules.l" + + "t <= this && this <= rules.gt)? \'value m" + + "ust be greater than %s or less than %s\'." + + "format([rules.gt, rules.lt]) : \'\'\n\305\001\n\016fi" + + "xed32.gt_lte\032\262\001has(rules.lte) && rules.l" + + "te >= rules.gt && (this > rules.lte || t" + + "his <= rules.gt)? \'value must be greater" + + " than %s and less than or equal to %s\'.f" + + "ormat([rules.gt, rules.lte]) : \'\'\n\315\001\n\030fi" + + "xed32.gt_lte_exclusive\032\260\001has(rules.lte) " + + "&& rules.lte < rules.gt && (rules.lte < " + + "this && this <= rules.gt)? \'value must b" + + "e greater than %s or less than or equal " + + "to %s\'.format([rules.gt, rules.lte]) : \'" + + "\'H\001R\002gt\022\362\007\n\003gte\030\005 \001(\007B\335\007\302H\331\007\n\212\001\n\013fixed32" + + ".gte\032{!has(rules.lt) && !has(rules.lte) " + + "&& this < rules.gte? \'value must be grea" + + "ter than or equal to %s\'.format([rules.g" + + "te]) : \'\'\n\304\001\n\016fixed32.gte_lt\032\261\001has(rules" + + ".lt) && rules.lt >= rules.gte && (this >" + + "= rules.lt || this < rules.gte)? \'value " + + "must be greater than or equal to %s and " + + "less than %s\'.format([rules.gte, rules.l" + + "t]) : \'\'\n\314\001\n\030fixed32.gte_lt_exclusive\032\257\001" + + "has(rules.lt) && rules.lt < rules.gte &&" + + " (rules.lt <= this && this < rules.gte)?" + + " \'value must be greater than or equal to" + + " %s or less than %s\'.format([rules.gte, " + + "rules.lt]) : \'\'\n\324\001\n\017fixed32.gte_lte\032\300\001ha" + + "s(rules.lte) && rules.lte >= rules.gte &" + + "& (this > rules.lte || this < rules.gte)" + + "? \'value must be greater than or equal t" + + "o %s and less than or equal to %s\'.forma" + + "t([rules.gte, rules.lte]) : \'\'\n\334\001\n\031fixed" + + "32.gte_lte_exclusive\032\276\001has(rules.lte) &&" + + " rules.lte < rules.gte && (rules.lte < t" + + "his && this < rules.gte)? \'value must be" + + " greater than or equal to %s or less tha" + + "n or equal to %s\'.format([rules.gte, rul" + + "es.lte]) : \'\'H\001R\003gte\022{\n\002in\030\006 \003(\007Bk\302Hh\nf\n" + + "\nfixed32.in\032X!(this in dyn(rules)[\'in\'])" + + " ? \'value must be in list %s\'.format([dy" + + "n(rules)[\'in\']]) : \'\'R\002in\022\177\n\006not_in\030\007 \003(" + + "\007Bh\302He\nc\n\016fixed32.not_in\032Qthis in rules." + + "not_in ? \'value must not be in list %s\'." + + "format([rules.not_in]) : \'\'R\005notIn\0226\n\007ex" + + "ample\030\010 \003(\007B\034\302H\031\n\027\n\017fixed32.example\032\004tru" + + "eR\007example*\t\010\350\007\020\200\200\200\200\002B\013\n\tless_thanB\016\n\014gr" + + "eater_than\"\266\025\n\014Fixed64Rules\022r\n\005const\030\001 \001" + + "(\006B\\\302HY\nW\n\rfixed64.const\032Fthis != rules." + + "const ? \'value must equal %s\'.format([ru" + + "les.const]) : \'\'R\005const\022\220\001\n\002lt\030\002 \001(\006B~\302H" + + "{\ny\n\nfixed64.lt\032k!has(rules.gte) && !has" + + "(rules.gt) && this >= rules.lt? \'value m" + + "ust be less than %s\'.format([rules.lt]) " + + ": \'\'H\000R\002lt\022\243\001\n\003lte\030\003 \001(\006B\216\001\302H\212\001\n\207\001\n\013fixe" + + "d64.lte\032x!has(rules.gte) && !has(rules.g" + + "t) && this > rules.lte? \'value must be l" + + "ess than or equal to %s\'.format([rules.l" + + "te]) : \'\'H\000R\003lte\022\245\007\n\002gt\030\004 \001(\006B\222\007\302H\216\007\n|\n\n" + + "fixed64.gt\032n!has(rules.lt) && !has(rules" + + ".lte) && this <= rules.gt? \'value must b" + + "e greater than %s\'.format([rules.gt]) : " + + "\'\'\n\265\001\n\rfixed64.gt_lt\032\243\001has(rules.lt) && " + + "rules.lt >= rules.gt && (this >= rules.l" + + "t || this <= rules.gt)? \'value must be g" + + "reater than %s and less than %s\'.format(" + + "[rules.gt, rules.lt]) : \'\'\n\275\001\n\027fixed64.g" + + "t_lt_exclusive\032\241\001has(rules.lt) && rules." + + "lt < rules.gt && (rules.lt <= this && th" + + "is <= rules.gt)? \'value must be greater " + + "than %s or less than %s\'.format([rules.g" + + "t, rules.lt]) : \'\'\n\305\001\n\016fixed64.gt_lte\032\262\001" + + "has(rules.lte) && rules.lte >= rules.gt " + + "&& (this > rules.lte || this <= rules.gt" + + ")? \'value must be greater than %s and le" + + "ss than or equal to %s\'.format([rules.gt" + + ", rules.lte]) : \'\'\n\315\001\n\030fixed64.gt_lte_ex" + + "clusive\032\260\001has(rules.lte) && rules.lte < " + + "rules.gt && (rules.lte < this && this <=" + + " rules.gt)? \'value must be greater than " + + "%s or less than or equal to %s\'.format([" + + "rules.gt, rules.lte]) : \'\'H\001R\002gt\022\362\007\n\003gte" + + "\030\005 \001(\006B\335\007\302H\331\007\n\212\001\n\013fixed64.gte\032{!has(rule" + + "s.lt) && !has(rules.lte) && this < rules" + + ".gte? \'value must be greater than or equ" + + "al to %s\'.format([rules.gte]) : \'\'\n\304\001\n\016f" + + "ixed64.gte_lt\032\261\001has(rules.lt) && rules.l" + + "t >= rules.gte && (this >= rules.lt || t" + + "his < rules.gte)? \'value must be greater" + + " than or equal to %s and less than %s\'.f" + + "ormat([rules.gte, rules.lt]) : \'\'\n\314\001\n\030fi" + + "xed64.gte_lt_exclusive\032\257\001has(rules.lt) &" + + "& rules.lt < rules.gte && (rules.lt <= t" + + "his && this < rules.gte)? \'value must be" + + " greater than or equal to %s or less tha" + + "n %s\'.format([rules.gte, rules.lt]) : \'\'" + + "\n\324\001\n\017fixed64.gte_lte\032\300\001has(rules.lte) &&" + + " rules.lte >= rules.gte && (this > rules" + + ".lte || this < rules.gte)? \'value must b" + + "e greater than or equal to %s and less t" + + "han or equal to %s\'.format([rules.gte, r" + + "ules.lte]) : \'\'\n\334\001\n\031fixed64.gte_lte_excl" + + "usive\032\276\001has(rules.lte) && rules.lte < ru" + + "les.gte && (rules.lte < this && this < r" + + "ules.gte)? \'value must be greater than o" + + "r equal to %s or less than or equal to %" + + "s\'.format([rules.gte, rules.lte]) : \'\'H\001" + + "R\003gte\022{\n\002in\030\006 \003(\006Bk\302Hh\nf\n\nfixed64.in\032X!(" + + "this in dyn(rules)[\'in\']) ? \'value must " + + "be in list %s\'.format([dyn(rules)[\'in\']]" + + ") : \'\'R\002in\022\177\n\006not_in\030\007 \003(\006Bh\302He\nc\n\016fixed" + + "64.not_in\032Qthis in rules.not_in ? \'value" + + " must not be in list %s\'.format([rules.n" + + "ot_in]) : \'\'R\005notIn\0226\n\007example\030\010 \003(\006B\034\302H" + + "\031\n\027\n\017fixed64.example\032\004trueR\007example*\t\010\350\007" + + "\020\200\200\200\200\002B\013\n\tless_thanB\016\n\014greater_than\"\310\025\n\r" + + "SFixed32Rules\022s\n\005const\030\001 \001(\017B]\302HZ\nX\n\016sfi" + + "xed32.const\032Fthis != rules.const ? \'valu" + + "e must equal %s\'.format([rules.const]) :" + + " \'\'R\005const\022\221\001\n\002lt\030\002 \001(\017B\177\302H|\nz\n\013sfixed32" + + ".lt\032k!has(rules.gte) && !has(rules.gt) &" + + "& this >= rules.lt? \'value must be less " + + "than %s\'.format([rules.lt]) : \'\'H\000R\002lt\022\244" + + "\001\n\003lte\030\003 \001(\017B\217\001\302H\213\001\n\210\001\n\014sfixed32.lte\032x!h" + + "as(rules.gte) && !has(rules.gt) && this " + + "> rules.lte? \'value must be less than or" + + " equal to %s\'.format([rules.lte]) : \'\'H\000" + + "R\003lte\022\252\007\n\002gt\030\004 \001(\017B\227\007\302H\223\007\n}\n\013sfixed32.gt" + + "\032n!has(rules.lt) && !has(rules.lte) && t" + + "his <= rules.gt? \'value must be greater " + + "than %s\'.format([rules.gt]) : \'\'\n\266\001\n\016sfi" + + "xed32.gt_lt\032\243\001has(rules.lt) && rules.lt " + + ">= rules.gt && (this >= rules.lt || this" + + " <= rules.gt)? \'value must be greater th" + + "an %s and less than %s\'.format([rules.gt" + + ", rules.lt]) : \'\'\n\276\001\n\030sfixed32.gt_lt_exc" + + "lusive\032\241\001has(rules.lt) && rules.lt < rul" + + "es.gt && (rules.lt <= this && this <= ru" + + "les.gt)? \'value must be greater than %s " + + "or less than %s\'.format([rules.gt, rules" + + ".lt]) : \'\'\n\306\001\n\017sfixed32.gt_lte\032\262\001has(rul" + + "es.lte) && rules.lte >= rules.gt && (thi" + + "s > rules.lte || this <= rules.gt)? \'val" + + "ue must be greater than %s and less than" + + " or equal to %s\'.format([rules.gt, rules" + + ".lte]) : \'\'\n\316\001\n\031sfixed32.gt_lte_exclusiv" + + "e\032\260\001has(rules.lte) && rules.lte < rules." + + "gt && (rules.lte < this && this <= rules" + + ".gt)? \'value must be greater than %s or " + + "less than or equal to %s\'.format([rules." + + "gt, rules.lte]) : \'\'H\001R\002gt\022\367\007\n\003gte\030\005 \001(\017" + + "B\342\007\302H\336\007\n\213\001\n\014sfixed32.gte\032{!has(rules.lt)" + + " && !has(rules.lte) && this < rules.gte?" + + " \'value must be greater than or equal to" + + " %s\'.format([rules.gte]) : \'\'\n\305\001\n\017sfixed" + + "32.gte_lt\032\261\001has(rules.lt) && rules.lt >=" + + " rules.gte && (this >= rules.lt || this " + + "< rules.gte)? \'value must be greater tha" + + "n or equal to %s and less than %s\'.forma" + + "t([rules.gte, rules.lt]) : \'\'\n\315\001\n\031sfixed" + + "32.gte_lt_exclusive\032\257\001has(rules.lt) && r" + + "ules.lt < rules.gte && (rules.lt <= this" + + " && this < rules.gte)? \'value must be gr" + + "eater than or equal to %s or less than %" + + "s\'.format([rules.gte, rules.lt]) : \'\'\n\325\001" + + "\n\020sfixed32.gte_lte\032\300\001has(rules.lte) && r" + + "ules.lte >= rules.gte && (this > rules.l" + + "te || this < rules.gte)? \'value must be " + + "greater than or equal to %s and less tha" + + "n or equal to %s\'.format([rules.gte, rul" + + "es.lte]) : \'\'\n\335\001\n\032sfixed32.gte_lte_exclu" + + "sive\032\276\001has(rules.lte) && rules.lte < rul" + + "es.gte && (rules.lte < this && this < ru", "les.gte)? \'value must be greater than or" + - " equal to %s and less than or equal to %" + - "s\'.format([rules.gte, rules.lte]) : \'\'\n\335" + - "\001\n\032sfixed64.gte_lte_exclusive\032\276\001has(rule" + - "s.lte) && rules.lte < rules.gte && (rule" + - "s.lte < this && this < rules.gte)? \'valu" + - "e must be greater than or equal to %s or" + - " less than or equal to %s\'.format([rules" + - ".gte, rules.lte]) : \'\'H\001R\003gte\022|\n\002in\030\006 \003(" + - "\020Bl\302Hi\ng\n\013sfixed64.in\032X!(this in dyn(rul" + - "es)[\'in\']) ? \'value must be in list %s\'." + - "format([dyn(rules)[\'in\']]) : \'\'R\002in\022\200\001\n\006" + - "not_in\030\007 \003(\020Bi\302Hf\nd\n\017sfixed64.not_in\032Qth" + - "is in rules.not_in ? \'value must not be " + - "in list %s\'.format([rules.not_in]) : \'\'R" + - "\005notInB\013\n\tless_thanB\016\n\014greater_thanB\010\n\006_" + - "const\"\213\001\n\tBoolRules\022t\n\005const\030\001 \001(\010BY\302HV\n" + - "T\n\nbool.const\032Fthis != rules.const ? \'va" + - "lue must equal %s\'.format([rules.const])" + - " : \'\'H\000R\005const\210\001\001B\010\n\006_const\"\2565\n\013StringRu" + - "les\022x\n\005const\030\001 \001(\tB]\302HZ\nX\n\014string.const\032" + - "Hthis != rules.const ? \'value must equal" + - " `%s`\'.format([rules.const]) : \'\'H\001R\005con" + - "st\210\001\001\022\210\001\n\003len\030\023 \001(\004Bq\302Hn\nl\n\nstring.len\032^" + + " equal to %s or less than or equal to %s" + + "\'.format([rules.gte, rules.lte]) : \'\'H\001R" + + "\003gte\022|\n\002in\030\006 \003(\017Bl\302Hi\ng\n\013sfixed32.in\032X!(" + + "this in dyn(rules)[\'in\']) ? \'value must " + + "be in list %s\'.format([dyn(rules)[\'in\']]" + + ") : \'\'R\002in\022\200\001\n\006not_in\030\007 \003(\017Bi\302Hf\nd\n\017sfix" + + "ed32.not_in\032Qthis in rules.not_in ? \'val" + + "ue must not be in list %s\'.format([rules" + + ".not_in]) : \'\'R\005notIn\0227\n\007example\030\010 \003(\017B\035" + + "\302H\032\n\030\n\020sfixed32.example\032\004trueR\007example*\t" + + "\010\350\007\020\200\200\200\200\002B\013\n\tless_thanB\016\n\014greater_than\"\310" + + "\025\n\rSFixed64Rules\022s\n\005const\030\001 \001(\020B]\302HZ\nX\n\016" + + "sfixed64.const\032Fthis != rules.const ? \'v" + + "alue must equal %s\'.format([rules.const]" + + ") : \'\'R\005const\022\221\001\n\002lt\030\002 \001(\020B\177\302H|\nz\n\013sfixe" + + "d64.lt\032k!has(rules.gte) && !has(rules.gt" + + ") && this >= rules.lt? \'value must be le" + + "ss than %s\'.format([rules.lt]) : \'\'H\000R\002l" + + "t\022\244\001\n\003lte\030\003 \001(\020B\217\001\302H\213\001\n\210\001\n\014sfixed64.lte\032" + + "x!has(rules.gte) && !has(rules.gt) && th" + + "is > rules.lte? \'value must be less than" + + " or equal to %s\'.format([rules.lte]) : \'" + + "\'H\000R\003lte\022\252\007\n\002gt\030\004 \001(\020B\227\007\302H\223\007\n}\n\013sfixed64" + + ".gt\032n!has(rules.lt) && !has(rules.lte) &" + + "& this <= rules.gt? \'value must be great" + + "er than %s\'.format([rules.gt]) : \'\'\n\266\001\n\016" + + "sfixed64.gt_lt\032\243\001has(rules.lt) && rules." + + "lt >= rules.gt && (this >= rules.lt || t" + + "his <= rules.gt)? \'value must be greater" + + " than %s and less than %s\'.format([rules" + + ".gt, rules.lt]) : \'\'\n\276\001\n\030sfixed64.gt_lt_" + + "exclusive\032\241\001has(rules.lt) && rules.lt < " + + "rules.gt && (rules.lt <= this && this <=" + + " rules.gt)? \'value must be greater than " + + "%s or less than %s\'.format([rules.gt, ru" + + "les.lt]) : \'\'\n\306\001\n\017sfixed64.gt_lte\032\262\001has(" + + "rules.lte) && rules.lte >= rules.gt && (" + + "this > rules.lte || this <= rules.gt)? \'" + + "value must be greater than %s and less t" + + "han or equal to %s\'.format([rules.gt, ru" + + "les.lte]) : \'\'\n\316\001\n\031sfixed64.gt_lte_exclu" + + "sive\032\260\001has(rules.lte) && rules.lte < rul" + + "es.gt && (rules.lte < this && this <= ru" + + "les.gt)? \'value must be greater than %s " + + "or less than or equal to %s\'.format([rul" + + "es.gt, rules.lte]) : \'\'H\001R\002gt\022\367\007\n\003gte\030\005 " + + "\001(\020B\342\007\302H\336\007\n\213\001\n\014sfixed64.gte\032{!has(rules." + + "lt) && !has(rules.lte) && this < rules.g" + + "te? \'value must be greater than or equal" + + " to %s\'.format([rules.gte]) : \'\'\n\305\001\n\017sfi" + + "xed64.gte_lt\032\261\001has(rules.lt) && rules.lt" + + " >= rules.gte && (this >= rules.lt || th" + + "is < rules.gte)? \'value must be greater " + + "than or equal to %s and less than %s\'.fo" + + "rmat([rules.gte, rules.lt]) : \'\'\n\315\001\n\031sfi" + + "xed64.gte_lt_exclusive\032\257\001has(rules.lt) &" + + "& rules.lt < rules.gte && (rules.lt <= t" + + "his && this < rules.gte)? \'value must be" + + " greater than or equal to %s or less tha" + + "n %s\'.format([rules.gte, rules.lt]) : \'\'" + + "\n\325\001\n\020sfixed64.gte_lte\032\300\001has(rules.lte) &" + + "& rules.lte >= rules.gte && (this > rule" + + "s.lte || this < rules.gte)? \'value must " + + "be greater than or equal to %s and less " + + "than or equal to %s\'.format([rules.gte, " + + "rules.lte]) : \'\'\n\335\001\n\032sfixed64.gte_lte_ex" + + "clusive\032\276\001has(rules.lte) && rules.lte < " + + "rules.gte && (rules.lte < this && this <" + + " rules.gte)? \'value must be greater than" + + " or equal to %s or less than or equal to" + + " %s\'.format([rules.gte, rules.lte]) : \'\'" + + "H\001R\003gte\022|\n\002in\030\006 \003(\020Bl\302Hi\ng\n\013sfixed64.in\032" + + "X!(this in dyn(rules)[\'in\']) ? \'value mu" + + "st be in list %s\'.format([dyn(rules)[\'in" + + "\']]) : \'\'R\002in\022\200\001\n\006not_in\030\007 \003(\020Bi\302Hf\nd\n\017s" + + "fixed64.not_in\032Qthis in rules.not_in ? \'" + + "value must not be in list %s\'.format([ru" + + "les.not_in]) : \'\'R\005notIn\0227\n\007example\030\010 \003(" + + "\020B\035\302H\032\n\030\n\020sfixed64.example\032\004trueR\007exampl" + + "e*\t\010\350\007\020\200\200\200\200\002B\013\n\tless_thanB\016\n\014greater_tha" + + "n\"\274\001\n\tBoolRules\022o\n\005const\030\001 \001(\010BY\302HV\nT\n\nb" + + "ool.const\032Fthis != rules.const ? \'value " + + "must equal %s\'.format([rules.const]) : \'" + + "\'R\005const\0223\n\007example\030\002 \003(\010B\031\302H\026\n\024\n\014bool.e" + + "xample\032\004trueR\007example*\t\010\350\007\020\200\200\200\200\002\"\2419\n\013Str" + + "ingRules\022s\n\005const\030\001 \001(\tB]\302HZ\nX\n\014string.c" + + "onst\032Hthis != rules.const ? \'value must " + + "equal `%s`\'.format([rules.const]) : \'\'R\005" + + "const\022\203\001\n\003len\030\023 \001(\004Bq\302Hn\nl\n\nstring.len\032^" + "uint(this.size()) != rules.len ? \'value " + "length must be %s characters\'.format([ru" + - "les.len]) : \'\'H\002R\003len\210\001\001\022\246\001\n\007min_len\030\002 \001" + - "(\004B\207\001\302H\203\001\n\200\001\n\016string.min_len\032nuint(this." + - "size()) < rules.min_len ? \'value length " + - "must be at least %s characters\'.format([" + - "rules.min_len]) : \'\'H\003R\006minLen\210\001\001\022\244\001\n\007ma" + - "x_len\030\003 \001(\004B\205\001\302H\201\001\n\177\n\016string.max_len\032mui" + - "nt(this.size()) > rules.max_len ? \'value" + - " length must be at most %s characters\'.f" + - "ormat([rules.max_len]) : \'\'H\004R\006maxLen\210\001\001" + - "\022\252\001\n\tlen_bytes\030\024 \001(\004B\207\001\302H\203\001\n\200\001\n\020string.l" + - "en_bytes\032luint(bytes(this).size()) != ru" + - "les.len_bytes ? \'value length must be %s" + - " bytes\'.format([rules.len_bytes]) : \'\'H\005" + - "R\010lenBytes\210\001\001\022\262\001\n\tmin_bytes\030\004 \001(\004B\217\001\302H\213\001" + - "\n\210\001\n\020string.min_bytes\032tuint(bytes(this)." + - "size()) < rules.min_bytes ? \'value lengt" + - "h must be at least %s bytes\'.format([rul" + - "es.min_bytes]) : \'\'H\006R\010minBytes\210\001\001\022\261\001\n\tm" + - "ax_bytes\030\005 \001(\004B\216\001\302H\212\001\n\207\001\n\020string.max_byt" + - "es\032suint(bytes(this).size()) > rules.max" + - "_bytes ? \'value length must be at most %" + - "s bytes\'.format([rules.max_bytes]) : \'\'H" + - "\007R\010maxBytes\210\001\001\022\233\001\n\007pattern\030\006 \001(\tB|\302Hy\nw\n" + - "\016string.pattern\032e!this.matches(rules.pat" + - "tern) ? \'value does not match regex patt" + - "ern `%s`\'.format([rules.pattern]) : \'\'H\010" + - "R\007pattern\210\001\001\022\221\001\n\006prefix\030\007 \001(\tBt\302Hq\no\n\rst" + - "ring.prefix\032^!this.startsWith(rules.pref" + - "ix) ? \'value does not have prefix `%s`\'." + - "format([rules.prefix]) : \'\'H\tR\006prefix\210\001\001" + - "\022\217\001\n\006suffix\030\010 \001(\tBr\302Ho\nm\n\rstring.suffix\032" + + "les.len]) : \'\'R\003len\022\241\001\n\007min_len\030\002 \001(\004B\207\001" + + "\302H\203\001\n\200\001\n\016string.min_len\032nuint(this.size(" + + ")) < rules.min_len ? \'value length must " + + "be at least %s characters\'.format([rules" + + ".min_len]) : \'\'R\006minLen\022\237\001\n\007max_len\030\003 \001(" + + "\004B\205\001\302H\201\001\n\177\n\016string.max_len\032muint(this.si" + + "ze()) > rules.max_len ? \'value length mu" + + "st be at most %s characters\'.format([rul" + + "es.max_len]) : \'\'R\006maxLen\022\245\001\n\tlen_bytes\030" + + "\024 \001(\004B\207\001\302H\203\001\n\200\001\n\020string.len_bytes\032luint(" + + "bytes(this).size()) != rules.len_bytes ?" + + " \'value length must be %s bytes\'.format(" + + "[rules.len_bytes]) : \'\'R\010lenBytes\022\255\001\n\tmi" + + "n_bytes\030\004 \001(\004B\217\001\302H\213\001\n\210\001\n\020string.min_byte" + + "s\032tuint(bytes(this).size()) < rules.min_" + + "bytes ? \'value length must be at least %" + + "s bytes\'.format([rules.min_bytes]) : \'\'R" + + "\010minBytes\022\254\001\n\tmax_bytes\030\005 \001(\004B\216\001\302H\212\001\n\207\001\n" + + "\020string.max_bytes\032suint(bytes(this).size" + + "()) > rules.max_bytes ? \'value length mu" + + "st be at most %s bytes\'.format([rules.ma" + + "x_bytes]) : \'\'R\010maxBytes\022\226\001\n\007pattern\030\006 \001" + + "(\tB|\302Hy\nw\n\016string.pattern\032e!this.matches" + + "(rules.pattern) ? \'value does not match " + + "regex pattern `%s`\'.format([rules.patter" + + "n]) : \'\'R\007pattern\022\214\001\n\006prefix\030\007 \001(\tBt\302Hq\n" + + "o\n\rstring.prefix\032^!this.startsWith(rules" + + ".prefix) ? \'value does not have prefix `" + + "%s`\'.format([rules.prefix]) : \'\'R\006prefix" + + "\022\212\001\n\006suffix\030\010 \001(\tBr\302Ho\nm\n\rstring.suffix\032" + "\\!this.endsWith(rules.suffix) ? \'value d" + "oes not have suffix `%s`\'.format([rules." + - "suffix]) : \'\'H\nR\006suffix\210\001\001\022\237\001\n\010contains\030" + - "\t \001(\tB~\302H{\ny\n\017string.contains\032f!this.con" + - "tains(rules.contains) ? \'value does not " + - "contain substring `%s`\'.format([rules.co" + - "ntains]) : \'\'H\013R\010contains\210\001\001\022\252\001\n\014not_con" + - "tains\030\027 \001(\tB\201\001\302H~\n|\n\023string.not_contains" + - "\032ethis.contains(rules.not_contains) ? \'v" + - "alue contains substring `%s`\'.format([ru" + - "les.not_contains]) : \'\'H\014R\013notContains\210\001" + - "\001\022z\n\002in\030\n \003(\tBj\302Hg\ne\n\tstring.in\032X!(this " + - "in dyn(rules)[\'in\']) ? \'value must be in" + - " list %s\'.format([dyn(rules)[\'in\']]) : \'" + - "\'R\002in\022~\n\006not_in\030\013 \003(\tBg\302Hd\nb\n\rstring.not" + - "_in\032Qthis in rules.not_in ? \'value must " + - "not be in list %s\'.format([rules.not_in]" + - ") : \'\'R\005notIn\022\306\001\n\005email\030\014 \001(\010B\255\001\302H\251\001\nQ\n\014" + - "string.email\022#value must be a valid emai" + - "l address\032\034this == \'\' || this.isEmail()\n" + - "T\n\022string.email_empty\0222value is empty, w" + - "hich is not a valid email address\032\nthis " + - "!= \'\'H\000R\005email\022\313\001\n\010hostname\030\r \001(\010B\254\001\302H\250\001" + - "\nR\n\017string.hostname\022\036value must be a val" + - "id hostname\032\037this == \'\' || this.isHostna" + - "me()\nR\n\025string.hostname_empty\022-value is " + - "empty, which is not a valid hostname\032\nth" + - "is != \'\'H\000R\010hostname\022\261\001\n\002ip\030\016 \001(\010B\236\001\302H\232\001" + - "\nH\n\tstring.ip\022 value must be a valid IP " + - "address\032\031this == \'\' || this.isIp()\nN\n\017st" + - "ring.ip_empty\022/value is empty, which is " + - "not a valid IP address\032\nthis != \'\'H\000R\002ip" + - "\022\276\001\n\004ipv4\030\017 \001(\010B\247\001\302H\243\001\nM\n\013string.ipv4\022\"v" + - "alue must be a valid IPv4 address\032\032this " + - "== \'\' || this.isIp(4)\nR\n\021string.ipv4_emp" + - "ty\0221value is empty, which is not a valid" + - " IPv4 address\032\nthis != \'\'H\000R\004ipv4\022\276\001\n\004ip" + - "v6\030\020 \001(\010B\247\001\302H\243\001\nM\n\013string.ipv6\022\"value mu" + - "st be a valid IPv6 address\032\032this == \'\' |" + - "| this.isIp(6)\nR\n\021string.ipv6_empty\0221val" + - "ue is empty, which is not a valid IPv6 a" + - "ddress\032\nthis != \'\'H\000R\004ipv6\022\250\001\n\003uri\030\021 \001(\010" + - "B\223\001\302H\217\001\nC\n\nstring.uri\022\031value must be a v" + - "alid URI\032\032this == \'\' || this.isUri()\nH\n\020" + - "string.uri_empty\022(value is empty, which " + - "is not a valid URI\032\nthis != \'\'H\000R\003uri\022\\\n" + - "\007uri_ref\030\022 \001(\010BA\302H>\n<\n\016string.uri_ref\022\031v" + - "alue must be a valid URI\032\017this.isUriRef(" + - ")H\000R\006uriRef\022\364\001\n\007address\030\025 \001(\010B\327\001\302H\323\001\no\n\016" + - "string.address\022-value must be a valid ho" + - "stname, or ip address\032.this == \'\' || thi" + - "s.isHostname() || this.isIp()\n`\n\024string." + - "address_empty\022 rules.max_len " + - "? \'value must be at most %s bytes\'.forma" + - "t([rules.max_len]) : \'\'H\004R\006maxLen\210\001\001\022\236\001\n" + - "\007pattern\030\004 \001(\tB\177\302H|\nz\n\rbytes.pattern\032i!s" + - "tring(this).matches(rules.pattern) ? \'va" + - "lue must match regex pattern `%s`\'.forma" + - "t([rules.pattern]) : \'\'H\005R\007pattern\210\001\001\022\216\001" + - "\n\006prefix\030\005 \001(\014Bq\302Hn\nl\n\014bytes.prefix\032\\!th" + - "is.startsWith(rules.prefix) ? \'value doe" + - "s not have prefix %x\'.format([rules.pref" + - "ix]) : \'\'H\006R\006prefix\210\001\001\022\214\001\n\006suffix\030\006 \001(\014B" + - "o\302Hl\nj\n\014bytes.suffix\032Z!this.endsWith(rul" + - "es.suffix) ? \'value does not have suffix" + - " %x\'.format([rules.suffix]) : \'\'H\007R\006suff" + - "ix\210\001\001\022\222\001\n\010contains\030\007 \001(\014Bq\302Hn\nl\n\016bytes.c" + - "ontains\032Z!this.contains(rules.contains) " + - "? \'value does not contain %x\'.format([ru" + - "les.contains]) : \'\'H\010R\010contains\210\001\001\022\233\001\n\002i" + - "n\030\010 \003(\014B\212\001\302H\206\001\n\203\001\n\010bytes.in\032wdyn(rules)[" + - "\'in\'].size() > 0 && !(this in dyn(rules)" + - "[\'in\']) ? \'value must be in list %s\'.for" + - "mat([dyn(rules)[\'in\']]) : \'\'R\002in\022}\n\006not_" + - "in\030\t \003(\014Bf\302Hc\na\n\014bytes.not_in\032Qthis in r" + - "ules.not_in ? \'value must not be in list" + - " %s\'.format([rules.not_in]) : \'\'R\005notIn\022" + - "\325\001\n\002ip\030\n \001(\010B\302\001\302H\276\001\ng\n\010bytes.ip\022 value m" + - "ust be a valid IP address\0329this.size() =" + - "= 0 || this.size() == 4 || this.size() =" + - "= 16\nS\n\016bytes.ip_empty\022/value is empty, " + - "which is not a valid IP address\032\020this.si" + - "ze() != 0H\000R\002ip\022\314\001\n\004ipv4\030\013 \001(\010B\265\001\302H\261\001\nV\n" + - "\nbytes.ipv4\022\"value must be a valid IPv4 " + - "address\032$this.size() == 0 || this.size()" + - " == 4\nW\n\020bytes.ipv4_empty\0221value is empt" + - "y, which is not a valid IPv4 address\032\020th" + - "is.size() != 0H\000R\004ipv4\022\315\001\n\004ipv6\030\014 \001(\010B\266\001" + - "\302H\262\001\nW\n\nbytes.ipv6\022\"value must be a vali" + - "d IPv6 address\032%this.size() == 0 || this" + - ".size() == 16\nW\n\020bytes.ipv6_empty\0221value" + - " is empty, which is not a valid IPv6 add" + - "ress\032\020this.size() != 0H\000R\004ipv6B\014\n\nwell_k" + - "nownB\010\n\006_constB\006\n\004_lenB\n\n\010_min_lenB\n\n\010_m" + - "ax_lenB\n\n\010_patternB\t\n\007_prefixB\t\n\007_suffix" + - "B\013\n\t_contains\"\274\003\n\tEnumRules\022t\n\005const\030\001 \001" + - "(\005BY\302HV\nT\n\nenum.const\032Fthis != rules.con" + + "suffix]) : \'\'R\006suffix\022\232\001\n\010contains\030\t \001(\t" + + "B~\302H{\ny\n\017string.contains\032f!this.contains" + + "(rules.contains) ? \'value does not conta" + + "in substring `%s`\'.format([rules.contain" + + "s]) : \'\'R\010contains\022\245\001\n\014not_contains\030\027 \001(" + + "\tB\201\001\302H~\n|\n\023string.not_contains\032ethis.con" + + "tains(rules.not_contains) ? \'value conta" + + "ins substring `%s`\'.format([rules.not_co" + + "ntains]) : \'\'R\013notContains\022z\n\002in\030\n \003(\tBj" + + "\302Hg\ne\n\tstring.in\032X!(this in dyn(rules)[\'" + + "in\']) ? \'value must be in list %s\'.forma" + + "t([dyn(rules)[\'in\']]) : \'\'R\002in\022~\n\006not_in" + + "\030\013 \003(\tBg\302Hd\nb\n\rstring.not_in\032Qthis in ru" + + "les.not_in ? \'value must not be in list " + + "%s\'.format([rules.not_in]) : \'\'R\005notIn\022\346" + + "\001\n\005email\030\014 \001(\010B\315\001\302H\311\001\na\n\014string.email\022#v" + + "alue must be a valid email address\032,!rul" + + "es.email || this == \'\' || this.isEmail()" + + "\nd\n\022string.email_empty\0222value is empty, " + + "which is not a valid email address\032\032!rul" + + "es.email || this != \'\'H\000R\005email\022\361\001\n\010host" + + "name\030\r \001(\010B\322\001\302H\316\001\ne\n\017string.hostname\022\036va" + + "lue must be a valid hostname\0322!rules.hos" + + "tname || this == \'\' || this.isHostname()" + + "\ne\n\025string.hostname_empty\022-value is empt" + + "y, which is not a valid hostname\032\035!rules" + + ".hostname || this != \'\'H\000R\010hostname\022\313\001\n\002" + + "ip\030\016 \001(\010B\270\001\302H\264\001\nU\n\tstring.ip\022 value must" + + " be a valid IP address\032&!rules.ip || thi" + + "s == \'\' || this.isIp()\n[\n\017string.ip_empt" + + "y\022/value is empty, which is not a valid " + + "IP address\032\027!rules.ip || this != \'\'H\000R\002i" + + "p\022\334\001\n\004ipv4\030\017 \001(\010B\305\001\302H\301\001\n\\\n\013string.ipv4\022\"" + + "value must be a valid IPv4 address\032)!rul" + + "es.ipv4 || this == \'\' || this.isIp(4)\na\n" + + "\021string.ipv4_empty\0221value is empty, whic" + + "h is not a valid IPv4 address\032\031!rules.ip" + + "v4 || this != \'\'H\000R\004ipv4\022\334\001\n\004ipv6\030\020 \001(\010B" + + "\305\001\302H\301\001\n\\\n\013string.ipv6\022\"value must be a v" + + "alid IPv6 address\032)!rules.ipv6 || this =" + + "= \'\' || this.isIp(6)\na\n\021string.ipv6_empt" + + "y\0221value is empty, which is not a valid " + + "IPv6 address\032\031!rules.ipv6 || this != \'\'H" + + "\000R\004ipv6\022\304\001\n\003uri\030\021 \001(\010B\257\001\302H\253\001\nQ\n\nstring.u" + + "ri\022\031value must be a valid URI\032(!rules.ur" + + "i || this == \'\' || this.isUri()\nV\n\020strin" + + "g.uri_empty\022(value is empty, which is no" + + "t a valid URI\032\030!rules.uri || this != \'\'H" + + "\000R\003uri\022n\n\007uri_ref\030\022 \001(\010BS\302HP\nN\n\016string.u" + + "ri_ref\022\031value must be a valid URI\032!!rule" + + "s.uri_ref || this.isUriRef()H\000R\006uriRef\022\231" + + "\002\n\007address\030\025 \001(\010B\374\001\302H\370\001\n\201\001\n\016string.addre" + + "ss\022-value must be a valid hostname, or i" + + "p address\032@!rules.address || this == \'\' " + + "|| this.isHostname() || this.isIp()\nr\n\024s" + + "tring.address_empty\022!rules.ipv4_with_prefixlen || this =" + + "= \'\' || this.isIpPrefix(4)\n\222\001\n string.ip" + + "v4_with_prefixlen_empty\022Dvalue is empty," + + " which is not a valid IPv4 address with " + + "prefix length\032(!rules.ipv4_with_prefixle" + + "n || this != \'\'H\000R\021ipv4WithPrefixlen\022\342\002\n" + + "\023ipv6_with_prefixlen\030\034 \001(\010B\257\002\302H\253\002\n\223\001\n\032st" + + "ring.ipv6_with_prefixlen\0225value must be " + + "a valid IPv6 address with prefix length\032" + + ">!rules.ipv6_with_prefixlen || this == \'" + + "\' || this.isIpPrefix(6)\n\222\001\n string.ipv6_" + + "with_prefixlen_empty\022Dvalue is empty, wh" + + "ich is not a valid IPv6 address with pre" + + "fix length\032(!rules.ipv6_with_prefixlen |" + + "| this != \'\'H\000R\021ipv6WithPrefixlen\022\374\001\n\tip" + + "_prefix\030\035 \001(\010B\334\001\302H\330\001\nl\n\020string.ip_prefix" + + "\022\037value must be a valid IP prefix\0327!rule" + + "s.ip_prefix || this == \'\' || this.isIpPr" + + "efix(true)\nh\n\026string.ip_prefix_empty\022.va" + + "lue is empty, which is not a valid IP pr" + + "efix\032\036!rules.ip_prefix || this != \'\'H\000R\010" + + "ipPrefix\022\217\002\n\013ipv4_prefix\030\036 \001(\010B\353\001\302H\347\001\nu\n" + + "\022string.ipv4_prefix\022!value must be a val" + + "id IPv4 prefix\032!rules.host_and_port || this == \'\' || t" + + "his.isHostAndPort(true)\ny\n\032string.host_a" + + "nd_port_empty\0227value is empty, which is " + + "not a valid host and port pair\032\"!rules.h" + + "ost_and_port || this != \'\'H\000R\013hostAndPor" + + "t\022\270\005\n\020well_known_regex\030\030 \001(\0162\030.buf.valid" + + "ate.KnownRegexB\361\004\302H\355\004\n\360\001\n#string.well_kn" + + "own_regex.header_name\022&value must be a v" + + "alid HTTP header name\032\240\001rules.well_known" + + "_regex != 1 || this == \'\' || this.matche" + + "s(!has(rules.strict) || rules.strict ?\'^" + + ":?[0-9a-zA-Z!#$%&\\\'*+-.^_|~\\x60]+$\' :\'^[" + + "^\\u0000\\u000A\\u000D]+$\')\n\215\001\n)string.well" + + "_known_regex.header_name_empty\0225value is" + + " empty, which is not a valid HTTP header" + + " name\032)rules.well_known_regex != 1 || th" + + "is != \'\'\n\347\001\n$string.well_known_regex.hea" + + "der_value\022\'value must be a valid HTTP he" + + "ader value\032\225\001rules.well_known_regex != 2" + + " || this.matches(!has(rules.strict) || r" + + "ules.strict ?\'^[^\\u0000-\\u0008\\u000A-\\u0" + + "01F\\u007F]*$\' :\'^[^\\u0000\\u000A\\u000D]*$" + + "\')H\000R\016wellKnownRegex\022\026\n\006strict\030\031 \001(\010R\006st" + + "rict\0225\n\007example\030\" \003(\tB\033\302H\030\n\026\n\016string.exa" + + "mple\032\004trueR\007example*\t\010\350\007\020\200\200\200\200\002B\014\n\nwell_k" + + "nown\"\243\021\n\nBytesRules\022m\n\005const\030\001 \001(\014BW\302HT\n" + + "R\n\013bytes.const\032Cthis != rules.const ? \'v" + + "alue must be %x\'.format([rules.const]) :" + + " \'\'R\005const\022}\n\003len\030\r \001(\004Bk\302Hh\nf\n\tbytes.le" + + "n\032Yuint(this.size()) != rules.len ? \'val" + + "ue length must be %s bytes\'.format([rule" + + "s.len]) : \'\'R\003len\022\230\001\n\007min_len\030\002 \001(\004B\177\302H|" + + "\nz\n\rbytes.min_len\032iuint(this.size()) < r" + + "ules.min_len ? \'value length must be at " + + "least %s bytes\'.format([rules.min_len]) " + + ": \'\'R\006minLen\022\220\001\n\007max_len\030\003 \001(\004Bw\302Ht\nr\n\rb" + + "ytes.max_len\032auint(this.size()) > rules." + + "max_len ? \'value must be at most %s byte" + + "s\'.format([rules.max_len]) : \'\'R\006maxLen\022" + + "\231\001\n\007pattern\030\004 \001(\tB\177\302H|\nz\n\rbytes.pattern\032" + + "i!string(this).matches(rules.pattern) ? " + + "\'value must match regex pattern `%s`\'.fo" + + "rmat([rules.pattern]) : \'\'R\007pattern\022\211\001\n\006" + + "prefix\030\005 \001(\014Bq\302Hn\nl\n\014bytes.prefix\032\\!this" + + ".startsWith(rules.prefix) ? \'value does " + + "not have prefix %x\'.format([rules.prefix" + + "]) : \'\'R\006prefix\022\207\001\n\006suffix\030\006 \001(\014Bo\302Hl\nj\n" + + "\014bytes.suffix\032Z!this.endsWith(rules.suff" + + "ix) ? \'value does not have suffix %x\'.fo" + + "rmat([rules.suffix]) : \'\'R\006suffix\022\215\001\n\010co" + + "ntains\030\007 \001(\014Bq\302Hn\nl\n\016bytes.contains\032Z!th" + + "is.contains(rules.contains) ? \'value doe" + + "s not contain %x\'.format([rules.contains" + + "]) : \'\'R\010contains\022\233\001\n\002in\030\010 \003(\014B\212\001\302H\206\001\n\203\001" + + "\n\010bytes.in\032wdyn(rules)[\'in\'].size() > 0 " + + "&& !(this in dyn(rules)[\'in\']) ? \'value " + + "must be in list %s\'.format([dyn(rules)[\'" + + "in\']]) : \'\'R\002in\022}\n\006not_in\030\t \003(\014Bf\302Hc\na\n\014" + + "bytes.not_in\032Qthis in rules.not_in ? \'va" + + "lue must not be in list %s\'.format([rule" + + "s.not_in]) : \'\'R\005notIn\022\357\001\n\002ip\030\n \001(\010B\334\001\302H" + + "\330\001\nt\n\010bytes.ip\022 value must be a valid IP" + + " address\032F!rules.ip || this.size() == 0 " + + "|| this.size() == 4 || this.size() == 16" + + "\n`\n\016bytes.ip_empty\022/value is empty, whic" + + "h is not a valid IP address\032\035!rules.ip |" + + "| this.size() != 0H\000R\002ip\022\352\001\n\004ipv4\030\013 \001(\010B" + + "\323\001\302H\317\001\ne\n\nbytes.ipv4\022\"value must be a va" + + "lid IPv4 address\0323!rules.ipv4 || this.si" + + "ze() == 0 || this.size() == 4\nf\n\020bytes.i" + + "pv4_empty\0221value is empty, which is not " + + "a valid IPv4 address\032\037!rules.ipv4 || thi" + + "s.size() != 0H\000R\004ipv4\022\353\001\n\004ipv6\030\014 \001(\010B\324\001\302" + + "H\320\001\nf\n\nbytes.ipv6\022\"value must be a valid" + + " IPv6 address\0324!rules.ipv6 || this.size(" + + ") == 0 || this.size() == 16\nf\n\020bytes.ipv" + + "6_empty\0221value is empty, which is not a " + + "valid IPv6 address\032\037!rules.ipv6 || this." + + "size() != 0H\000R\004ipv6\0224\n\007example\030\016 \003(\014B\032\302H" + + "\027\n\025\n\rbytes.example\032\004trueR\007example*\t\010\350\007\020\200" + + "\200\200\200\002B\014\n\nwell_known\"\327\003\n\tEnumRules\022o\n\005cons" + + "t\030\001 \001(\005BY\302HV\nT\n\nenum.const\032Fthis != rule" + + "s.const ? \'value must equal %s\'.format([" + + "rules.const]) : \'\'R\005const\022!\n\014defined_onl" + + "y\030\002 \001(\010R\013definedOnly\022x\n\002in\030\003 \003(\005Bh\302He\nc\n" + + "\007enum.in\032X!(this in dyn(rules)[\'in\']) ? " + + "\'value must be in list %s\'.format([dyn(r" + + "ules)[\'in\']]) : \'\'R\002in\022|\n\006not_in\030\004 \003(\005Be" + + "\302Hb\n`\n\013enum.not_in\032Qthis in rules.not_in" + + " ? \'value must not be in list %s\'.format" + + "([rules.not_in]) : \'\'R\005notIn\0223\n\007example\030" + + "\005 \003(\005B\031\302H\026\n\024\n\014enum.example\032\004trueR\007exampl" + + "e*\t\010\350\007\020\200\200\200\200\002\"\244\004\n\rRepeatedRules\022\250\001\n\tmin_i" + + "tems\030\001 \001(\004B\212\001\302H\206\001\n\203\001\n\022repeated.min_items" + + "\032muint(this.size()) < rules.min_items ? " + + "\'value must contain at least %d item(s)\'" + + ".format([rules.min_items]) : \'\'R\010minItem" + + "s\022\254\001\n\tmax_items\030\002 \001(\004B\216\001\302H\212\001\n\207\001\n\022repeate" + + "d.max_items\032quint(this.size()) > rules.m" + + "ax_items ? \'value must contain no more t" + + "han %s item(s)\'.format([rules.max_items]" + + ") : \'\'R\010maxItems\022x\n\006unique\030\003 \001(\010B`\302H]\n[\n" + + "\017repeated.unique\022(repeated value must co" + + "ntain unique items\032\036!rules.unique || thi" + + "s.unique()R\006unique\0224\n\005items\030\004 \001(\0132\036.buf." + + "validate.FieldConstraintsR\005items*\t\010\350\007\020\200\200" + + "\200\200\002\"\270\003\n\010MapRules\022\231\001\n\tmin_pairs\030\001 \001(\004B|\302H" + + "y\nw\n\rmap.min_pairs\032fuint(this.size()) < " + + "rules.min_pairs ? \'map must be at least " + + "%d entries\'.format([rules.min_pairs]) : " + + "\'\'R\010minPairs\022\230\001\n\tmax_pairs\030\002 \001(\004B{\302Hx\nv\n" + + "\rmap.max_pairs\032euint(this.size()) > rule" + + "s.max_pairs ? \'map must be at most %d en" + + "tries\'.format([rules.max_pairs]) : \'\'R\010m" + + "axPairs\0222\n\004keys\030\004 \001(\0132\036.buf.validate.Fie" + + "ldConstraintsR\004keys\0226\n\006values\030\005 \001(\0132\036.bu" + + "f.validate.FieldConstraintsR\006values*\t\010\350\007" + + "\020\200\200\200\200\002\"1\n\010AnyRules\022\016\n\002in\030\002 \003(\tR\002in\022\025\n\006no" + + "t_in\030\003 \003(\tR\005notIn\"\242\027\n\rDurationRules\022\216\001\n\005" + + "const\030\002 \001(\0132\031.google.protobuf.DurationB]" + + "\302HZ\nX\n\016duration.const\032Fthis != rules.con" + "st ? \'value must equal %s\'.format([rules" + - ".const]) : \'\'H\000R\005const\210\001\001\022&\n\014defined_onl" + - "y\030\002 \001(\010H\001R\013definedOnly\210\001\001\022x\n\002in\030\003 \003(\005Bh\302" + - "He\nc\n\007enum.in\032X!(this in dyn(rules)[\'in\'" + - "]) ? \'value must be in list %s\'.format([" + - "dyn(rules)[\'in\']]) : \'\'R\002in\022|\n\006not_in\030\004 " + - "\003(\005Be\302Hb\n`\n\013enum.not_in\032Qthis in rules.n" + - "ot_in ? \'value must not be in list %s\'.f" + - "ormat([rules.not_in]) : \'\'R\005notInB\010\n\006_co" + - "nstB\017\n\r_defined_only\"\315\004\n\rRepeatedRules\022\255" + - "\001\n\tmin_items\030\001 \001(\004B\212\001\302H\206\001\n\203\001\n\022repeated.m" + - "in_items\032muint(this.size()) < rules.min_" + - "items ? \'value must contain at least %d " + - "item(s)\'.format([rules.min_items]) : \'\'H" + - "\000R\010minItems\210\001\001\022\261\001\n\tmax_items\030\002 \001(\004B\216\001\302H\212" + - "\001\n\207\001\n\022repeated.max_items\032quint(this.size" + - "()) > rules.max_items ? \'value must cont" + - "ain no more than %s item(s)\'.format([rul" + - "es.max_items]) : \'\'H\001R\010maxItems\210\001\001\022l\n\006un" + - "ique\030\003 \001(\010BO\302HL\nJ\n\017repeated.unique\022(repe" + - "ated value must contain unique items\032\rth" + - "is.unique()H\002R\006unique\210\001\001\0229\n\005items\030\004 \001(\0132" + - "\036.buf.validate.FieldConstraintsH\003R\005items" + - "\210\001\001B\014\n\n_min_itemsB\014\n\n_max_itemsB\t\n\007_uniq" + - "ueB\010\n\006_items\"\361\003\n\010MapRules\022\236\001\n\tmin_pairs\030" + - "\001 \001(\004B|\302Hy\nw\n\rmap.min_pairs\032fuint(this.s" + - "ize()) < rules.min_pairs ? \'map must be " + - "at least %d entries\'.format([rules.min_p" + - "airs]) : \'\'H\000R\010minPairs\210\001\001\022\235\001\n\tmax_pairs" + - "\030\002 \001(\004B{\302Hx\nv\n\rmap.max_pairs\032euint(this." + - "size()) > rules.max_pairs ? \'map must be" + - " at most %d entries\'.format([rules.max_p" + - "airs]) : \'\'H\001R\010maxPairs\210\001\001\0227\n\004keys\030\004 \001(\013" + - "2\036.buf.validate.FieldConstraintsH\002R\004keys" + - "\210\001\001\022;\n\006values\030\005 \001(\0132\036.buf.validate.Field" + - "ConstraintsH\003R\006values\210\001\001B\014\n\n_min_pairsB\014" + - "\n\n_max_pairsB\007\n\005_keysB\t\n\007_values\"1\n\010AnyR" + - "ules\022\016\n\002in\030\002 \003(\tR\002in\022\025\n\006not_in\030\003 \003(\tR\005no" + - "tIn\"\322\026\n\rDurationRules\022\223\001\n\005const\030\002 \001(\0132\031." + - "google.protobuf.DurationB]\302HZ\nX\n\016duratio" + - "n.const\032Fthis != rules.const ? \'value mu" + - "st equal %s\'.format([rules.const]) : \'\'H" + - "\002R\005const\210\001\001\022\254\001\n\002lt\030\003 \001(\0132\031.google.protob" + - "uf.DurationB\177\302H|\nz\n\013duration.lt\032k!has(ru" + - "les.gte) && !has(rules.gt) && this >= ru" + - "les.lt? \'value must be less than %s\'.for" + - "mat([rules.lt]) : \'\'H\000R\002lt\022\277\001\n\003lte\030\004 \001(\013" + - "2\031.google.protobuf.DurationB\217\001\302H\213\001\n\210\001\n\014d" + - "uration.lte\032x!has(rules.gte) && !has(rul" + - "es.gt) && this > rules.lte? \'value must " + - "be less than or equal to %s\'.format([rul" + - "es.lte]) : \'\'H\000R\003lte\022\305\007\n\002gt\030\005 \001(\0132\031.goog" + - "le.protobuf.DurationB\227\007\302H\223\007\n}\n\013duration." + - "gt\032n!has(rules.lt) && !has(rules.lte) &&" + - " this <= rules.gt? \'value must be greate" + - "r than %s\'.format([rules.gt]) : \'\'\n\266\001\n\016d" + - "uration.gt_lt\032\243\001has(rules.lt) && rules.l" + - "t >= rules.gt && (this >= rules.lt || th" + + ".const]) : \'\'R\005const\022\254\001\n\002lt\030\003 \001(\0132\031.goog" + + "le.protobuf.DurationB\177\302H|\nz\n\013duration.lt" + + "\032k!has(rules.gte) && !has(rules.gt) && t" + + "his >= rules.lt? \'value must be less tha" + + "n %s\'.format([rules.lt]) : \'\'H\000R\002lt\022\277\001\n\003" + + "lte\030\004 \001(\0132\031.google.protobuf.DurationB\217\001\302" + + "H\213\001\n\210\001\n\014duration.lte\032x!has(rules.gte) &&" + + " !has(rules.gt) && this > rules.lte? \'va" + + "lue must be less than or equal to %s\'.fo" + + "rmat([rules.lte]) : \'\'H\000R\003lte\022\305\007\n\002gt\030\005 \001" + + "(\0132\031.google.protobuf.DurationB\227\007\302H\223\007\n}\n\013" + + "duration.gt\032n!has(rules.lt) && !has(rule" + + "s.lte) && this <= rules.gt? \'value must " + + "be greater than %s\'.format([rules.gt]) :" + + " \'\'\n\266\001\n\016duration.gt_lt\032\243\001has(rules.lt) &" + + "& rules.lt >= rules.gt && (this >= rules" + + ".lt || this <= rules.gt)? \'value must be" + + " greater than %s and less than %s\'.forma" + + "t([rules.gt, rules.lt]) : \'\'\n\276\001\n\030duratio" + + "n.gt_lt_exclusive\032\241\001has(rules.lt) && rul" + + "es.lt < rules.gt && (rules.lt <= this &&" + + " this <= rules.gt)? \'value must be great" + + "er than %s or less than %s\'.format([rule" + + "s.gt, rules.lt]) : \'\'\n\306\001\n\017duration.gt_lt" + + "e\032\262\001has(rules.lte) && rules.lte >= rules" + + ".gt && (this > rules.lte || this <= rule" + + "s.gt)? \'value must be greater than %s an" + + "d less than or equal to %s\'.format([rule" + + "s.gt, rules.lte]) : \'\'\n\316\001\n\031duration.gt_l" + + "te_exclusive\032\260\001has(rules.lte) && rules.l" + + "te < rules.gt && (rules.lte < this && th" + "is <= rules.gt)? \'value must be greater " + - "than %s and less than %s\'.format([rules." + - "gt, rules.lt]) : \'\'\n\276\001\n\030duration.gt_lt_e" + - "xclusive\032\241\001has(rules.lt) && rules.lt < r" + - "ules.gt && (rules.lt <= this && this <= " + - "rules.gt)? \'value must be greater than %" + - "s or less than %s\'.format([rules.gt, rul" + - "es.lt]) : \'\'\n\306\001\n\017duration.gt_lte\032\262\001has(r" + + "than %s or less than or equal to %s\'.for" + + "mat([rules.gt, rules.lte]) : \'\'H\001R\002gt\022\222\010", + "\n\003gte\030\006 \001(\0132\031.google.protobuf.DurationB\342" + + "\007\302H\336\007\n\213\001\n\014duration.gte\032{!has(rules.lt) &" + + "& !has(rules.lte) && this < rules.gte? \'" + + "value must be greater than or equal to %" + + "s\'.format([rules.gte]) : \'\'\n\305\001\n\017duration" + + ".gte_lt\032\261\001has(rules.lt) && rules.lt >= r" + + "ules.gte && (this >= rules.lt || this < " + + "rules.gte)? \'value must be greater than " + + "or equal to %s and less than %s\'.format(" + + "[rules.gte, rules.lt]) : \'\'\n\315\001\n\031duration" + + ".gte_lt_exclusive\032\257\001has(rules.lt) && rul" + + "es.lt < rules.gte && (rules.lt <= this &" + + "& this < rules.gte)? \'value must be grea" + + "ter than or equal to %s or less than %s\'" + + ".format([rules.gte, rules.lt]) : \'\'\n\325\001\n\020" + + "duration.gte_lte\032\300\001has(rules.lte) && rul" + + "es.lte >= rules.gte && (this > rules.lte" + + " || this < rules.gte)? \'value must be gr" + + "eater than or equal to %s and less than " + + "or equal to %s\'.format([rules.gte, rules" + + ".lte]) : \'\'\n\335\001\n\032duration.gte_lte_exclusi" + + "ve\032\276\001has(rules.lte) && rules.lte < rules" + + ".gte && (rules.lte < this && this < rule" + + "s.gte)? \'value must be greater than or e" + + "qual to %s or less than or equal to %s\'." + + "format([rules.gte, rules.lte]) : \'\'H\001R\003g" + + "te\022\227\001\n\002in\030\007 \003(\0132\031.google.protobuf.Durati" + + "onBl\302Hi\ng\n\013duration.in\032X!(this in dyn(ru" + + "les)[\'in\']) ? \'value must be in list %s\'" + + ".format([dyn(rules)[\'in\']]) : \'\'R\002in\022\233\001\n" + + "\006not_in\030\010 \003(\0132\031.google.protobuf.Duration" + + "Bi\302Hf\nd\n\017duration.not_in\032Qthis in rules." + + "not_in ? \'value must not be in list %s\'." + + "format([rules.not_in]) : \'\'R\005notIn\022R\n\007ex" + + "ample\030\t \003(\0132\031.google.protobuf.DurationB\035" + + "\302H\032\n\030\n\020duration.example\032\004trueR\007example*\t" + + "\010\350\007\020\200\200\200\200\002B\013\n\tless_thanB\016\n\014greater_than\"\260" + + "\030\n\016TimestampRules\022\220\001\n\005const\030\002 \001(\0132\032.goog" + + "le.protobuf.TimestampB^\302H[\nY\n\017timestamp." + + "const\032Fthis != rules.const ? \'value must" + + " equal %s\'.format([rules.const]) : \'\'R\005c" + + "onst\022\257\001\n\002lt\030\003 \001(\0132\032.google.protobuf.Time" + + "stampB\200\001\302H}\n{\n\014timestamp.lt\032k!has(rules." + + "gte) && !has(rules.gt) && this >= rules." + + "lt? \'value must be less than %s\'.format(" + + "[rules.lt]) : \'\'H\000R\002lt\022\301\001\n\003lte\030\004 \001(\0132\032.g" + + "oogle.protobuf.TimestampB\220\001\302H\214\001\n\211\001\n\rtime" + + "stamp.lte\032x!has(rules.gte) && !has(rules" + + ".gt) && this > rules.lte? \'value must be" + + " less than or equal to %s\'.format([rules" + + ".lte]) : \'\'H\000R\003lte\022s\n\006lt_now\030\007 \001(\010BZ\302HW\n" + + "U\n\020timestamp.lt_now\032A(rules.lt_now && th" + + "is > now) ? \'value must be less than now" + + "\' : \'\'H\000R\005ltNow\022\313\007\n\002gt\030\005 \001(\0132\032.google.pr" + + "otobuf.TimestampB\234\007\302H\230\007\n~\n\014timestamp.gt\032" + + "n!has(rules.lt) && !has(rules.lte) && th" + + "is <= rules.gt? \'value must be greater t" + + "han %s\'.format([rules.gt]) : \'\'\n\267\001\n\017time" + + "stamp.gt_lt\032\243\001has(rules.lt) && rules.lt " + + ">= rules.gt && (this >= rules.lt || this" + + " <= rules.gt)? \'value must be greater th" + + "an %s and less than %s\'.format([rules.gt" + + ", rules.lt]) : \'\'\n\277\001\n\031timestamp.gt_lt_ex" + + "clusive\032\241\001has(rules.lt) && rules.lt < ru" + + "les.gt && (rules.lt <= this && this <= r" + + "ules.gt)? \'value must be greater than %s" + + " or less than %s\'.format([rules.gt, rule" + + "s.lt]) : \'\'\n\307\001\n\020timestamp.gt_lte\032\262\001has(r" + "ules.lte) && rules.lte >= rules.gt && (t" + "his > rules.lte || this <= rules.gt)? \'v" + "alue must be greater than %s and less th" + "an or equal to %s\'.format([rules.gt, rul" + - "es.lte]) : \'\'\n\316\001\n\031duration.gt_lte_exclus" + - "ive\032\260\001has(rules.lte) && rules.lte < rule" + - "s.gt && (rules.lte < this && this <= rul" + - "es.gt)? \'value must be greater than %s o" + - "r less than or equal to %s\'.format([rule" + - "s.gt, rules.lte]) : \'\'H\001R\002gt\022\222\010\n\003gte\030\006 \001" + - "(\0132\031.google.protobuf.DurationB\342\007\302H\336\007\n\213\001\n" + - "\014duration.gte\032{!has(rules.lt) && !has(ru" + - "les.lte) && this < rules.gte? \'value mus" + - "t be greater than or equal to %s\'.format" + - "([rules.gte]) : \'\'\n\305\001\n\017duration.gte_lt\032\261" + - "\001has(rules.lt) && rules.lt >= rules.gte " + - "&& (this >= rules.lt || this < rules.gte" + - ")? \'value must be greater than or equal " + - "to %s and less than %s\'.format([rules.gt" + - "e, rules.lt]) : \'\'\n\315\001\n\031duration.gte_lt_e" + - "xclusive\032\257\001has(rules.lt) && rules.lt < r" + - "ules.gte && (rules.lt <= this && this < " + - "rules.gte)? \'value must be greater than " + - "or equal to %s or less than %s\'.format([" + - "rules.gte, rules.lt]) : \'\'\n\325\001\n\020duration." + - "gte_lte\032\300\001has(rules.lte) && rules.lte >=" + - " rules.gte && (this > rules.lte || this " + - "< rules.gte)? \'value must be greater tha" + - "n or equal to %s and less than or equal " + - "to %s\'.format([rules.gte, rules.lte]) : " + - "\'\'\n\335\001\n\032duration.gte_lte_exclusive\032\276\001has(" + - "rules.lte) && rules.lte < rules.gte && (" + - "rules.lte < this && this < rules.gte)? \'" + - "value must be greater than or equal to %" + - "s or less than or equal to %s\'.format([r" + - "ules.gte, rules.lte]) : \'\'H\001R\003gte\022\227\001\n\002in" + - "\030\007 \003(\0132\031.google.protobuf.DurationBl\302Hi\ng" + - "\n\013duration.in\032X!(this in dyn(rules)[\'in\'" + - "]) ? \'value must be in list %s\'.format([" + - "dyn(rules)[\'in\']]) : \'\'R\002in\022\233\001\n\006not_in\030\010", - " \003(\0132\031.google.protobuf.DurationBi\302Hf\nd\n\017" + - "duration.not_in\032Qthis in rules.not_in ? " + - "\'value must not be in list %s\'.format([r" + - "ules.not_in]) : \'\'R\005notInB\013\n\tless_thanB\016" + - "\n\014greater_thanB\010\n\006_const\"\312\027\n\016TimestampRu" + - "les\022\225\001\n\005const\030\002 \001(\0132\032.google.protobuf.Ti" + - "mestampB^\302H[\nY\n\017timestamp.const\032Fthis !=" + - " rules.const ? \'value must equal %s\'.for" + - "mat([rules.const]) : \'\'H\002R\005const\210\001\001\022\257\001\n\002" + - "lt\030\003 \001(\0132\032.google.protobuf.TimestampB\200\001\302" + - "H}\n{\n\014timestamp.lt\032k!has(rules.gte) && !" + - "has(rules.gt) && this >= rules.lt? \'valu" + - "e must be less than %s\'.format([rules.lt" + - "]) : \'\'H\000R\002lt\022\301\001\n\003lte\030\004 \001(\0132\032.google.pro" + - "tobuf.TimestampB\220\001\302H\214\001\n\211\001\n\rtimestamp.lte" + - "\032x!has(rules.gte) && !has(rules.gt) && t" + - "his > rules.lte? \'value must be less tha" + - "n or equal to %s\'.format([rules.lte]) : " + - "\'\'H\000R\003lte\022a\n\006lt_now\030\007 \001(\010BH\302HE\nC\n\020timest" + - "amp.lt_now\032/this > now ? \'value must be " + - "less than now\' : \'\'H\000R\005ltNow\022\313\007\n\002gt\030\005 \001(" + - "\0132\032.google.protobuf.TimestampB\234\007\302H\230\007\n~\n\014" + - "timestamp.gt\032n!has(rules.lt) && !has(rul" + - "es.lte) && this <= rules.gt? \'value must" + - " be greater than %s\'.format([rules.gt]) " + - ": \'\'\n\267\001\n\017timestamp.gt_lt\032\243\001has(rules.lt)" + - " && rules.lt >= rules.gt && (this >= rul" + - "es.lt || this <= rules.gt)? \'value must " + - "be greater than %s and less than %s\'.for" + - "mat([rules.gt, rules.lt]) : \'\'\n\277\001\n\031times" + - "tamp.gt_lt_exclusive\032\241\001has(rules.lt) && " + - "rules.lt < rules.gt && (rules.lt <= this" + - " && this <= rules.gt)? \'value must be gr" + - "eater than %s or less than %s\'.format([r" + - "ules.gt, rules.lt]) : \'\'\n\307\001\n\020timestamp.g" + - "t_lte\032\262\001has(rules.lte) && rules.lte >= r" + - "ules.gt && (this > rules.lte || this <= " + - "rules.gt)? \'value must be greater than %" + - "s and less than or equal to %s\'.format([" + - "rules.gt, rules.lte]) : \'\'\n\317\001\n\032timestamp" + - ".gt_lte_exclusive\032\260\001has(rules.lte) && ru" + - "les.lte < rules.gt && (rules.lte < this " + - "&& this <= rules.gt)? \'value must be gre" + - "ater than %s or less than or equal to %s" + - "\'.format([rules.gt, rules.lte]) : \'\'H\001R\002" + - "gt\022\230\010\n\003gte\030\006 \001(\0132\032.google.protobuf.Times" + - "tampB\347\007\302H\343\007\n\214\001\n\rtimestamp.gte\032{!has(rule" + - "s.lt) && !has(rules.lte) && this < rules" + - ".gte? \'value must be greater than or equ" + - "al to %s\'.format([rules.gte]) : \'\'\n\306\001\n\020t" + - "imestamp.gte_lt\032\261\001has(rules.lt) && rules" + - ".lt >= rules.gte && (this >= rules.lt ||" + + "es.lte]) : \'\'\n\317\001\n\032timestamp.gt_lte_exclu" + + "sive\032\260\001has(rules.lte) && rules.lte < rul" + + "es.gt && (rules.lte < this && this <= ru" + + "les.gt)? \'value must be greater than %s " + + "or less than or equal to %s\'.format([rul" + + "es.gt, rules.lte]) : \'\'H\001R\002gt\022\230\010\n\003gte\030\006 " + + "\001(\0132\032.google.protobuf.TimestampB\347\007\302H\343\007\n\214" + + "\001\n\rtimestamp.gte\032{!has(rules.lt) && !has" + + "(rules.lte) && this < rules.gte? \'value " + + "must be greater than or equal to %s\'.for" + + "mat([rules.gte]) : \'\'\n\306\001\n\020timestamp.gte_" + + "lt\032\261\001has(rules.lt) && rules.lt >= rules." + + "gte && (this >= rules.lt || this < rules" + + ".gte)? \'value must be greater than or eq" + + "ual to %s and less than %s\'.format([rule" + + "s.gte, rules.lt]) : \'\'\n\316\001\n\032timestamp.gte" + + "_lt_exclusive\032\257\001has(rules.lt) && rules.l" + + "t < rules.gte && (rules.lt <= this && th" + + "is < rules.gte)? \'value must be greater " + + "than or equal to %s or less than %s\'.for" + + "mat([rules.gte, rules.lt]) : \'\'\n\326\001\n\021time" + + "stamp.gte_lte\032\300\001has(rules.lte) && rules." + + "lte >= rules.gte && (this > rules.lte ||" + " this < rules.gte)? \'value must be great" + - "er than or equal to %s and less than %s\'" + - ".format([rules.gte, rules.lt]) : \'\'\n\316\001\n\032" + - "timestamp.gte_lt_exclusive\032\257\001has(rules.l" + - "t) && rules.lt < rules.gte && (rules.lt " + - "<= this && this < rules.gte)? \'value mus" + - "t be greater than or equal to %s or less" + - " than %s\'.format([rules.gte, rules.lt]) " + - ": \'\'\n\326\001\n\021timestamp.gte_lte\032\300\001has(rules.l" + - "te) && rules.lte >= rules.gte && (this >" + - " rules.lte || this < rules.gte)? \'value " + - "must be greater than or equal to %s and " + - "less than or equal to %s\'.format([rules." + - "gte, rules.lte]) : \'\'\n\336\001\n\033timestamp.gte_" + - "lte_exclusive\032\276\001has(rules.lte) && rules." + - "lte < rules.gte && (rules.lte < this && " + - "this < rules.gte)? \'value must be greate" + - "r than or equal to %s or less than or eq" + - "ual to %s\'.format([rules.gte, rules.lte]" + - ") : \'\'H\001R\003gte\022d\n\006gt_now\030\010 \001(\010BK\302HH\nF\n\020ti" + - "mestamp.gt_now\0322this < now ? \'value must" + - " be greater than now\' : \'\'H\001R\005gtNow\022\305\001\n\006" + - "within\030\t \001(\0132\031.google.protobuf.DurationB" + - "\214\001\302H\210\001\n\205\001\n\020timestamp.within\032qthis < now-" + - "rules.within || this > now+rules.within " + - "? \'value must be within %s of now\'.forma" + - "t([rules.within]) : \'\'H\003R\006within\210\001\001B\013\n\tl" + - "ess_thanB\016\n\014greater_thanB\010\n\006_constB\t\n\007_w" + - "ithin*\235\001\n\006Ignore\022\026\n\022IGNORE_UNSPECIFIED\020\000" + + "er than or equal to %s and less than or " + + "equal to %s\'.format([rules.gte, rules.lt" + + "e]) : \'\'\n\336\001\n\033timestamp.gte_lte_exclusive" + + "\032\276\001has(rules.lte) && rules.lte < rules.g" + + "te && (rules.lte < this && this < rules." + + "gte)? \'value must be greater than or equ" + + "al to %s or less than or equal to %s\'.fo" + + "rmat([rules.gte, rules.lte]) : \'\'H\001R\003gte" + + "\022v\n\006gt_now\030\010 \001(\010B]\302HZ\nX\n\020timestamp.gt_no" + + "w\032D(rules.gt_now && this < now) ? \'value" + + " must be greater than now\' : \'\'H\001R\005gtNow" + + "\022\300\001\n\006within\030\t \001(\0132\031.google.protobuf.Dura" + + "tionB\214\001\302H\210\001\n\205\001\n\020timestamp.within\032qthis <" + + " now-rules.within || this > now+rules.wi" + + "thin ? \'value must be within %s of now\'." + + "format([rules.within]) : \'\'R\006within\022T\n\007e" + + "xample\030\n \003(\0132\032.google.protobuf.Timestamp" + + "B\036\302H\033\n\031\n\021timestamp.example\032\004trueR\007exampl" + + "e*\t\010\350\007\020\200\200\200\200\002B\013\n\tless_thanB\016\n\014greater_tha" + + "n\"E\n\nViolations\0227\n\nviolations\030\001 \003(\0132\027.bu" + + "f.validate.ViolationR\nviolations\"\202\001\n\tVio" + + "lation\022\035\n\nfield_path\030\001 \001(\tR\tfieldPath\022#\n" + + "\rconstraint_id\030\002 \001(\tR\014constraintId\022\030\n\007me" + + "ssage\030\003 \001(\tR\007message\022\027\n\007for_key\030\004 \001(\010R\006f" + + "orKey*\235\001\n\006Ignore\022\026\n\022IGNORE_UNSPECIFIED\020\000" + "\022\031\n\025IGNORE_IF_UNPOPULATED\020\001\022\033\n\027IGNORE_IF" + "_DEFAULT_VALUE\020\002\022\021\n\rIGNORE_ALWAYS\020\003\022\024\n\014I" + "GNORE_EMPTY\020\001\032\002\010\001\022\026\n\016IGNORE_DEFAULT\020\002\032\002\010" + "\001\032\002\020\001*n\n\nKnownRegex\022\033\n\027KNOWN_REGEX_UNSPE" + "CIFIED\020\000\022 \n\034KNOWN_REGEX_HTTP_HEADER_NAME" + - "\020\001\022!\n\035KNOWN_REGEX_HTTP_HEADER_VALUE\020\002:_\n" + + "\020\001\022!\n\035KNOWN_REGEX_HTTP_HEADER_VALUE\020\002:\\\n" + "\007message\022\037.google.protobuf.MessageOption" + "s\030\207\t \001(\0132 .buf.validate.MessageConstrain" + - "tsR\007message\210\001\001:W\n\005oneof\022\035.google.protobu" + - "f.OneofOptions\030\207\t \001(\0132\036.buf.validate.One" + - "ofConstraintsR\005oneof\210\001\001:W\n\005field\022\035.googl" + - "e.protobuf.FieldOptions\030\207\t \001(\0132\036.buf.val" + - "idate.FieldConstraintsR\005field\210\001\001Bn\n\022buil" + - "d.buf.validateB\rValidateProtoP\001ZGbuf.bui" + - "ld/gen/go/bufbuild/protovalidate/protoco" + - "lbuffers/go/buf/validateb\006proto3" + "tsR\007message:T\n\005oneof\022\035.google.protobuf.O" + + "neofOptions\030\207\t \001(\0132\036.buf.validate.OneofC" + + "onstraintsR\005oneof:T\n\005field\022\035.google.prot" + + "obuf.FieldOptions\030\207\t \001(\0132\036.buf.validate." + + "FieldConstraintsR\005field:c\n\npredefined\022\035." + + "google.protobuf.FieldOptions\030\210\t \001(\0132#.bu" + + "f.validate.PredefinedConstraintsR\npredef" + + "inedBn\n\022build.buf.validateB\rValidateProt" + + "oP\001ZGbuf.build/gen/go/bufbuild/protovali" + + "date/protocolbuffers/go/buf/validate" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor .internalBuildGeneratedFileFrom(descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] { - build.buf.validate.ExpressionProto.getDescriptor(), - build.buf.validate.priv.PrivateProto.getDescriptor(), com.google.protobuf.DescriptorProtos.getDescriptor(), com.google.protobuf.DurationProto.getDescriptor(), com.google.protobuf.TimestampProto.getDescriptor(), }); - internal_static_buf_validate_MessageConstraints_descriptor = + internal_static_buf_validate_Constraint_descriptor = getDescriptor().getMessageTypes().get(0); + internal_static_buf_validate_Constraint_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_buf_validate_Constraint_descriptor, + new java.lang.String[] { "Id", "Message", "Expression", }); + internal_static_buf_validate_MessageConstraints_descriptor = + getDescriptor().getMessageTypes().get(1); internal_static_buf_validate_MessageConstraints_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_MessageConstraints_descriptor, new java.lang.String[] { "Disabled", "Cel", }); internal_static_buf_validate_OneofConstraints_descriptor = - getDescriptor().getMessageTypes().get(1); + getDescriptor().getMessageTypes().get(2); internal_static_buf_validate_OneofConstraints_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_OneofConstraints_descriptor, new java.lang.String[] { "Required", }); internal_static_buf_validate_FieldConstraints_descriptor = - getDescriptor().getMessageTypes().get(2); + getDescriptor().getMessageTypes().get(3); internal_static_buf_validate_FieldConstraints_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_FieldConstraints_descriptor, new java.lang.String[] { "Cel", "Required", "Ignore", "Float", "Double", "Int32", "Int64", "Uint32", "Uint64", "Sint32", "Sint64", "Fixed32", "Fixed64", "Sfixed32", "Sfixed64", "Bool", "String", "Bytes", "Enum", "Repeated", "Map", "Any", "Duration", "Timestamp", "Skipped", "IgnoreEmpty", "Type", }); + internal_static_buf_validate_PredefinedConstraints_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_buf_validate_PredefinedConstraints_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_buf_validate_PredefinedConstraints_descriptor, + new java.lang.String[] { "Cel", }); internal_static_buf_validate_FloatRules_descriptor = - getDescriptor().getMessageTypes().get(3); + getDescriptor().getMessageTypes().get(5); internal_static_buf_validate_FloatRules_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_FloatRules_descriptor, - new java.lang.String[] { "Const", "Lt", "Lte", "Gt", "Gte", "In", "NotIn", "Finite", "LessThan", "GreaterThan", }); + new java.lang.String[] { "Const", "Lt", "Lte", "Gt", "Gte", "In", "NotIn", "Finite", "Example", "LessThan", "GreaterThan", }); internal_static_buf_validate_DoubleRules_descriptor = - getDescriptor().getMessageTypes().get(4); + getDescriptor().getMessageTypes().get(6); internal_static_buf_validate_DoubleRules_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_DoubleRules_descriptor, - new java.lang.String[] { "Const", "Lt", "Lte", "Gt", "Gte", "In", "NotIn", "Finite", "LessThan", "GreaterThan", }); + new java.lang.String[] { "Const", "Lt", "Lte", "Gt", "Gte", "In", "NotIn", "Finite", "Example", "LessThan", "GreaterThan", }); internal_static_buf_validate_Int32Rules_descriptor = - getDescriptor().getMessageTypes().get(5); + getDescriptor().getMessageTypes().get(7); internal_static_buf_validate_Int32Rules_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_Int32Rules_descriptor, - new java.lang.String[] { "Const", "Lt", "Lte", "Gt", "Gte", "In", "NotIn", "LessThan", "GreaterThan", }); + new java.lang.String[] { "Const", "Lt", "Lte", "Gt", "Gte", "In", "NotIn", "Example", "LessThan", "GreaterThan", }); internal_static_buf_validate_Int64Rules_descriptor = - getDescriptor().getMessageTypes().get(6); + getDescriptor().getMessageTypes().get(8); internal_static_buf_validate_Int64Rules_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_Int64Rules_descriptor, - new java.lang.String[] { "Const", "Lt", "Lte", "Gt", "Gte", "In", "NotIn", "LessThan", "GreaterThan", }); + new java.lang.String[] { "Const", "Lt", "Lte", "Gt", "Gte", "In", "NotIn", "Example", "LessThan", "GreaterThan", }); internal_static_buf_validate_UInt32Rules_descriptor = - getDescriptor().getMessageTypes().get(7); + getDescriptor().getMessageTypes().get(9); internal_static_buf_validate_UInt32Rules_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_UInt32Rules_descriptor, - new java.lang.String[] { "Const", "Lt", "Lte", "Gt", "Gte", "In", "NotIn", "LessThan", "GreaterThan", }); + new java.lang.String[] { "Const", "Lt", "Lte", "Gt", "Gte", "In", "NotIn", "Example", "LessThan", "GreaterThan", }); internal_static_buf_validate_UInt64Rules_descriptor = - getDescriptor().getMessageTypes().get(8); + getDescriptor().getMessageTypes().get(10); internal_static_buf_validate_UInt64Rules_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_UInt64Rules_descriptor, - new java.lang.String[] { "Const", "Lt", "Lte", "Gt", "Gte", "In", "NotIn", "LessThan", "GreaterThan", }); + new java.lang.String[] { "Const", "Lt", "Lte", "Gt", "Gte", "In", "NotIn", "Example", "LessThan", "GreaterThan", }); internal_static_buf_validate_SInt32Rules_descriptor = - getDescriptor().getMessageTypes().get(9); + getDescriptor().getMessageTypes().get(11); internal_static_buf_validate_SInt32Rules_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_SInt32Rules_descriptor, - new java.lang.String[] { "Const", "Lt", "Lte", "Gt", "Gte", "In", "NotIn", "LessThan", "GreaterThan", }); + new java.lang.String[] { "Const", "Lt", "Lte", "Gt", "Gte", "In", "NotIn", "Example", "LessThan", "GreaterThan", }); internal_static_buf_validate_SInt64Rules_descriptor = - getDescriptor().getMessageTypes().get(10); + getDescriptor().getMessageTypes().get(12); internal_static_buf_validate_SInt64Rules_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_SInt64Rules_descriptor, - new java.lang.String[] { "Const", "Lt", "Lte", "Gt", "Gte", "In", "NotIn", "LessThan", "GreaterThan", }); + new java.lang.String[] { "Const", "Lt", "Lte", "Gt", "Gte", "In", "NotIn", "Example", "LessThan", "GreaterThan", }); internal_static_buf_validate_Fixed32Rules_descriptor = - getDescriptor().getMessageTypes().get(11); + getDescriptor().getMessageTypes().get(13); internal_static_buf_validate_Fixed32Rules_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_Fixed32Rules_descriptor, - new java.lang.String[] { "Const", "Lt", "Lte", "Gt", "Gte", "In", "NotIn", "LessThan", "GreaterThan", }); + new java.lang.String[] { "Const", "Lt", "Lte", "Gt", "Gte", "In", "NotIn", "Example", "LessThan", "GreaterThan", }); internal_static_buf_validate_Fixed64Rules_descriptor = - getDescriptor().getMessageTypes().get(12); + getDescriptor().getMessageTypes().get(14); internal_static_buf_validate_Fixed64Rules_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_Fixed64Rules_descriptor, - new java.lang.String[] { "Const", "Lt", "Lte", "Gt", "Gte", "In", "NotIn", "LessThan", "GreaterThan", }); + new java.lang.String[] { "Const", "Lt", "Lte", "Gt", "Gte", "In", "NotIn", "Example", "LessThan", "GreaterThan", }); internal_static_buf_validate_SFixed32Rules_descriptor = - getDescriptor().getMessageTypes().get(13); + getDescriptor().getMessageTypes().get(15); internal_static_buf_validate_SFixed32Rules_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_SFixed32Rules_descriptor, - new java.lang.String[] { "Const", "Lt", "Lte", "Gt", "Gte", "In", "NotIn", "LessThan", "GreaterThan", }); + new java.lang.String[] { "Const", "Lt", "Lte", "Gt", "Gte", "In", "NotIn", "Example", "LessThan", "GreaterThan", }); internal_static_buf_validate_SFixed64Rules_descriptor = - getDescriptor().getMessageTypes().get(14); + getDescriptor().getMessageTypes().get(16); internal_static_buf_validate_SFixed64Rules_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_SFixed64Rules_descriptor, - new java.lang.String[] { "Const", "Lt", "Lte", "Gt", "Gte", "In", "NotIn", "LessThan", "GreaterThan", }); + new java.lang.String[] { "Const", "Lt", "Lte", "Gt", "Gte", "In", "NotIn", "Example", "LessThan", "GreaterThan", }); internal_static_buf_validate_BoolRules_descriptor = - getDescriptor().getMessageTypes().get(15); + getDescriptor().getMessageTypes().get(17); internal_static_buf_validate_BoolRules_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_BoolRules_descriptor, - new java.lang.String[] { "Const", }); + new java.lang.String[] { "Const", "Example", }); internal_static_buf_validate_StringRules_descriptor = - getDescriptor().getMessageTypes().get(16); + getDescriptor().getMessageTypes().get(18); internal_static_buf_validate_StringRules_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_StringRules_descriptor, - new java.lang.String[] { "Const", "Len", "MinLen", "MaxLen", "LenBytes", "MinBytes", "MaxBytes", "Pattern", "Prefix", "Suffix", "Contains", "NotContains", "In", "NotIn", "Email", "Hostname", "Ip", "Ipv4", "Ipv6", "Uri", "UriRef", "Address", "Uuid", "Tuuid", "IpWithPrefixlen", "Ipv4WithPrefixlen", "Ipv6WithPrefixlen", "IpPrefix", "Ipv4Prefix", "Ipv6Prefix", "HostAndPort", "WellKnownRegex", "Strict", "WellKnown", }); + new java.lang.String[] { "Const", "Len", "MinLen", "MaxLen", "LenBytes", "MinBytes", "MaxBytes", "Pattern", "Prefix", "Suffix", "Contains", "NotContains", "In", "NotIn", "Email", "Hostname", "Ip", "Ipv4", "Ipv6", "Uri", "UriRef", "Address", "Uuid", "Tuuid", "IpWithPrefixlen", "Ipv4WithPrefixlen", "Ipv6WithPrefixlen", "IpPrefix", "Ipv4Prefix", "Ipv6Prefix", "HostAndPort", "WellKnownRegex", "Strict", "Example", "WellKnown", }); internal_static_buf_validate_BytesRules_descriptor = - getDescriptor().getMessageTypes().get(17); + getDescriptor().getMessageTypes().get(19); internal_static_buf_validate_BytesRules_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_BytesRules_descriptor, - new java.lang.String[] { "Const", "Len", "MinLen", "MaxLen", "Pattern", "Prefix", "Suffix", "Contains", "In", "NotIn", "Ip", "Ipv4", "Ipv6", "WellKnown", }); + new java.lang.String[] { "Const", "Len", "MinLen", "MaxLen", "Pattern", "Prefix", "Suffix", "Contains", "In", "NotIn", "Ip", "Ipv4", "Ipv6", "Example", "WellKnown", }); internal_static_buf_validate_EnumRules_descriptor = - getDescriptor().getMessageTypes().get(18); + getDescriptor().getMessageTypes().get(20); internal_static_buf_validate_EnumRules_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_EnumRules_descriptor, - new java.lang.String[] { "Const", "DefinedOnly", "In", "NotIn", }); + new java.lang.String[] { "Const", "DefinedOnly", "In", "NotIn", "Example", }); internal_static_buf_validate_RepeatedRules_descriptor = - getDescriptor().getMessageTypes().get(19); + getDescriptor().getMessageTypes().get(21); internal_static_buf_validate_RepeatedRules_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_RepeatedRules_descriptor, new java.lang.String[] { "MinItems", "MaxItems", "Unique", "Items", }); internal_static_buf_validate_MapRules_descriptor = - getDescriptor().getMessageTypes().get(20); + getDescriptor().getMessageTypes().get(22); internal_static_buf_validate_MapRules_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_MapRules_descriptor, new java.lang.String[] { "MinPairs", "MaxPairs", "Keys", "Values", }); internal_static_buf_validate_AnyRules_descriptor = - getDescriptor().getMessageTypes().get(21); + getDescriptor().getMessageTypes().get(23); internal_static_buf_validate_AnyRules_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_AnyRules_descriptor, new java.lang.String[] { "In", "NotIn", }); internal_static_buf_validate_DurationRules_descriptor = - getDescriptor().getMessageTypes().get(22); + getDescriptor().getMessageTypes().get(24); internal_static_buf_validate_DurationRules_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_DurationRules_descriptor, - new java.lang.String[] { "Const", "Lt", "Lte", "Gt", "Gte", "In", "NotIn", "LessThan", "GreaterThan", }); + new java.lang.String[] { "Const", "Lt", "Lte", "Gt", "Gte", "In", "NotIn", "Example", "LessThan", "GreaterThan", }); internal_static_buf_validate_TimestampRules_descriptor = - getDescriptor().getMessageTypes().get(23); + getDescriptor().getMessageTypes().get(25); internal_static_buf_validate_TimestampRules_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_TimestampRules_descriptor, - new java.lang.String[] { "Const", "Lt", "Lte", "LtNow", "Gt", "Gte", "GtNow", "Within", "LessThan", "GreaterThan", }); + new java.lang.String[] { "Const", "Lt", "Lte", "LtNow", "Gt", "Gte", "GtNow", "Within", "Example", "LessThan", "GreaterThan", }); + internal_static_buf_validate_Violations_descriptor = + getDescriptor().getMessageTypes().get(26); + internal_static_buf_validate_Violations_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_buf_validate_Violations_descriptor, + new java.lang.String[] { "Violations", }); + internal_static_buf_validate_Violation_descriptor = + getDescriptor().getMessageTypes().get(27); + internal_static_buf_validate_Violation_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_buf_validate_Violation_descriptor, + new java.lang.String[] { "FieldPath", "ConstraintId", "Message", "ForKey", }); message.internalInit(descriptor.getExtensions().get(0)); oneof.internalInit(descriptor.getExtensions().get(1)); field.internalInit(descriptor.getExtensions().get(2)); + predefined.internalInit(descriptor.getExtensions().get(3)); descriptor.resolveAllFeaturesImmutable(); - build.buf.validate.ExpressionProto.getDescriptor(); - build.buf.validate.priv.PrivateProto.getDescriptor(); com.google.protobuf.DescriptorProtos.getDescriptor(); com.google.protobuf.DurationProto.getDescriptor(); com.google.protobuf.TimestampProto.getDescriptor(); com.google.protobuf.ExtensionRegistry registry = com.google.protobuf.ExtensionRegistry.newInstance(); - registry.add(build.buf.validate.priv.PrivateProto.field); + registry.add(build.buf.validate.ValidateProto.predefined); com.google.protobuf.Descriptors.FileDescriptor .internalUpdateFileDescriptor(descriptor, registry); } diff --git a/src/main/java/build/buf/validate/Violation.java b/src/main/java/build/buf/validate/Violation.java index 94c241f5..e69e2f82 100644 --- a/src/main/java/build/buf/validate/Violation.java +++ b/src/main/java/build/buf/validate/Violation.java @@ -1,6 +1,6 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // NO CHECKED-IN PROTOBUF GENCODE -// source: buf/validate/expression.proto +// source: buf/validate/validate.proto // Protobuf Java Version: 4.28.1 package build.buf.validate; @@ -49,17 +49,18 @@ private Violation() { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return build.buf.validate.ExpressionProto.internal_static_buf_validate_Violation_descriptor; + return build.buf.validate.ValidateProto.internal_static_buf_validate_Violation_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return build.buf.validate.ExpressionProto.internal_static_buf_validate_Violation_fieldAccessorTable + return build.buf.validate.ValidateProto.internal_static_buf_validate_Violation_fieldAccessorTable .ensureFieldAccessorsInitialized( build.buf.validate.Violation.class, build.buf.validate.Violation.Builder.class); } + private int bitField0_; public static final int FIELD_PATH_FIELD_NUMBER = 1; @SuppressWarnings("serial") private volatile java.lang.Object fieldPath_ = ""; @@ -69,7 +70,20 @@ private Violation() { * This could be a nested field, in which case the path will include all the parent fields leading to the actual field that caused the violation. * * - * string field_path = 1 [json_name = "fieldPath"]; + * optional string field_path = 1 [json_name = "fieldPath"]; + * @return Whether the fieldPath field is set. + */ + @java.lang.Override + public boolean hasFieldPath() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + *
+   * `field_path` is a machine-readable identifier that points to the specific field that failed the validation.
+   * This could be a nested field, in which case the path will include all the parent fields leading to the actual field that caused the violation.
+   * 
+ * + * optional string field_path = 1 [json_name = "fieldPath"]; * @return The fieldPath. */ @java.lang.Override @@ -81,7 +95,9 @@ public java.lang.String getFieldPath() { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); - fieldPath_ = s; + if (bs.isValidUtf8()) { + fieldPath_ = s; + } return s; } } @@ -91,7 +107,7 @@ public java.lang.String getFieldPath() { * This could be a nested field, in which case the path will include all the parent fields leading to the actual field that caused the violation. * * - * string field_path = 1 [json_name = "fieldPath"]; + * optional string field_path = 1 [json_name = "fieldPath"]; * @return The bytes for fieldPath. */ @java.lang.Override @@ -118,7 +134,20 @@ public java.lang.String getFieldPath() { * This is the same `id` that was specified in the `Constraint` message, allowing easy tracing of which rule was violated. * * - * string constraint_id = 2 [json_name = "constraintId"]; + * optional string constraint_id = 2 [json_name = "constraintId"]; + * @return Whether the constraintId field is set. + */ + @java.lang.Override + public boolean hasConstraintId() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + *
+   * `constraint_id` is the unique identifier of the `Constraint` that was not fulfilled.
+   * This is the same `id` that was specified in the `Constraint` message, allowing easy tracing of which rule was violated.
+   * 
+ * + * optional string constraint_id = 2 [json_name = "constraintId"]; * @return The constraintId. */ @java.lang.Override @@ -130,7 +159,9 @@ public java.lang.String getConstraintId() { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); - constraintId_ = s; + if (bs.isValidUtf8()) { + constraintId_ = s; + } return s; } } @@ -140,7 +171,7 @@ public java.lang.String getConstraintId() { * This is the same `id` that was specified in the `Constraint` message, allowing easy tracing of which rule was violated. * * - * string constraint_id = 2 [json_name = "constraintId"]; + * optional string constraint_id = 2 [json_name = "constraintId"]; * @return The bytes for constraintId. */ @java.lang.Override @@ -167,7 +198,20 @@ public java.lang.String getConstraintId() { * This can be the default error message from the violated `Constraint`, or it can be a custom message that gives more context about the violation. * * - * string message = 3 [json_name = "message"]; + * optional string message = 3 [json_name = "message"]; + * @return Whether the message field is set. + */ + @java.lang.Override + public boolean hasMessage() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + *
+   * `message` is a human-readable error message that describes the nature of the violation.
+   * This can be the default error message from the violated `Constraint`, or it can be a custom message that gives more context about the violation.
+   * 
+ * + * optional string message = 3 [json_name = "message"]; * @return The message. */ @java.lang.Override @@ -179,7 +223,9 @@ public java.lang.String getMessage() { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); - message_ = s; + if (bs.isValidUtf8()) { + message_ = s; + } return s; } } @@ -189,7 +235,7 @@ public java.lang.String getMessage() { * This can be the default error message from the violated `Constraint`, or it can be a custom message that gives more context about the violation. * * - * string message = 3 [json_name = "message"]; + * optional string message = 3 [json_name = "message"]; * @return The bytes for message. */ @java.lang.Override @@ -214,7 +260,19 @@ public java.lang.String getMessage() { * `for_key` indicates whether the violation was caused by a map key, rather than a value. * * - * bool for_key = 4 [json_name = "forKey"]; + * optional bool for_key = 4 [json_name = "forKey"]; + * @return Whether the forKey field is set. + */ + @java.lang.Override + public boolean hasForKey() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + *
+   * `for_key` indicates whether the violation was caused by a map key, rather than a value.
+   * 
+ * + * optional bool for_key = 4 [json_name = "forKey"]; * @return The forKey. */ @java.lang.Override @@ -236,16 +294,16 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessage.isStringEmpty(fieldPath_)) { + if (((bitField0_ & 0x00000001) != 0)) { com.google.protobuf.GeneratedMessage.writeString(output, 1, fieldPath_); } - if (!com.google.protobuf.GeneratedMessage.isStringEmpty(constraintId_)) { + if (((bitField0_ & 0x00000002) != 0)) { com.google.protobuf.GeneratedMessage.writeString(output, 2, constraintId_); } - if (!com.google.protobuf.GeneratedMessage.isStringEmpty(message_)) { + if (((bitField0_ & 0x00000004) != 0)) { com.google.protobuf.GeneratedMessage.writeString(output, 3, message_); } - if (forKey_ != false) { + if (((bitField0_ & 0x00000008) != 0)) { output.writeBool(4, forKey_); } getUnknownFields().writeTo(output); @@ -257,16 +315,16 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (!com.google.protobuf.GeneratedMessage.isStringEmpty(fieldPath_)) { + if (((bitField0_ & 0x00000001) != 0)) { size += com.google.protobuf.GeneratedMessage.computeStringSize(1, fieldPath_); } - if (!com.google.protobuf.GeneratedMessage.isStringEmpty(constraintId_)) { + if (((bitField0_ & 0x00000002) != 0)) { size += com.google.protobuf.GeneratedMessage.computeStringSize(2, constraintId_); } - if (!com.google.protobuf.GeneratedMessage.isStringEmpty(message_)) { + if (((bitField0_ & 0x00000004) != 0)) { size += com.google.protobuf.GeneratedMessage.computeStringSize(3, message_); } - if (forKey_ != false) { + if (((bitField0_ & 0x00000008) != 0)) { size += com.google.protobuf.CodedOutputStream .computeBoolSize(4, forKey_); } @@ -285,14 +343,26 @@ public boolean equals(final java.lang.Object obj) { } build.buf.validate.Violation other = (build.buf.validate.Violation) obj; - if (!getFieldPath() - .equals(other.getFieldPath())) return false; - if (!getConstraintId() - .equals(other.getConstraintId())) return false; - if (!getMessage() - .equals(other.getMessage())) return false; - if (getForKey() - != other.getForKey()) return false; + if (hasFieldPath() != other.hasFieldPath()) return false; + if (hasFieldPath()) { + if (!getFieldPath() + .equals(other.getFieldPath())) return false; + } + if (hasConstraintId() != other.hasConstraintId()) return false; + if (hasConstraintId()) { + if (!getConstraintId() + .equals(other.getConstraintId())) return false; + } + if (hasMessage() != other.hasMessage()) return false; + if (hasMessage()) { + if (!getMessage() + .equals(other.getMessage())) return false; + } + if (hasForKey() != other.hasForKey()) return false; + if (hasForKey()) { + if (getForKey() + != other.getForKey()) return false; + } if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -304,15 +374,23 @@ public int hashCode() { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + FIELD_PATH_FIELD_NUMBER; - hash = (53 * hash) + getFieldPath().hashCode(); - hash = (37 * hash) + CONSTRAINT_ID_FIELD_NUMBER; - hash = (53 * hash) + getConstraintId().hashCode(); - hash = (37 * hash) + MESSAGE_FIELD_NUMBER; - hash = (53 * hash) + getMessage().hashCode(); - hash = (37 * hash) + FOR_KEY_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getForKey()); + if (hasFieldPath()) { + hash = (37 * hash) + FIELD_PATH_FIELD_NUMBER; + hash = (53 * hash) + getFieldPath().hashCode(); + } + if (hasConstraintId()) { + hash = (37 * hash) + CONSTRAINT_ID_FIELD_NUMBER; + hash = (53 * hash) + getConstraintId().hashCode(); + } + if (hasMessage()) { + hash = (37 * hash) + MESSAGE_FIELD_NUMBER; + hash = (53 * hash) + getMessage().hashCode(); + } + if (hasForKey()) { + hash = (37 * hash) + FOR_KEY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getForKey()); + } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -434,13 +512,13 @@ public static final class Builder extends build.buf.validate.ViolationOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return build.buf.validate.ExpressionProto.internal_static_buf_validate_Violation_descriptor; + return build.buf.validate.ValidateProto.internal_static_buf_validate_Violation_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return build.buf.validate.ExpressionProto.internal_static_buf_validate_Violation_fieldAccessorTable + return build.buf.validate.ValidateProto.internal_static_buf_validate_Violation_fieldAccessorTable .ensureFieldAccessorsInitialized( build.buf.validate.Violation.class, build.buf.validate.Violation.Builder.class); } @@ -469,7 +547,7 @@ public Builder clear() { @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return build.buf.validate.ExpressionProto.internal_static_buf_validate_Violation_descriptor; + return build.buf.validate.ValidateProto.internal_static_buf_validate_Violation_descriptor; } @java.lang.Override @@ -496,18 +574,24 @@ public build.buf.validate.Violation buildPartial() { private void buildPartial0(build.buf.validate.Violation result) { int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; if (((from_bitField0_ & 0x00000001) != 0)) { result.fieldPath_ = fieldPath_; + to_bitField0_ |= 0x00000001; } if (((from_bitField0_ & 0x00000002) != 0)) { result.constraintId_ = constraintId_; + to_bitField0_ |= 0x00000002; } if (((from_bitField0_ & 0x00000004) != 0)) { result.message_ = message_; + to_bitField0_ |= 0x00000004; } if (((from_bitField0_ & 0x00000008) != 0)) { result.forKey_ = forKey_; + to_bitField0_ |= 0x00000008; } + result.bitField0_ |= to_bitField0_; } @java.lang.Override @@ -522,22 +606,22 @@ public Builder mergeFrom(com.google.protobuf.Message other) { public Builder mergeFrom(build.buf.validate.Violation other) { if (other == build.buf.validate.Violation.getDefaultInstance()) return this; - if (!other.getFieldPath().isEmpty()) { + if (other.hasFieldPath()) { fieldPath_ = other.fieldPath_; bitField0_ |= 0x00000001; onChanged(); } - if (!other.getConstraintId().isEmpty()) { + if (other.hasConstraintId()) { constraintId_ = other.constraintId_; bitField0_ |= 0x00000002; onChanged(); } - if (!other.getMessage().isEmpty()) { + if (other.hasMessage()) { message_ = other.message_; bitField0_ |= 0x00000004; onChanged(); } - if (other.getForKey() != false) { + if (other.hasForKey()) { setForKey(other.getForKey()); } this.mergeUnknownFields(other.getUnknownFields()); @@ -567,17 +651,17 @@ public Builder mergeFrom( done = true; break; case 10: { - fieldPath_ = input.readStringRequireUtf8(); + fieldPath_ = input.readBytes(); bitField0_ |= 0x00000001; break; } // case 10 case 18: { - constraintId_ = input.readStringRequireUtf8(); + constraintId_ = input.readBytes(); bitField0_ |= 0x00000002; break; } // case 18 case 26: { - message_ = input.readStringRequireUtf8(); + message_ = input.readBytes(); bitField0_ |= 0x00000004; break; } // case 26 @@ -610,7 +694,19 @@ public Builder mergeFrom( * This could be a nested field, in which case the path will include all the parent fields leading to the actual field that caused the violation. * * - * string field_path = 1 [json_name = "fieldPath"]; + * optional string field_path = 1 [json_name = "fieldPath"]; + * @return Whether the fieldPath field is set. + */ + public boolean hasFieldPath() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + *
+     * `field_path` is a machine-readable identifier that points to the specific field that failed the validation.
+     * This could be a nested field, in which case the path will include all the parent fields leading to the actual field that caused the violation.
+     * 
+ * + * optional string field_path = 1 [json_name = "fieldPath"]; * @return The fieldPath. */ public java.lang.String getFieldPath() { @@ -619,7 +715,9 @@ public java.lang.String getFieldPath() { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); - fieldPath_ = s; + if (bs.isValidUtf8()) { + fieldPath_ = s; + } return s; } else { return (java.lang.String) ref; @@ -631,7 +729,7 @@ public java.lang.String getFieldPath() { * This could be a nested field, in which case the path will include all the parent fields leading to the actual field that caused the violation. * * - * string field_path = 1 [json_name = "fieldPath"]; + * optional string field_path = 1 [json_name = "fieldPath"]; * @return The bytes for fieldPath. */ public com.google.protobuf.ByteString @@ -653,7 +751,7 @@ public java.lang.String getFieldPath() { * This could be a nested field, in which case the path will include all the parent fields leading to the actual field that caused the violation. * * - * string field_path = 1 [json_name = "fieldPath"]; + * optional string field_path = 1 [json_name = "fieldPath"]; * @param value The fieldPath to set. * @return This builder for chaining. */ @@ -671,7 +769,7 @@ public Builder setFieldPath( * This could be a nested field, in which case the path will include all the parent fields leading to the actual field that caused the violation. * * - * string field_path = 1 [json_name = "fieldPath"]; + * optional string field_path = 1 [json_name = "fieldPath"]; * @return This builder for chaining. */ public Builder clearFieldPath() { @@ -686,14 +784,13 @@ public Builder clearFieldPath() { * This could be a nested field, in which case the path will include all the parent fields leading to the actual field that caused the violation. * * - * string field_path = 1 [json_name = "fieldPath"]; + * optional string field_path = 1 [json_name = "fieldPath"]; * @param value The bytes for fieldPath to set. * @return This builder for chaining. */ public Builder setFieldPathBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } - checkByteStringIsUtf8(value); fieldPath_ = value; bitField0_ |= 0x00000001; onChanged(); @@ -707,7 +804,19 @@ public Builder setFieldPathBytes( * This is the same `id` that was specified in the `Constraint` message, allowing easy tracing of which rule was violated. * * - * string constraint_id = 2 [json_name = "constraintId"]; + * optional string constraint_id = 2 [json_name = "constraintId"]; + * @return Whether the constraintId field is set. + */ + public boolean hasConstraintId() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + *
+     * `constraint_id` is the unique identifier of the `Constraint` that was not fulfilled.
+     * This is the same `id` that was specified in the `Constraint` message, allowing easy tracing of which rule was violated.
+     * 
+ * + * optional string constraint_id = 2 [json_name = "constraintId"]; * @return The constraintId. */ public java.lang.String getConstraintId() { @@ -716,7 +825,9 @@ public java.lang.String getConstraintId() { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); - constraintId_ = s; + if (bs.isValidUtf8()) { + constraintId_ = s; + } return s; } else { return (java.lang.String) ref; @@ -728,7 +839,7 @@ public java.lang.String getConstraintId() { * This is the same `id` that was specified in the `Constraint` message, allowing easy tracing of which rule was violated. * * - * string constraint_id = 2 [json_name = "constraintId"]; + * optional string constraint_id = 2 [json_name = "constraintId"]; * @return The bytes for constraintId. */ public com.google.protobuf.ByteString @@ -750,7 +861,7 @@ public java.lang.String getConstraintId() { * This is the same `id` that was specified in the `Constraint` message, allowing easy tracing of which rule was violated. * * - * string constraint_id = 2 [json_name = "constraintId"]; + * optional string constraint_id = 2 [json_name = "constraintId"]; * @param value The constraintId to set. * @return This builder for chaining. */ @@ -768,7 +879,7 @@ public Builder setConstraintId( * This is the same `id` that was specified in the `Constraint` message, allowing easy tracing of which rule was violated. * * - * string constraint_id = 2 [json_name = "constraintId"]; + * optional string constraint_id = 2 [json_name = "constraintId"]; * @return This builder for chaining. */ public Builder clearConstraintId() { @@ -783,14 +894,13 @@ public Builder clearConstraintId() { * This is the same `id` that was specified in the `Constraint` message, allowing easy tracing of which rule was violated. * * - * string constraint_id = 2 [json_name = "constraintId"]; + * optional string constraint_id = 2 [json_name = "constraintId"]; * @param value The bytes for constraintId to set. * @return This builder for chaining. */ public Builder setConstraintIdBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } - checkByteStringIsUtf8(value); constraintId_ = value; bitField0_ |= 0x00000002; onChanged(); @@ -804,7 +914,19 @@ public Builder setConstraintIdBytes( * This can be the default error message from the violated `Constraint`, or it can be a custom message that gives more context about the violation. * * - * string message = 3 [json_name = "message"]; + * optional string message = 3 [json_name = "message"]; + * @return Whether the message field is set. + */ + public boolean hasMessage() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + *
+     * `message` is a human-readable error message that describes the nature of the violation.
+     * This can be the default error message from the violated `Constraint`, or it can be a custom message that gives more context about the violation.
+     * 
+ * + * optional string message = 3 [json_name = "message"]; * @return The message. */ public java.lang.String getMessage() { @@ -813,7 +935,9 @@ public java.lang.String getMessage() { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); - message_ = s; + if (bs.isValidUtf8()) { + message_ = s; + } return s; } else { return (java.lang.String) ref; @@ -825,7 +949,7 @@ public java.lang.String getMessage() { * This can be the default error message from the violated `Constraint`, or it can be a custom message that gives more context about the violation. * * - * string message = 3 [json_name = "message"]; + * optional string message = 3 [json_name = "message"]; * @return The bytes for message. */ public com.google.protobuf.ByteString @@ -847,7 +971,7 @@ public java.lang.String getMessage() { * This can be the default error message from the violated `Constraint`, or it can be a custom message that gives more context about the violation. * * - * string message = 3 [json_name = "message"]; + * optional string message = 3 [json_name = "message"]; * @param value The message to set. * @return This builder for chaining. */ @@ -865,7 +989,7 @@ public Builder setMessage( * This can be the default error message from the violated `Constraint`, or it can be a custom message that gives more context about the violation. * * - * string message = 3 [json_name = "message"]; + * optional string message = 3 [json_name = "message"]; * @return This builder for chaining. */ public Builder clearMessage() { @@ -880,14 +1004,13 @@ public Builder clearMessage() { * This can be the default error message from the violated `Constraint`, or it can be a custom message that gives more context about the violation. * * - * string message = 3 [json_name = "message"]; + * optional string message = 3 [json_name = "message"]; * @param value The bytes for message to set. * @return This builder for chaining. */ public Builder setMessageBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } - checkByteStringIsUtf8(value); message_ = value; bitField0_ |= 0x00000004; onChanged(); @@ -900,7 +1023,19 @@ public Builder setMessageBytes( * `for_key` indicates whether the violation was caused by a map key, rather than a value. * * - * bool for_key = 4 [json_name = "forKey"]; + * optional bool for_key = 4 [json_name = "forKey"]; + * @return Whether the forKey field is set. + */ + @java.lang.Override + public boolean hasForKey() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + *
+     * `for_key` indicates whether the violation was caused by a map key, rather than a value.
+     * 
+ * + * optional bool for_key = 4 [json_name = "forKey"]; * @return The forKey. */ @java.lang.Override @@ -912,7 +1047,7 @@ public boolean getForKey() { * `for_key` indicates whether the violation was caused by a map key, rather than a value. * * - * bool for_key = 4 [json_name = "forKey"]; + * optional bool for_key = 4 [json_name = "forKey"]; * @param value The forKey to set. * @return This builder for chaining. */ @@ -928,7 +1063,7 @@ public Builder setForKey(boolean value) { * `for_key` indicates whether the violation was caused by a map key, rather than a value. * * - * bool for_key = 4 [json_name = "forKey"]; + * optional bool for_key = 4 [json_name = "forKey"]; * @return This builder for chaining. */ public Builder clearForKey() { diff --git a/src/main/java/build/buf/validate/ViolationOrBuilder.java b/src/main/java/build/buf/validate/ViolationOrBuilder.java index f337197b..fa6fc753 100644 --- a/src/main/java/build/buf/validate/ViolationOrBuilder.java +++ b/src/main/java/build/buf/validate/ViolationOrBuilder.java @@ -1,6 +1,6 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // NO CHECKED-IN PROTOBUF GENCODE -// source: buf/validate/expression.proto +// source: buf/validate/validate.proto // Protobuf Java Version: 4.28.1 package build.buf.validate; @@ -15,7 +15,17 @@ public interface ViolationOrBuilder extends * This could be a nested field, in which case the path will include all the parent fields leading to the actual field that caused the violation. * * - * string field_path = 1 [json_name = "fieldPath"]; + * optional string field_path = 1 [json_name = "fieldPath"]; + * @return Whether the fieldPath field is set. + */ + boolean hasFieldPath(); + /** + *
+   * `field_path` is a machine-readable identifier that points to the specific field that failed the validation.
+   * This could be a nested field, in which case the path will include all the parent fields leading to the actual field that caused the violation.
+   * 
+ * + * optional string field_path = 1 [json_name = "fieldPath"]; * @return The fieldPath. */ java.lang.String getFieldPath(); @@ -25,7 +35,7 @@ public interface ViolationOrBuilder extends * This could be a nested field, in which case the path will include all the parent fields leading to the actual field that caused the violation. * * - * string field_path = 1 [json_name = "fieldPath"]; + * optional string field_path = 1 [json_name = "fieldPath"]; * @return The bytes for fieldPath. */ com.google.protobuf.ByteString @@ -37,7 +47,17 @@ public interface ViolationOrBuilder extends * This is the same `id` that was specified in the `Constraint` message, allowing easy tracing of which rule was violated. * * - * string constraint_id = 2 [json_name = "constraintId"]; + * optional string constraint_id = 2 [json_name = "constraintId"]; + * @return Whether the constraintId field is set. + */ + boolean hasConstraintId(); + /** + *
+   * `constraint_id` is the unique identifier of the `Constraint` that was not fulfilled.
+   * This is the same `id` that was specified in the `Constraint` message, allowing easy tracing of which rule was violated.
+   * 
+ * + * optional string constraint_id = 2 [json_name = "constraintId"]; * @return The constraintId. */ java.lang.String getConstraintId(); @@ -47,7 +67,7 @@ public interface ViolationOrBuilder extends * This is the same `id` that was specified in the `Constraint` message, allowing easy tracing of which rule was violated. * * - * string constraint_id = 2 [json_name = "constraintId"]; + * optional string constraint_id = 2 [json_name = "constraintId"]; * @return The bytes for constraintId. */ com.google.protobuf.ByteString @@ -59,7 +79,17 @@ public interface ViolationOrBuilder extends * This can be the default error message from the violated `Constraint`, or it can be a custom message that gives more context about the violation. * * - * string message = 3 [json_name = "message"]; + * optional string message = 3 [json_name = "message"]; + * @return Whether the message field is set. + */ + boolean hasMessage(); + /** + *
+   * `message` is a human-readable error message that describes the nature of the violation.
+   * This can be the default error message from the violated `Constraint`, or it can be a custom message that gives more context about the violation.
+   * 
+ * + * optional string message = 3 [json_name = "message"]; * @return The message. */ java.lang.String getMessage(); @@ -69,7 +99,7 @@ public interface ViolationOrBuilder extends * This can be the default error message from the violated `Constraint`, or it can be a custom message that gives more context about the violation. * * - * string message = 3 [json_name = "message"]; + * optional string message = 3 [json_name = "message"]; * @return The bytes for message. */ com.google.protobuf.ByteString @@ -80,7 +110,16 @@ public interface ViolationOrBuilder extends * `for_key` indicates whether the violation was caused by a map key, rather than a value. * * - * bool for_key = 4 [json_name = "forKey"]; + * optional bool for_key = 4 [json_name = "forKey"]; + * @return Whether the forKey field is set. + */ + boolean hasForKey(); + /** + *
+   * `for_key` indicates whether the violation was caused by a map key, rather than a value.
+   * 
+ * + * optional bool for_key = 4 [json_name = "forKey"]; * @return The forKey. */ boolean getForKey(); diff --git a/src/main/java/build/buf/validate/Violations.java b/src/main/java/build/buf/validate/Violations.java index 712add14..02ed8c83 100644 --- a/src/main/java/build/buf/validate/Violations.java +++ b/src/main/java/build/buf/validate/Violations.java @@ -1,6 +1,6 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // NO CHECKED-IN PROTOBUF GENCODE -// source: buf/validate/expression.proto +// source: buf/validate/validate.proto // Protobuf Java Version: 4.28.1 package build.buf.validate; @@ -38,13 +38,13 @@ private Violations() { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return build.buf.validate.ExpressionProto.internal_static_buf_validate_Violations_descriptor; + return build.buf.validate.ValidateProto.internal_static_buf_validate_Violations_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return build.buf.validate.ExpressionProto.internal_static_buf_validate_Violations_fieldAccessorTable + return build.buf.validate.ValidateProto.internal_static_buf_validate_Violations_fieldAccessorTable .ensureFieldAccessorsInitialized( build.buf.validate.Violations.class, build.buf.validate.Violations.Builder.class); } @@ -284,13 +284,13 @@ public static final class Builder extends build.buf.validate.ViolationsOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return build.buf.validate.ExpressionProto.internal_static_buf_validate_Violations_descriptor; + return build.buf.validate.ValidateProto.internal_static_buf_validate_Violations_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return build.buf.validate.ExpressionProto.internal_static_buf_validate_Violations_fieldAccessorTable + return build.buf.validate.ValidateProto.internal_static_buf_validate_Violations_fieldAccessorTable .ensureFieldAccessorsInitialized( build.buf.validate.Violations.class, build.buf.validate.Violations.Builder.class); } @@ -322,7 +322,7 @@ public Builder clear() { @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return build.buf.validate.ExpressionProto.internal_static_buf_validate_Violations_descriptor; + return build.buf.validate.ValidateProto.internal_static_buf_validate_Violations_descriptor; } @java.lang.Override diff --git a/src/main/java/build/buf/validate/ViolationsOrBuilder.java b/src/main/java/build/buf/validate/ViolationsOrBuilder.java index d5277da5..92029326 100644 --- a/src/main/java/build/buf/validate/ViolationsOrBuilder.java +++ b/src/main/java/build/buf/validate/ViolationsOrBuilder.java @@ -1,6 +1,6 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // NO CHECKED-IN PROTOBUF GENCODE -// source: buf/validate/expression.proto +// source: buf/validate/validate.proto // Protobuf Java Version: 4.28.1 package build.buf.validate; diff --git a/src/main/java/build/buf/validate/priv/Constraint.java b/src/main/java/build/buf/validate/priv/Constraint.java deleted file mode 100644 index 56038981..00000000 --- a/src/main/java/build/buf/validate/priv/Constraint.java +++ /dev/null @@ -1,781 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// NO CHECKED-IN PROTOBUF GENCODE -// source: buf/validate/priv/private.proto -// Protobuf Java Version: 4.28.1 - -package build.buf.validate.priv; - -/** - *
- * Do not use. Internal to protovalidate library
- * 
- * - * Protobuf type {@code buf.validate.priv.Constraint} - */ -public final class Constraint extends - com.google.protobuf.GeneratedMessage implements - // @@protoc_insertion_point(message_implements:buf.validate.priv.Constraint) - ConstraintOrBuilder { -private static final long serialVersionUID = 0L; - static { - com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( - com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, - /* major= */ 4, - /* minor= */ 28, - /* patch= */ 1, - /* suffix= */ "", - Constraint.class.getName()); - } - // Use Constraint.newBuilder() to construct. - private Constraint(com.google.protobuf.GeneratedMessage.Builder builder) { - super(builder); - } - private Constraint() { - id_ = ""; - message_ = ""; - expression_ = ""; - } - - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return build.buf.validate.priv.PrivateProto.internal_static_buf_validate_priv_Constraint_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return build.buf.validate.priv.PrivateProto.internal_static_buf_validate_priv_Constraint_fieldAccessorTable - .ensureFieldAccessorsInitialized( - build.buf.validate.priv.Constraint.class, build.buf.validate.priv.Constraint.Builder.class); - } - - public static final int ID_FIELD_NUMBER = 1; - @SuppressWarnings("serial") - private volatile java.lang.Object id_ = ""; - /** - * string id = 1 [json_name = "id"]; - * @return The id. - */ - @java.lang.Override - public java.lang.String getId() { - java.lang.Object ref = id_; - 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(); - id_ = s; - return s; - } - } - /** - * string id = 1 [json_name = "id"]; - * @return The bytes for id. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getIdBytes() { - java.lang.Object ref = id_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - id_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int MESSAGE_FIELD_NUMBER = 2; - @SuppressWarnings("serial") - private volatile java.lang.Object message_ = ""; - /** - * string message = 2 [json_name = "message"]; - * @return The message. - */ - @java.lang.Override - public java.lang.String getMessage() { - java.lang.Object ref = message_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - message_ = s; - return s; - } - } - /** - * string message = 2 [json_name = "message"]; - * @return The bytes for message. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getMessageBytes() { - java.lang.Object ref = message_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - message_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int EXPRESSION_FIELD_NUMBER = 3; - @SuppressWarnings("serial") - private volatile java.lang.Object expression_ = ""; - /** - * string expression = 3 [json_name = "expression"]; - * @return The expression. - */ - @java.lang.Override - public java.lang.String getExpression() { - java.lang.Object ref = expression_; - 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(); - expression_ = s; - return s; - } - } - /** - * string expression = 3 [json_name = "expression"]; - * @return The bytes for expression. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getExpressionBytes() { - java.lang.Object ref = expression_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - expression_ = 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(id_)) { - com.google.protobuf.GeneratedMessage.writeString(output, 1, id_); - } - if (!com.google.protobuf.GeneratedMessage.isStringEmpty(message_)) { - com.google.protobuf.GeneratedMessage.writeString(output, 2, message_); - } - if (!com.google.protobuf.GeneratedMessage.isStringEmpty(expression_)) { - com.google.protobuf.GeneratedMessage.writeString(output, 3, expression_); - } - 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(id_)) { - size += com.google.protobuf.GeneratedMessage.computeStringSize(1, id_); - } - if (!com.google.protobuf.GeneratedMessage.isStringEmpty(message_)) { - size += com.google.protobuf.GeneratedMessage.computeStringSize(2, message_); - } - if (!com.google.protobuf.GeneratedMessage.isStringEmpty(expression_)) { - size += com.google.protobuf.GeneratedMessage.computeStringSize(3, expression_); - } - 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.priv.Constraint)) { - return super.equals(obj); - } - build.buf.validate.priv.Constraint other = (build.buf.validate.priv.Constraint) obj; - - if (!getId() - .equals(other.getId())) return false; - if (!getMessage() - .equals(other.getMessage())) return false; - if (!getExpression() - .equals(other.getExpression())) 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) + ID_FIELD_NUMBER; - hash = (53 * hash) + getId().hashCode(); - hash = (37 * hash) + MESSAGE_FIELD_NUMBER; - hash = (53 * hash) + getMessage().hashCode(); - hash = (37 * hash) + EXPRESSION_FIELD_NUMBER; - hash = (53 * hash) + getExpression().hashCode(); - hash = (29 * hash) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static build.buf.validate.priv.Constraint parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static build.buf.validate.priv.Constraint 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.priv.Constraint parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static build.buf.validate.priv.Constraint 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.priv.Constraint parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static build.buf.validate.priv.Constraint parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static build.buf.validate.priv.Constraint parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input); - } - public static build.buf.validate.priv.Constraint 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.priv.Constraint parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseDelimitedWithIOException(PARSER, input); - } - - public static build.buf.validate.priv.Constraint 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.priv.Constraint parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input); - } - public static build.buf.validate.priv.Constraint 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.priv.Constraint 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; - } - /** - *
-   * Do not use. Internal to protovalidate library
-   * 
- * - * Protobuf type {@code buf.validate.priv.Constraint} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder implements - // @@protoc_insertion_point(builder_implements:buf.validate.priv.Constraint) - build.buf.validate.priv.ConstraintOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return build.buf.validate.priv.PrivateProto.internal_static_buf_validate_priv_Constraint_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return build.buf.validate.priv.PrivateProto.internal_static_buf_validate_priv_Constraint_fieldAccessorTable - .ensureFieldAccessorsInitialized( - build.buf.validate.priv.Constraint.class, build.buf.validate.priv.Constraint.Builder.class); - } - - // Construct using build.buf.validate.priv.Constraint.newBuilder() - private Builder() { - - } - - private Builder( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - super(parent); - - } - @java.lang.Override - public Builder clear() { - super.clear(); - bitField0_ = 0; - id_ = ""; - message_ = ""; - expression_ = ""; - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return build.buf.validate.priv.PrivateProto.internal_static_buf_validate_priv_Constraint_descriptor; - } - - @java.lang.Override - public build.buf.validate.priv.Constraint getDefaultInstanceForType() { - return build.buf.validate.priv.Constraint.getDefaultInstance(); - } - - @java.lang.Override - public build.buf.validate.priv.Constraint build() { - build.buf.validate.priv.Constraint result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public build.buf.validate.priv.Constraint buildPartial() { - build.buf.validate.priv.Constraint result = new build.buf.validate.priv.Constraint(this); - if (bitField0_ != 0) { buildPartial0(result); } - onBuilt(); - return result; - } - - private void buildPartial0(build.buf.validate.priv.Constraint result) { - int from_bitField0_ = bitField0_; - if (((from_bitField0_ & 0x00000001) != 0)) { - result.id_ = id_; - } - if (((from_bitField0_ & 0x00000002) != 0)) { - result.message_ = message_; - } - if (((from_bitField0_ & 0x00000004) != 0)) { - result.expression_ = expression_; - } - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof build.buf.validate.priv.Constraint) { - return mergeFrom((build.buf.validate.priv.Constraint)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(build.buf.validate.priv.Constraint other) { - if (other == build.buf.validate.priv.Constraint.getDefaultInstance()) return this; - if (!other.getId().isEmpty()) { - id_ = other.id_; - bitField0_ |= 0x00000001; - onChanged(); - } - if (!other.getMessage().isEmpty()) { - message_ = other.message_; - bitField0_ |= 0x00000002; - onChanged(); - } - if (!other.getExpression().isEmpty()) { - expression_ = other.expression_; - bitField0_ |= 0x00000004; - 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: { - id_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000001; - break; - } // case 10 - case 18: { - message_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000002; - break; - } // case 18 - case 26: { - expression_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000004; - break; - } // case 26 - 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 id_ = ""; - /** - * string id = 1 [json_name = "id"]; - * @return The id. - */ - public java.lang.String getId() { - java.lang.Object ref = id_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - id_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string id = 1 [json_name = "id"]; - * @return The bytes for id. - */ - public com.google.protobuf.ByteString - getIdBytes() { - java.lang.Object ref = id_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - id_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string id = 1 [json_name = "id"]; - * @param value The id to set. - * @return This builder for chaining. - */ - public Builder setId( - java.lang.String value) { - if (value == null) { throw new NullPointerException(); } - id_ = value; - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - /** - * string id = 1 [json_name = "id"]; - * @return This builder for chaining. - */ - public Builder clearId() { - id_ = getDefaultInstance().getId(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - return this; - } - /** - * string id = 1 [json_name = "id"]; - * @param value The bytes for id to set. - * @return This builder for chaining. - */ - public Builder setIdBytes( - com.google.protobuf.ByteString value) { - if (value == null) { throw new NullPointerException(); } - checkByteStringIsUtf8(value); - id_ = value; - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - - private java.lang.Object message_ = ""; - /** - * string message = 2 [json_name = "message"]; - * @return The message. - */ - public java.lang.String getMessage() { - java.lang.Object ref = message_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - message_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string message = 2 [json_name = "message"]; - * @return The bytes for message. - */ - public com.google.protobuf.ByteString - getMessageBytes() { - java.lang.Object ref = message_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - message_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string message = 2 [json_name = "message"]; - * @param value The message to set. - * @return This builder for chaining. - */ - public Builder setMessage( - java.lang.String value) { - if (value == null) { throw new NullPointerException(); } - message_ = value; - bitField0_ |= 0x00000002; - onChanged(); - return this; - } - /** - * string message = 2 [json_name = "message"]; - * @return This builder for chaining. - */ - public Builder clearMessage() { - message_ = getDefaultInstance().getMessage(); - bitField0_ = (bitField0_ & ~0x00000002); - onChanged(); - return this; - } - /** - * string message = 2 [json_name = "message"]; - * @param value The bytes for message to set. - * @return This builder for chaining. - */ - public Builder setMessageBytes( - com.google.protobuf.ByteString value) { - if (value == null) { throw new NullPointerException(); } - checkByteStringIsUtf8(value); - message_ = value; - bitField0_ |= 0x00000002; - onChanged(); - return this; - } - - private java.lang.Object expression_ = ""; - /** - * string expression = 3 [json_name = "expression"]; - * @return The expression. - */ - public java.lang.String getExpression() { - java.lang.Object ref = expression_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - expression_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string expression = 3 [json_name = "expression"]; - * @return The bytes for expression. - */ - public com.google.protobuf.ByteString - getExpressionBytes() { - java.lang.Object ref = expression_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - expression_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string expression = 3 [json_name = "expression"]; - * @param value The expression to set. - * @return This builder for chaining. - */ - public Builder setExpression( - java.lang.String value) { - if (value == null) { throw new NullPointerException(); } - expression_ = value; - bitField0_ |= 0x00000004; - onChanged(); - return this; - } - /** - * string expression = 3 [json_name = "expression"]; - * @return This builder for chaining. - */ - public Builder clearExpression() { - expression_ = getDefaultInstance().getExpression(); - bitField0_ = (bitField0_ & ~0x00000004); - onChanged(); - return this; - } - /** - * string expression = 3 [json_name = "expression"]; - * @param value The bytes for expression to set. - * @return This builder for chaining. - */ - public Builder setExpressionBytes( - com.google.protobuf.ByteString value) { - if (value == null) { throw new NullPointerException(); } - checkByteStringIsUtf8(value); - expression_ = value; - bitField0_ |= 0x00000004; - onChanged(); - return this; - } - - // @@protoc_insertion_point(builder_scope:buf.validate.priv.Constraint) - } - - // @@protoc_insertion_point(class_scope:buf.validate.priv.Constraint) - private static final build.buf.validate.priv.Constraint DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new build.buf.validate.priv.Constraint(); - } - - public static build.buf.validate.priv.Constraint getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public Constraint 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.priv.Constraint getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/src/main/java/build/buf/validate/priv/ConstraintOrBuilder.java b/src/main/java/build/buf/validate/priv/ConstraintOrBuilder.java deleted file mode 100644 index bba1546c..00000000 --- a/src/main/java/build/buf/validate/priv/ConstraintOrBuilder.java +++ /dev/null @@ -1,47 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// NO CHECKED-IN PROTOBUF GENCODE -// source: buf/validate/priv/private.proto -// Protobuf Java Version: 4.28.1 - -package build.buf.validate.priv; - -public interface ConstraintOrBuilder extends - // @@protoc_insertion_point(interface_extends:buf.validate.priv.Constraint) - com.google.protobuf.MessageOrBuilder { - - /** - * string id = 1 [json_name = "id"]; - * @return The id. - */ - java.lang.String getId(); - /** - * string id = 1 [json_name = "id"]; - * @return The bytes for id. - */ - com.google.protobuf.ByteString - getIdBytes(); - - /** - * string message = 2 [json_name = "message"]; - * @return The message. - */ - java.lang.String getMessage(); - /** - * string message = 2 [json_name = "message"]; - * @return The bytes for message. - */ - com.google.protobuf.ByteString - getMessageBytes(); - - /** - * string expression = 3 [json_name = "expression"]; - * @return The expression. - */ - java.lang.String getExpression(); - /** - * string expression = 3 [json_name = "expression"]; - * @return The bytes for expression. - */ - com.google.protobuf.ByteString - getExpressionBytes(); -} diff --git a/src/main/java/build/buf/validate/priv/FieldConstraints.java b/src/main/java/build/buf/validate/priv/FieldConstraints.java deleted file mode 100644 index de9afcf6..00000000 --- a/src/main/java/build/buf/validate/priv/FieldConstraints.java +++ /dev/null @@ -1,727 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// NO CHECKED-IN PROTOBUF GENCODE -// source: buf/validate/priv/private.proto -// Protobuf Java Version: 4.28.1 - -package build.buf.validate.priv; - -/** - *
- * Do not use. Internal to protovalidate library
- * 
- * - * Protobuf type {@code buf.validate.priv.FieldConstraints} - */ -public final class FieldConstraints extends - com.google.protobuf.GeneratedMessage implements - // @@protoc_insertion_point(message_implements:buf.validate.priv.FieldConstraints) - FieldConstraintsOrBuilder { -private static final long serialVersionUID = 0L; - static { - com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( - com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, - /* major= */ 4, - /* minor= */ 28, - /* patch= */ 1, - /* suffix= */ "", - FieldConstraints.class.getName()); - } - // Use FieldConstraints.newBuilder() to construct. - private FieldConstraints(com.google.protobuf.GeneratedMessage.Builder builder) { - super(builder); - } - private FieldConstraints() { - cel_ = java.util.Collections.emptyList(); - } - - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return build.buf.validate.priv.PrivateProto.internal_static_buf_validate_priv_FieldConstraints_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return build.buf.validate.priv.PrivateProto.internal_static_buf_validate_priv_FieldConstraints_fieldAccessorTable - .ensureFieldAccessorsInitialized( - build.buf.validate.priv.FieldConstraints.class, build.buf.validate.priv.FieldConstraints.Builder.class); - } - - public static final int CEL_FIELD_NUMBER = 1; - @SuppressWarnings("serial") - private java.util.List cel_; - /** - * repeated .buf.validate.priv.Constraint cel = 1 [json_name = "cel"]; - */ - @java.lang.Override - public java.util.List getCelList() { - return cel_; - } - /** - * repeated .buf.validate.priv.Constraint cel = 1 [json_name = "cel"]; - */ - @java.lang.Override - public java.util.List - getCelOrBuilderList() { - return cel_; - } - /** - * repeated .buf.validate.priv.Constraint cel = 1 [json_name = "cel"]; - */ - @java.lang.Override - public int getCelCount() { - return cel_.size(); - } - /** - * repeated .buf.validate.priv.Constraint cel = 1 [json_name = "cel"]; - */ - @java.lang.Override - public build.buf.validate.priv.Constraint getCel(int index) { - return cel_.get(index); - } - /** - * repeated .buf.validate.priv.Constraint cel = 1 [json_name = "cel"]; - */ - @java.lang.Override - public build.buf.validate.priv.ConstraintOrBuilder getCelOrBuilder( - int index) { - return cel_.get(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 < cel_.size(); i++) { - output.writeMessage(1, cel_.get(i)); - } - getUnknownFields().writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - for (int i = 0; i < cel_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, cel_.get(i)); - } - 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.priv.FieldConstraints)) { - return super.equals(obj); - } - build.buf.validate.priv.FieldConstraints other = (build.buf.validate.priv.FieldConstraints) obj; - - if (!getCelList() - .equals(other.getCelList())) 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 (getCelCount() > 0) { - hash = (37 * hash) + CEL_FIELD_NUMBER; - hash = (53 * hash) + getCelList().hashCode(); - } - hash = (29 * hash) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static build.buf.validate.priv.FieldConstraints parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static build.buf.validate.priv.FieldConstraints 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.priv.FieldConstraints parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static build.buf.validate.priv.FieldConstraints 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.priv.FieldConstraints parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static build.buf.validate.priv.FieldConstraints parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static build.buf.validate.priv.FieldConstraints parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input); - } - public static build.buf.validate.priv.FieldConstraints 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.priv.FieldConstraints parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseDelimitedWithIOException(PARSER, input); - } - - public static build.buf.validate.priv.FieldConstraints 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.priv.FieldConstraints parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input); - } - public static build.buf.validate.priv.FieldConstraints 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.priv.FieldConstraints 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; - } - /** - *
-   * Do not use. Internal to protovalidate library
-   * 
- * - * Protobuf type {@code buf.validate.priv.FieldConstraints} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder implements - // @@protoc_insertion_point(builder_implements:buf.validate.priv.FieldConstraints) - build.buf.validate.priv.FieldConstraintsOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return build.buf.validate.priv.PrivateProto.internal_static_buf_validate_priv_FieldConstraints_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return build.buf.validate.priv.PrivateProto.internal_static_buf_validate_priv_FieldConstraints_fieldAccessorTable - .ensureFieldAccessorsInitialized( - build.buf.validate.priv.FieldConstraints.class, build.buf.validate.priv.FieldConstraints.Builder.class); - } - - // Construct using build.buf.validate.priv.FieldConstraints.newBuilder() - private Builder() { - - } - - private Builder( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - super(parent); - - } - @java.lang.Override - public Builder clear() { - super.clear(); - bitField0_ = 0; - if (celBuilder_ == null) { - cel_ = java.util.Collections.emptyList(); - } else { - cel_ = null; - celBuilder_.clear(); - } - bitField0_ = (bitField0_ & ~0x00000001); - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return build.buf.validate.priv.PrivateProto.internal_static_buf_validate_priv_FieldConstraints_descriptor; - } - - @java.lang.Override - public build.buf.validate.priv.FieldConstraints getDefaultInstanceForType() { - return build.buf.validate.priv.FieldConstraints.getDefaultInstance(); - } - - @java.lang.Override - public build.buf.validate.priv.FieldConstraints build() { - build.buf.validate.priv.FieldConstraints result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public build.buf.validate.priv.FieldConstraints buildPartial() { - build.buf.validate.priv.FieldConstraints result = new build.buf.validate.priv.FieldConstraints(this); - buildPartialRepeatedFields(result); - if (bitField0_ != 0) { buildPartial0(result); } - onBuilt(); - return result; - } - - private void buildPartialRepeatedFields(build.buf.validate.priv.FieldConstraints result) { - if (celBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - cel_ = java.util.Collections.unmodifiableList(cel_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.cel_ = cel_; - } else { - result.cel_ = celBuilder_.build(); - } - } - - private void buildPartial0(build.buf.validate.priv.FieldConstraints result) { - int from_bitField0_ = bitField0_; - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof build.buf.validate.priv.FieldConstraints) { - return mergeFrom((build.buf.validate.priv.FieldConstraints)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(build.buf.validate.priv.FieldConstraints other) { - if (other == build.buf.validate.priv.FieldConstraints.getDefaultInstance()) return this; - if (celBuilder_ == null) { - if (!other.cel_.isEmpty()) { - if (cel_.isEmpty()) { - cel_ = other.cel_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureCelIsMutable(); - cel_.addAll(other.cel_); - } - onChanged(); - } - } else { - if (!other.cel_.isEmpty()) { - if (celBuilder_.isEmpty()) { - celBuilder_.dispose(); - celBuilder_ = null; - cel_ = other.cel_; - bitField0_ = (bitField0_ & ~0x00000001); - celBuilder_ = - com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? - getCelFieldBuilder() : null; - } else { - celBuilder_.addAllMessages(other.cel_); - } - } - } - 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: { - build.buf.validate.priv.Constraint m = - input.readMessage( - build.buf.validate.priv.Constraint.parser(), - extensionRegistry); - if (celBuilder_ == null) { - ensureCelIsMutable(); - cel_.add(m); - } else { - celBuilder_.addMessage(m); - } - 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.util.List cel_ = - java.util.Collections.emptyList(); - private void ensureCelIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - cel_ = new java.util.ArrayList(cel_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilder< - build.buf.validate.priv.Constraint, build.buf.validate.priv.Constraint.Builder, build.buf.validate.priv.ConstraintOrBuilder> celBuilder_; - - /** - * repeated .buf.validate.priv.Constraint cel = 1 [json_name = "cel"]; - */ - public java.util.List getCelList() { - if (celBuilder_ == null) { - return java.util.Collections.unmodifiableList(cel_); - } else { - return celBuilder_.getMessageList(); - } - } - /** - * repeated .buf.validate.priv.Constraint cel = 1 [json_name = "cel"]; - */ - public int getCelCount() { - if (celBuilder_ == null) { - return cel_.size(); - } else { - return celBuilder_.getCount(); - } - } - /** - * repeated .buf.validate.priv.Constraint cel = 1 [json_name = "cel"]; - */ - public build.buf.validate.priv.Constraint getCel(int index) { - if (celBuilder_ == null) { - return cel_.get(index); - } else { - return celBuilder_.getMessage(index); - } - } - /** - * repeated .buf.validate.priv.Constraint cel = 1 [json_name = "cel"]; - */ - public Builder setCel( - int index, build.buf.validate.priv.Constraint value) { - if (celBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureCelIsMutable(); - cel_.set(index, value); - onChanged(); - } else { - celBuilder_.setMessage(index, value); - } - return this; - } - /** - * repeated .buf.validate.priv.Constraint cel = 1 [json_name = "cel"]; - */ - public Builder setCel( - int index, build.buf.validate.priv.Constraint.Builder builderForValue) { - if (celBuilder_ == null) { - ensureCelIsMutable(); - cel_.set(index, builderForValue.build()); - onChanged(); - } else { - celBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .buf.validate.priv.Constraint cel = 1 [json_name = "cel"]; - */ - public Builder addCel(build.buf.validate.priv.Constraint value) { - if (celBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureCelIsMutable(); - cel_.add(value); - onChanged(); - } else { - celBuilder_.addMessage(value); - } - return this; - } - /** - * repeated .buf.validate.priv.Constraint cel = 1 [json_name = "cel"]; - */ - public Builder addCel( - int index, build.buf.validate.priv.Constraint value) { - if (celBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureCelIsMutable(); - cel_.add(index, value); - onChanged(); - } else { - celBuilder_.addMessage(index, value); - } - return this; - } - /** - * repeated .buf.validate.priv.Constraint cel = 1 [json_name = "cel"]; - */ - public Builder addCel( - build.buf.validate.priv.Constraint.Builder builderForValue) { - if (celBuilder_ == null) { - ensureCelIsMutable(); - cel_.add(builderForValue.build()); - onChanged(); - } else { - celBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * repeated .buf.validate.priv.Constraint cel = 1 [json_name = "cel"]; - */ - public Builder addCel( - int index, build.buf.validate.priv.Constraint.Builder builderForValue) { - if (celBuilder_ == null) { - ensureCelIsMutable(); - cel_.add(index, builderForValue.build()); - onChanged(); - } else { - celBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .buf.validate.priv.Constraint cel = 1 [json_name = "cel"]; - */ - public Builder addAllCel( - java.lang.Iterable values) { - if (celBuilder_ == null) { - ensureCelIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, cel_); - onChanged(); - } else { - celBuilder_.addAllMessages(values); - } - return this; - } - /** - * repeated .buf.validate.priv.Constraint cel = 1 [json_name = "cel"]; - */ - public Builder clearCel() { - if (celBuilder_ == null) { - cel_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - celBuilder_.clear(); - } - return this; - } - /** - * repeated .buf.validate.priv.Constraint cel = 1 [json_name = "cel"]; - */ - public Builder removeCel(int index) { - if (celBuilder_ == null) { - ensureCelIsMutable(); - cel_.remove(index); - onChanged(); - } else { - celBuilder_.remove(index); - } - return this; - } - /** - * repeated .buf.validate.priv.Constraint cel = 1 [json_name = "cel"]; - */ - public build.buf.validate.priv.Constraint.Builder getCelBuilder( - int index) { - return getCelFieldBuilder().getBuilder(index); - } - /** - * repeated .buf.validate.priv.Constraint cel = 1 [json_name = "cel"]; - */ - public build.buf.validate.priv.ConstraintOrBuilder getCelOrBuilder( - int index) { - if (celBuilder_ == null) { - return cel_.get(index); } else { - return celBuilder_.getMessageOrBuilder(index); - } - } - /** - * repeated .buf.validate.priv.Constraint cel = 1 [json_name = "cel"]; - */ - public java.util.List - getCelOrBuilderList() { - if (celBuilder_ != null) { - return celBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(cel_); - } - } - /** - * repeated .buf.validate.priv.Constraint cel = 1 [json_name = "cel"]; - */ - public build.buf.validate.priv.Constraint.Builder addCelBuilder() { - return getCelFieldBuilder().addBuilder( - build.buf.validate.priv.Constraint.getDefaultInstance()); - } - /** - * repeated .buf.validate.priv.Constraint cel = 1 [json_name = "cel"]; - */ - public build.buf.validate.priv.Constraint.Builder addCelBuilder( - int index) { - return getCelFieldBuilder().addBuilder( - index, build.buf.validate.priv.Constraint.getDefaultInstance()); - } - /** - * repeated .buf.validate.priv.Constraint cel = 1 [json_name = "cel"]; - */ - public java.util.List - getCelBuilderList() { - return getCelFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilder< - build.buf.validate.priv.Constraint, build.buf.validate.priv.Constraint.Builder, build.buf.validate.priv.ConstraintOrBuilder> - getCelFieldBuilder() { - if (celBuilder_ == null) { - celBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< - build.buf.validate.priv.Constraint, build.buf.validate.priv.Constraint.Builder, build.buf.validate.priv.ConstraintOrBuilder>( - cel_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - cel_ = null; - } - return celBuilder_; - } - - // @@protoc_insertion_point(builder_scope:buf.validate.priv.FieldConstraints) - } - - // @@protoc_insertion_point(class_scope:buf.validate.priv.FieldConstraints) - private static final build.buf.validate.priv.FieldConstraints DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new build.buf.validate.priv.FieldConstraints(); - } - - public static build.buf.validate.priv.FieldConstraints getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public FieldConstraints 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.priv.FieldConstraints getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/src/main/java/build/buf/validate/priv/FieldConstraintsOrBuilder.java b/src/main/java/build/buf/validate/priv/FieldConstraintsOrBuilder.java deleted file mode 100644 index 129e35b8..00000000 --- a/src/main/java/build/buf/validate/priv/FieldConstraintsOrBuilder.java +++ /dev/null @@ -1,35 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// NO CHECKED-IN PROTOBUF GENCODE -// source: buf/validate/priv/private.proto -// Protobuf Java Version: 4.28.1 - -package build.buf.validate.priv; - -public interface FieldConstraintsOrBuilder extends - // @@protoc_insertion_point(interface_extends:buf.validate.priv.FieldConstraints) - com.google.protobuf.MessageOrBuilder { - - /** - * repeated .buf.validate.priv.Constraint cel = 1 [json_name = "cel"]; - */ - java.util.List - getCelList(); - /** - * repeated .buf.validate.priv.Constraint cel = 1 [json_name = "cel"]; - */ - build.buf.validate.priv.Constraint getCel(int index); - /** - * repeated .buf.validate.priv.Constraint cel = 1 [json_name = "cel"]; - */ - int getCelCount(); - /** - * repeated .buf.validate.priv.Constraint cel = 1 [json_name = "cel"]; - */ - java.util.List - getCelOrBuilderList(); - /** - * repeated .buf.validate.priv.Constraint cel = 1 [json_name = "cel"]; - */ - build.buf.validate.priv.ConstraintOrBuilder getCelOrBuilder( - int index); -} diff --git a/src/main/java/build/buf/validate/priv/PrivateProto.java b/src/main/java/build/buf/validate/priv/PrivateProto.java deleted file mode 100644 index efc9c08b..00000000 --- a/src/main/java/build/buf/validate/priv/PrivateProto.java +++ /dev/null @@ -1,99 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// NO CHECKED-IN PROTOBUF GENCODE -// source: buf/validate/priv/private.proto -// Protobuf Java Version: 4.28.1 - -package build.buf.validate.priv; - -public final class PrivateProto { - private PrivateProto() {} - static { - com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( - com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, - /* major= */ 4, - /* minor= */ 28, - /* patch= */ 1, - /* suffix= */ "", - PrivateProto.class.getName()); - } - public static void registerAllExtensions( - com.google.protobuf.ExtensionRegistryLite registry) { - registry.add(build.buf.validate.priv.PrivateProto.field); - } - - public static void registerAllExtensions( - com.google.protobuf.ExtensionRegistry registry) { - registerAllExtensions( - (com.google.protobuf.ExtensionRegistryLite) registry); - } - public static final int FIELD_FIELD_NUMBER = 1160; - /** - *
-   * Do not use. Internal to protovalidate library
-   * 
- * - * extend .google.protobuf.FieldOptions { ... } - */ - public static final - com.google.protobuf.GeneratedMessage.GeneratedExtension< - com.google.protobuf.DescriptorProtos.FieldOptions, - build.buf.validate.priv.FieldConstraints> field = com.google.protobuf.GeneratedMessage - .newFileScopedGeneratedExtension( - build.buf.validate.priv.FieldConstraints.class, - build.buf.validate.priv.FieldConstraints.getDefaultInstance()); - static final com.google.protobuf.Descriptors.Descriptor - internal_static_buf_validate_priv_FieldConstraints_descriptor; - static final - com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_buf_validate_priv_FieldConstraints_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_buf_validate_priv_Constraint_descriptor; - static final - com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_buf_validate_priv_Constraint_fieldAccessorTable; - - public static com.google.protobuf.Descriptors.FileDescriptor - getDescriptor() { - return descriptor; - } - private static com.google.protobuf.Descriptors.FileDescriptor - descriptor; - static { - java.lang.String[] descriptorData = { - "\n\037buf/validate/priv/private.proto\022\021buf.v" + - "alidate.priv\032 google/protobuf/descriptor" + - ".proto\"C\n\020FieldConstraints\022/\n\003cel\030\001 \003(\0132" + - "\035.buf.validate.priv.ConstraintR\003cel\"V\n\nC" + - "onstraint\022\016\n\002id\030\001 \001(\tR\002id\022\030\n\007message\030\002 \001" + - "(\tR\007message\022\036\n\nexpression\030\003 \001(\tR\nexpress" + - "ion:\\\n\005field\022\035.google.protobuf.FieldOpti" + - "ons\030\210\t \001(\0132#.buf.validate.priv.FieldCons" + - "traintsR\005field\210\001\001Bw\n\027build.buf.validate." + - "privB\014PrivateProtoP\001ZLbuf.build/gen/go/b" + - "ufbuild/protovalidate/protocolbuffers/go" + - "/buf/validate/privb\006proto3" - }; - descriptor = com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - com.google.protobuf.DescriptorProtos.getDescriptor(), - }); - internal_static_buf_validate_priv_FieldConstraints_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_buf_validate_priv_FieldConstraints_fieldAccessorTable = new - com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_buf_validate_priv_FieldConstraints_descriptor, - new java.lang.String[] { "Cel", }); - internal_static_buf_validate_priv_Constraint_descriptor = - getDescriptor().getMessageTypes().get(1); - internal_static_buf_validate_priv_Constraint_fieldAccessorTable = new - com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_buf_validate_priv_Constraint_descriptor, - new java.lang.String[] { "Id", "Message", "Expression", }); - field.internalInit(descriptor.getExtensions().get(0)); - descriptor.resolveAllFeaturesImmutable(); - com.google.protobuf.DescriptorProtos.getDescriptor(); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/src/main/resources/buf/validate/expression.proto b/src/main/resources/buf/validate/expression.proto deleted file mode 100644 index 72ce36dc..00000000 --- a/src/main/resources/buf/validate/expression.proto +++ /dev/null @@ -1,92 +0,0 @@ -// Copyright 2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package buf.validate; - -option go_package = "buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go/buf/validate"; -option java_multiple_files = true; -option java_outer_classname = "ExpressionProto"; -option java_package = "build.buf.validate"; - -// `Constraint` represents a validation rule written in the Common Expression -// Language (CEL) syntax. Each Constraint includes a unique identifier, an -// optional error message, and the CEL expression to evaluate. For more -// information on CEL, [see our documentation](https://github.com/bufbuild/protovalidate/blob/main/docs/cel.md). -// -// ```proto -// message Foo { -// option (buf.validate.message).cel = { -// id: "foo.bar" -// message: "bar must be greater than 0" -// expression: "this.bar > 0" -// }; -// int32 bar = 1; -// } -// ``` -message Constraint { - // `id` is a string that serves as a machine-readable name for this Constraint. - // It should be unique within its scope, which could be either a message or a field. - string id = 1; - - // `message` is an optional field that provides a human-readable error message - // for this Constraint when the CEL expression evaluates to false. If a - // non-empty message is provided, any strings resulting from the CEL - // expression evaluation are ignored. - string message = 2; - - // `expression` is the actual CEL expression that will be evaluated for - // validation. This string must resolve to either a boolean or a string - // value. If the expression evaluates to false or a non-empty string, the - // validation is considered failed, and the message is rejected. - string expression = 3; -} - -// `Violations` is a collection of `Violation` messages. This message type is returned by -// protovalidate when a proto message fails to meet the requirements set by the `Constraint` validation rules. -// Each individual violation is represented by a `Violation` message. -message Violations { - // `violations` is a repeated field that contains all the `Violation` messages corresponding to the violations detected. - repeated Violation violations = 1; -} - -// `Violation` represents a single instance where a validation rule, expressed -// as a `Constraint`, was not met. It provides information about the field that -// caused the violation, the specific constraint that wasn't fulfilled, and a -// human-readable error message. -// -// ```json -// { -// "fieldPath": "bar", -// "constraintId": "foo.bar", -// "message": "bar must be greater than 0" -// } -// ``` -message Violation { - // `field_path` is a machine-readable identifier that points to the specific field that failed the validation. - // This could be a nested field, in which case the path will include all the parent fields leading to the actual field that caused the violation. - string field_path = 1; - - // `constraint_id` is the unique identifier of the `Constraint` that was not fulfilled. - // This is the same `id` that was specified in the `Constraint` message, allowing easy tracing of which rule was violated. - string constraint_id = 2; - - // `message` is a human-readable error message that describes the nature of the violation. - // This can be the default error message from the violated `Constraint`, or it can be a custom message that gives more context about the violation. - string message = 3; - - // `for_key` indicates whether the violation was caused by a map key, rather than a value. - bool for_key = 4; -} diff --git a/src/main/resources/buf/validate/priv/private.proto b/src/main/resources/buf/validate/priv/private.proto deleted file mode 100644 index ddaf938a..00000000 --- a/src/main/resources/buf/validate/priv/private.proto +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package buf.validate.priv; - -import "google/protobuf/descriptor.proto"; - -option go_package = "buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go/buf/validate/priv"; -option java_multiple_files = true; -option java_outer_classname = "PrivateProto"; -option java_package = "build.buf.validate.priv"; - -extend google.protobuf.FieldOptions { - // Do not use. Internal to protovalidate library - optional FieldConstraints field = 1160; -} - -// Do not use. Internal to protovalidate library -message FieldConstraints { - repeated Constraint cel = 1; -} - -// Do not use. Internal to protovalidate library -message Constraint { - string id = 1; - string message = 2; - string expression = 3; -} diff --git a/src/main/resources/buf/validate/validate.proto b/src/main/resources/buf/validate/validate.proto index fcc8cac4..7236347a 100644 --- a/src/main/resources/buf/validate/validate.proto +++ b/src/main/resources/buf/validate/validate.proto @@ -12,12 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. -syntax = "proto3"; +syntax = "proto2"; package buf.validate; -import "buf/validate/expression.proto"; -import "buf/validate/priv/private.proto"; import "google/protobuf/descriptor.proto"; import "google/protobuf/duration.proto"; import "google/protobuf/timestamp.proto"; @@ -55,6 +53,57 @@ extend google.protobuf.FieldOptions { // Rules specify the validations to be performed on this field. By default, // no validation is performed against a field. optional FieldConstraints field = 1159; + + // Specifies predefined rules. When extending a standard constraint message, + // this adds additional CEL expressions that apply when the extension is used. + // + // ```proto + // extend buf.validate.Int32Rules { + // bool is_zero [(buf.validate.predefined).cel = { + // id: "int32.is_zero", + // message: "value must be zero", + // expression: "!rule || this == 0", + // }]; + // } + // + // message Foo { + // int32 reserved = 1 [(buf.validate.field).int32.(is_zero) = true]; + // } + // ``` + optional PredefinedConstraints predefined = 1160; +} + +// `Constraint` represents a validation rule written in the Common Expression +// Language (CEL) syntax. Each Constraint includes a unique identifier, an +// optional error message, and the CEL expression to evaluate. For more +// information on CEL, [see our documentation](https://github.com/bufbuild/protovalidate/blob/main/docs/cel.md). +// +// ```proto +// message Foo { +// option (buf.validate.message).cel = { +// id: "foo.bar" +// message: "bar must be greater than 0" +// expression: "this.bar > 0" +// }; +// int32 bar = 1; +// } +// ``` +message Constraint { + // `id` is a string that serves as a machine-readable name for this Constraint. + // It should be unique within its scope, which could be either a message or a field. + optional string id = 1; + + // `message` is an optional field that provides a human-readable error message + // for this Constraint when the CEL expression evaluates to false. If a + // non-empty message is provided, any strings resulting from the CEL + // expression evaluation are ignored. + optional string message = 2; + + // `expression` is the actual CEL expression that will be evaluated for + // validation. This string must resolve to either a boolean or a string + // value. If the expression evaluates to false or a non-empty string, the + // validation is considered failed, and the message is rejected. + optional string expression = 3; } // MessageConstraints represents validation rules that are applied to the entire message. @@ -148,7 +197,7 @@ message FieldConstraints { // optional MyOtherMessage value = 1 [(buf.validate.field).required = true]; // } // ``` - bool required = 25; + optional bool required = 25; // Skip validation on the field if its value matches the specified criteria. // See Ignore enum for details. // @@ -162,7 +211,7 @@ message FieldConstraints { // ]; // } // ``` - Ignore ignore = 27; + optional Ignore ignore = 27; oneof type { // Scalar Field Types @@ -194,9 +243,29 @@ message FieldConstraints { } // DEPRECATED: use ignore=IGNORE_ALWAYS instead. TODO: remove this field pre-v1. - bool skipped = 24 [deprecated = true]; + optional bool skipped = 24 [deprecated = true]; // DEPRECATED: use ignore=IGNORE_IF_UNPOPULATED instead. TODO: remove this field pre-v1. - bool ignore_empty = 26 [deprecated = true]; + optional bool ignore_empty = 26 [deprecated = true]; +} + +// PredefinedConstraints are custom constraints that can be re-used with +// multiple fields. +message PredefinedConstraints { + // `cel` is a repeated field used to represent a textual expression + // in the Common Expression Language (CEL) syntax. For more information on + // CEL, [see our documentation](https://github.com/bufbuild/protovalidate/blob/main/docs/cel.md). + // + // ```proto + // message MyMessage { + // // The field `value` must be greater than 42. + // optional int32 value = 1 [(buf.validate.predefined).cel = { + // id: "my_message.value", + // message: "value must be greater than 42", + // expression: "this > 42", + // }]; + // } + // ``` + repeated Constraint cel = 1; } // Specifies how FieldConstraints.ignore behaves. See the documentation for @@ -365,7 +434,7 @@ message FloatRules { // float value = 1 [(buf.validate.field).float.const = 42.0]; // } // ``` - optional float const = 1 [(priv.field).cel = { + optional float const = 1 [(predefined).cel = { id: "float.const" expression: "this != rules.const ? 'value must equal %s'.format([rules.const]) : ''" }]; @@ -381,7 +450,7 @@ message FloatRules { // float value = 1 [(buf.validate.field).float.lt = 10.0]; // } // ``` - float lt = 2 [(priv.field).cel = { + float lt = 2 [(predefined).cel = { id: "float.lt" expression: "!has(rules.gte) && !has(rules.gt) && (this.isNan() || this >= rules.lt)" @@ -398,7 +467,7 @@ message FloatRules { // float value = 1 [(buf.validate.field).float.lte = 10.0]; // } // ``` - float lte = 3 [(priv.field).cel = { + float lte = 3 [(predefined).cel = { id: "float.lte" expression: "!has(rules.gte) && !has(rules.gt) && (this.isNan() || this > rules.lte)" @@ -426,31 +495,31 @@ message FloatRules { // } // ``` float gt = 4 [ - (priv.field).cel = { + (predefined).cel = { id: "float.gt" expression: "!has(rules.lt) && !has(rules.lte) && (this.isNan() || this <= rules.gt)" "? 'value must be greater than %s'.format([rules.gt]) : ''" }, - (priv.field).cel = { + (predefined).cel = { id: "float.gt_lt" expression: "has(rules.lt) && rules.lt >= rules.gt && (this.isNan() || this >= rules.lt || this <= rules.gt)" "? 'value must be greater than %s and less than %s'.format([rules.gt, rules.lt]) : ''" }, - (priv.field).cel = { + (predefined).cel = { id: "float.gt_lt_exclusive" expression: "has(rules.lt) && rules.lt < rules.gt && (this.isNan() || (rules.lt <= this && this <= rules.gt))" "? 'value must be greater than %s or less than %s'.format([rules.gt, rules.lt]) : ''" }, - (priv.field).cel = { + (predefined).cel = { id: "float.gt_lte" expression: "has(rules.lte) && rules.lte >= rules.gt && (this.isNan() || this > rules.lte || this <= rules.gt)" "? 'value must be greater than %s and less than or equal to %s'.format([rules.gt, rules.lte]) : ''" }, - (priv.field).cel = { + (predefined).cel = { id: "float.gt_lte_exclusive" expression: "has(rules.lte) && rules.lte < rules.gt && (this.isNan() || (rules.lte < this && this <= rules.gt))" @@ -477,31 +546,31 @@ message FloatRules { // } // ``` float gte = 5 [ - (priv.field).cel = { + (predefined).cel = { id: "float.gte" expression: "!has(rules.lt) && !has(rules.lte) && (this.isNan() || this < rules.gte)" "? 'value must be greater than or equal to %s'.format([rules.gte]) : ''" }, - (priv.field).cel = { + (predefined).cel = { id: "float.gte_lt" expression: "has(rules.lt) && rules.lt >= rules.gte && (this.isNan() || this >= rules.lt || this < rules.gte)" "? 'value must be greater than or equal to %s and less than %s'.format([rules.gte, rules.lt]) : ''" }, - (priv.field).cel = { + (predefined).cel = { id: "float.gte_lt_exclusive" expression: "has(rules.lt) && rules.lt < rules.gte && (this.isNan() || (rules.lt <= this && this < rules.gte))" "? 'value must be greater than or equal to %s or less than %s'.format([rules.gte, rules.lt]) : ''" }, - (priv.field).cel = { + (predefined).cel = { id: "float.gte_lte" expression: "has(rules.lte) && rules.lte >= rules.gte && (this.isNan() || this > rules.lte || this < rules.gte)" "? 'value must be greater than or equal to %s and less than or equal to %s'.format([rules.gte, rules.lte]) : ''" }, - (priv.field).cel = { + (predefined).cel = { id: "float.gte_lte_exclusive" expression: "has(rules.lte) && rules.lte < rules.gte && (this.isNan() || (rules.lte < this && this < rules.gte))" @@ -520,7 +589,7 @@ message FloatRules { // repeated float value = 1 (buf.validate.field).float = { in: [1.0, 2.0, 3.0] }; // } // ``` - repeated float in = 6 [(priv.field).cel = { + repeated float in = 6 [(predefined).cel = { id: "float.in" expression: "!(this in dyn(rules)['in']) ? 'value must be in list %s'.format([dyn(rules)['in']]) : ''" }]; @@ -535,17 +604,46 @@ message FloatRules { // repeated float value = 1 (buf.validate.field).float = { not_in: [1.0, 2.0, 3.0] }; // } // ``` - repeated float not_in = 7 [(priv.field).cel = { + repeated float not_in = 7 [(predefined).cel = { id: "float.not_in" expression: "this in rules.not_in ? 'value must not be in list %s'.format([rules.not_in]) : ''" }]; // `finite` requires the field value to be finite. If the field value is // infinite or NaN, an error message is generated. - bool finite = 8 [(priv.field).cel = { + optional bool finite = 8 [(predefined).cel = { id: "float.finite" - expression: "this.isNan() || this.isInf() ? 'value must be finite' : ''" + expression: "rules.finite ? (this.isNan() || this.isInf() ? 'value must be finite' : '') : ''" + }]; + + // `example` specifies values that the field may have. These values SHOULD + // conform to other constraints. `example` values will not impact validation + // but may be used as helpful guidance on how to populate the given field. + // + // ```proto + // message MyFloat { + // float value = 1 [ + // (buf.validate.field).float.example = 1.0, + // (buf.validate.field).float.example = "Infinity" + // ]; + // } + // ``` + repeated float example = 9 [(predefined).cel = { + id: "float.example" + expression: "true" }]; + + // Extension fields in this range that have the (buf.validate.predefined) + // option set will be treated as predefined field constraints that can then be + // set on the field options of other fields to apply field constraints. + // Extension numbers 1000 to 99999 are reserved for extension numbers that are + // defined in the [Protobuf Global Extension Registry][1]. Extension numbers + // above this range are reserved for extension numbers that are not explicitly + // assigned. For rules defined in publicly-consumed schemas, use of extensions + // above 99999 is discouraged due to the risk of conflicts. + // + // [1]: https://github.com/protocolbuffers/protobuf/blob/main/docs/options.md + extensions 1000 to max; } // DoubleRules describes the constraints applied to `double` values. These @@ -560,7 +658,7 @@ message DoubleRules { // double value = 1 [(buf.validate.field).double.const = 42.0]; // } // ``` - optional double const = 1 [(priv.field).cel = { + optional double const = 1 [(predefined).cel = { id: "double.const" expression: "this != rules.const ? 'value must equal %s'.format([rules.const]) : ''" }]; @@ -575,7 +673,7 @@ message DoubleRules { // double value = 1 [(buf.validate.field).double.lt = 10.0]; // } // ``` - double lt = 2 [(priv.field).cel = { + double lt = 2 [(predefined).cel = { id: "double.lt" expression: "!has(rules.gte) && !has(rules.gt) && (this.isNan() || this >= rules.lt)" @@ -592,7 +690,7 @@ message DoubleRules { // double value = 1 [(buf.validate.field).double.lte = 10.0]; // } // ``` - double lte = 3 [(priv.field).cel = { + double lte = 3 [(predefined).cel = { id: "double.lte" expression: "!has(rules.gte) && !has(rules.gt) && (this.isNan() || this > rules.lte)" @@ -619,31 +717,31 @@ message DoubleRules { // } // ``` double gt = 4 [ - (priv.field).cel = { + (predefined).cel = { id: "double.gt" expression: "!has(rules.lt) && !has(rules.lte) && (this.isNan() || this <= rules.gt)" "? 'value must be greater than %s'.format([rules.gt]) : ''" }, - (priv.field).cel = { + (predefined).cel = { id: "double.gt_lt" expression: "has(rules.lt) && rules.lt >= rules.gt && (this.isNan() || this >= rules.lt || this <= rules.gt)" "? 'value must be greater than %s and less than %s'.format([rules.gt, rules.lt]) : ''" }, - (priv.field).cel = { + (predefined).cel = { id: "double.gt_lt_exclusive" expression: "has(rules.lt) && rules.lt < rules.gt && (this.isNan() || (rules.lt <= this && this <= rules.gt))" "? 'value must be greater than %s or less than %s'.format([rules.gt, rules.lt]) : ''" }, - (priv.field).cel = { + (predefined).cel = { id: "double.gt_lte" expression: "has(rules.lte) && rules.lte >= rules.gt && (this.isNan() || this > rules.lte || this <= rules.gt)" "? 'value must be greater than %s and less than or equal to %s'.format([rules.gt, rules.lte]) : ''" }, - (priv.field).cel = { + (predefined).cel = { id: "double.gt_lte_exclusive" expression: "has(rules.lte) && rules.lte < rules.gt && (this.isNan() || (rules.lte < this && this <= rules.gt))" @@ -670,31 +768,31 @@ message DoubleRules { // } // ``` double gte = 5 [ - (priv.field).cel = { + (predefined).cel = { id: "double.gte" expression: "!has(rules.lt) && !has(rules.lte) && (this.isNan() || this < rules.gte)" "? 'value must be greater than or equal to %s'.format([rules.gte]) : ''" }, - (priv.field).cel = { + (predefined).cel = { id: "double.gte_lt" expression: "has(rules.lt) && rules.lt >= rules.gte && (this.isNan() || this >= rules.lt || this < rules.gte)" "? 'value must be greater than or equal to %s and less than %s'.format([rules.gte, rules.lt]) : ''" }, - (priv.field).cel = { + (predefined).cel = { id: "double.gte_lt_exclusive" expression: "has(rules.lt) && rules.lt < rules.gte && (this.isNan() || (rules.lt <= this && this < rules.gte))" "? 'value must be greater than or equal to %s or less than %s'.format([rules.gte, rules.lt]) : ''" }, - (priv.field).cel = { + (predefined).cel = { id: "double.gte_lte" expression: "has(rules.lte) && rules.lte >= rules.gte && (this.isNan() || this > rules.lte || this < rules.gte)" "? 'value must be greater than or equal to %s and less than or equal to %s'.format([rules.gte, rules.lte]) : ''" }, - (priv.field).cel = { + (predefined).cel = { id: "double.gte_lte_exclusive" expression: "has(rules.lte) && rules.lte < rules.gte && (this.isNan() || (rules.lte < this && this < rules.gte))" @@ -712,7 +810,7 @@ message DoubleRules { // repeated double value = 1 (buf.validate.field).double = { in: [1.0, 2.0, 3.0] }; // } // ``` - repeated double in = 6 [(priv.field).cel = { + repeated double in = 6 [(predefined).cel = { id: "double.in" expression: "!(this in dyn(rules)['in']) ? 'value must be in list %s'.format([dyn(rules)['in']]) : ''" }]; @@ -727,17 +825,46 @@ message DoubleRules { // repeated double value = 1 (buf.validate.field).double = { not_in: [1.0, 2.0, 3.0] }; // } // ``` - repeated double not_in = 7 [(priv.field).cel = { + repeated double not_in = 7 [(predefined).cel = { id: "double.not_in" expression: "this in rules.not_in ? 'value must not be in list %s'.format([rules.not_in]) : ''" }]; // `finite` requires the field value to be finite. If the field value is // infinite or NaN, an error message is generated. - bool finite = 8 [(priv.field).cel = { + optional bool finite = 8 [(predefined).cel = { id: "double.finite" - expression: "this.isNan() || this.isInf() ? 'value must be finite' : ''" + expression: "rules.finite ? (this.isNan() || this.isInf() ? 'value must be finite' : '') : ''" + }]; + + // `example` specifies values that the field may have. These values SHOULD + // conform to other constraints. `example` values will not impact validation + // but may be used as helpful guidance on how to populate the given field. + // + // ```proto + // message MyDouble { + // double value = 1 [ + // (buf.validate.field).double.example = 1.0, + // (buf.validate.field).double.example = "Infinity" + // ]; + // } + // ``` + repeated double example = 9 [(predefined).cel = { + id: "double.example" + expression: "true" }]; + + // Extension fields in this range that have the (buf.validate.predefined) + // option set will be treated as predefined field constraints that can then be + // set on the field options of other fields to apply field constraints. + // Extension numbers 1000 to 99999 are reserved for extension numbers that are + // defined in the [Protobuf Global Extension Registry][1]. Extension numbers + // above this range are reserved for extension numbers that are not explicitly + // assigned. For rules defined in publicly-consumed schemas, use of extensions + // above 99999 is discouraged due to the risk of conflicts. + // + // [1]: https://github.com/protocolbuffers/protobuf/blob/main/docs/options.md + extensions 1000 to max; } // Int32Rules describes the constraints applied to `int32` values. These @@ -752,7 +879,7 @@ message Int32Rules { // int32 value = 1 [(buf.validate.field).int32.const = 42]; // } // ``` - optional int32 const = 1 [(priv.field).cel = { + optional int32 const = 1 [(predefined).cel = { id: "int32.const" expression: "this != rules.const ? 'value must equal %s'.format([rules.const]) : ''" }]; @@ -767,7 +894,7 @@ message Int32Rules { // int32 value = 1 [(buf.validate.field).int32.lt = 10]; // } // ``` - int32 lt = 2 [(priv.field).cel = { + int32 lt = 2 [(predefined).cel = { id: "int32.lt" expression: "!has(rules.gte) && !has(rules.gt) && this >= rules.lt" @@ -784,7 +911,7 @@ message Int32Rules { // int32 value = 1 [(buf.validate.field).int32.lte = 10]; // } // ``` - int32 lte = 3 [(priv.field).cel = { + int32 lte = 3 [(predefined).cel = { id: "int32.lte" expression: "!has(rules.gte) && !has(rules.gt) && this > rules.lte" @@ -811,31 +938,31 @@ message Int32Rules { // } // ``` int32 gt = 4 [ - (priv.field).cel = { + (predefined).cel = { id: "int32.gt" expression: "!has(rules.lt) && !has(rules.lte) && this <= rules.gt" "? 'value must be greater than %s'.format([rules.gt]) : ''" }, - (priv.field).cel = { + (predefined).cel = { id: "int32.gt_lt" expression: "has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)" "? 'value must be greater than %s and less than %s'.format([rules.gt, rules.lt]) : ''" }, - (priv.field).cel = { + (predefined).cel = { id: "int32.gt_lt_exclusive" expression: "has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)" "? 'value must be greater than %s or less than %s'.format([rules.gt, rules.lt]) : ''" }, - (priv.field).cel = { + (predefined).cel = { id: "int32.gt_lte" expression: "has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)" "? 'value must be greater than %s and less than or equal to %s'.format([rules.gt, rules.lte]) : ''" }, - (priv.field).cel = { + (predefined).cel = { id: "int32.gt_lte_exclusive" expression: "has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)" @@ -862,31 +989,31 @@ message Int32Rules { // } // ``` int32 gte = 5 [ - (priv.field).cel = { + (predefined).cel = { id: "int32.gte" expression: "!has(rules.lt) && !has(rules.lte) && this < rules.gte" "? 'value must be greater than or equal to %s'.format([rules.gte]) : ''" }, - (priv.field).cel = { + (predefined).cel = { id: "int32.gte_lt" expression: "has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)" "? 'value must be greater than or equal to %s and less than %s'.format([rules.gte, rules.lt]) : ''" }, - (priv.field).cel = { + (predefined).cel = { id: "int32.gte_lt_exclusive" expression: "has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)" "? 'value must be greater than or equal to %s or less than %s'.format([rules.gte, rules.lt]) : ''" }, - (priv.field).cel = { + (predefined).cel = { id: "int32.gte_lte" expression: "has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)" "? 'value must be greater than or equal to %s and less than or equal to %s'.format([rules.gte, rules.lte]) : ''" }, - (priv.field).cel = { + (predefined).cel = { id: "int32.gte_lte_exclusive" expression: "has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)" @@ -905,7 +1032,7 @@ message Int32Rules { // repeated int32 value = 1 (buf.validate.field).int32 = { in: [1, 2, 3] }; // } // ``` - repeated int32 in = 6 [(priv.field).cel = { + repeated int32 in = 6 [(predefined).cel = { id: "int32.in" expression: "!(this in dyn(rules)['in']) ? 'value must be in list %s'.format([dyn(rules)['in']]) : ''" }]; @@ -920,10 +1047,39 @@ message Int32Rules { // repeated int32 value = 1 (buf.validate.field).int32 = { not_in: [1, 2, 3] }; // } // ``` - repeated int32 not_in = 7 [(priv.field).cel = { + repeated int32 not_in = 7 [(predefined).cel = { id: "int32.not_in" expression: "this in rules.not_in ? 'value must not be in list %s'.format([rules.not_in]) : ''" }]; + + // `example` specifies values that the field may have. These values SHOULD + // conform to other constraints. `example` values will not impact validation + // but may be used as helpful guidance on how to populate the given field. + // + // ```proto + // message MyInt32 { + // int32 value = 1 [ + // (buf.validate.field).int32.example = 1, + // (buf.validate.field).int32.example = -10 + // ]; + // } + // ``` + repeated int32 example = 8 [(predefined).cel = { + id: "int32.example" + expression: "true" + }]; + + // Extension fields in this range that have the (buf.validate.predefined) + // option set will be treated as predefined field constraints that can then be + // set on the field options of other fields to apply field constraints. + // Extension numbers 1000 to 99999 are reserved for extension numbers that are + // defined in the [Protobuf Global Extension Registry][1]. Extension numbers + // above this range are reserved for extension numbers that are not explicitly + // assigned. For rules defined in publicly-consumed schemas, use of extensions + // above 99999 is discouraged due to the risk of conflicts. + // + // [1]: https://github.com/protocolbuffers/protobuf/blob/main/docs/options.md + extensions 1000 to max; } // Int64Rules describes the constraints applied to `int64` values. These @@ -938,7 +1094,7 @@ message Int64Rules { // int64 value = 1 [(buf.validate.field).int64.const = 42]; // } // ``` - optional int64 const = 1 [(priv.field).cel = { + optional int64 const = 1 [(predefined).cel = { id: "int64.const" expression: "this != rules.const ? 'value must equal %s'.format([rules.const]) : ''" }]; @@ -953,7 +1109,7 @@ message Int64Rules { // int64 value = 1 [(buf.validate.field).int64.lt = 10]; // } // ``` - int64 lt = 2 [(priv.field).cel = { + int64 lt = 2 [(predefined).cel = { id: "int64.lt" expression: "!has(rules.gte) && !has(rules.gt) && this >= rules.lt" @@ -970,7 +1126,7 @@ message Int64Rules { // int64 value = 1 [(buf.validate.field).int64.lte = 10]; // } // ``` - int64 lte = 3 [(priv.field).cel = { + int64 lte = 3 [(predefined).cel = { id: "int64.lte" expression: "!has(rules.gte) && !has(rules.gt) && this > rules.lte" @@ -997,31 +1153,31 @@ message Int64Rules { // } // ``` int64 gt = 4 [ - (priv.field).cel = { + (predefined).cel = { id: "int64.gt" expression: "!has(rules.lt) && !has(rules.lte) && this <= rules.gt" "? 'value must be greater than %s'.format([rules.gt]) : ''" }, - (priv.field).cel = { + (predefined).cel = { id: "int64.gt_lt" expression: "has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)" "? 'value must be greater than %s and less than %s'.format([rules.gt, rules.lt]) : ''" }, - (priv.field).cel = { + (predefined).cel = { id: "int64.gt_lt_exclusive" expression: "has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)" "? 'value must be greater than %s or less than %s'.format([rules.gt, rules.lt]) : ''" }, - (priv.field).cel = { + (predefined).cel = { id: "int64.gt_lte" expression: "has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)" "? 'value must be greater than %s and less than or equal to %s'.format([rules.gt, rules.lte]) : ''" }, - (priv.field).cel = { + (predefined).cel = { id: "int64.gt_lte_exclusive" expression: "has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)" @@ -1048,31 +1204,31 @@ message Int64Rules { // } // ``` int64 gte = 5 [ - (priv.field).cel = { + (predefined).cel = { id: "int64.gte" expression: "!has(rules.lt) && !has(rules.lte) && this < rules.gte" "? 'value must be greater than or equal to %s'.format([rules.gte]) : ''" }, - (priv.field).cel = { + (predefined).cel = { id: "int64.gte_lt" expression: "has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)" "? 'value must be greater than or equal to %s and less than %s'.format([rules.gte, rules.lt]) : ''" }, - (priv.field).cel = { + (predefined).cel = { id: "int64.gte_lt_exclusive" expression: "has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)" "? 'value must be greater than or equal to %s or less than %s'.format([rules.gte, rules.lt]) : ''" }, - (priv.field).cel = { + (predefined).cel = { id: "int64.gte_lte" expression: "has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)" "? 'value must be greater than or equal to %s and less than or equal to %s'.format([rules.gte, rules.lte]) : ''" }, - (priv.field).cel = { + (predefined).cel = { id: "int64.gte_lte_exclusive" expression: "has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)" @@ -1091,7 +1247,7 @@ message Int64Rules { // repeated int64 value = 1 (buf.validate.field).int64 = { in: [1, 2, 3] }; // } // ``` - repeated int64 in = 6 [(priv.field).cel = { + repeated int64 in = 6 [(predefined).cel = { id: "int64.in" expression: "!(this in dyn(rules)['in']) ? 'value must be in list %s'.format([dyn(rules)['in']]) : ''" }]; @@ -1106,10 +1262,39 @@ message Int64Rules { // repeated int64 value = 1 (buf.validate.field).int64 = { not_in: [1, 2, 3] }; // } // ``` - repeated int64 not_in = 7 [(priv.field).cel = { + repeated int64 not_in = 7 [(predefined).cel = { id: "int64.not_in" expression: "this in rules.not_in ? 'value must not be in list %s'.format([rules.not_in]) : ''" }]; + + // `example` specifies values that the field may have. These values SHOULD + // conform to other constraints. `example` values will not impact validation + // but may be used as helpful guidance on how to populate the given field. + // + // ```proto + // message MyInt64 { + // int64 value = 1 [ + // (buf.validate.field).int64.example = 1, + // (buf.validate.field).int64.example = -10 + // ]; + // } + // ``` + repeated int64 example = 9 [(predefined).cel = { + id: "int64.example" + expression: "true" + }]; + + // Extension fields in this range that have the (buf.validate.predefined) + // option set will be treated as predefined field constraints that can then be + // set on the field options of other fields to apply field constraints. + // Extension numbers 1000 to 99999 are reserved for extension numbers that are + // defined in the [Protobuf Global Extension Registry][1]. Extension numbers + // above this range are reserved for extension numbers that are not explicitly + // assigned. For rules defined in publicly-consumed schemas, use of extensions + // above 99999 is discouraged due to the risk of conflicts. + // + // [1]: https://github.com/protocolbuffers/protobuf/blob/main/docs/options.md + extensions 1000 to max; } // UInt32Rules describes the constraints applied to `uint32` values. These @@ -1124,7 +1309,7 @@ message UInt32Rules { // uint32 value = 1 [(buf.validate.field).uint32.const = 42]; // } // ``` - optional uint32 const = 1 [(priv.field).cel = { + optional uint32 const = 1 [(predefined).cel = { id: "uint32.const" expression: "this != rules.const ? 'value must equal %s'.format([rules.const]) : ''" }]; @@ -1139,7 +1324,7 @@ message UInt32Rules { // uint32 value = 1 [(buf.validate.field).uint32.lt = 10]; // } // ``` - uint32 lt = 2 [(priv.field).cel = { + uint32 lt = 2 [(predefined).cel = { id: "uint32.lt" expression: "!has(rules.gte) && !has(rules.gt) && this >= rules.lt" @@ -1156,7 +1341,7 @@ message UInt32Rules { // uint32 value = 1 [(buf.validate.field).uint32.lte = 10]; // } // ``` - uint32 lte = 3 [(priv.field).cel = { + uint32 lte = 3 [(predefined).cel = { id: "uint32.lte" expression: "!has(rules.gte) && !has(rules.gt) && this > rules.lte" @@ -1183,31 +1368,31 @@ message UInt32Rules { // } // ``` uint32 gt = 4 [ - (priv.field).cel = { + (predefined).cel = { id: "uint32.gt" expression: "!has(rules.lt) && !has(rules.lte) && this <= rules.gt" "? 'value must be greater than %s'.format([rules.gt]) : ''" }, - (priv.field).cel = { + (predefined).cel = { id: "uint32.gt_lt" expression: "has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)" "? 'value must be greater than %s and less than %s'.format([rules.gt, rules.lt]) : ''" }, - (priv.field).cel = { + (predefined).cel = { id: "uint32.gt_lt_exclusive" expression: "has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)" "? 'value must be greater than %s or less than %s'.format([rules.gt, rules.lt]) : ''" }, - (priv.field).cel = { + (predefined).cel = { id: "uint32.gt_lte" expression: "has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)" "? 'value must be greater than %s and less than or equal to %s'.format([rules.gt, rules.lte]) : ''" }, - (priv.field).cel = { + (predefined).cel = { id: "uint32.gt_lte_exclusive" expression: "has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)" @@ -1234,31 +1419,31 @@ message UInt32Rules { // } // ``` uint32 gte = 5 [ - (priv.field).cel = { + (predefined).cel = { id: "uint32.gte" expression: "!has(rules.lt) && !has(rules.lte) && this < rules.gte" "? 'value must be greater than or equal to %s'.format([rules.gte]) : ''" }, - (priv.field).cel = { + (predefined).cel = { id: "uint32.gte_lt" expression: "has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)" "? 'value must be greater than or equal to %s and less than %s'.format([rules.gte, rules.lt]) : ''" }, - (priv.field).cel = { + (predefined).cel = { id: "uint32.gte_lt_exclusive" expression: "has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)" "? 'value must be greater than or equal to %s or less than %s'.format([rules.gte, rules.lt]) : ''" }, - (priv.field).cel = { + (predefined).cel = { id: "uint32.gte_lte" expression: "has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)" "? 'value must be greater than or equal to %s and less than or equal to %s'.format([rules.gte, rules.lte]) : ''" }, - (priv.field).cel = { + (predefined).cel = { id: "uint32.gte_lte_exclusive" expression: "has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)" @@ -1277,7 +1462,7 @@ message UInt32Rules { // repeated uint32 value = 1 (buf.validate.field).uint32 = { in: [1, 2, 3] }; // } // ``` - repeated uint32 in = 6 [(priv.field).cel = { + repeated uint32 in = 6 [(predefined).cel = { id: "uint32.in" expression: "!(this in dyn(rules)['in']) ? 'value must be in list %s'.format([dyn(rules)['in']]) : ''" }]; @@ -1292,10 +1477,39 @@ message UInt32Rules { // repeated uint32 value = 1 (buf.validate.field).uint32 = { not_in: [1, 2, 3] }; // } // ``` - repeated uint32 not_in = 7 [(priv.field).cel = { + repeated uint32 not_in = 7 [(predefined).cel = { id: "uint32.not_in" expression: "this in rules.not_in ? 'value must not be in list %s'.format([rules.not_in]) : ''" }]; + + // `example` specifies values that the field may have. These values SHOULD + // conform to other constraints. `example` values will not impact validation + // but may be used as helpful guidance on how to populate the given field. + // + // ```proto + // message MyUInt32 { + // uint32 value = 1 [ + // (buf.validate.field).uint32.example = 1, + // (buf.validate.field).uint32.example = 10 + // ]; + // } + // ``` + repeated uint32 example = 8 [(predefined).cel = { + id: "uint32.example" + expression: "true" + }]; + + // Extension fields in this range that have the (buf.validate.predefined) + // option set will be treated as predefined field constraints that can then be + // set on the field options of other fields to apply field constraints. + // Extension numbers 1000 to 99999 are reserved for extension numbers that are + // defined in the [Protobuf Global Extension Registry][1]. Extension numbers + // above this range are reserved for extension numbers that are not explicitly + // assigned. For rules defined in publicly-consumed schemas, use of extensions + // above 99999 is discouraged due to the risk of conflicts. + // + // [1]: https://github.com/protocolbuffers/protobuf/blob/main/docs/options.md + extensions 1000 to max; } // UInt64Rules describes the constraints applied to `uint64` values. These @@ -1310,7 +1524,7 @@ message UInt64Rules { // uint64 value = 1 [(buf.validate.field).uint64.const = 42]; // } // ``` - optional uint64 const = 1 [(priv.field).cel = { + optional uint64 const = 1 [(predefined).cel = { id: "uint64.const" expression: "this != rules.const ? 'value must equal %s'.format([rules.const]) : ''" }]; @@ -1325,7 +1539,7 @@ message UInt64Rules { // uint64 value = 1 [(buf.validate.field).uint64.lt = 10]; // } // ``` - uint64 lt = 2 [(priv.field).cel = { + uint64 lt = 2 [(predefined).cel = { id: "uint64.lt" expression: "!has(rules.gte) && !has(rules.gt) && this >= rules.lt" @@ -1342,7 +1556,7 @@ message UInt64Rules { // uint64 value = 1 [(buf.validate.field).uint64.lte = 10]; // } // ``` - uint64 lte = 3 [(priv.field).cel = { + uint64 lte = 3 [(predefined).cel = { id: "uint64.lte" expression: "!has(rules.gte) && !has(rules.gt) && this > rules.lte" @@ -1369,31 +1583,31 @@ message UInt64Rules { // } // ``` uint64 gt = 4 [ - (priv.field).cel = { + (predefined).cel = { id: "uint64.gt" expression: "!has(rules.lt) && !has(rules.lte) && this <= rules.gt" "? 'value must be greater than %s'.format([rules.gt]) : ''" }, - (priv.field).cel = { + (predefined).cel = { id: "uint64.gt_lt" expression: "has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)" "? 'value must be greater than %s and less than %s'.format([rules.gt, rules.lt]) : ''" }, - (priv.field).cel = { + (predefined).cel = { id: "uint64.gt_lt_exclusive" expression: "has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)" "? 'value must be greater than %s or less than %s'.format([rules.gt, rules.lt]) : ''" }, - (priv.field).cel = { + (predefined).cel = { id: "uint64.gt_lte" expression: "has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)" "? 'value must be greater than %s and less than or equal to %s'.format([rules.gt, rules.lte]) : ''" }, - (priv.field).cel = { + (predefined).cel = { id: "uint64.gt_lte_exclusive" expression: "has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)" @@ -1420,31 +1634,31 @@ message UInt64Rules { // } // ``` uint64 gte = 5 [ - (priv.field).cel = { + (predefined).cel = { id: "uint64.gte" expression: "!has(rules.lt) && !has(rules.lte) && this < rules.gte" "? 'value must be greater than or equal to %s'.format([rules.gte]) : ''" }, - (priv.field).cel = { + (predefined).cel = { id: "uint64.gte_lt" expression: "has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)" "? 'value must be greater than or equal to %s and less than %s'.format([rules.gte, rules.lt]) : ''" }, - (priv.field).cel = { + (predefined).cel = { id: "uint64.gte_lt_exclusive" expression: "has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)" "? 'value must be greater than or equal to %s or less than %s'.format([rules.gte, rules.lt]) : ''" }, - (priv.field).cel = { + (predefined).cel = { id: "uint64.gte_lte" expression: "has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)" "? 'value must be greater than or equal to %s and less than or equal to %s'.format([rules.gte, rules.lte]) : ''" }, - (priv.field).cel = { + (predefined).cel = { id: "uint64.gte_lte_exclusive" expression: "has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)" @@ -1462,7 +1676,7 @@ message UInt64Rules { // repeated uint64 value = 1 (buf.validate.field).uint64 = { in: [1, 2, 3] }; // } // ``` - repeated uint64 in = 6 [(priv.field).cel = { + repeated uint64 in = 6 [(predefined).cel = { id: "uint64.in" expression: "!(this in dyn(rules)['in']) ? 'value must be in list %s'.format([dyn(rules)['in']]) : ''" }]; @@ -1477,10 +1691,39 @@ message UInt64Rules { // repeated uint64 value = 1 (buf.validate.field).uint64 = { not_in: [1, 2, 3] }; // } // ``` - repeated uint64 not_in = 7 [(priv.field).cel = { + repeated uint64 not_in = 7 [(predefined).cel = { id: "uint64.not_in" expression: "this in rules.not_in ? 'value must not be in list %s'.format([rules.not_in]) : ''" }]; + + // `example` specifies values that the field may have. These values SHOULD + // conform to other constraints. `example` values will not impact validation + // but may be used as helpful guidance on how to populate the given field. + // + // ```proto + // message MyUInt64 { + // uint64 value = 1 [ + // (buf.validate.field).uint64.example = 1, + // (buf.validate.field).uint64.example = -10 + // ]; + // } + // ``` + repeated uint64 example = 8 [(predefined).cel = { + id: "uint64.example" + expression: "true" + }]; + + // Extension fields in this range that have the (buf.validate.predefined) + // option set will be treated as predefined field constraints that can then be + // set on the field options of other fields to apply field constraints. + // Extension numbers 1000 to 99999 are reserved for extension numbers that are + // defined in the [Protobuf Global Extension Registry][1]. Extension numbers + // above this range are reserved for extension numbers that are not explicitly + // assigned. For rules defined in publicly-consumed schemas, use of extensions + // above 99999 is discouraged due to the risk of conflicts. + // + // [1]: https://github.com/protocolbuffers/protobuf/blob/main/docs/options.md + extensions 1000 to max; } // SInt32Rules describes the constraints applied to `sint32` values. @@ -1494,7 +1737,7 @@ message SInt32Rules { // sint32 value = 1 [(buf.validate.field).sint32.const = 42]; // } // ``` - optional sint32 const = 1 [(priv.field).cel = { + optional sint32 const = 1 [(predefined).cel = { id: "sint32.const" expression: "this != rules.const ? 'value must equal %s'.format([rules.const]) : ''" }]; @@ -1509,7 +1752,7 @@ message SInt32Rules { // sint32 value = 1 [(buf.validate.field).sint32.lt = 10]; // } // ``` - sint32 lt = 2 [(priv.field).cel = { + sint32 lt = 2 [(predefined).cel = { id: "sint32.lt" expression: "!has(rules.gte) && !has(rules.gt) && this >= rules.lt" @@ -1526,7 +1769,7 @@ message SInt32Rules { // sint32 value = 1 [(buf.validate.field).sint32.lte = 10]; // } // ``` - sint32 lte = 3 [(priv.field).cel = { + sint32 lte = 3 [(predefined).cel = { id: "sint32.lte" expression: "!has(rules.gte) && !has(rules.gt) && this > rules.lte" @@ -1553,31 +1796,31 @@ message SInt32Rules { // } // ``` sint32 gt = 4 [ - (priv.field).cel = { + (predefined).cel = { id: "sint32.gt" expression: "!has(rules.lt) && !has(rules.lte) && this <= rules.gt" "? 'value must be greater than %s'.format([rules.gt]) : ''" }, - (priv.field).cel = { + (predefined).cel = { id: "sint32.gt_lt" expression: "has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)" "? 'value must be greater than %s and less than %s'.format([rules.gt, rules.lt]) : ''" }, - (priv.field).cel = { + (predefined).cel = { id: "sint32.gt_lt_exclusive" expression: "has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)" "? 'value must be greater than %s or less than %s'.format([rules.gt, rules.lt]) : ''" }, - (priv.field).cel = { + (predefined).cel = { id: "sint32.gt_lte" expression: "has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)" "? 'value must be greater than %s and less than or equal to %s'.format([rules.gt, rules.lte]) : ''" }, - (priv.field).cel = { + (predefined).cel = { id: "sint32.gt_lte_exclusive" expression: "has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)" @@ -1604,31 +1847,31 @@ message SInt32Rules { // } // ``` sint32 gte = 5 [ - (priv.field).cel = { + (predefined).cel = { id: "sint32.gte" expression: "!has(rules.lt) && !has(rules.lte) && this < rules.gte" "? 'value must be greater than or equal to %s'.format([rules.gte]) : ''" }, - (priv.field).cel = { + (predefined).cel = { id: "sint32.gte_lt" expression: "has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)" "? 'value must be greater than or equal to %s and less than %s'.format([rules.gte, rules.lt]) : ''" }, - (priv.field).cel = { + (predefined).cel = { id: "sint32.gte_lt_exclusive" expression: "has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)" "? 'value must be greater than or equal to %s or less than %s'.format([rules.gte, rules.lt]) : ''" }, - (priv.field).cel = { + (predefined).cel = { id: "sint32.gte_lte" expression: "has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)" "? 'value must be greater than or equal to %s and less than or equal to %s'.format([rules.gte, rules.lte]) : ''" }, - (priv.field).cel = { + (predefined).cel = { id: "sint32.gte_lte_exclusive" expression: "has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)" @@ -1647,7 +1890,7 @@ message SInt32Rules { // repeated sint32 value = 1 (buf.validate.field).sint32 = { in: [1, 2, 3] }; // } // ``` - repeated sint32 in = 6 [(priv.field).cel = { + repeated sint32 in = 6 [(predefined).cel = { id: "sint32.in" expression: "!(this in dyn(rules)['in']) ? 'value must be in list %s'.format([dyn(rules)['in']]) : ''" }]; @@ -1662,10 +1905,39 @@ message SInt32Rules { // repeated sint32 value = 1 (buf.validate.field).sint32 = { not_in: [1, 2, 3] }; // } // ``` - repeated sint32 not_in = 7 [(priv.field).cel = { + repeated sint32 not_in = 7 [(predefined).cel = { id: "sint32.not_in" expression: "this in rules.not_in ? 'value must not be in list %s'.format([rules.not_in]) : ''" }]; + + // `example` specifies values that the field may have. These values SHOULD + // conform to other constraints. `example` values will not impact validation + // but may be used as helpful guidance on how to populate the given field. + // + // ```proto + // message MySInt32 { + // sint32 value = 1 [ + // (buf.validate.field).sint32.example = 1, + // (buf.validate.field).sint32.example = -10 + // ]; + // } + // ``` + repeated sint32 example = 8 [(predefined).cel = { + id: "sint32.example" + expression: "true" + }]; + + // Extension fields in this range that have the (buf.validate.predefined) + // option set will be treated as predefined field constraints that can then be + // set on the field options of other fields to apply field constraints. + // Extension numbers 1000 to 99999 are reserved for extension numbers that are + // defined in the [Protobuf Global Extension Registry][1]. Extension numbers + // above this range are reserved for extension numbers that are not explicitly + // assigned. For rules defined in publicly-consumed schemas, use of extensions + // above 99999 is discouraged due to the risk of conflicts. + // + // [1]: https://github.com/protocolbuffers/protobuf/blob/main/docs/options.md + extensions 1000 to max; } // SInt64Rules describes the constraints applied to `sint64` values. @@ -1679,7 +1951,7 @@ message SInt64Rules { // sint64 value = 1 [(buf.validate.field).sint64.const = 42]; // } // ``` - optional sint64 const = 1 [(priv.field).cel = { + optional sint64 const = 1 [(predefined).cel = { id: "sint64.const" expression: "this != rules.const ? 'value must equal %s'.format([rules.const]) : ''" }]; @@ -1694,7 +1966,7 @@ message SInt64Rules { // sint64 value = 1 [(buf.validate.field).sint64.lt = 10]; // } // ``` - sint64 lt = 2 [(priv.field).cel = { + sint64 lt = 2 [(predefined).cel = { id: "sint64.lt" expression: "!has(rules.gte) && !has(rules.gt) && this >= rules.lt" @@ -1711,7 +1983,7 @@ message SInt64Rules { // sint64 value = 1 [(buf.validate.field).sint64.lte = 10]; // } // ``` - sint64 lte = 3 [(priv.field).cel = { + sint64 lte = 3 [(predefined).cel = { id: "sint64.lte" expression: "!has(rules.gte) && !has(rules.gt) && this > rules.lte" @@ -1738,31 +2010,31 @@ message SInt64Rules { // } // ``` sint64 gt = 4 [ - (priv.field).cel = { + (predefined).cel = { id: "sint64.gt" expression: "!has(rules.lt) && !has(rules.lte) && this <= rules.gt" "? 'value must be greater than %s'.format([rules.gt]) : ''" }, - (priv.field).cel = { + (predefined).cel = { id: "sint64.gt_lt" expression: "has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)" "? 'value must be greater than %s and less than %s'.format([rules.gt, rules.lt]) : ''" }, - (priv.field).cel = { + (predefined).cel = { id: "sint64.gt_lt_exclusive" expression: "has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)" "? 'value must be greater than %s or less than %s'.format([rules.gt, rules.lt]) : ''" }, - (priv.field).cel = { + (predefined).cel = { id: "sint64.gt_lte" expression: "has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)" "? 'value must be greater than %s and less than or equal to %s'.format([rules.gt, rules.lte]) : ''" }, - (priv.field).cel = { + (predefined).cel = { id: "sint64.gt_lte_exclusive" expression: "has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)" @@ -1789,31 +2061,31 @@ message SInt64Rules { // } // ``` sint64 gte = 5 [ - (priv.field).cel = { + (predefined).cel = { id: "sint64.gte" expression: "!has(rules.lt) && !has(rules.lte) && this < rules.gte" "? 'value must be greater than or equal to %s'.format([rules.gte]) : ''" }, - (priv.field).cel = { + (predefined).cel = { id: "sint64.gte_lt" expression: "has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)" "? 'value must be greater than or equal to %s and less than %s'.format([rules.gte, rules.lt]) : ''" }, - (priv.field).cel = { + (predefined).cel = { id: "sint64.gte_lt_exclusive" expression: "has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)" "? 'value must be greater than or equal to %s or less than %s'.format([rules.gte, rules.lt]) : ''" }, - (priv.field).cel = { + (predefined).cel = { id: "sint64.gte_lte" expression: "has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)" "? 'value must be greater than or equal to %s and less than or equal to %s'.format([rules.gte, rules.lte]) : ''" }, - (priv.field).cel = { + (predefined).cel = { id: "sint64.gte_lte_exclusive" expression: "has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)" @@ -1832,7 +2104,7 @@ message SInt64Rules { // repeated sint64 value = 1 (buf.validate.field).sint64 = { in: [1, 2, 3] }; // } // ``` - repeated sint64 in = 6 [(priv.field).cel = { + repeated sint64 in = 6 [(predefined).cel = { id: "sint64.in" expression: "!(this in dyn(rules)['in']) ? 'value must be in list %s'.format([dyn(rules)['in']]) : ''" }]; @@ -1847,10 +2119,39 @@ message SInt64Rules { // repeated sint64 value = 1 (buf.validate.field).sint64 = { not_in: [1, 2, 3] }; // } // ``` - repeated sint64 not_in = 7 [(priv.field).cel = { + repeated sint64 not_in = 7 [(predefined).cel = { id: "sint64.not_in" expression: "this in rules.not_in ? 'value must not be in list %s'.format([rules.not_in]) : ''" }]; + + // `example` specifies values that the field may have. These values SHOULD + // conform to other constraints. `example` values will not impact validation + // but may be used as helpful guidance on how to populate the given field. + // + // ```proto + // message MySInt64 { + // sint64 value = 1 [ + // (buf.validate.field).sint64.example = 1, + // (buf.validate.field).sint64.example = -10 + // ]; + // } + // ``` + repeated sint64 example = 8 [(predefined).cel = { + id: "sint64.example" + expression: "true" + }]; + + // Extension fields in this range that have the (buf.validate.predefined) + // option set will be treated as predefined field constraints that can then be + // set on the field options of other fields to apply field constraints. + // Extension numbers 1000 to 99999 are reserved for extension numbers that are + // defined in the [Protobuf Global Extension Registry][1]. Extension numbers + // above this range are reserved for extension numbers that are not explicitly + // assigned. For rules defined in publicly-consumed schemas, use of extensions + // above 99999 is discouraged due to the risk of conflicts. + // + // [1]: https://github.com/protocolbuffers/protobuf/blob/main/docs/options.md + extensions 1000 to max; } // Fixed32Rules describes the constraints applied to `fixed32` values. @@ -1864,7 +2165,7 @@ message Fixed32Rules { // fixed32 value = 1 [(buf.validate.field).fixed32.const = 42]; // } // ``` - optional fixed32 const = 1 [(priv.field).cel = { + optional fixed32 const = 1 [(predefined).cel = { id: "fixed32.const" expression: "this != rules.const ? 'value must equal %s'.format([rules.const]) : ''" }]; @@ -1879,7 +2180,7 @@ message Fixed32Rules { // fixed32 value = 1 [(buf.validate.field).fixed32.lt = 10]; // } // ``` - fixed32 lt = 2 [(priv.field).cel = { + fixed32 lt = 2 [(predefined).cel = { id: "fixed32.lt" expression: "!has(rules.gte) && !has(rules.gt) && this >= rules.lt" @@ -1896,7 +2197,7 @@ message Fixed32Rules { // fixed32 value = 1 [(buf.validate.field).fixed32.lte = 10]; // } // ``` - fixed32 lte = 3 [(priv.field).cel = { + fixed32 lte = 3 [(predefined).cel = { id: "fixed32.lte" expression: "!has(rules.gte) && !has(rules.gt) && this > rules.lte" @@ -1923,31 +2224,31 @@ message Fixed32Rules { // } // ``` fixed32 gt = 4 [ - (priv.field).cel = { + (predefined).cel = { id: "fixed32.gt" expression: "!has(rules.lt) && !has(rules.lte) && this <= rules.gt" "? 'value must be greater than %s'.format([rules.gt]) : ''" }, - (priv.field).cel = { + (predefined).cel = { id: "fixed32.gt_lt" expression: "has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)" "? 'value must be greater than %s and less than %s'.format([rules.gt, rules.lt]) : ''" }, - (priv.field).cel = { + (predefined).cel = { id: "fixed32.gt_lt_exclusive" expression: "has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)" "? 'value must be greater than %s or less than %s'.format([rules.gt, rules.lt]) : ''" }, - (priv.field).cel = { + (predefined).cel = { id: "fixed32.gt_lte" expression: "has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)" "? 'value must be greater than %s and less than or equal to %s'.format([rules.gt, rules.lte]) : ''" }, - (priv.field).cel = { + (predefined).cel = { id: "fixed32.gt_lte_exclusive" expression: "has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)" @@ -1974,31 +2275,31 @@ message Fixed32Rules { // } // ``` fixed32 gte = 5 [ - (priv.field).cel = { + (predefined).cel = { id: "fixed32.gte" expression: "!has(rules.lt) && !has(rules.lte) && this < rules.gte" "? 'value must be greater than or equal to %s'.format([rules.gte]) : ''" }, - (priv.field).cel = { + (predefined).cel = { id: "fixed32.gte_lt" expression: "has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)" "? 'value must be greater than or equal to %s and less than %s'.format([rules.gte, rules.lt]) : ''" }, - (priv.field).cel = { + (predefined).cel = { id: "fixed32.gte_lt_exclusive" expression: "has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)" "? 'value must be greater than or equal to %s or less than %s'.format([rules.gte, rules.lt]) : ''" }, - (priv.field).cel = { + (predefined).cel = { id: "fixed32.gte_lte" expression: "has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)" "? 'value must be greater than or equal to %s and less than or equal to %s'.format([rules.gte, rules.lte]) : ''" }, - (priv.field).cel = { + (predefined).cel = { id: "fixed32.gte_lte_exclusive" expression: "has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)" @@ -2017,7 +2318,7 @@ message Fixed32Rules { // repeated fixed32 value = 1 (buf.validate.field).fixed32 = { in: [1, 2, 3] }; // } // ``` - repeated fixed32 in = 6 [(priv.field).cel = { + repeated fixed32 in = 6 [(predefined).cel = { id: "fixed32.in" expression: "!(this in dyn(rules)['in']) ? 'value must be in list %s'.format([dyn(rules)['in']]) : ''" }]; @@ -2032,10 +2333,39 @@ message Fixed32Rules { // repeated fixed32 value = 1 (buf.validate.field).fixed32 = { not_in: [1, 2, 3] }; // } // ``` - repeated fixed32 not_in = 7 [(priv.field).cel = { + repeated fixed32 not_in = 7 [(predefined).cel = { id: "fixed32.not_in" expression: "this in rules.not_in ? 'value must not be in list %s'.format([rules.not_in]) : ''" }]; + + // `example` specifies values that the field may have. These values SHOULD + // conform to other constraints. `example` values will not impact validation + // but may be used as helpful guidance on how to populate the given field. + // + // ```proto + // message MyFixed32 { + // fixed32 value = 1 [ + // (buf.validate.field).fixed32.example = 1, + // (buf.validate.field).fixed32.example = 2 + // ]; + // } + // ``` + repeated fixed32 example = 8 [(predefined).cel = { + id: "fixed32.example" + expression: "true" + }]; + + // Extension fields in this range that have the (buf.validate.predefined) + // option set will be treated as predefined field constraints that can then be + // set on the field options of other fields to apply field constraints. + // Extension numbers 1000 to 99999 are reserved for extension numbers that are + // defined in the [Protobuf Global Extension Registry][1]. Extension numbers + // above this range are reserved for extension numbers that are not explicitly + // assigned. For rules defined in publicly-consumed schemas, use of extensions + // above 99999 is discouraged due to the risk of conflicts. + // + // [1]: https://github.com/protocolbuffers/protobuf/blob/main/docs/options.md + extensions 1000 to max; } // Fixed64Rules describes the constraints applied to `fixed64` values. @@ -2049,7 +2379,7 @@ message Fixed64Rules { // fixed64 value = 1 [(buf.validate.field).fixed64.const = 42]; // } // ``` - optional fixed64 const = 1 [(priv.field).cel = { + optional fixed64 const = 1 [(predefined).cel = { id: "fixed64.const" expression: "this != rules.const ? 'value must equal %s'.format([rules.const]) : ''" }]; @@ -2064,7 +2394,7 @@ message Fixed64Rules { // fixed64 value = 1 [(buf.validate.field).fixed64.lt = 10]; // } // ``` - fixed64 lt = 2 [(priv.field).cel = { + fixed64 lt = 2 [(predefined).cel = { id: "fixed64.lt" expression: "!has(rules.gte) && !has(rules.gt) && this >= rules.lt" @@ -2081,7 +2411,7 @@ message Fixed64Rules { // fixed64 value = 1 [(buf.validate.field).fixed64.lte = 10]; // } // ``` - fixed64 lte = 3 [(priv.field).cel = { + fixed64 lte = 3 [(predefined).cel = { id: "fixed64.lte" expression: "!has(rules.gte) && !has(rules.gt) && this > rules.lte" @@ -2108,31 +2438,31 @@ message Fixed64Rules { // } // ``` fixed64 gt = 4 [ - (priv.field).cel = { + (predefined).cel = { id: "fixed64.gt" expression: "!has(rules.lt) && !has(rules.lte) && this <= rules.gt" "? 'value must be greater than %s'.format([rules.gt]) : ''" }, - (priv.field).cel = { + (predefined).cel = { id: "fixed64.gt_lt" expression: "has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)" "? 'value must be greater than %s and less than %s'.format([rules.gt, rules.lt]) : ''" }, - (priv.field).cel = { + (predefined).cel = { id: "fixed64.gt_lt_exclusive" expression: "has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)" "? 'value must be greater than %s or less than %s'.format([rules.gt, rules.lt]) : ''" }, - (priv.field).cel = { + (predefined).cel = { id: "fixed64.gt_lte" expression: "has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)" "? 'value must be greater than %s and less than or equal to %s'.format([rules.gt, rules.lte]) : ''" }, - (priv.field).cel = { + (predefined).cel = { id: "fixed64.gt_lte_exclusive" expression: "has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)" @@ -2159,31 +2489,31 @@ message Fixed64Rules { // } // ``` fixed64 gte = 5 [ - (priv.field).cel = { + (predefined).cel = { id: "fixed64.gte" expression: "!has(rules.lt) && !has(rules.lte) && this < rules.gte" "? 'value must be greater than or equal to %s'.format([rules.gte]) : ''" }, - (priv.field).cel = { + (predefined).cel = { id: "fixed64.gte_lt" expression: "has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)" "? 'value must be greater than or equal to %s and less than %s'.format([rules.gte, rules.lt]) : ''" }, - (priv.field).cel = { + (predefined).cel = { id: "fixed64.gte_lt_exclusive" expression: "has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)" "? 'value must be greater than or equal to %s or less than %s'.format([rules.gte, rules.lt]) : ''" }, - (priv.field).cel = { + (predefined).cel = { id: "fixed64.gte_lte" expression: "has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)" "? 'value must be greater than or equal to %s and less than or equal to %s'.format([rules.gte, rules.lte]) : ''" }, - (priv.field).cel = { + (predefined).cel = { id: "fixed64.gte_lte_exclusive" expression: "has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)" @@ -2202,7 +2532,7 @@ message Fixed64Rules { // repeated fixed64 value = 1 (buf.validate.field).fixed64 = { in: [1, 2, 3] }; // } // ``` - repeated fixed64 in = 6 [(priv.field).cel = { + repeated fixed64 in = 6 [(predefined).cel = { id: "fixed64.in" expression: "!(this in dyn(rules)['in']) ? 'value must be in list %s'.format([dyn(rules)['in']]) : ''" }]; @@ -2217,10 +2547,39 @@ message Fixed64Rules { // repeated fixed64 value = 1 (buf.validate.field).fixed64 = { not_in: [1, 2, 3] }; // } // ``` - repeated fixed64 not_in = 7 [(priv.field).cel = { + repeated fixed64 not_in = 7 [(predefined).cel = { id: "fixed64.not_in" expression: "this in rules.not_in ? 'value must not be in list %s'.format([rules.not_in]) : ''" }]; + + // `example` specifies values that the field may have. These values SHOULD + // conform to other constraints. `example` values will not impact validation + // but may be used as helpful guidance on how to populate the given field. + // + // ```proto + // message MyFixed64 { + // fixed64 value = 1 [ + // (buf.validate.field).fixed64.example = 1, + // (buf.validate.field).fixed64.example = 2 + // ]; + // } + // ``` + repeated fixed64 example = 8 [(predefined).cel = { + id: "fixed64.example" + expression: "true" + }]; + + // Extension fields in this range that have the (buf.validate.predefined) + // option set will be treated as predefined field constraints that can then be + // set on the field options of other fields to apply field constraints. + // Extension numbers 1000 to 99999 are reserved for extension numbers that are + // defined in the [Protobuf Global Extension Registry][1]. Extension numbers + // above this range are reserved for extension numbers that are not explicitly + // assigned. For rules defined in publicly-consumed schemas, use of extensions + // above 99999 is discouraged due to the risk of conflicts. + // + // [1]: https://github.com/protocolbuffers/protobuf/blob/main/docs/options.md + extensions 1000 to max; } // SFixed32Rules describes the constraints applied to `fixed32` values. @@ -2234,7 +2593,7 @@ message SFixed32Rules { // sfixed32 value = 1 [(buf.validate.field).sfixed32.const = 42]; // } // ``` - optional sfixed32 const = 1 [(priv.field).cel = { + optional sfixed32 const = 1 [(predefined).cel = { id: "sfixed32.const" expression: "this != rules.const ? 'value must equal %s'.format([rules.const]) : ''" }]; @@ -2249,7 +2608,7 @@ message SFixed32Rules { // sfixed32 value = 1 [(buf.validate.field).sfixed32.lt = 10]; // } // ``` - sfixed32 lt = 2 [(priv.field).cel = { + sfixed32 lt = 2 [(predefined).cel = { id: "sfixed32.lt" expression: "!has(rules.gte) && !has(rules.gt) && this >= rules.lt" @@ -2266,7 +2625,7 @@ message SFixed32Rules { // sfixed32 value = 1 [(buf.validate.field).sfixed32.lte = 10]; // } // ``` - sfixed32 lte = 3 [(priv.field).cel = { + sfixed32 lte = 3 [(predefined).cel = { id: "sfixed32.lte" expression: "!has(rules.gte) && !has(rules.gt) && this > rules.lte" @@ -2293,31 +2652,31 @@ message SFixed32Rules { // } // ``` sfixed32 gt = 4 [ - (priv.field).cel = { + (predefined).cel = { id: "sfixed32.gt" expression: "!has(rules.lt) && !has(rules.lte) && this <= rules.gt" "? 'value must be greater than %s'.format([rules.gt]) : ''" }, - (priv.field).cel = { + (predefined).cel = { id: "sfixed32.gt_lt" expression: "has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)" "? 'value must be greater than %s and less than %s'.format([rules.gt, rules.lt]) : ''" }, - (priv.field).cel = { + (predefined).cel = { id: "sfixed32.gt_lt_exclusive" expression: "has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)" "? 'value must be greater than %s or less than %s'.format([rules.gt, rules.lt]) : ''" }, - (priv.field).cel = { + (predefined).cel = { id: "sfixed32.gt_lte" expression: "has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)" "? 'value must be greater than %s and less than or equal to %s'.format([rules.gt, rules.lte]) : ''" }, - (priv.field).cel = { + (predefined).cel = { id: "sfixed32.gt_lte_exclusive" expression: "has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)" @@ -2344,31 +2703,31 @@ message SFixed32Rules { // } // ``` sfixed32 gte = 5 [ - (priv.field).cel = { + (predefined).cel = { id: "sfixed32.gte" expression: "!has(rules.lt) && !has(rules.lte) && this < rules.gte" "? 'value must be greater than or equal to %s'.format([rules.gte]) : ''" }, - (priv.field).cel = { + (predefined).cel = { id: "sfixed32.gte_lt" expression: "has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)" "? 'value must be greater than or equal to %s and less than %s'.format([rules.gte, rules.lt]) : ''" }, - (priv.field).cel = { + (predefined).cel = { id: "sfixed32.gte_lt_exclusive" expression: "has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)" "? 'value must be greater than or equal to %s or less than %s'.format([rules.gte, rules.lt]) : ''" }, - (priv.field).cel = { + (predefined).cel = { id: "sfixed32.gte_lte" expression: "has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)" "? 'value must be greater than or equal to %s and less than or equal to %s'.format([rules.gte, rules.lte]) : ''" }, - (priv.field).cel = { + (predefined).cel = { id: "sfixed32.gte_lte_exclusive" expression: "has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)" @@ -2387,7 +2746,7 @@ message SFixed32Rules { // repeated sfixed32 value = 1 (buf.validate.field).sfixed32 = { in: [1, 2, 3] }; // } // ``` - repeated sfixed32 in = 6 [(priv.field).cel = { + repeated sfixed32 in = 6 [(predefined).cel = { id: "sfixed32.in" expression: "!(this in dyn(rules)['in']) ? 'value must be in list %s'.format([dyn(rules)['in']]) : ''" }]; @@ -2402,10 +2761,39 @@ message SFixed32Rules { // repeated sfixed32 value = 1 (buf.validate.field).sfixed32 = { not_in: [1, 2, 3] }; // } // ``` - repeated sfixed32 not_in = 7 [(priv.field).cel = { + repeated sfixed32 not_in = 7 [(predefined).cel = { id: "sfixed32.not_in" expression: "this in rules.not_in ? 'value must not be in list %s'.format([rules.not_in]) : ''" }]; + + // `example` specifies values that the field may have. These values SHOULD + // conform to other constraints. `example` values will not impact validation + // but may be used as helpful guidance on how to populate the given field. + // + // ```proto + // message MySFixed32 { + // sfixed32 value = 1 [ + // (buf.validate.field).sfixed32.example = 1, + // (buf.validate.field).sfixed32.example = 2 + // ]; + // } + // ``` + repeated sfixed32 example = 8 [(predefined).cel = { + id: "sfixed32.example" + expression: "true" + }]; + + // Extension fields in this range that have the (buf.validate.predefined) + // option set will be treated as predefined field constraints that can then be + // set on the field options of other fields to apply field constraints. + // Extension numbers 1000 to 99999 are reserved for extension numbers that are + // defined in the [Protobuf Global Extension Registry][1]. Extension numbers + // above this range are reserved for extension numbers that are not explicitly + // assigned. For rules defined in publicly-consumed schemas, use of extensions + // above 99999 is discouraged due to the risk of conflicts. + // + // [1]: https://github.com/protocolbuffers/protobuf/blob/main/docs/options.md + extensions 1000 to max; } // SFixed64Rules describes the constraints applied to `fixed64` values. @@ -2419,7 +2807,7 @@ message SFixed64Rules { // sfixed64 value = 1 [(buf.validate.field).sfixed64.const = 42]; // } // ``` - optional sfixed64 const = 1 [(priv.field).cel = { + optional sfixed64 const = 1 [(predefined).cel = { id: "sfixed64.const" expression: "this != rules.const ? 'value must equal %s'.format([rules.const]) : ''" }]; @@ -2434,7 +2822,7 @@ message SFixed64Rules { // sfixed64 value = 1 [(buf.validate.field).sfixed64.lt = 10]; // } // ``` - sfixed64 lt = 2 [(priv.field).cel = { + sfixed64 lt = 2 [(predefined).cel = { id: "sfixed64.lt" expression: "!has(rules.gte) && !has(rules.gt) && this >= rules.lt" @@ -2451,7 +2839,7 @@ message SFixed64Rules { // sfixed64 value = 1 [(buf.validate.field).sfixed64.lte = 10]; // } // ``` - sfixed64 lte = 3 [(priv.field).cel = { + sfixed64 lte = 3 [(predefined).cel = { id: "sfixed64.lte" expression: "!has(rules.gte) && !has(rules.gt) && this > rules.lte" @@ -2478,31 +2866,31 @@ message SFixed64Rules { // } // ``` sfixed64 gt = 4 [ - (priv.field).cel = { + (predefined).cel = { id: "sfixed64.gt" expression: "!has(rules.lt) && !has(rules.lte) && this <= rules.gt" "? 'value must be greater than %s'.format([rules.gt]) : ''" }, - (priv.field).cel = { + (predefined).cel = { id: "sfixed64.gt_lt" expression: "has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)" "? 'value must be greater than %s and less than %s'.format([rules.gt, rules.lt]) : ''" }, - (priv.field).cel = { + (predefined).cel = { id: "sfixed64.gt_lt_exclusive" expression: "has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)" "? 'value must be greater than %s or less than %s'.format([rules.gt, rules.lt]) : ''" }, - (priv.field).cel = { + (predefined).cel = { id: "sfixed64.gt_lte" expression: "has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)" "? 'value must be greater than %s and less than or equal to %s'.format([rules.gt, rules.lte]) : ''" }, - (priv.field).cel = { + (predefined).cel = { id: "sfixed64.gt_lte_exclusive" expression: "has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)" @@ -2529,31 +2917,31 @@ message SFixed64Rules { // } // ``` sfixed64 gte = 5 [ - (priv.field).cel = { + (predefined).cel = { id: "sfixed64.gte" expression: "!has(rules.lt) && !has(rules.lte) && this < rules.gte" "? 'value must be greater than or equal to %s'.format([rules.gte]) : ''" }, - (priv.field).cel = { + (predefined).cel = { id: "sfixed64.gte_lt" expression: "has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)" "? 'value must be greater than or equal to %s and less than %s'.format([rules.gte, rules.lt]) : ''" }, - (priv.field).cel = { + (predefined).cel = { id: "sfixed64.gte_lt_exclusive" expression: "has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)" "? 'value must be greater than or equal to %s or less than %s'.format([rules.gte, rules.lt]) : ''" }, - (priv.field).cel = { + (predefined).cel = { id: "sfixed64.gte_lte" expression: "has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)" "? 'value must be greater than or equal to %s and less than or equal to %s'.format([rules.gte, rules.lte]) : ''" }, - (priv.field).cel = { + (predefined).cel = { id: "sfixed64.gte_lte_exclusive" expression: "has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)" @@ -2572,7 +2960,7 @@ message SFixed64Rules { // repeated sfixed64 value = 1 (buf.validate.field).sfixed64 = { in: [1, 2, 3] }; // } // ``` - repeated sfixed64 in = 6 [(priv.field).cel = { + repeated sfixed64 in = 6 [(predefined).cel = { id: "sfixed64.in" expression: "!(this in dyn(rules)['in']) ? 'value must be in list %s'.format([dyn(rules)['in']]) : ''" }]; @@ -2587,10 +2975,39 @@ message SFixed64Rules { // repeated sfixed64 value = 1 (buf.validate.field).sfixed64 = { not_in: [1, 2, 3] }; // } // ``` - repeated sfixed64 not_in = 7 [(priv.field).cel = { + repeated sfixed64 not_in = 7 [(predefined).cel = { id: "sfixed64.not_in" expression: "this in rules.not_in ? 'value must not be in list %s'.format([rules.not_in]) : ''" }]; + + // `example` specifies values that the field may have. These values SHOULD + // conform to other constraints. `example` values will not impact validation + // but may be used as helpful guidance on how to populate the given field. + // + // ```proto + // message MySFixed64 { + // sfixed64 value = 1 [ + // (buf.validate.field).sfixed64.example = 1, + // (buf.validate.field).sfixed64.example = 2 + // ]; + // } + // ``` + repeated sfixed64 example = 8 [(predefined).cel = { + id: "sfixed64.example" + expression: "true" + }]; + + // Extension fields in this range that have the (buf.validate.predefined) + // option set will be treated as predefined field constraints that can then be + // set on the field options of other fields to apply field constraints. + // Extension numbers 1000 to 99999 are reserved for extension numbers that are + // defined in the [Protobuf Global Extension Registry][1]. Extension numbers + // above this range are reserved for extension numbers that are not explicitly + // assigned. For rules defined in publicly-consumed schemas, use of extensions + // above 99999 is discouraged due to the risk of conflicts. + // + // [1]: https://github.com/protocolbuffers/protobuf/blob/main/docs/options.md + extensions 1000 to max; } // BoolRules describes the constraints applied to `bool` values. These rules @@ -2605,10 +3022,39 @@ message BoolRules { // bool value = 1 [(buf.validate.field).bool.const = true]; // } // ``` - optional bool const = 1 [(priv.field).cel = { + optional bool const = 1 [(predefined).cel = { id: "bool.const" expression: "this != rules.const ? 'value must equal %s'.format([rules.const]) : ''" }]; + + // `example` specifies values that the field may have. These values SHOULD + // conform to other constraints. `example` values will not impact validation + // but may be used as helpful guidance on how to populate the given field. + // + // ```proto + // message MyBool { + // bool value = 1 [ + // (buf.validate.field).bool.example = 1, + // (buf.validate.field).bool.example = 2 + // ]; + // } + // ``` + repeated bool example = 2 [(predefined).cel = { + id: "bool.example" + expression: "true" + }]; + + // Extension fields in this range that have the (buf.validate.predefined) + // option set will be treated as predefined field constraints that can then be + // set on the field options of other fields to apply field constraints. + // Extension numbers 1000 to 99999 are reserved for extension numbers that are + // defined in the [Protobuf Global Extension Registry][1]. Extension numbers + // above this range are reserved for extension numbers that are not explicitly + // assigned. For rules defined in publicly-consumed schemas, use of extensions + // above 99999 is discouraged due to the risk of conflicts. + // + // [1]: https://github.com/protocolbuffers/protobuf/blob/main/docs/options.md + extensions 1000 to max; } // StringRules describes the constraints applied to `string` values These @@ -2623,7 +3069,7 @@ message StringRules { // string value = 1 [(buf.validate.field).string.const = "hello"]; // } // ``` - optional string const = 1 [(priv.field).cel = { + optional string const = 1 [(predefined).cel = { id: "string.const" expression: "this != rules.const ? 'value must equal `%s`'.format([rules.const]) : ''" }]; @@ -2639,7 +3085,7 @@ message StringRules { // string value = 1 [(buf.validate.field).string.len = 5]; // } // ``` - optional uint64 len = 19 [(priv.field).cel = { + optional uint64 len = 19 [(predefined).cel = { id: "string.len" expression: "uint(this.size()) != rules.len ? 'value length must be %s characters'.format([rules.len]) : ''" }]; @@ -2655,7 +3101,7 @@ message StringRules { // string value = 1 [(buf.validate.field).string.min_len = 3]; // } // ``` - optional uint64 min_len = 2 [(priv.field).cel = { + optional uint64 min_len = 2 [(predefined).cel = { id: "string.min_len" expression: "uint(this.size()) < rules.min_len ? 'value length must be at least %s characters'.format([rules.min_len]) : ''" }]; @@ -2671,7 +3117,7 @@ message StringRules { // string value = 1 [(buf.validate.field).string.max_len = 10]; // } // ``` - optional uint64 max_len = 3 [(priv.field).cel = { + optional uint64 max_len = 3 [(predefined).cel = { id: "string.max_len" expression: "uint(this.size()) > rules.max_len ? 'value length must be at most %s characters'.format([rules.max_len]) : ''" }]; @@ -2686,7 +3132,7 @@ message StringRules { // string value = 1 [(buf.validate.field).string.len_bytes = 6]; // } // ``` - optional uint64 len_bytes = 20 [(priv.field).cel = { + optional uint64 len_bytes = 20 [(predefined).cel = { id: "string.len_bytes" expression: "uint(bytes(this).size()) != rules.len_bytes ? 'value length must be %s bytes'.format([rules.len_bytes]) : ''" }]; @@ -2702,7 +3148,7 @@ message StringRules { // } // // ``` - optional uint64 min_bytes = 4 [(priv.field).cel = { + optional uint64 min_bytes = 4 [(predefined).cel = { id: "string.min_bytes" expression: "uint(bytes(this).size()) < rules.min_bytes ? 'value length must be at least %s bytes'.format([rules.min_bytes]) : ''" }]; @@ -2717,7 +3163,7 @@ message StringRules { // string value = 1 [(buf.validate.field).string.max_bytes = 8]; // } // ``` - optional uint64 max_bytes = 5 [(priv.field).cel = { + optional uint64 max_bytes = 5 [(predefined).cel = { id: "string.max_bytes" expression: "uint(bytes(this).size()) > rules.max_bytes ? 'value length must be at most %s bytes'.format([rules.max_bytes]) : ''" }]; @@ -2733,7 +3179,7 @@ message StringRules { // string value = 1 [(buf.validate.field).string.pattern = "^[a-zA-Z]//$"]; // } // ``` - optional string pattern = 6 [(priv.field).cel = { + optional string pattern = 6 [(predefined).cel = { id: "string.pattern" expression: "!this.matches(rules.pattern) ? 'value does not match regex pattern `%s`'.format([rules.pattern]) : ''" }]; @@ -2749,7 +3195,7 @@ message StringRules { // string value = 1 [(buf.validate.field).string.prefix = "pre"]; // } // ``` - optional string prefix = 7 [(priv.field).cel = { + optional string prefix = 7 [(predefined).cel = { id: "string.prefix" expression: "!this.startsWith(rules.prefix) ? 'value does not have prefix `%s`'.format([rules.prefix]) : ''" }]; @@ -2764,7 +3210,7 @@ message StringRules { // string value = 1 [(buf.validate.field).string.suffix = "post"]; // } // ``` - optional string suffix = 8 [(priv.field).cel = { + optional string suffix = 8 [(predefined).cel = { id: "string.suffix" expression: "!this.endsWith(rules.suffix) ? 'value does not have suffix `%s`'.format([rules.suffix]) : ''" }]; @@ -2779,7 +3225,7 @@ message StringRules { // string value = 1 [(buf.validate.field).string.contains = "inside"]; // } // ``` - optional string contains = 9 [(priv.field).cel = { + optional string contains = 9 [(predefined).cel = { id: "string.contains" expression: "!this.contains(rules.contains) ? 'value does not contain substring `%s`'.format([rules.contains]) : ''" }]; @@ -2794,7 +3240,7 @@ message StringRules { // string value = 1 [(buf.validate.field).string.not_contains = "inside"]; // } // ``` - optional string not_contains = 23 [(priv.field).cel = { + optional string not_contains = 23 [(predefined).cel = { id: "string.not_contains" expression: "this.contains(rules.not_contains) ? 'value contains substring `%s`'.format([rules.not_contains]) : ''" }]; @@ -2809,7 +3255,7 @@ message StringRules { // repeated string value = 1 [(buf.validate.field).string.in = "apple", (buf.validate.field).string.in = "banana"]; // } // ``` - repeated string in = 10 [(priv.field).cel = { + repeated string in = 10 [(predefined).cel = { id: "string.in" expression: "!(this in dyn(rules)['in']) ? 'value must be in list %s'.format([dyn(rules)['in']]) : ''" }]; @@ -2823,7 +3269,7 @@ message StringRules { // repeated string value = 1 [(buf.validate.field).string.not_in = "orange", (buf.validate.field).string.not_in = "grape"]; // } // ``` - repeated string not_in = 11 [(priv.field).cel = { + repeated string not_in = 11 [(predefined).cel = { id: "string.not_in" expression: "this in rules.not_in ? 'value must not be in list %s'.format([rules.not_in]) : ''" }]; @@ -2842,15 +3288,15 @@ message StringRules { // } // ``` bool email = 12 [ - (priv.field).cel = { + (predefined).cel = { id: "string.email" message: "value must be a valid email address" - expression: "this == '' || this.isEmail()" + expression: "!rules.email || this == '' || this.isEmail()" }, - (priv.field).cel = { + (predefined).cel = { id: "string.email_empty" message: "value is empty, which is not a valid email address" - expression: "this != ''" + expression: "!rules.email || this != ''" } ]; @@ -2866,15 +3312,15 @@ message StringRules { // } // ``` bool hostname = 13 [ - (priv.field).cel = { + (predefined).cel = { id: "string.hostname" message: "value must be a valid hostname" - expression: "this == '' || this.isHostname()" + expression: "!rules.hostname || this == '' || this.isHostname()" }, - (priv.field).cel = { + (predefined).cel = { id: "string.hostname_empty" message: "value is empty, which is not a valid hostname" - expression: "this != ''" + expression: "!rules.hostname || this != ''" } ]; @@ -2890,15 +3336,15 @@ message StringRules { // } // ``` bool ip = 14 [ - (priv.field).cel = { + (predefined).cel = { id: "string.ip" message: "value must be a valid IP address" - expression: "this == '' || this.isIp()" + expression: "!rules.ip || this == '' || this.isIp()" }, - (priv.field).cel = { + (predefined).cel = { id: "string.ip_empty" message: "value is empty, which is not a valid IP address" - expression: "this != ''" + expression: "!rules.ip || this != ''" } ]; @@ -2913,15 +3359,15 @@ message StringRules { // } // ``` bool ipv4 = 15 [ - (priv.field).cel = { + (predefined).cel = { id: "string.ipv4" message: "value must be a valid IPv4 address" - expression: "this == '' || this.isIp(4)" + expression: "!rules.ipv4 || this == '' || this.isIp(4)" }, - (priv.field).cel = { + (predefined).cel = { id: "string.ipv4_empty" message: "value is empty, which is not a valid IPv4 address" - expression: "this != ''" + expression: "!rules.ipv4 || this != ''" } ]; @@ -2936,15 +3382,15 @@ message StringRules { // } // ``` bool ipv6 = 16 [ - (priv.field).cel = { + (predefined).cel = { id: "string.ipv6" message: "value must be a valid IPv6 address" - expression: "this == '' || this.isIp(6)" + expression: "!rules.ipv6 || this == '' || this.isIp(6)" }, - (priv.field).cel = { + (predefined).cel = { id: "string.ipv6_empty" message: "value is empty, which is not a valid IPv6 address" - expression: "this != ''" + expression: "!rules.ipv6 || this != ''" } ]; @@ -2959,15 +3405,15 @@ message StringRules { // } // ``` bool uri = 17 [ - (priv.field).cel = { + (predefined).cel = { id: "string.uri" message: "value must be a valid URI" - expression: "this == '' || this.isUri()" + expression: "!rules.uri || this == '' || this.isUri()" }, - (priv.field).cel = { + (predefined).cel = { id: "string.uri_empty" message: "value is empty, which is not a valid URI" - expression: "this != ''" + expression: "!rules.uri || this != ''" } ]; @@ -2981,10 +3427,10 @@ message StringRules { // string value = 1 [(buf.validate.field).string.uri_ref = true]; // } // ``` - bool uri_ref = 18 [(priv.field).cel = { + bool uri_ref = 18 [(predefined).cel = { id: "string.uri_ref" message: "value must be a valid URI" - expression: "this.isUriRef()" + expression: "!rules.uri_ref || this.isUriRef()" }]; // `address` specifies that the field value must be either a valid hostname @@ -3000,15 +3446,15 @@ message StringRules { // } // ``` bool address = 21 [ - (priv.field).cel = { + (predefined).cel = { id: "string.address" message: "value must be a valid hostname, or ip address" - expression: "this == '' || this.isHostname() || this.isIp()" + expression: "!rules.address || this == '' || this.isHostname() || this.isIp()" }, - (priv.field).cel = { + (predefined).cel = { id: "string.address_empty" message: "value is empty, which is not a valid hostname, or ip address" - expression: "this != ''" + expression: "!rules.address || this != ''" } ]; @@ -3023,15 +3469,15 @@ message StringRules { // } // ``` bool uuid = 22 [ - (priv.field).cel = { + (predefined).cel = { id: "string.uuid" message: "value must be a valid UUID" - expression: "this == '' || this.matches('^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$')" + expression: "!rules.uuid || this == '' || this.matches('^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$')" }, - (priv.field).cel = { + (predefined).cel = { id: "string.uuid_empty" message: "value is empty, which is not a valid UUID" - expression: "this != ''" + expression: "!rules.uuid || this != ''" } ]; @@ -3047,15 +3493,15 @@ message StringRules { // } // ``` bool tuuid = 33 [ - (priv.field).cel = { + (predefined).cel = { id: "string.tuuid" message: "value must be a valid trimmed UUID" - expression: "this == '' || this.matches('^[0-9a-fA-F]{32}$')" + expression: "!rules.tuuid || this == '' || this.matches('^[0-9a-fA-F]{32}$')" }, - (priv.field).cel = { + (predefined).cel = { id: "string.tuuid_empty" message: "value is empty, which is not a valid trimmed UUID" - expression: "this != ''" + expression: "!rules.tuuid || this != ''" } ]; @@ -3071,15 +3517,15 @@ message StringRules { // } // ``` bool ip_with_prefixlen = 26 [ - (priv.field).cel = { + (predefined).cel = { id: "string.ip_with_prefixlen" message: "value must be a valid IP prefix" - expression: "this == '' || this.isIpPrefix()" + expression: "!rules.ip_with_prefixlen || this == '' || this.isIpPrefix()" }, - (priv.field).cel = { + (predefined).cel = { id: "string.ip_with_prefixlen_empty" message: "value is empty, which is not a valid IP prefix" - expression: "this != ''" + expression: "!rules.ip_with_prefixlen || this != ''" } ]; @@ -3095,15 +3541,15 @@ message StringRules { // } // ``` bool ipv4_with_prefixlen = 27 [ - (priv.field).cel = { + (predefined).cel = { id: "string.ipv4_with_prefixlen" message: "value must be a valid IPv4 address with prefix length" - expression: "this == '' || this.isIpPrefix(4)" + expression: "!rules.ipv4_with_prefixlen || this == '' || this.isIpPrefix(4)" }, - (priv.field).cel = { + (predefined).cel = { id: "string.ipv4_with_prefixlen_empty" message: "value is empty, which is not a valid IPv4 address with prefix length" - expression: "this != ''" + expression: "!rules.ipv4_with_prefixlen || this != ''" } ]; @@ -3119,15 +3565,15 @@ message StringRules { // } // ``` bool ipv6_with_prefixlen = 28 [ - (priv.field).cel = { + (predefined).cel = { id: "string.ipv6_with_prefixlen" message: "value must be a valid IPv6 address with prefix length" - expression: "this == '' || this.isIpPrefix(6)" + expression: "!rules.ipv6_with_prefixlen || this == '' || this.isIpPrefix(6)" }, - (priv.field).cel = { + (predefined).cel = { id: "string.ipv6_with_prefixlen_empty" message: "value is empty, which is not a valid IPv6 address with prefix length" - expression: "this != ''" + expression: "!rules.ipv6_with_prefixlen || this != ''" } ]; @@ -3143,15 +3589,15 @@ message StringRules { // } // ``` bool ip_prefix = 29 [ - (priv.field).cel = { + (predefined).cel = { id: "string.ip_prefix" message: "value must be a valid IP prefix" - expression: "this == '' || this.isIpPrefix(true)" + expression: "!rules.ip_prefix || this == '' || this.isIpPrefix(true)" }, - (priv.field).cel = { + (predefined).cel = { id: "string.ip_prefix_empty" message: "value is empty, which is not a valid IP prefix" - expression: "this != ''" + expression: "!rules.ip_prefix || this != ''" } ]; @@ -3167,15 +3613,15 @@ message StringRules { // } // ``` bool ipv4_prefix = 30 [ - (priv.field).cel = { + (predefined).cel = { id: "string.ipv4_prefix" message: "value must be a valid IPv4 prefix" - expression: "this == '' || this.isIpPrefix(4, true)" + expression: "!rules.ipv4_prefix || this == '' || this.isIpPrefix(4, true)" }, - (priv.field).cel = { + (predefined).cel = { id: "string.ipv4_prefix_empty" message: "value is empty, which is not a valid IPv4 prefix" - expression: "this != ''" + expression: "!rules.ipv4_prefix || this != ''" } ]; @@ -3191,15 +3637,15 @@ message StringRules { // } // ``` bool ipv6_prefix = 31 [ - (priv.field).cel = { + (predefined).cel = { id: "string.ipv6_prefix" message: "value must be a valid IPv6 prefix" - expression: "this == '' || this.isIpPrefix(6, true)" + expression: "!rules.ipv6_prefix || this == '' || this.isIpPrefix(6, true)" }, - (priv.field).cel = { + (predefined).cel = { id: "string.ipv6_prefix_empty" message: "value is empty, which is not a valid IPv6 prefix" - expression: "this != ''" + expression: "!rules.ipv6_prefix || this != ''" } ]; @@ -3208,15 +3654,15 @@ message StringRules { // must be in the range of 0-65535, inclusive. IPv6 addresses must be delimited // with square brackets (e.g., `[::1]:1234`). bool host_and_port = 32 [ - (priv.field).cel = { + (predefined).cel = { id: "string.host_and_port" message: "value must be a valid host (hostname or IP address) and port pair" - expression: "this == '' || this.isHostAndPort(true)" + expression: "!rules.host_and_port || this == '' || this.isHostAndPort(true)" }, - (priv.field).cel = { + (predefined).cel = { id: "string.host_and_port_empty" message: "value is empty, which is not a valid host and port pair" - expression: "this != ''" + expression: "!rules.host_and_port || this != ''" } ]; @@ -3241,7 +3687,7 @@ message StringRules { // | KNOWN_REGEX_HTTP_HEADER_NAME | 1 | HTTP header name as defined by [RFC 7230](https://tools.ietf.org/html/rfc7230#section-3.2) | // | KNOWN_REGEX_HTTP_HEADER_VALUE | 2 | HTTP header value as defined by [RFC 7230](https://tools.ietf.org/html/rfc7230#section-3.2.4) | KnownRegex well_known_regex = 24 [ - (priv.field).cel = { + (predefined).cel = { id: "string.well_known_regex.header_name" message: "value must be a valid HTTP header name" expression: @@ -3249,12 +3695,12 @@ message StringRules { "'^:?[0-9a-zA-Z!#$%&\\'*+-.^_|~\\x60]+$' :" "'^[^\\u0000\\u000A\\u000D]+$')" }, - (priv.field).cel = { + (predefined).cel = { id: "string.well_known_regex.header_name_empty" message: "value is empty, which is not a valid HTTP header name" expression: "rules.well_known_regex != 1 || this != ''" }, - (priv.field).cel = { + (predefined).cel = { id: "string.well_known_regex.header_value" message: "value must be a valid HTTP header value" expression: @@ -3278,6 +3724,35 @@ message StringRules { // } // ``` optional bool strict = 25; + + // `example` specifies values that the field may have. These values SHOULD + // conform to other constraints. `example` values will not impact validation + // but may be used as helpful guidance on how to populate the given field. + // + // ```proto + // message MyString { + // string value = 1 [ + // (buf.validate.field).string.example = 1, + // (buf.validate.field).string.example = 2 + // ]; + // } + // ``` + repeated string example = 34 [(predefined).cel = { + id: "string.example" + expression: "true" + }]; + + // Extension fields in this range that have the (buf.validate.predefined) + // option set will be treated as predefined field constraints that can then be + // set on the field options of other fields to apply field constraints. + // Extension numbers 1000 to 99999 are reserved for extension numbers that are + // defined in the [Protobuf Global Extension Registry][1]. Extension numbers + // above this range are reserved for extension numbers that are not explicitly + // assigned. For rules defined in publicly-consumed schemas, use of extensions + // above 99999 is discouraged due to the risk of conflicts. + // + // [1]: https://github.com/protocolbuffers/protobuf/blob/main/docs/options.md + extensions 1000 to max; } // WellKnownRegex contain some well-known patterns. @@ -3303,7 +3778,7 @@ message BytesRules { // bytes value = 1 [(buf.validate.field).bytes.const = "\x01\x02\x03\x04"]; // } // ``` - optional bytes const = 1 [(priv.field).cel = { + optional bytes const = 1 [(predefined).cel = { id: "bytes.const" expression: "this != rules.const ? 'value must be %x'.format([rules.const]) : ''" }]; @@ -3317,7 +3792,7 @@ message BytesRules { // optional bytes value = 1 [(buf.validate.field).bytes.len = 4]; // } // ``` - optional uint64 len = 13 [(priv.field).cel = { + optional uint64 len = 13 [(predefined).cel = { id: "bytes.len" expression: "uint(this.size()) != rules.len ? 'value length must be %s bytes'.format([rules.len]) : ''" }]; @@ -3332,7 +3807,7 @@ message BytesRules { // optional bytes value = 1 [(buf.validate.field).bytes.min_len = 2]; // } // ``` - optional uint64 min_len = 2 [(priv.field).cel = { + optional uint64 min_len = 2 [(predefined).cel = { id: "bytes.min_len" expression: "uint(this.size()) < rules.min_len ? 'value length must be at least %s bytes'.format([rules.min_len]) : ''" }]; @@ -3347,7 +3822,7 @@ message BytesRules { // optional bytes value = 1 [(buf.validate.field).bytes.max_len = 6]; // } // ``` - optional uint64 max_len = 3 [(priv.field).cel = { + optional uint64 max_len = 3 [(predefined).cel = { id: "bytes.max_len" expression: "uint(this.size()) > rules.max_len ? 'value must be at most %s bytes'.format([rules.max_len]) : ''" }]; @@ -3364,7 +3839,7 @@ message BytesRules { // optional bytes value = 1 [(buf.validate.field).bytes.pattern = "^[a-zA-Z0-9]+$"]; // } // ``` - optional string pattern = 4 [(priv.field).cel = { + optional string pattern = 4 [(predefined).cel = { id: "bytes.pattern" expression: "!string(this).matches(rules.pattern) ? 'value must match regex pattern `%s`'.format([rules.pattern]) : ''" }]; @@ -3379,7 +3854,7 @@ message BytesRules { // optional bytes value = 1 [(buf.validate.field).bytes.prefix = "\x01\x02"]; // } // ``` - optional bytes prefix = 5 [(priv.field).cel = { + optional bytes prefix = 5 [(predefined).cel = { id: "bytes.prefix" expression: "!this.startsWith(rules.prefix) ? 'value does not have prefix %x'.format([rules.prefix]) : ''" }]; @@ -3394,7 +3869,7 @@ message BytesRules { // optional bytes value = 1 [(buf.validate.field).bytes.suffix = "\x03\x04"]; // } // ``` - optional bytes suffix = 6 [(priv.field).cel = { + optional bytes suffix = 6 [(predefined).cel = { id: "bytes.suffix" expression: "!this.endsWith(rules.suffix) ? 'value does not have suffix %x'.format([rules.suffix]) : ''" }]; @@ -3409,7 +3884,7 @@ message BytesRules { // optional bytes value = 1 [(buf.validate.field).bytes.contains = "\x02\x03"]; // } // ``` - optional bytes contains = 7 [(priv.field).cel = { + optional bytes contains = 7 [(predefined).cel = { id: "bytes.contains" expression: "!this.contains(rules.contains) ? 'value does not contain %x'.format([rules.contains]) : ''" }]; @@ -3424,7 +3899,7 @@ message BytesRules { // optional bytes value = 1 [(buf.validate.field).bytes.in = {"\x01\x02", "\x02\x03", "\x03\x04"}]; // } // ``` - repeated bytes in = 8 [(priv.field).cel = { + repeated bytes in = 8 [(predefined).cel = { id: "bytes.in" expression: "dyn(rules)['in'].size() > 0 && !(this in dyn(rules)['in']) ? 'value must be in list %s'.format([dyn(rules)['in']]) : ''" }]; @@ -3440,7 +3915,7 @@ message BytesRules { // optional bytes value = 1 [(buf.validate.field).bytes.not_in = {"\x01\x02", "\x02\x03", "\x03\x04"}]; // } // ``` - repeated bytes not_in = 9 [(priv.field).cel = { + repeated bytes not_in = 9 [(predefined).cel = { id: "bytes.not_in" expression: "this in rules.not_in ? 'value must not be in list %s'.format([rules.not_in]) : ''" }]; @@ -3458,15 +3933,15 @@ message BytesRules { // } // ``` bool ip = 10 [ - (priv.field).cel = { + (predefined).cel = { id: "bytes.ip" message: "value must be a valid IP address" - expression: "this.size() == 0 || this.size() == 4 || this.size() == 16" + expression: "!rules.ip || this.size() == 0 || this.size() == 4 || this.size() == 16" }, - (priv.field).cel = { + (predefined).cel = { id: "bytes.ip_empty" message: "value is empty, which is not a valid IP address" - expression: "this.size() != 0" + expression: "!rules.ip || this.size() != 0" } ]; @@ -3480,15 +3955,15 @@ message BytesRules { // } // ``` bool ipv4 = 11 [ - (priv.field).cel = { + (predefined).cel = { id: "bytes.ipv4" message: "value must be a valid IPv4 address" - expression: "this.size() == 0 || this.size() == 4" + expression: "!rules.ipv4 || this.size() == 0 || this.size() == 4" }, - (priv.field).cel = { + (predefined).cel = { id: "bytes.ipv4_empty" message: "value is empty, which is not a valid IPv4 address" - expression: "this.size() != 0" + expression: "!rules.ipv4 || this.size() != 0" } ]; @@ -3501,18 +3976,47 @@ message BytesRules { // } // ``` bool ipv6 = 12 [ - (priv.field).cel = { + (predefined).cel = { id: "bytes.ipv6" message: "value must be a valid IPv6 address" - expression: "this.size() == 0 || this.size() == 16" + expression: "!rules.ipv6 || this.size() == 0 || this.size() == 16" }, - (priv.field).cel = { + (predefined).cel = { id: "bytes.ipv6_empty" message: "value is empty, which is not a valid IPv6 address" - expression: "this.size() != 0" + expression: "!rules.ipv6 || this.size() != 0" } ]; } + + // `example` specifies values that the field may have. These values SHOULD + // conform to other constraints. `example` values will not impact validation + // but may be used as helpful guidance on how to populate the given field. + // + // ```proto + // message MyBytes { + // bytes value = 1 [ + // (buf.validate.field).bytes.example = "\x01\x02", + // (buf.validate.field).bytes.example = "\x02\x03" + // ]; + // } + // ``` + repeated bytes example = 14 [(predefined).cel = { + id: "bytes.example" + expression: "true" + }]; + + // Extension fields in this range that have the (buf.validate.predefined) + // option set will be treated as predefined field constraints that can then be + // set on the field options of other fields to apply field constraints. + // Extension numbers 1000 to 99999 are reserved for extension numbers that are + // defined in the [Protobuf Global Extension Registry][1]. Extension numbers + // above this range are reserved for extension numbers that are not explicitly + // assigned. For rules defined in publicly-consumed schemas, use of extensions + // above 99999 is discouraged due to the risk of conflicts. + // + // [1]: https://github.com/protocolbuffers/protobuf/blob/main/docs/options.md + extensions 1000 to max; } // EnumRules describe the constraints applied to `enum` values. @@ -3532,7 +4036,7 @@ message EnumRules { // MyEnum value = 1 [(buf.validate.field).enum.const = 1]; // } // ``` - optional int32 const = 1 [(priv.field).cel = { + optional int32 const = 1 [(predefined).cel = { id: "enum.const" expression: "this != rules.const ? 'value must equal %s'.format([rules.const]) : ''" }]; @@ -3570,7 +4074,7 @@ message EnumRules { // MyEnum value = 1 [(buf.validate.field).enum = { in: [1, 2]}]; // } // ``` - repeated int32 in = 3 [(priv.field).cel = { + repeated int32 in = 3 [(predefined).cel = { id: "enum.in" expression: "!(this in dyn(rules)['in']) ? 'value must be in list %s'.format([dyn(rules)['in']]) : ''" }]; @@ -3591,10 +4095,43 @@ message EnumRules { // MyEnum value = 1 [(buf.validate.field).enum = { not_in: [1, 2]}]; // } // ``` - repeated int32 not_in = 4 [(priv.field).cel = { + repeated int32 not_in = 4 [(predefined).cel = { id: "enum.not_in" expression: "this in rules.not_in ? 'value must not be in list %s'.format([rules.not_in]) : ''" }]; + + // `example` specifies values that the field may have. These values SHOULD + // conform to other constraints. `example` values will not impact validation + // but may be used as helpful guidance on how to populate the given field. + // + // ```proto + // enum MyEnum { + // MY_ENUM_UNSPECIFIED = 0; + // MY_ENUM_VALUE1 = 1; + // MY_ENUM_VALUE2 = 2; + // } + // + // message MyMessage { + // (buf.validate.field).enum.example = 1, + // (buf.validate.field).enum.example = 2 + // } + // ``` + repeated int32 example = 5 [(predefined).cel = { + id: "enum.example" + expression: "true" + }]; + + // Extension fields in this range that have the (buf.validate.predefined) + // option set will be treated as predefined field constraints that can then be + // set on the field options of other fields to apply field constraints. + // Extension numbers 1000 to 99999 are reserved for extension numbers that are + // defined in the [Protobuf Global Extension Registry][1]. Extension numbers + // above this range are reserved for extension numbers that are not explicitly + // assigned. For rules defined in publicly-consumed schemas, use of extensions + // above 99999 is discouraged due to the risk of conflicts. + // + // [1]: https://github.com/protocolbuffers/protobuf/blob/main/docs/options.md + extensions 1000 to max; } // RepeatedRules describe the constraints applied to `repeated` values. @@ -3610,7 +4147,7 @@ message RepeatedRules { // repeated string value = 1 [(buf.validate.field).repeated.min_items = 2]; // } // ``` - optional uint64 min_items = 1 [(priv.field).cel = { + optional uint64 min_items = 1 [(predefined).cel = { id: "repeated.min_items" expression: "uint(this.size()) < rules.min_items ? 'value must contain at least %d item(s)'.format([rules.min_items]) : ''" }]; @@ -3626,7 +4163,7 @@ message RepeatedRules { // repeated string value = 1 [(buf.validate.field).repeated.max_items = 3]; // } // ``` - optional uint64 max_items = 2 [(priv.field).cel = { + optional uint64 max_items = 2 [(predefined).cel = { id: "repeated.max_items" expression: "uint(this.size()) > rules.max_items ? 'value must contain no more than %s item(s)'.format([rules.max_items]) : ''" }]; @@ -3641,10 +4178,10 @@ message RepeatedRules { // repeated string value = 1 [(buf.validate.field).repeated.unique = true]; // } // ``` - optional bool unique = 3 [(priv.field).cel = { + optional bool unique = 3 [(predefined).cel = { id: "repeated.unique" message: "repeated value must contain unique items" - expression: "this.unique()" + expression: "!rules.unique || this.unique()" }]; // `items` details the constraints to be applied to each item @@ -3663,6 +4200,18 @@ message RepeatedRules { // } // ``` optional FieldConstraints items = 4; + + // Extension fields in this range that have the (buf.validate.predefined) + // option set will be treated as predefined field constraints that can then be + // set on the field options of other fields to apply field constraints. + // Extension numbers 1000 to 99999 are reserved for extension numbers that are + // defined in the [Protobuf Global Extension Registry][1]. Extension numbers + // above this range are reserved for extension numbers that are not explicitly + // assigned. For rules defined in publicly-consumed schemas, use of extensions + // above 99999 is discouraged due to the risk of conflicts. + // + // [1]: https://github.com/protocolbuffers/protobuf/blob/main/docs/options.md + extensions 1000 to max; } // MapRules describe the constraints applied to `map` values. @@ -3676,7 +4225,7 @@ message MapRules { // map value = 1 [(buf.validate.field).map.min_pairs = 2]; // } // ``` - optional uint64 min_pairs = 1 [(priv.field).cel = { + optional uint64 min_pairs = 1 [(predefined).cel = { id: "map.min_pairs" expression: "uint(this.size()) < rules.min_pairs ? 'map must be at least %d entries'.format([rules.min_pairs]) : ''" }]; @@ -3690,7 +4239,7 @@ message MapRules { // map value = 1 [(buf.validate.field).map.max_pairs = 3]; // } // ``` - optional uint64 max_pairs = 2 [(priv.field).cel = { + optional uint64 max_pairs = 2 [(predefined).cel = { id: "map.max_pairs" expression: "uint(this.size()) > rules.max_pairs ? 'map must be at most %d entries'.format([rules.max_pairs]) : ''" }]; @@ -3726,6 +4275,18 @@ message MapRules { // } // ``` optional FieldConstraints values = 5; + + // Extension fields in this range that have the (buf.validate.predefined) + // option set will be treated as predefined field constraints that can then be + // set on the field options of other fields to apply field constraints. + // Extension numbers 1000 to 99999 are reserved for extension numbers that are + // defined in the [Protobuf Global Extension Registry][1]. Extension numbers + // above this range are reserved for extension numbers that are not explicitly + // assigned. For rules defined in publicly-consumed schemas, use of extensions + // above 99999 is discouraged due to the risk of conflicts. + // + // [1]: https://github.com/protocolbuffers/protobuf/blob/main/docs/options.md + extensions 1000 to max; } // AnyRules describe constraints applied exclusively to the `google.protobuf.Any` well-known type. @@ -3765,7 +4326,7 @@ message DurationRules { // google.protobuf.Duration value = 1 [(buf.validate.field).duration.const = "5s"]; // } // ``` - optional google.protobuf.Duration const = 2 [(priv.field).cel = { + optional google.protobuf.Duration const = 2 [(predefined).cel = { id: "duration.const" expression: "this != rules.const ? 'value must equal %s'.format([rules.const]) : ''" }]; @@ -3780,7 +4341,7 @@ message DurationRules { // google.protobuf.Duration value = 1 [(buf.validate.field).duration.lt = "5s"]; // } // ``` - google.protobuf.Duration lt = 3 [(priv.field).cel = { + google.protobuf.Duration lt = 3 [(predefined).cel = { id: "duration.lt" expression: "!has(rules.gte) && !has(rules.gt) && this >= rules.lt" @@ -3797,7 +4358,7 @@ message DurationRules { // google.protobuf.Duration value = 1 [(buf.validate.field).duration.lte = "10s"]; // } // ``` - google.protobuf.Duration lte = 4 [(priv.field).cel = { + google.protobuf.Duration lte = 4 [(predefined).cel = { id: "duration.lte" expression: "!has(rules.gte) && !has(rules.gt) && this > rules.lte" @@ -3824,31 +4385,31 @@ message DurationRules { // } // ``` google.protobuf.Duration gt = 5 [ - (priv.field).cel = { + (predefined).cel = { id: "duration.gt" expression: "!has(rules.lt) && !has(rules.lte) && this <= rules.gt" "? 'value must be greater than %s'.format([rules.gt]) : ''" }, - (priv.field).cel = { + (predefined).cel = { id: "duration.gt_lt" expression: "has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)" "? 'value must be greater than %s and less than %s'.format([rules.gt, rules.lt]) : ''" }, - (priv.field).cel = { + (predefined).cel = { id: "duration.gt_lt_exclusive" expression: "has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)" "? 'value must be greater than %s or less than %s'.format([rules.gt, rules.lt]) : ''" }, - (priv.field).cel = { + (predefined).cel = { id: "duration.gt_lte" expression: "has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)" "? 'value must be greater than %s and less than or equal to %s'.format([rules.gt, rules.lte]) : ''" }, - (priv.field).cel = { + (predefined).cel = { id: "duration.gt_lte_exclusive" expression: "has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)" @@ -3875,31 +4436,31 @@ message DurationRules { // } // ``` google.protobuf.Duration gte = 6 [ - (priv.field).cel = { + (predefined).cel = { id: "duration.gte" expression: "!has(rules.lt) && !has(rules.lte) && this < rules.gte" "? 'value must be greater than or equal to %s'.format([rules.gte]) : ''" }, - (priv.field).cel = { + (predefined).cel = { id: "duration.gte_lt" expression: "has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)" "? 'value must be greater than or equal to %s and less than %s'.format([rules.gte, rules.lt]) : ''" }, - (priv.field).cel = { + (predefined).cel = { id: "duration.gte_lt_exclusive" expression: "has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)" "? 'value must be greater than or equal to %s or less than %s'.format([rules.gte, rules.lt]) : ''" }, - (priv.field).cel = { + (predefined).cel = { id: "duration.gte_lte" expression: "has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)" "? 'value must be greater than or equal to %s and less than or equal to %s'.format([rules.gte, rules.lte]) : ''" }, - (priv.field).cel = { + (predefined).cel = { id: "duration.gte_lte_exclusive" expression: "has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)" @@ -3918,7 +4479,7 @@ message DurationRules { // google.protobuf.Duration value = 1 [(buf.validate.field).duration.in = ["1s", "2s", "3s"]]; // } // ``` - repeated google.protobuf.Duration in = 7 [(priv.field).cel = { + repeated google.protobuf.Duration in = 7 [(predefined).cel = { id: "duration.in" expression: "!(this in dyn(rules)['in']) ? 'value must be in list %s'.format([dyn(rules)['in']]) : ''" }]; @@ -3934,10 +4495,39 @@ message DurationRules { // google.protobuf.Duration value = 1 [(buf.validate.field).duration.not_in = ["1s", "2s", "3s"]]; // } // ``` - repeated google.protobuf.Duration not_in = 8 [(priv.field).cel = { + repeated google.protobuf.Duration not_in = 8 [(predefined).cel = { id: "duration.not_in" expression: "this in rules.not_in ? 'value must not be in list %s'.format([rules.not_in]) : ''" }]; + + // `example` specifies values that the field may have. These values SHOULD + // conform to other constraints. `example` values will not impact validation + // but may be used as helpful guidance on how to populate the given field. + // + // ```proto + // message MyDuration { + // google.protobuf.Duration value = 1 [ + // (buf.validate.field).duration.example = { seconds: 1 }, + // (buf.validate.field).duration.example = { seconds: 2 }, + // ]; + // } + // ``` + repeated google.protobuf.Duration example = 9 [(predefined).cel = { + id: "duration.example" + expression: "true" + }]; + + // Extension fields in this range that have the (buf.validate.predefined) + // option set will be treated as predefined field constraints that can then be + // set on the field options of other fields to apply field constraints. + // Extension numbers 1000 to 99999 are reserved for extension numbers that are + // defined in the [Protobuf Global Extension Registry][1]. Extension numbers + // above this range are reserved for extension numbers that are not explicitly + // assigned. For rules defined in publicly-consumed schemas, use of extensions + // above 99999 is discouraged due to the risk of conflicts. + // + // [1]: https://github.com/protocolbuffers/protobuf/blob/main/docs/options.md + extensions 1000 to max; } // TimestampRules describe the constraints applied exclusively to the `google.protobuf.Timestamp` well-known type. @@ -3950,7 +4540,7 @@ message TimestampRules { // google.protobuf.Timestamp created_at = 1 [(buf.validate.field).timestamp.const = {seconds: 1727998800}]; // } // ``` - optional google.protobuf.Timestamp const = 2 [(priv.field).cel = { + optional google.protobuf.Timestamp const = 2 [(predefined).cel = { id: "timestamp.const" expression: "this != rules.const ? 'value must equal %s'.format([rules.const]) : ''" }]; @@ -3963,7 +4553,7 @@ message TimestampRules { // google.protobuf.Duration value = 1 [(buf.validate.field).duration.lt = { seconds: 259200 }]; // } // ``` - google.protobuf.Timestamp lt = 3 [(priv.field).cel = { + google.protobuf.Timestamp lt = 3 [(predefined).cel = { id: "timestamp.lt" expression: "!has(rules.gte) && !has(rules.gt) && this >= rules.lt" @@ -3978,7 +4568,7 @@ message TimestampRules { // google.protobuf.Timestamp value = 1 [(buf.validate.field).timestamp.lte = { seconds: 1678867200 }]; // } // ``` - google.protobuf.Timestamp lte = 4 [(priv.field).cel = { + google.protobuf.Timestamp lte = 4 [(predefined).cel = { id: "timestamp.lte" expression: "!has(rules.gte) && !has(rules.gt) && this > rules.lte" @@ -3993,9 +4583,9 @@ message TimestampRules { // google.protobuf.Timestamp created_at = 1 [(buf.validate.field).timestamp.lt_now = true]; // } // ``` - bool lt_now = 7 [(priv.field).cel = { + bool lt_now = 7 [(predefined).cel = { id: "timestamp.lt_now" - expression: "this > now ? 'value must be less than now' : ''" + expression: "(rules.lt_now && this > now) ? 'value must be less than now' : ''" }]; } oneof greater_than { @@ -4018,31 +4608,31 @@ message TimestampRules { // } // ``` google.protobuf.Timestamp gt = 5 [ - (priv.field).cel = { + (predefined).cel = { id: "timestamp.gt" expression: "!has(rules.lt) && !has(rules.lte) && this <= rules.gt" "? 'value must be greater than %s'.format([rules.gt]) : ''" }, - (priv.field).cel = { + (predefined).cel = { id: "timestamp.gt_lt" expression: "has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)" "? 'value must be greater than %s and less than %s'.format([rules.gt, rules.lt]) : ''" }, - (priv.field).cel = { + (predefined).cel = { id: "timestamp.gt_lt_exclusive" expression: "has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)" "? 'value must be greater than %s or less than %s'.format([rules.gt, rules.lt]) : ''" }, - (priv.field).cel = { + (predefined).cel = { id: "timestamp.gt_lte" expression: "has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)" "? 'value must be greater than %s and less than or equal to %s'.format([rules.gt, rules.lte]) : ''" }, - (priv.field).cel = { + (predefined).cel = { id: "timestamp.gt_lte_exclusive" expression: "has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)" @@ -4069,31 +4659,31 @@ message TimestampRules { // } // ``` google.protobuf.Timestamp gte = 6 [ - (priv.field).cel = { + (predefined).cel = { id: "timestamp.gte" expression: "!has(rules.lt) && !has(rules.lte) && this < rules.gte" "? 'value must be greater than or equal to %s'.format([rules.gte]) : ''" }, - (priv.field).cel = { + (predefined).cel = { id: "timestamp.gte_lt" expression: "has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)" "? 'value must be greater than or equal to %s and less than %s'.format([rules.gte, rules.lt]) : ''" }, - (priv.field).cel = { + (predefined).cel = { id: "timestamp.gte_lt_exclusive" expression: "has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)" "? 'value must be greater than or equal to %s or less than %s'.format([rules.gte, rules.lt]) : ''" }, - (priv.field).cel = { + (predefined).cel = { id: "timestamp.gte_lte" expression: "has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)" "? 'value must be greater than or equal to %s and less than or equal to %s'.format([rules.gte, rules.lte]) : ''" }, - (priv.field).cel = { + (predefined).cel = { id: "timestamp.gte_lte_exclusive" expression: "has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)" @@ -4109,9 +4699,9 @@ message TimestampRules { // google.protobuf.Timestamp created_at = 1 [(buf.validate.field).timestamp.gt_now = true]; // } // ``` - bool gt_now = 8 [(priv.field).cel = { + bool gt_now = 8 [(predefined).cel = { id: "timestamp.gt_now" - expression: "this < now ? 'value must be greater than now' : ''" + expression: "(rules.gt_now && this < now) ? 'value must be greater than now' : ''" }]; } @@ -4123,8 +4713,75 @@ message TimestampRules { // google.protobuf.Timestamp created_at = 1 [(buf.validate.field).timestamp.within = {seconds: 3600}]; // } // ``` - optional google.protobuf.Duration within = 9 [(priv.field).cel = { + optional google.protobuf.Duration within = 9 [(predefined).cel = { id: "timestamp.within" expression: "this < now-rules.within || this > now+rules.within ? 'value must be within %s of now'.format([rules.within]) : ''" }]; + + // `example` specifies values that the field may have. These values SHOULD + // conform to other constraints. `example` values will not impact validation + // but may be used as helpful guidance on how to populate the given field. + // + // ```proto + // message MyTimestamp { + // google.protobuf.Timestamp value = 1 [ + // (buf.validate.field).timestamp.example = { seconds: 1672444800 }, + // (buf.validate.field).timestamp.example = { seconds: 1672531200 }, + // ]; + // } + // ``` + + repeated google.protobuf.Timestamp example = 10 [(predefined).cel = { + id: "timestamp.example" + expression: "true" + }]; + + // Extension fields in this range that have the (buf.validate.predefined) + // option set will be treated as predefined field constraints that can then be + // set on the field options of other fields to apply field constraints. + // Extension numbers 1000 to 99999 are reserved for extension numbers that are + // defined in the [Protobuf Global Extension Registry][1]. Extension numbers + // above this range are reserved for extension numbers that are not explicitly + // assigned. For rules defined in publicly-consumed schemas, use of extensions + // above 99999 is discouraged due to the risk of conflicts. + // + // [1]: https://github.com/protocolbuffers/protobuf/blob/main/docs/options.md + extensions 1000 to max; +} + +// `Violations` is a collection of `Violation` messages. This message type is returned by +// protovalidate when a proto message fails to meet the requirements set by the `Constraint` validation rules. +// Each individual violation is represented by a `Violation` message. +message Violations { + // `violations` is a repeated field that contains all the `Violation` messages corresponding to the violations detected. + repeated Violation violations = 1; +} + +// `Violation` represents a single instance where a validation rule, expressed +// as a `Constraint`, was not met. It provides information about the field that +// caused the violation, the specific constraint that wasn't fulfilled, and a +// human-readable error message. +// +// ```json +// { +// "fieldPath": "bar", +// "constraintId": "foo.bar", +// "message": "bar must be greater than 0" +// } +// ``` +message Violation { + // `field_path` is a machine-readable identifier that points to the specific field that failed the validation. + // This could be a nested field, in which case the path will include all the parent fields leading to the actual field that caused the violation. + optional string field_path = 1; + + // `constraint_id` is the unique identifier of the `Constraint` that was not fulfilled. + // This is the same `id` that was specified in the `Constraint` message, allowing easy tracing of which rule was violated. + optional string constraint_id = 2; + + // `message` is a human-readable error message that describes the nature of the violation. + // This can be the default error message from the violated `Constraint`, or it can be a custom message that gives more context about the violation. + optional string message = 3; + + // `for_key` indicates whether the violation was caused by a map key, rather than a value. + optional bool for_key = 4; } diff --git a/src/test/java/build/buf/protovalidate/ValidatorDynamicMessageTest.java b/src/test/java/build/buf/protovalidate/ValidatorDynamicMessageTest.java index 97603def..70db7fde 100644 --- a/src/test/java/build/buf/protovalidate/ValidatorDynamicMessageTest.java +++ b/src/test/java/build/buf/protovalidate/ValidatorDynamicMessageTest.java @@ -14,9 +14,11 @@ package build.buf.protovalidate; +import static com.example.imports.validationtest.PredefinedProto.isIdent; import static org.assertj.core.api.Assertions.assertThat; import build.buf.validate.Violation; +import com.example.imports.validationtest.ExamplePredefinedFieldConstraints; import com.example.noimports.validationtest.ExampleFieldConstraints; import com.example.noimports.validationtest.ExampleMessageConstraints; import com.example.noimports.validationtest.ExampleOneofConstraints; @@ -24,8 +26,10 @@ import com.google.protobuf.DescriptorProtos; import com.google.protobuf.Descriptors; import com.google.protobuf.DynamicMessage; +import com.google.protobuf.ExtensionRegistry; import com.google.protobuf.InvalidProtocolBufferException; import com.google.protobuf.Message; +import com.google.protobuf.TypeRegistry; import java.util.LinkedHashSet; import java.util.Map; import java.util.Set; @@ -112,6 +116,43 @@ public void testRequiredFieldConstraintDynamicMessageInvalid() throws Exception .containsExactly(expectedViolation); } + @Test + public void testPredefinedFieldConstraintDynamicMessage() throws Exception { + DynamicMessage.Builder messageBuilder = + createMessageWithUnknownOptions(ExamplePredefinedFieldConstraints.getDefaultInstance()); + messageBuilder.setField( + messageBuilder.getDescriptorForType().findFieldByName("ident_field"), "abc123"); + ExtensionRegistry registry = ExtensionRegistry.newInstance(); + registry.add(isIdent); + TypeRegistry typeRegistry = + TypeRegistry.newBuilder().add(isIdent.getDescriptor().getContainingType()).build(); + Config config = + Config.newBuilder().setExtensionRegistry(registry).setTypeRegistry(typeRegistry).build(); + assertThat(new Validator(config).validate(messageBuilder.build()).getViolations()).isEmpty(); + } + + @Test + public void testPredefinedFieldConstraintDynamicMessageInvalid() throws Exception { + DynamicMessage.Builder messageBuilder = + createMessageWithUnknownOptions(ExamplePredefinedFieldConstraints.getDefaultInstance()); + messageBuilder.setField( + messageBuilder.getDescriptorForType().findFieldByName("ident_field"), "0123456789"); + Violation expectedViolation = + Violation.newBuilder() + .setConstraintId("string.is_ident") + .setFieldPath("ident_field") + .setMessage("invalid identifier") + .build(); + ExtensionRegistry registry = ExtensionRegistry.newInstance(); + registry.add(isIdent); + TypeRegistry typeRegistry = + TypeRegistry.newBuilder().add(isIdent.getDescriptor().getContainingType()).build(); + Config config = + Config.newBuilder().setExtensionRegistry(registry).setTypeRegistry(typeRegistry).build(); + assertThat(new Validator(config).validate(messageBuilder.build()).getViolations()) + .containsExactly(expectedViolation); + } + private static void gatherDependencies( Descriptors.FileDescriptor fd, Set dependencies) { dependencies.add(fd.toProto()); diff --git a/src/test/resources/proto/validationtest/predefined.proto b/src/test/resources/proto/validationtest/predefined.proto new file mode 100644 index 00000000..74caab08 --- /dev/null +++ b/src/test/resources/proto/validationtest/predefined.proto @@ -0,0 +1,32 @@ +// Copyright 2023-2024 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto2"; + +package validationtest; + +import "buf/validate/validate.proto"; + +extend buf.validate.StringRules { + optional bool is_ident = 1161 [ + (buf.validate.predefined).cel = { + id: "string.is_ident", + expression: "(rule && !this.matches('^[a-z0-9]{1,9}$')) ? 'invalid identifier' : ''", + } + ]; +} + +message ExamplePredefinedFieldConstraints { + optional string ident_field = 1 [(buf.validate.field).string.(is_ident) = true]; +}