Class MessageConstraints.Builder

  • All Implemented Interfaces:
    MessageConstraintsOrBuilder, com.google.protobuf.Message.Builder, com.google.protobuf.MessageLite.Builder, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, java.lang.Cloneable
    Enclosing class:
    MessageConstraints

    public static final class MessageConstraints.Builder
    extends com.google.protobuf.GeneratedMessage.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 Detail

      • getDescriptor

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

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

        public 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.GeneratedMessage.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.GeneratedMessage.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
      • 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>
      • isInitialized

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

        public MessageConstraints.Builder mergeFrom​(com.google.protobuf.CodedInputStream input,
                                                    com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                             throws java.io.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:
        java.io.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;
        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;
        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;
        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;
        Returns:
        This builder for chaining.
      • getCelList

        public java.util.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;
        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;
        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;
        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;
      • 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;
      • 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;
      • 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;
      • 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;
      • 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;
      • addAllCel

        public MessageConstraints.Builder addAllCel​(java.lang.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;
      • 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;
      • 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;
      • 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;
      • 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;
        Specified by:
        getCelOrBuilder in interface MessageConstraintsOrBuilder
      • getCelOrBuilderList

        public java.util.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;
        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;
      • 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;
      • getCelBuilderList

        public java.util.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;