Class BytesRules.Builder

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

    public static final class BytesRules.Builder
    extends com.google.protobuf.GeneratedMessage.Builder<BytesRules.Builder>
    implements BytesRulesOrBuilder
     BytesRules describe the constraints applied to `bytes` values. These rules
     may also be applied to the `google.protobuf.BytesValue` Well-Known-Type.
     
    Protobuf type buf.validate.BytesRules
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      BytesRules.Builder addAllIn​(java.lang.Iterable<? extends com.google.protobuf.ByteString> values)
      `in` requires the field value to be equal to one of the specified values.
      BytesRules.Builder addAllNotIn​(java.lang.Iterable<? extends com.google.protobuf.ByteString> values)
      `not_in` requires the field value to be not equal to any of the specified values.
      BytesRules.Builder addIn​(com.google.protobuf.ByteString value)
      `in` requires the field value to be equal to one of the specified values.
      BytesRules.Builder addNotIn​(com.google.protobuf.ByteString value)
      `not_in` requires the field value to be not equal to any of the specified values.
      BytesRules build()  
      BytesRules buildPartial()  
      BytesRules.Builder clear()  
      BytesRules.Builder clearConst()
      `const` requires the field value to exactly match the specified bytes value.
      BytesRules.Builder clearContains()
      `contains` requires the field value to have the specified bytes anywhere in the string.
      BytesRules.Builder clearIn()
      `in` requires the field value to be equal to one of the specified values.
      BytesRules.Builder clearIp()
      `ip` ensures that the field `value` is a valid IP address (v4 or v6) in byte format.
      BytesRules.Builder clearIpv4()
      `ipv4` ensures that the field `value` is a valid IPv4 address in byte format.
      BytesRules.Builder clearIpv6()
      `ipv6` ensures that the field `value` is a valid IPv6 address in byte format.
      BytesRules.Builder clearLen()
      `len` requires the field value to have the specified length in bytes.
      BytesRules.Builder clearMaxLen()
      `max_len` requires the field value to have at most the specified maximum length in bytes.
      BytesRules.Builder clearMinLen()
      `min_len` requires the field value to have at least the specified minimum length in bytes.
      BytesRules.Builder clearNotIn()
      `not_in` requires the field value to be not equal to any of the specified values.
      BytesRules.Builder clearPattern()
      `pattern` requires the field value to match the specified regular expression ([RE2 syntax](https://github.com/google/re2/wiki/Syntax)).
      BytesRules.Builder clearPrefix()
      `prefix` requires the field value to have the specified bytes at the beginning of the string.
      BytesRules.Builder clearSuffix()
      `suffix` requires the field value to have the specified bytes at the end of the string.
      BytesRules.Builder clearWellKnown()  
      com.google.protobuf.ByteString getConst()
      `const` requires the field value to exactly match the specified bytes value.
      com.google.protobuf.ByteString getContains()
      `contains` requires the field value to have the specified bytes anywhere in the string.
      BytesRules getDefaultInstanceForType()  
      static com.google.protobuf.Descriptors.Descriptor getDescriptor()  
      com.google.protobuf.Descriptors.Descriptor getDescriptorForType()  
      com.google.protobuf.ByteString getIn​(int index)
      `in` requires the field value to be equal to one of the specified values.
      int getInCount()
      `in` requires the field value to be equal to one of the specified values.
      java.util.List<com.google.protobuf.ByteString> getInList()
      `in` requires the field value to be equal to one of the specified values.
      boolean getIp()
      `ip` ensures that the field `value` is a valid IP address (v4 or v6) in byte format.
      boolean getIpv4()
      `ipv4` ensures that the field `value` is a valid IPv4 address in byte format.
      boolean getIpv6()
      `ipv6` ensures that the field `value` is a valid IPv6 address in byte format.
      long getLen()
      `len` requires the field value to have the specified length in bytes.
      long getMaxLen()
      `max_len` requires the field value to have at most the specified maximum length in bytes.
      long getMinLen()
      `min_len` requires the field value to have at least the specified minimum length in bytes.
      com.google.protobuf.ByteString getNotIn​(int index)
      `not_in` requires the field value to be not equal to any of the specified values.
      int getNotInCount()
      `not_in` requires the field value to be not equal to any of the specified values.
      java.util.List<com.google.protobuf.ByteString> getNotInList()
      `not_in` requires the field value to be not equal to any of the specified values.
      java.lang.String getPattern()
      `pattern` requires the field value to match the specified regular expression ([RE2 syntax](https://github.com/google/re2/wiki/Syntax)).
      com.google.protobuf.ByteString getPatternBytes()
      `pattern` requires the field value to match the specified regular expression ([RE2 syntax](https://github.com/google/re2/wiki/Syntax)).
      com.google.protobuf.ByteString getPrefix()
      `prefix` requires the field value to have the specified bytes at the beginning of the string.
      com.google.protobuf.ByteString getSuffix()
      `suffix` requires the field value to have the specified bytes at the end of the string.
      BytesRules.WellKnownCase getWellKnownCase()  
      boolean hasConst()
      `const` requires the field value to exactly match the specified bytes value.
      boolean hasContains()
      `contains` requires the field value to have the specified bytes anywhere in the string.
      boolean hasIp()
      `ip` ensures that the field `value` is a valid IP address (v4 or v6) in byte format.
      boolean hasIpv4()
      `ipv4` ensures that the field `value` is a valid IPv4 address in byte format.
      boolean hasIpv6()
      `ipv6` ensures that the field `value` is a valid IPv6 address in byte format.
      boolean hasLen()
      `len` requires the field value to have the specified length in bytes.
      boolean hasMaxLen()
      `max_len` requires the field value to have at most the specified maximum length in bytes.
      boolean hasMinLen()
      `min_len` requires the field value to have at least the specified minimum length in bytes.
      boolean hasPattern()
      `pattern` requires the field value to match the specified regular expression ([RE2 syntax](https://github.com/google/re2/wiki/Syntax)).
      boolean hasPrefix()
      `prefix` requires the field value to have the specified bytes at the beginning of the string.
      boolean hasSuffix()
      `suffix` requires the field value to have the specified bytes at the end of the string.
      protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()  
      boolean isInitialized()  
      BytesRules.Builder mergeFrom​(BytesRules other)  
      BytesRules.Builder mergeFrom​(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)  
      BytesRules.Builder mergeFrom​(com.google.protobuf.Message other)  
      BytesRules.Builder setConst​(com.google.protobuf.ByteString value)
      `const` requires the field value to exactly match the specified bytes value.
      BytesRules.Builder setContains​(com.google.protobuf.ByteString value)
      `contains` requires the field value to have the specified bytes anywhere in the string.
      BytesRules.Builder setIn​(int index, com.google.protobuf.ByteString value)
      `in` requires the field value to be equal to one of the specified values.
      BytesRules.Builder setIp​(boolean value)
      `ip` ensures that the field `value` is a valid IP address (v4 or v6) in byte format.
      BytesRules.Builder setIpv4​(boolean value)
      `ipv4` ensures that the field `value` is a valid IPv4 address in byte format.
      BytesRules.Builder setIpv6​(boolean value)
      `ipv6` ensures that the field `value` is a valid IPv6 address in byte format.
      BytesRules.Builder setLen​(long value)
      `len` requires the field value to have the specified length in bytes.
      BytesRules.Builder setMaxLen​(long value)
      `max_len` requires the field value to have at most the specified maximum length in bytes.
      BytesRules.Builder setMinLen​(long value)
      `min_len` requires the field value to have at least the specified minimum length in bytes.
      BytesRules.Builder setNotIn​(int index, com.google.protobuf.ByteString value)
      `not_in` requires the field value to be not equal to any of the specified values.
      BytesRules.Builder setPattern​(java.lang.String value)
      `pattern` requires the field value to match the specified regular expression ([RE2 syntax](https://github.com/google/re2/wiki/Syntax)).
      BytesRules.Builder setPatternBytes​(com.google.protobuf.ByteString value)
      `pattern` requires the field value to match the specified regular expression ([RE2 syntax](https://github.com/google/re2/wiki/Syntax)).
      BytesRules.Builder setPrefix​(com.google.protobuf.ByteString value)
      `prefix` requires the field value to have the specified bytes at the beginning of the string.
      BytesRules.Builder setSuffix​(com.google.protobuf.ByteString value)
      `suffix` requires the field value to have the specified bytes at the end of the string.
      • Methods inherited from class com.google.protobuf.GeneratedMessage.Builder

        addRepeatedField, clearField, clearOneof, clone, getAllFields, getField, getFieldBuilder, getOneofFieldDescriptor, getParentForChildren, getRepeatedField, getRepeatedFieldBuilder, getRepeatedFieldCount, getUnknownFields, getUnknownFieldSetBuilder, hasField, hasOneof, internalGetMapField, internalGetMapFieldReflection, internalGetMutableMapField, internalGetMutableMapFieldReflection, isClean, markClean, mergeUnknownFields, mergeUnknownLengthDelimitedField, mergeUnknownVarintField, newBuilderForField, onBuilt, onChanged, parseUnknownField, setField, setRepeatedField, setUnknownFields, setUnknownFieldSetBuilder, setUnknownFieldsProto3
      • Methods inherited from class com.google.protobuf.AbstractMessage.Builder

        findInitializationErrors, getInitializationErrorString, internalMergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, newUninitializedMessageException, toString
      • Methods inherited from class com.google.protobuf.AbstractMessageLite.Builder

        addAll, addAll, mergeDelimitedFrom, mergeDelimitedFrom, mergeFrom, newUninitializedMessageException
      • Methods inherited from class java.lang.Object

        equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface com.google.protobuf.Message.Builder

        mergeDelimitedFrom, mergeDelimitedFrom
      • Methods inherited from interface com.google.protobuf.MessageLite.Builder

        mergeFrom
      • Methods inherited from interface com.google.protobuf.MessageOrBuilder

        findInitializationErrors, getAllFields, getField, getInitializationErrorString, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof
    • 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<BytesRules.Builder>
      • clear

        public BytesRules.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<BytesRules.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<BytesRules.Builder>
      • getDefaultInstanceForType

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

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

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

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

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

        public BytesRules.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<BytesRules.Builder>
        Throws:
        java.io.IOException
      • hasConst

        public boolean hasConst()
         `const` requires the field value to exactly match the specified bytes
         value. If the field value doesn't match, an error message is generated.
        
         ```proto
         message MyBytes {
         // value must be "\x01\x02\x03\x04"
         bytes value = 1 [(buf.validate.field).bytes.const = "\x01\x02\x03\x04"];
         }
         ```
         
        optional bytes const = 1 [(.buf.validate.priv.field) = { ... }
        Specified by:
        hasConst in interface BytesRulesOrBuilder
        Returns:
        Whether the const field is set.
      • getConst

        public com.google.protobuf.ByteString getConst()
         `const` requires the field value to exactly match the specified bytes
         value. If the field value doesn't match, an error message is generated.
        
         ```proto
         message MyBytes {
         // value must be "\x01\x02\x03\x04"
         bytes value = 1 [(buf.validate.field).bytes.const = "\x01\x02\x03\x04"];
         }
         ```
         
        optional bytes const = 1 [(.buf.validate.priv.field) = { ... }
        Specified by:
        getConst in interface BytesRulesOrBuilder
        Returns:
        The const.
      • setConst

        public BytesRules.Builder setConst​(com.google.protobuf.ByteString value)
         `const` requires the field value to exactly match the specified bytes
         value. If the field value doesn't match, an error message is generated.
        
         ```proto
         message MyBytes {
         // value must be "\x01\x02\x03\x04"
         bytes value = 1 [(buf.validate.field).bytes.const = "\x01\x02\x03\x04"];
         }
         ```
         
        optional bytes const = 1 [(.buf.validate.priv.field) = { ... }
        Parameters:
        value - The const to set.
        Returns:
        This builder for chaining.
      • clearConst

        public BytesRules.Builder clearConst()
         `const` requires the field value to exactly match the specified bytes
         value. If the field value doesn't match, an error message is generated.
        
         ```proto
         message MyBytes {
         // value must be "\x01\x02\x03\x04"
         bytes value = 1 [(buf.validate.field).bytes.const = "\x01\x02\x03\x04"];
         }
         ```
         
        optional bytes const = 1 [(.buf.validate.priv.field) = { ... }
        Returns:
        This builder for chaining.
      • hasLen

        public boolean hasLen()
         `len` requires the field value to have the specified length in bytes.
         If the field value doesn't match, an error message is generated.
        
         ```proto
         message MyBytes {
         // value length must be 4 bytes.
         optional bytes value = 1 [(buf.validate.field).bytes.len = 4];
         }
         ```
         
        optional uint64 len = 13 [(.buf.validate.priv.field) = { ... }
        Specified by:
        hasLen in interface BytesRulesOrBuilder
        Returns:
        Whether the len field is set.
      • getLen

        public long getLen()
         `len` requires the field value to have the specified length in bytes.
         If the field value doesn't match, an error message is generated.
        
         ```proto
         message MyBytes {
         // value length must be 4 bytes.
         optional bytes value = 1 [(buf.validate.field).bytes.len = 4];
         }
         ```
         
        optional uint64 len = 13 [(.buf.validate.priv.field) = { ... }
        Specified by:
        getLen in interface BytesRulesOrBuilder
        Returns:
        The len.
      • setLen

        public BytesRules.Builder setLen​(long value)
         `len` requires the field value to have the specified length in bytes.
         If the field value doesn't match, an error message is generated.
        
         ```proto
         message MyBytes {
         // value length must be 4 bytes.
         optional bytes value = 1 [(buf.validate.field).bytes.len = 4];
         }
         ```
         
        optional uint64 len = 13 [(.buf.validate.priv.field) = { ... }
        Parameters:
        value - The len to set.
        Returns:
        This builder for chaining.
      • clearLen

        public BytesRules.Builder clearLen()
         `len` requires the field value to have the specified length in bytes.
         If the field value doesn't match, an error message is generated.
        
         ```proto
         message MyBytes {
         // value length must be 4 bytes.
         optional bytes value = 1 [(buf.validate.field).bytes.len = 4];
         }
         ```
         
        optional uint64 len = 13 [(.buf.validate.priv.field) = { ... }
        Returns:
        This builder for chaining.
      • hasMinLen

        public boolean hasMinLen()
         `min_len` requires the field value to have at least the specified minimum
         length in bytes.
         If the field value doesn't meet the requirement, an error message is generated.
        
         ```proto
         message MyBytes {
         // value length must be at least 2 bytes.
         optional bytes value = 1 [(buf.validate.field).bytes.min_len = 2];
         }
         ```
         
        optional uint64 min_len = 2 [(.buf.validate.priv.field) = { ... }
        Specified by:
        hasMinLen in interface BytesRulesOrBuilder
        Returns:
        Whether the minLen field is set.
      • getMinLen

        public long getMinLen()
         `min_len` requires the field value to have at least the specified minimum
         length in bytes.
         If the field value doesn't meet the requirement, an error message is generated.
        
         ```proto
         message MyBytes {
         // value length must be at least 2 bytes.
         optional bytes value = 1 [(buf.validate.field).bytes.min_len = 2];
         }
         ```
         
        optional uint64 min_len = 2 [(.buf.validate.priv.field) = { ... }
        Specified by:
        getMinLen in interface BytesRulesOrBuilder
        Returns:
        The minLen.
      • setMinLen

        public BytesRules.Builder setMinLen​(long value)
         `min_len` requires the field value to have at least the specified minimum
         length in bytes.
         If the field value doesn't meet the requirement, an error message is generated.
        
         ```proto
         message MyBytes {
         // value length must be at least 2 bytes.
         optional bytes value = 1 [(buf.validate.field).bytes.min_len = 2];
         }
         ```
         
        optional uint64 min_len = 2 [(.buf.validate.priv.field) = { ... }
        Parameters:
        value - The minLen to set.
        Returns:
        This builder for chaining.
      • clearMinLen

        public BytesRules.Builder clearMinLen()
         `min_len` requires the field value to have at least the specified minimum
         length in bytes.
         If the field value doesn't meet the requirement, an error message is generated.
        
         ```proto
         message MyBytes {
         // value length must be at least 2 bytes.
         optional bytes value = 1 [(buf.validate.field).bytes.min_len = 2];
         }
         ```
         
        optional uint64 min_len = 2 [(.buf.validate.priv.field) = { ... }
        Returns:
        This builder for chaining.
      • hasMaxLen

        public boolean hasMaxLen()
         `max_len` requires the field value to have at most the specified maximum
         length in bytes.
         If the field value exceeds the requirement, an error message is generated.
        
         ```proto
         message MyBytes {
         // value must be at most 6 bytes.
         optional bytes value = 1 [(buf.validate.field).bytes.max_len = 6];
         }
         ```
         
        optional uint64 max_len = 3 [(.buf.validate.priv.field) = { ... }
        Specified by:
        hasMaxLen in interface BytesRulesOrBuilder
        Returns:
        Whether the maxLen field is set.
      • getMaxLen

        public long getMaxLen()
         `max_len` requires the field value to have at most the specified maximum
         length in bytes.
         If the field value exceeds the requirement, an error message is generated.
        
         ```proto
         message MyBytes {
         // value must be at most 6 bytes.
         optional bytes value = 1 [(buf.validate.field).bytes.max_len = 6];
         }
         ```
         
        optional uint64 max_len = 3 [(.buf.validate.priv.field) = { ... }
        Specified by:
        getMaxLen in interface BytesRulesOrBuilder
        Returns:
        The maxLen.
      • setMaxLen

        public BytesRules.Builder setMaxLen​(long value)
         `max_len` requires the field value to have at most the specified maximum
         length in bytes.
         If the field value exceeds the requirement, an error message is generated.
        
         ```proto
         message MyBytes {
         // value must be at most 6 bytes.
         optional bytes value = 1 [(buf.validate.field).bytes.max_len = 6];
         }
         ```
         
        optional uint64 max_len = 3 [(.buf.validate.priv.field) = { ... }
        Parameters:
        value - The maxLen to set.
        Returns:
        This builder for chaining.
      • clearMaxLen

        public BytesRules.Builder clearMaxLen()
         `max_len` requires the field value to have at most the specified maximum
         length in bytes.
         If the field value exceeds the requirement, an error message is generated.
        
         ```proto
         message MyBytes {
         // value must be at most 6 bytes.
         optional bytes value = 1 [(buf.validate.field).bytes.max_len = 6];
         }
         ```
         
        optional uint64 max_len = 3 [(.buf.validate.priv.field) = { ... }
        Returns:
        This builder for chaining.
      • hasPattern

        public boolean hasPattern()
         `pattern` requires the field value to match the specified regular
         expression ([RE2 syntax](https://github.com/google/re2/wiki/Syntax)).
         The value of the field must be valid UTF-8 or validation will fail with a
         runtime error.
         If the field value doesn't match the pattern, an error message is generated.
        
         ```proto
         message MyBytes {
         // value must match regex pattern "^[a-zA-Z0-9]+$".
         optional bytes value = 1 [(buf.validate.field).bytes.pattern = "^[a-zA-Z0-9]+$"];
         }
         ```
         
        optional string pattern = 4 [(.buf.validate.priv.field) = { ... }
        Specified by:
        hasPattern in interface BytesRulesOrBuilder
        Returns:
        Whether the pattern field is set.
      • getPattern

        public java.lang.String getPattern()
         `pattern` requires the field value to match the specified regular
         expression ([RE2 syntax](https://github.com/google/re2/wiki/Syntax)).
         The value of the field must be valid UTF-8 or validation will fail with a
         runtime error.
         If the field value doesn't match the pattern, an error message is generated.
        
         ```proto
         message MyBytes {
         // value must match regex pattern "^[a-zA-Z0-9]+$".
         optional bytes value = 1 [(buf.validate.field).bytes.pattern = "^[a-zA-Z0-9]+$"];
         }
         ```
         
        optional string pattern = 4 [(.buf.validate.priv.field) = { ... }
        Specified by:
        getPattern in interface BytesRulesOrBuilder
        Returns:
        The pattern.
      • getPatternBytes

        public com.google.protobuf.ByteString getPatternBytes()
         `pattern` requires the field value to match the specified regular
         expression ([RE2 syntax](https://github.com/google/re2/wiki/Syntax)).
         The value of the field must be valid UTF-8 or validation will fail with a
         runtime error.
         If the field value doesn't match the pattern, an error message is generated.
        
         ```proto
         message MyBytes {
         // value must match regex pattern "^[a-zA-Z0-9]+$".
         optional bytes value = 1 [(buf.validate.field).bytes.pattern = "^[a-zA-Z0-9]+$"];
         }
         ```
         
        optional string pattern = 4 [(.buf.validate.priv.field) = { ... }
        Specified by:
        getPatternBytes in interface BytesRulesOrBuilder
        Returns:
        The bytes for pattern.
      • setPattern

        public BytesRules.Builder setPattern​(java.lang.String value)
         `pattern` requires the field value to match the specified regular
         expression ([RE2 syntax](https://github.com/google/re2/wiki/Syntax)).
         The value of the field must be valid UTF-8 or validation will fail with a
         runtime error.
         If the field value doesn't match the pattern, an error message is generated.
        
         ```proto
         message MyBytes {
         // value must match regex pattern "^[a-zA-Z0-9]+$".
         optional bytes value = 1 [(buf.validate.field).bytes.pattern = "^[a-zA-Z0-9]+$"];
         }
         ```
         
        optional string pattern = 4 [(.buf.validate.priv.field) = { ... }
        Parameters:
        value - The pattern to set.
        Returns:
        This builder for chaining.
      • clearPattern

        public BytesRules.Builder clearPattern()
         `pattern` requires the field value to match the specified regular
         expression ([RE2 syntax](https://github.com/google/re2/wiki/Syntax)).
         The value of the field must be valid UTF-8 or validation will fail with a
         runtime error.
         If the field value doesn't match the pattern, an error message is generated.
        
         ```proto
         message MyBytes {
         // value must match regex pattern "^[a-zA-Z0-9]+$".
         optional bytes value = 1 [(buf.validate.field).bytes.pattern = "^[a-zA-Z0-9]+$"];
         }
         ```
         
        optional string pattern = 4 [(.buf.validate.priv.field) = { ... }
        Returns:
        This builder for chaining.
      • setPatternBytes

        public BytesRules.Builder setPatternBytes​(com.google.protobuf.ByteString value)
         `pattern` requires the field value to match the specified regular
         expression ([RE2 syntax](https://github.com/google/re2/wiki/Syntax)).
         The value of the field must be valid UTF-8 or validation will fail with a
         runtime error.
         If the field value doesn't match the pattern, an error message is generated.
        
         ```proto
         message MyBytes {
         // value must match regex pattern "^[a-zA-Z0-9]+$".
         optional bytes value = 1 [(buf.validate.field).bytes.pattern = "^[a-zA-Z0-9]+$"];
         }
         ```
         
        optional string pattern = 4 [(.buf.validate.priv.field) = { ... }
        Parameters:
        value - The bytes for pattern to set.
        Returns:
        This builder for chaining.
      • hasPrefix

        public boolean hasPrefix()
         `prefix` requires the field value to have the specified bytes at the
         beginning of the string.
         If the field value doesn't meet the requirement, an error message is generated.
        
         ```proto
         message MyBytes {
         // value does not have prefix \x01\x02
         optional bytes value = 1 [(buf.validate.field).bytes.prefix = "\x01\x02"];
         }
         ```
         
        optional bytes prefix = 5 [(.buf.validate.priv.field) = { ... }
        Specified by:
        hasPrefix in interface BytesRulesOrBuilder
        Returns:
        Whether the prefix field is set.
      • getPrefix

        public com.google.protobuf.ByteString getPrefix()
         `prefix` requires the field value to have the specified bytes at the
         beginning of the string.
         If the field value doesn't meet the requirement, an error message is generated.
        
         ```proto
         message MyBytes {
         // value does not have prefix \x01\x02
         optional bytes value = 1 [(buf.validate.field).bytes.prefix = "\x01\x02"];
         }
         ```
         
        optional bytes prefix = 5 [(.buf.validate.priv.field) = { ... }
        Specified by:
        getPrefix in interface BytesRulesOrBuilder
        Returns:
        The prefix.
      • setPrefix

        public BytesRules.Builder setPrefix​(com.google.protobuf.ByteString value)
         `prefix` requires the field value to have the specified bytes at the
         beginning of the string.
         If the field value doesn't meet the requirement, an error message is generated.
        
         ```proto
         message MyBytes {
         // value does not have prefix \x01\x02
         optional bytes value = 1 [(buf.validate.field).bytes.prefix = "\x01\x02"];
         }
         ```
         
        optional bytes prefix = 5 [(.buf.validate.priv.field) = { ... }
        Parameters:
        value - The prefix to set.
        Returns:
        This builder for chaining.
      • clearPrefix

        public BytesRules.Builder clearPrefix()
         `prefix` requires the field value to have the specified bytes at the
         beginning of the string.
         If the field value doesn't meet the requirement, an error message is generated.
        
         ```proto
         message MyBytes {
         // value does not have prefix \x01\x02
         optional bytes value = 1 [(buf.validate.field).bytes.prefix = "\x01\x02"];
         }
         ```
         
        optional bytes prefix = 5 [(.buf.validate.priv.field) = { ... }
        Returns:
        This builder for chaining.
      • hasSuffix

        public boolean hasSuffix()
         `suffix` requires the field value to have the specified bytes at the end
         of the string.
         If the field value doesn't meet the requirement, an error message is generated.
        
         ```proto
         message MyBytes {
         // value does not have suffix \x03\x04
         optional bytes value = 1 [(buf.validate.field).bytes.suffix = "\x03\x04"];
         }
         ```
         
        optional bytes suffix = 6 [(.buf.validate.priv.field) = { ... }
        Specified by:
        hasSuffix in interface BytesRulesOrBuilder
        Returns:
        Whether the suffix field is set.
      • getSuffix

        public com.google.protobuf.ByteString getSuffix()
         `suffix` requires the field value to have the specified bytes at the end
         of the string.
         If the field value doesn't meet the requirement, an error message is generated.
        
         ```proto
         message MyBytes {
         // value does not have suffix \x03\x04
         optional bytes value = 1 [(buf.validate.field).bytes.suffix = "\x03\x04"];
         }
         ```
         
        optional bytes suffix = 6 [(.buf.validate.priv.field) = { ... }
        Specified by:
        getSuffix in interface BytesRulesOrBuilder
        Returns:
        The suffix.
      • setSuffix

        public BytesRules.Builder setSuffix​(com.google.protobuf.ByteString value)
         `suffix` requires the field value to have the specified bytes at the end
         of the string.
         If the field value doesn't meet the requirement, an error message is generated.
        
         ```proto
         message MyBytes {
         // value does not have suffix \x03\x04
         optional bytes value = 1 [(buf.validate.field).bytes.suffix = "\x03\x04"];
         }
         ```
         
        optional bytes suffix = 6 [(.buf.validate.priv.field) = { ... }
        Parameters:
        value - The suffix to set.
        Returns:
        This builder for chaining.
      • clearSuffix

        public BytesRules.Builder clearSuffix()
         `suffix` requires the field value to have the specified bytes at the end
         of the string.
         If the field value doesn't meet the requirement, an error message is generated.
        
         ```proto
         message MyBytes {
         // value does not have suffix \x03\x04
         optional bytes value = 1 [(buf.validate.field).bytes.suffix = "\x03\x04"];
         }
         ```
         
        optional bytes suffix = 6 [(.buf.validate.priv.field) = { ... }
        Returns:
        This builder for chaining.
      • hasContains

        public boolean hasContains()
         `contains` requires the field value to have the specified bytes anywhere in
         the string.
         If the field value doesn't meet the requirement, an error message is generated.
        
         ```protobuf
         message MyBytes {
         // value does not contain \x02\x03
         optional bytes value = 1 [(buf.validate.field).bytes.contains = "\x02\x03"];
         }
         ```
         
        optional bytes contains = 7 [(.buf.validate.priv.field) = { ... }
        Specified by:
        hasContains in interface BytesRulesOrBuilder
        Returns:
        Whether the contains field is set.
      • getContains

        public com.google.protobuf.ByteString getContains()
         `contains` requires the field value to have the specified bytes anywhere in
         the string.
         If the field value doesn't meet the requirement, an error message is generated.
        
         ```protobuf
         message MyBytes {
         // value does not contain \x02\x03
         optional bytes value = 1 [(buf.validate.field).bytes.contains = "\x02\x03"];
         }
         ```
         
        optional bytes contains = 7 [(.buf.validate.priv.field) = { ... }
        Specified by:
        getContains in interface BytesRulesOrBuilder
        Returns:
        The contains.
      • setContains

        public BytesRules.Builder setContains​(com.google.protobuf.ByteString value)
         `contains` requires the field value to have the specified bytes anywhere in
         the string.
         If the field value doesn't meet the requirement, an error message is generated.
        
         ```protobuf
         message MyBytes {
         // value does not contain \x02\x03
         optional bytes value = 1 [(buf.validate.field).bytes.contains = "\x02\x03"];
         }
         ```
         
        optional bytes contains = 7 [(.buf.validate.priv.field) = { ... }
        Parameters:
        value - The contains to set.
        Returns:
        This builder for chaining.
      • clearContains

        public BytesRules.Builder clearContains()
         `contains` requires the field value to have the specified bytes anywhere in
         the string.
         If the field value doesn't meet the requirement, an error message is generated.
        
         ```protobuf
         message MyBytes {
         // value does not contain \x02\x03
         optional bytes value = 1 [(buf.validate.field).bytes.contains = "\x02\x03"];
         }
         ```
         
        optional bytes contains = 7 [(.buf.validate.priv.field) = { ... }
        Returns:
        This builder for chaining.
      • getInList

        public java.util.List<com.google.protobuf.ByteString> getInList()
         `in` requires the field value to be equal to one of the specified
         values. If the field value doesn't match any of the specified values, an
         error message is generated.
        
         ```protobuf
         message MyBytes {
         // value must in ["\x01\x02", "\x02\x03", "\x03\x04"]
         optional bytes value = 1 [(buf.validate.field).bytes.in = {"\x01\x02", "\x02\x03", "\x03\x04"}];
         }
         ```
         
        repeated bytes in = 8 [(.buf.validate.priv.field) = { ... }
        Specified by:
        getInList in interface BytesRulesOrBuilder
        Returns:
        A list containing the in.
      • getInCount

        public int getInCount()
         `in` requires the field value to be equal to one of the specified
         values. If the field value doesn't match any of the specified values, an
         error message is generated.
        
         ```protobuf
         message MyBytes {
         // value must in ["\x01\x02", "\x02\x03", "\x03\x04"]
         optional bytes value = 1 [(buf.validate.field).bytes.in = {"\x01\x02", "\x02\x03", "\x03\x04"}];
         }
         ```
         
        repeated bytes in = 8 [(.buf.validate.priv.field) = { ... }
        Specified by:
        getInCount in interface BytesRulesOrBuilder
        Returns:
        The count of in.
      • getIn

        public com.google.protobuf.ByteString getIn​(int index)
         `in` requires the field value to be equal to one of the specified
         values. If the field value doesn't match any of the specified values, an
         error message is generated.
        
         ```protobuf
         message MyBytes {
         // value must in ["\x01\x02", "\x02\x03", "\x03\x04"]
         optional bytes value = 1 [(buf.validate.field).bytes.in = {"\x01\x02", "\x02\x03", "\x03\x04"}];
         }
         ```
         
        repeated bytes in = 8 [(.buf.validate.priv.field) = { ... }
        Specified by:
        getIn in interface BytesRulesOrBuilder
        Parameters:
        index - The index of the element to return.
        Returns:
        The in at the given index.
      • setIn

        public BytesRules.Builder setIn​(int index,
                                        com.google.protobuf.ByteString value)
         `in` requires the field value to be equal to one of the specified
         values. If the field value doesn't match any of the specified values, an
         error message is generated.
        
         ```protobuf
         message MyBytes {
         // value must in ["\x01\x02", "\x02\x03", "\x03\x04"]
         optional bytes value = 1 [(buf.validate.field).bytes.in = {"\x01\x02", "\x02\x03", "\x03\x04"}];
         }
         ```
         
        repeated bytes in = 8 [(.buf.validate.priv.field) = { ... }
        Parameters:
        index - The index to set the value at.
        value - The in to set.
        Returns:
        This builder for chaining.
      • addIn

        public BytesRules.Builder addIn​(com.google.protobuf.ByteString value)
         `in` requires the field value to be equal to one of the specified
         values. If the field value doesn't match any of the specified values, an
         error message is generated.
        
         ```protobuf
         message MyBytes {
         // value must in ["\x01\x02", "\x02\x03", "\x03\x04"]
         optional bytes value = 1 [(buf.validate.field).bytes.in = {"\x01\x02", "\x02\x03", "\x03\x04"}];
         }
         ```
         
        repeated bytes in = 8 [(.buf.validate.priv.field) = { ... }
        Parameters:
        value - The in to add.
        Returns:
        This builder for chaining.
      • addAllIn

        public BytesRules.Builder addAllIn​(java.lang.Iterable<? extends com.google.protobuf.ByteString> values)
         `in` requires the field value to be equal to one of the specified
         values. If the field value doesn't match any of the specified values, an
         error message is generated.
        
         ```protobuf
         message MyBytes {
         // value must in ["\x01\x02", "\x02\x03", "\x03\x04"]
         optional bytes value = 1 [(buf.validate.field).bytes.in = {"\x01\x02", "\x02\x03", "\x03\x04"}];
         }
         ```
         
        repeated bytes in = 8 [(.buf.validate.priv.field) = { ... }
        Parameters:
        values - The in to add.
        Returns:
        This builder for chaining.
      • clearIn

        public BytesRules.Builder clearIn()
         `in` requires the field value to be equal to one of the specified
         values. If the field value doesn't match any of the specified values, an
         error message is generated.
        
         ```protobuf
         message MyBytes {
         // value must in ["\x01\x02", "\x02\x03", "\x03\x04"]
         optional bytes value = 1 [(buf.validate.field).bytes.in = {"\x01\x02", "\x02\x03", "\x03\x04"}];
         }
         ```
         
        repeated bytes in = 8 [(.buf.validate.priv.field) = { ... }
        Returns:
        This builder for chaining.
      • getNotInList

        public java.util.List<com.google.protobuf.ByteString> getNotInList()
         `not_in` requires the field value to be not equal to any of the specified
         values.
         If the field value matches any of the specified values, an error message is
         generated.
        
         ```proto
         message MyBytes {
         // value must not in ["\x01\x02", "\x02\x03", "\x03\x04"]
         optional bytes value = 1 [(buf.validate.field).bytes.not_in = {"\x01\x02", "\x02\x03", "\x03\x04"}];
         }
         ```
         
        repeated bytes not_in = 9 [(.buf.validate.priv.field) = { ... }
        Specified by:
        getNotInList in interface BytesRulesOrBuilder
        Returns:
        A list containing the notIn.
      • getNotInCount

        public int getNotInCount()
         `not_in` requires the field value to be not equal to any of the specified
         values.
         If the field value matches any of the specified values, an error message is
         generated.
        
         ```proto
         message MyBytes {
         // value must not in ["\x01\x02", "\x02\x03", "\x03\x04"]
         optional bytes value = 1 [(buf.validate.field).bytes.not_in = {"\x01\x02", "\x02\x03", "\x03\x04"}];
         }
         ```
         
        repeated bytes not_in = 9 [(.buf.validate.priv.field) = { ... }
        Specified by:
        getNotInCount in interface BytesRulesOrBuilder
        Returns:
        The count of notIn.
      • getNotIn

        public com.google.protobuf.ByteString getNotIn​(int index)
         `not_in` requires the field value to be not equal to any of the specified
         values.
         If the field value matches any of the specified values, an error message is
         generated.
        
         ```proto
         message MyBytes {
         // value must not in ["\x01\x02", "\x02\x03", "\x03\x04"]
         optional bytes value = 1 [(buf.validate.field).bytes.not_in = {"\x01\x02", "\x02\x03", "\x03\x04"}];
         }
         ```
         
        repeated bytes not_in = 9 [(.buf.validate.priv.field) = { ... }
        Specified by:
        getNotIn in interface BytesRulesOrBuilder
        Parameters:
        index - The index of the element to return.
        Returns:
        The notIn at the given index.
      • setNotIn

        public BytesRules.Builder setNotIn​(int index,
                                           com.google.protobuf.ByteString value)
         `not_in` requires the field value to be not equal to any of the specified
         values.
         If the field value matches any of the specified values, an error message is
         generated.
        
         ```proto
         message MyBytes {
         // value must not in ["\x01\x02", "\x02\x03", "\x03\x04"]
         optional bytes value = 1 [(buf.validate.field).bytes.not_in = {"\x01\x02", "\x02\x03", "\x03\x04"}];
         }
         ```
         
        repeated bytes not_in = 9 [(.buf.validate.priv.field) = { ... }
        Parameters:
        index - The index to set the value at.
        value - The notIn to set.
        Returns:
        This builder for chaining.
      • addNotIn

        public BytesRules.Builder addNotIn​(com.google.protobuf.ByteString value)
         `not_in` requires the field value to be not equal to any of the specified
         values.
         If the field value matches any of the specified values, an error message is
         generated.
        
         ```proto
         message MyBytes {
         // value must not in ["\x01\x02", "\x02\x03", "\x03\x04"]
         optional bytes value = 1 [(buf.validate.field).bytes.not_in = {"\x01\x02", "\x02\x03", "\x03\x04"}];
         }
         ```
         
        repeated bytes not_in = 9 [(.buf.validate.priv.field) = { ... }
        Parameters:
        value - The notIn to add.
        Returns:
        This builder for chaining.
      • addAllNotIn

        public BytesRules.Builder addAllNotIn​(java.lang.Iterable<? extends com.google.protobuf.ByteString> values)
         `not_in` requires the field value to be not equal to any of the specified
         values.
         If the field value matches any of the specified values, an error message is
         generated.
        
         ```proto
         message MyBytes {
         // value must not in ["\x01\x02", "\x02\x03", "\x03\x04"]
         optional bytes value = 1 [(buf.validate.field).bytes.not_in = {"\x01\x02", "\x02\x03", "\x03\x04"}];
         }
         ```
         
        repeated bytes not_in = 9 [(.buf.validate.priv.field) = { ... }
        Parameters:
        values - The notIn to add.
        Returns:
        This builder for chaining.
      • clearNotIn

        public BytesRules.Builder clearNotIn()
         `not_in` requires the field value to be not equal to any of the specified
         values.
         If the field value matches any of the specified values, an error message is
         generated.
        
         ```proto
         message MyBytes {
         // value must not in ["\x01\x02", "\x02\x03", "\x03\x04"]
         optional bytes value = 1 [(buf.validate.field).bytes.not_in = {"\x01\x02", "\x02\x03", "\x03\x04"}];
         }
         ```
         
        repeated bytes not_in = 9 [(.buf.validate.priv.field) = { ... }
        Returns:
        This builder for chaining.
      • hasIp

        public boolean hasIp()
         `ip` ensures that the field `value` is a valid IP address (v4 or v6) in byte format.
         If the field value doesn't meet this constraint, an error message is generated.
        
         ```proto
         message MyBytes {
         // value must be a valid IP address
         optional bytes value = 1 [(buf.validate.field).bytes.ip = true];
         }
         ```
         
        bool ip = 10 [(.buf.validate.priv.field) = { ... }
        Specified by:
        hasIp in interface BytesRulesOrBuilder
        Returns:
        Whether the ip field is set.
      • getIp

        public boolean getIp()
         `ip` ensures that the field `value` is a valid IP address (v4 or v6) in byte format.
         If the field value doesn't meet this constraint, an error message is generated.
        
         ```proto
         message MyBytes {
         // value must be a valid IP address
         optional bytes value = 1 [(buf.validate.field).bytes.ip = true];
         }
         ```
         
        bool ip = 10 [(.buf.validate.priv.field) = { ... }
        Specified by:
        getIp in interface BytesRulesOrBuilder
        Returns:
        The ip.
      • setIp

        public BytesRules.Builder setIp​(boolean value)
         `ip` ensures that the field `value` is a valid IP address (v4 or v6) in byte format.
         If the field value doesn't meet this constraint, an error message is generated.
        
         ```proto
         message MyBytes {
         // value must be a valid IP address
         optional bytes value = 1 [(buf.validate.field).bytes.ip = true];
         }
         ```
         
        bool ip = 10 [(.buf.validate.priv.field) = { ... }
        Parameters:
        value - The ip to set.
        Returns:
        This builder for chaining.
      • clearIp

        public BytesRules.Builder clearIp()
         `ip` ensures that the field `value` is a valid IP address (v4 or v6) in byte format.
         If the field value doesn't meet this constraint, an error message is generated.
        
         ```proto
         message MyBytes {
         // value must be a valid IP address
         optional bytes value = 1 [(buf.validate.field).bytes.ip = true];
         }
         ```
         
        bool ip = 10 [(.buf.validate.priv.field) = { ... }
        Returns:
        This builder for chaining.
      • hasIpv4

        public boolean hasIpv4()
         `ipv4` ensures that the field `value` is a valid IPv4 address in byte format.
         If the field value doesn't meet this constraint, an error message is generated.
        
         ```proto
         message MyBytes {
         // value must be a valid IPv4 address
         optional bytes value = 1 [(buf.validate.field).bytes.ipv4 = true];
         }
         ```
         
        bool ipv4 = 11 [(.buf.validate.priv.field) = { ... }
        Specified by:
        hasIpv4 in interface BytesRulesOrBuilder
        Returns:
        Whether the ipv4 field is set.
      • getIpv4

        public boolean getIpv4()
         `ipv4` ensures that the field `value` is a valid IPv4 address in byte format.
         If the field value doesn't meet this constraint, an error message is generated.
        
         ```proto
         message MyBytes {
         // value must be a valid IPv4 address
         optional bytes value = 1 [(buf.validate.field).bytes.ipv4 = true];
         }
         ```
         
        bool ipv4 = 11 [(.buf.validate.priv.field) = { ... }
        Specified by:
        getIpv4 in interface BytesRulesOrBuilder
        Returns:
        The ipv4.
      • setIpv4

        public BytesRules.Builder setIpv4​(boolean value)
         `ipv4` ensures that the field `value` is a valid IPv4 address in byte format.
         If the field value doesn't meet this constraint, an error message is generated.
        
         ```proto
         message MyBytes {
         // value must be a valid IPv4 address
         optional bytes value = 1 [(buf.validate.field).bytes.ipv4 = true];
         }
         ```
         
        bool ipv4 = 11 [(.buf.validate.priv.field) = { ... }
        Parameters:
        value - The ipv4 to set.
        Returns:
        This builder for chaining.
      • clearIpv4

        public BytesRules.Builder clearIpv4()
         `ipv4` ensures that the field `value` is a valid IPv4 address in byte format.
         If the field value doesn't meet this constraint, an error message is generated.
        
         ```proto
         message MyBytes {
         // value must be a valid IPv4 address
         optional bytes value = 1 [(buf.validate.field).bytes.ipv4 = true];
         }
         ```
         
        bool ipv4 = 11 [(.buf.validate.priv.field) = { ... }
        Returns:
        This builder for chaining.
      • hasIpv6

        public boolean hasIpv6()
         `ipv6` ensures that the field `value` is a valid IPv6 address in byte format.
         If the field value doesn't meet this constraint, an error message is generated.
         ```proto
         message MyBytes {
         // value must be a valid IPv6 address
         optional bytes value = 1 [(buf.validate.field).bytes.ipv6 = true];
         }
         ```
         
        bool ipv6 = 12 [(.buf.validate.priv.field) = { ... }
        Specified by:
        hasIpv6 in interface BytesRulesOrBuilder
        Returns:
        Whether the ipv6 field is set.
      • getIpv6

        public boolean getIpv6()
         `ipv6` ensures that the field `value` is a valid IPv6 address in byte format.
         If the field value doesn't meet this constraint, an error message is generated.
         ```proto
         message MyBytes {
         // value must be a valid IPv6 address
         optional bytes value = 1 [(buf.validate.field).bytes.ipv6 = true];
         }
         ```
         
        bool ipv6 = 12 [(.buf.validate.priv.field) = { ... }
        Specified by:
        getIpv6 in interface BytesRulesOrBuilder
        Returns:
        The ipv6.
      • setIpv6

        public BytesRules.Builder setIpv6​(boolean value)
         `ipv6` ensures that the field `value` is a valid IPv6 address in byte format.
         If the field value doesn't meet this constraint, an error message is generated.
         ```proto
         message MyBytes {
         // value must be a valid IPv6 address
         optional bytes value = 1 [(buf.validate.field).bytes.ipv6 = true];
         }
         ```
         
        bool ipv6 = 12 [(.buf.validate.priv.field) = { ... }
        Parameters:
        value - The ipv6 to set.
        Returns:
        This builder for chaining.
      • clearIpv6

        public BytesRules.Builder clearIpv6()
         `ipv6` ensures that the field `value` is a valid IPv6 address in byte format.
         If the field value doesn't meet this constraint, an error message is generated.
         ```proto
         message MyBytes {
         // value must be a valid IPv6 address
         optional bytes value = 1 [(buf.validate.field).bytes.ipv6 = true];
         }
         ```
         
        bool ipv6 = 12 [(.buf.validate.priv.field) = { ... }
        Returns:
        This builder for chaining.