Class MessageConstraints.Builder

java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder
com.google.protobuf.AbstractMessage.Builder<MessageConstraints.Builder>
com.google.protobuf.GeneratedMessageV3.Builder<MessageConstraints.Builder>
build.buf.validate.MessageConstraints.Builder
All Implemented Interfaces:
MessageConstraintsOrBuilder, com.google.protobuf.Message.Builder, com.google.protobuf.MessageLite.Builder, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, Cloneable
Enclosing class:
MessageConstraints

public static final class MessageConstraints.Builder extends com.google.protobuf.GeneratedMessageV3.Builder<MessageConstraints.Builder> implements MessageConstraintsOrBuilder
 MessageConstraints represents validation rules that are applied to the entire message.
 It includes disabling options and a list of Constraint messages representing Common Expression Language (CEL) validation rules.
 
Protobuf type buf.validate.MessageConstraints
  • Method Details

    • getDescriptor

      public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
    • internalGetFieldAccessorTable

      protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
      Specified by:
      internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessageV3.Builder<MessageConstraints.Builder>
    • clear

      Specified by:
      clear in interface com.google.protobuf.Message.Builder
      Specified by:
      clear in interface com.google.protobuf.MessageLite.Builder
      Overrides:
      clear in class com.google.protobuf.GeneratedMessageV3.Builder<MessageConstraints.Builder>
    • getDescriptorForType

      public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
      Specified by:
      getDescriptorForType in interface com.google.protobuf.Message.Builder
      Specified by:
      getDescriptorForType in interface com.google.protobuf.MessageOrBuilder
      Overrides:
      getDescriptorForType in class com.google.protobuf.GeneratedMessageV3.Builder<MessageConstraints.Builder>
    • getDefaultInstanceForType

      public MessageConstraints getDefaultInstanceForType()
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder
    • build

      public MessageConstraints build()
      Specified by:
      build in interface com.google.protobuf.Message.Builder
      Specified by:
      build in interface com.google.protobuf.MessageLite.Builder
    • buildPartial

      public MessageConstraints buildPartial()
      Specified by:
      buildPartial in interface com.google.protobuf.Message.Builder
      Specified by:
      buildPartial in interface com.google.protobuf.MessageLite.Builder
    • clone

      Specified by:
      clone in interface com.google.protobuf.Message.Builder
      Specified by:
      clone in interface com.google.protobuf.MessageLite.Builder
      Overrides:
      clone in class com.google.protobuf.GeneratedMessageV3.Builder<MessageConstraints.Builder>
    • setField

      public MessageConstraints.Builder setField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value)
      Specified by:
      setField in interface com.google.protobuf.Message.Builder
      Overrides:
      setField in class com.google.protobuf.GeneratedMessageV3.Builder<MessageConstraints.Builder>
    • clearField

      public MessageConstraints.Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field)
      Specified by:
      clearField in interface com.google.protobuf.Message.Builder
      Overrides:
      clearField in class com.google.protobuf.GeneratedMessageV3.Builder<MessageConstraints.Builder>
    • clearOneof

      public MessageConstraints.Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)
      Specified by:
      clearOneof in interface com.google.protobuf.Message.Builder
      Overrides:
      clearOneof in class com.google.protobuf.GeneratedMessageV3.Builder<MessageConstraints.Builder>
    • setRepeatedField

      public MessageConstraints.Builder setRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, int index, Object value)
      Specified by:
      setRepeatedField in interface com.google.protobuf.Message.Builder
      Overrides:
      setRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<MessageConstraints.Builder>
    • addRepeatedField

      public MessageConstraints.Builder addRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value)
      Specified by:
      addRepeatedField in interface com.google.protobuf.Message.Builder
      Overrides:
      addRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<MessageConstraints.Builder>
    • mergeFrom

      public MessageConstraints.Builder mergeFrom(com.google.protobuf.Message other)
      Specified by:
      mergeFrom in interface com.google.protobuf.Message.Builder
      Overrides:
      mergeFrom in class com.google.protobuf.AbstractMessage.Builder<MessageConstraints.Builder>
    • mergeFrom

    • isInitialized

      public final boolean isInitialized()
      Specified by:
      isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
      Overrides:
      isInitialized in class com.google.protobuf.GeneratedMessageV3.Builder<MessageConstraints.Builder>
    • mergeFrom

      public MessageConstraints.Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
      Specified by:
      mergeFrom in interface com.google.protobuf.Message.Builder
      Specified by:
      mergeFrom in interface com.google.protobuf.MessageLite.Builder
      Overrides:
      mergeFrom in class com.google.protobuf.AbstractMessage.Builder<MessageConstraints.Builder>
      Throws:
      IOException
    • hasDisabled

      public boolean hasDisabled()
       `disabled` is a boolean flag that, when set to true, nullifies any validation rules for this message.
       This includes any fields within the message that would otherwise support validation.
      
       ```proto
       message MyMessage {
         // validation will be bypassed for this message
         option (buf.validate.message).disabled = true;
       }
       ```
       
      optional bool disabled = 1 [json_name = "disabled"];
      Specified by:
      hasDisabled in interface MessageConstraintsOrBuilder
      Returns:
      Whether the disabled field is set.
    • getDisabled

      public boolean getDisabled()
       `disabled` is a boolean flag that, when set to true, nullifies any validation rules for this message.
       This includes any fields within the message that would otherwise support validation.
      
       ```proto
       message MyMessage {
         // validation will be bypassed for this message
         option (buf.validate.message).disabled = true;
       }
       ```
       
      optional bool disabled = 1 [json_name = "disabled"];
      Specified by:
      getDisabled in interface MessageConstraintsOrBuilder
      Returns:
      The disabled.
    • setDisabled

      public MessageConstraints.Builder setDisabled(boolean value)
       `disabled` is a boolean flag that, when set to true, nullifies any validation rules for this message.
       This includes any fields within the message that would otherwise support validation.
      
       ```proto
       message MyMessage {
         // validation will be bypassed for this message
         option (buf.validate.message).disabled = true;
       }
       ```
       
      optional bool disabled = 1 [json_name = "disabled"];
      Parameters:
      value - The disabled to set.
      Returns:
      This builder for chaining.
    • clearDisabled

      public MessageConstraints.Builder clearDisabled()
       `disabled` is a boolean flag that, when set to true, nullifies any validation rules for this message.
       This includes any fields within the message that would otherwise support validation.
      
       ```proto
       message MyMessage {
         // validation will be bypassed for this message
         option (buf.validate.message).disabled = true;
       }
       ```
       
      optional bool disabled = 1 [json_name = "disabled"];
      Returns:
      This builder for chaining.
    • getCelList

      public List<Constraint> getCelList()
       `cel` is a repeated field of type Constraint. Each Constraint specifies a validation rule to be applied to this message.
       These constraints are written in 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 `foo` must be greater than 42.
         option (buf.validate.message).cel = {
           id: "my_message.value",
           message: "value must be greater than 42",
           expression: "this.foo > 42",
         };
         optional int32 foo = 1;
       }
       ```
       
      repeated .buf.validate.Constraint cel = 3 [json_name = "cel"];
      Specified by:
      getCelList in interface MessageConstraintsOrBuilder
    • getCelCount

      public int getCelCount()
       `cel` is a repeated field of type Constraint. Each Constraint specifies a validation rule to be applied to this message.
       These constraints are written in 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 `foo` must be greater than 42.
         option (buf.validate.message).cel = {
           id: "my_message.value",
           message: "value must be greater than 42",
           expression: "this.foo > 42",
         };
         optional int32 foo = 1;
       }
       ```
       
      repeated .buf.validate.Constraint cel = 3 [json_name = "cel"];
      Specified by:
      getCelCount in interface MessageConstraintsOrBuilder
    • getCel

      public Constraint getCel(int index)
       `cel` is a repeated field of type Constraint. Each Constraint specifies a validation rule to be applied to this message.
       These constraints are written in 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 `foo` must be greater than 42.
         option (buf.validate.message).cel = {
           id: "my_message.value",
           message: "value must be greater than 42",
           expression: "this.foo > 42",
         };
         optional int32 foo = 1;
       }
       ```
       
      repeated .buf.validate.Constraint cel = 3 [json_name = "cel"];
      Specified by:
      getCel in interface MessageConstraintsOrBuilder
    • setCel

      public MessageConstraints.Builder setCel(int index, Constraint value)
       `cel` is a repeated field of type Constraint. Each Constraint specifies a validation rule to be applied to this message.
       These constraints are written in 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 `foo` must be greater than 42.
         option (buf.validate.message).cel = {
           id: "my_message.value",
           message: "value must be greater than 42",
           expression: "this.foo > 42",
         };
         optional int32 foo = 1;
       }
       ```
       
      repeated .buf.validate.Constraint cel = 3 [json_name = "cel"];
    • setCel

      public MessageConstraints.Builder setCel(int index, Constraint.Builder builderForValue)
       `cel` is a repeated field of type Constraint. Each Constraint specifies a validation rule to be applied to this message.
       These constraints are written in 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 `foo` must be greater than 42.
         option (buf.validate.message).cel = {
           id: "my_message.value",
           message: "value must be greater than 42",
           expression: "this.foo > 42",
         };
         optional int32 foo = 1;
       }
       ```
       
      repeated .buf.validate.Constraint cel = 3 [json_name = "cel"];
    • addCel

      public MessageConstraints.Builder addCel(Constraint value)
       `cel` is a repeated field of type Constraint. Each Constraint specifies a validation rule to be applied to this message.
       These constraints are written in 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 `foo` must be greater than 42.
         option (buf.validate.message).cel = {
           id: "my_message.value",
           message: "value must be greater than 42",
           expression: "this.foo > 42",
         };
         optional int32 foo = 1;
       }
       ```
       
      repeated .buf.validate.Constraint cel = 3 [json_name = "cel"];
    • addCel

      public MessageConstraints.Builder addCel(int index, Constraint value)
       `cel` is a repeated field of type Constraint. Each Constraint specifies a validation rule to be applied to this message.
       These constraints are written in 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 `foo` must be greater than 42.
         option (buf.validate.message).cel = {
           id: "my_message.value",
           message: "value must be greater than 42",
           expression: "this.foo > 42",
         };
         optional int32 foo = 1;
       }
       ```
       
      repeated .buf.validate.Constraint cel = 3 [json_name = "cel"];
    • addCel

      public MessageConstraints.Builder addCel(Constraint.Builder builderForValue)
       `cel` is a repeated field of type Constraint. Each Constraint specifies a validation rule to be applied to this message.
       These constraints are written in 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 `foo` must be greater than 42.
         option (buf.validate.message).cel = {
           id: "my_message.value",
           message: "value must be greater than 42",
           expression: "this.foo > 42",
         };
         optional int32 foo = 1;
       }
       ```
       
      repeated .buf.validate.Constraint cel = 3 [json_name = "cel"];
    • addCel

      public MessageConstraints.Builder addCel(int index, Constraint.Builder builderForValue)
       `cel` is a repeated field of type Constraint. Each Constraint specifies a validation rule to be applied to this message.
       These constraints are written in 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 `foo` must be greater than 42.
         option (buf.validate.message).cel = {
           id: "my_message.value",
           message: "value must be greater than 42",
           expression: "this.foo > 42",
         };
         optional int32 foo = 1;
       }
       ```
       
      repeated .buf.validate.Constraint cel = 3 [json_name = "cel"];
    • addAllCel

      public MessageConstraints.Builder addAllCel(Iterable<? extends Constraint> values)
       `cel` is a repeated field of type Constraint. Each Constraint specifies a validation rule to be applied to this message.
       These constraints are written in 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 `foo` must be greater than 42.
         option (buf.validate.message).cel = {
           id: "my_message.value",
           message: "value must be greater than 42",
           expression: "this.foo > 42",
         };
         optional int32 foo = 1;
       }
       ```
       
      repeated .buf.validate.Constraint cel = 3 [json_name = "cel"];
    • clearCel

      public MessageConstraints.Builder clearCel()
       `cel` is a repeated field of type Constraint. Each Constraint specifies a validation rule to be applied to this message.
       These constraints are written in 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 `foo` must be greater than 42.
         option (buf.validate.message).cel = {
           id: "my_message.value",
           message: "value must be greater than 42",
           expression: "this.foo > 42",
         };
         optional int32 foo = 1;
       }
       ```
       
      repeated .buf.validate.Constraint cel = 3 [json_name = "cel"];
    • removeCel

      public MessageConstraints.Builder removeCel(int index)
       `cel` is a repeated field of type Constraint. Each Constraint specifies a validation rule to be applied to this message.
       These constraints are written in 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 `foo` must be greater than 42.
         option (buf.validate.message).cel = {
           id: "my_message.value",
           message: "value must be greater than 42",
           expression: "this.foo > 42",
         };
         optional int32 foo = 1;
       }
       ```
       
      repeated .buf.validate.Constraint cel = 3 [json_name = "cel"];
    • getCelBuilder

      public Constraint.Builder getCelBuilder(int index)
       `cel` is a repeated field of type Constraint. Each Constraint specifies a validation rule to be applied to this message.
       These constraints are written in 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 `foo` must be greater than 42.
         option (buf.validate.message).cel = {
           id: "my_message.value",
           message: "value must be greater than 42",
           expression: "this.foo > 42",
         };
         optional int32 foo = 1;
       }
       ```
       
      repeated .buf.validate.Constraint cel = 3 [json_name = "cel"];
    • getCelOrBuilder

      public ConstraintOrBuilder getCelOrBuilder(int index)
       `cel` is a repeated field of type Constraint. Each Constraint specifies a validation rule to be applied to this message.
       These constraints are written in 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 `foo` must be greater than 42.
         option (buf.validate.message).cel = {
           id: "my_message.value",
           message: "value must be greater than 42",
           expression: "this.foo > 42",
         };
         optional int32 foo = 1;
       }
       ```
       
      repeated .buf.validate.Constraint cel = 3 [json_name = "cel"];
      Specified by:
      getCelOrBuilder in interface MessageConstraintsOrBuilder
    • getCelOrBuilderList

      public List<? extends ConstraintOrBuilder> getCelOrBuilderList()
       `cel` is a repeated field of type Constraint. Each Constraint specifies a validation rule to be applied to this message.
       These constraints are written in 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 `foo` must be greater than 42.
         option (buf.validate.message).cel = {
           id: "my_message.value",
           message: "value must be greater than 42",
           expression: "this.foo > 42",
         };
         optional int32 foo = 1;
       }
       ```
       
      repeated .buf.validate.Constraint cel = 3 [json_name = "cel"];
      Specified by:
      getCelOrBuilderList in interface MessageConstraintsOrBuilder
    • addCelBuilder

      public Constraint.Builder addCelBuilder()
       `cel` is a repeated field of type Constraint. Each Constraint specifies a validation rule to be applied to this message.
       These constraints are written in 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 `foo` must be greater than 42.
         option (buf.validate.message).cel = {
           id: "my_message.value",
           message: "value must be greater than 42",
           expression: "this.foo > 42",
         };
         optional int32 foo = 1;
       }
       ```
       
      repeated .buf.validate.Constraint cel = 3 [json_name = "cel"];
    • addCelBuilder

      public Constraint.Builder addCelBuilder(int index)
       `cel` is a repeated field of type Constraint. Each Constraint specifies a validation rule to be applied to this message.
       These constraints are written in 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 `foo` must be greater than 42.
         option (buf.validate.message).cel = {
           id: "my_message.value",
           message: "value must be greater than 42",
           expression: "this.foo > 42",
         };
         optional int32 foo = 1;
       }
       ```
       
      repeated .buf.validate.Constraint cel = 3 [json_name = "cel"];
    • getCelBuilderList

      public List<Constraint.Builder> getCelBuilderList()
       `cel` is a repeated field of type Constraint. Each Constraint specifies a validation rule to be applied to this message.
       These constraints are written in 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 `foo` must be greater than 42.
         option (buf.validate.message).cel = {
           id: "my_message.value",
           message: "value must be greater than 42",
           expression: "this.foo > 42",
         };
         optional int32 foo = 1;
       }
       ```
       
      repeated .buf.validate.Constraint cel = 3 [json_name = "cel"];
    • setUnknownFields

      public final MessageConstraints.Builder setUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)
      Specified by:
      setUnknownFields in interface com.google.protobuf.Message.Builder
      Overrides:
      setUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<MessageConstraints.Builder>
    • mergeUnknownFields

      public final MessageConstraints.Builder mergeUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)
      Specified by:
      mergeUnknownFields in interface com.google.protobuf.Message.Builder
      Overrides:
      mergeUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<MessageConstraints.Builder>