build.buf.validate.RepeatedRules Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of protovalidate Show documentation
Show all versions of protovalidate Show documentation
Protocol Buffer Validation
The newest version!
// Generated by the protocol buffer compiler. DO NOT EDIT!
// NO CHECKED-IN PROTOBUF GENCODE
// source: buf/validate/validate.proto
// Protobuf Java Version: 4.28.1
package build.buf.validate;
/**
*
* RepeatedRules describe the constraints applied to `repeated` values.
*
*
* Protobuf type {@code buf.validate.RepeatedRules}
*/
public final class RepeatedRules extends
com.google.protobuf.GeneratedMessage implements
// @@protoc_insertion_point(message_implements:buf.validate.RepeatedRules)
RepeatedRulesOrBuilder {
private static final long serialVersionUID = 0L;
static {
com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
/* major= */ 4,
/* minor= */ 28,
/* patch= */ 1,
/* suffix= */ "",
RepeatedRules.class.getName());
}
// Use RepeatedRules.newBuilder() to construct.
private RepeatedRules(com.google.protobuf.GeneratedMessage.Builder> builder) {
super(builder);
}
private RepeatedRules() {
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return build.buf.validate.ValidateProto.internal_static_buf_validate_RepeatedRules_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return build.buf.validate.ValidateProto.internal_static_buf_validate_RepeatedRules_fieldAccessorTable
.ensureFieldAccessorsInitialized(
build.buf.validate.RepeatedRules.class, build.buf.validate.RepeatedRules.Builder.class);
}
private int bitField0_;
public static final int MIN_ITEMS_FIELD_NUMBER = 1;
private long minItems_ = 0L;
/**
*
* `min_items` requires that this field must contain at least the specified
* minimum number of items.
*
* Note that `min_items = 1` is equivalent to setting a field as `required`.
*
* ```proto
* message MyRepeated {
* // value must contain at least 2 items
* repeated string value = 1 [(buf.validate.field).repeated.min_items = 2];
* }
* ```
*
*
* optional uint64 min_items = 1 [json_name = "minItems", (.buf.validate.priv.field) = { ... }
* @return Whether the minItems field is set.
*/
@java.lang.Override
public boolean hasMinItems() {
return ((bitField0_ & 0x00000001) != 0);
}
/**
*
* `min_items` requires that this field must contain at least the specified
* minimum number of items.
*
* Note that `min_items = 1` is equivalent to setting a field as `required`.
*
* ```proto
* message MyRepeated {
* // value must contain at least 2 items
* repeated string value = 1 [(buf.validate.field).repeated.min_items = 2];
* }
* ```
*
*
* optional uint64 min_items = 1 [json_name = "minItems", (.buf.validate.priv.field) = { ... }
* @return The minItems.
*/
@java.lang.Override
public long getMinItems() {
return minItems_;
}
public static final int MAX_ITEMS_FIELD_NUMBER = 2;
private long maxItems_ = 0L;
/**
*
* `max_items` denotes that this field must not exceed a
* certain number of items as the upper limit. If the field contains more
* items than specified, an error message will be generated, requiring the
* field to maintain no more than the specified number of items.
*
* ```proto
* message MyRepeated {
* // value must contain no more than 3 item(s)
* repeated string value = 1 [(buf.validate.field).repeated.max_items = 3];
* }
* ```
*
*
* optional uint64 max_items = 2 [json_name = "maxItems", (.buf.validate.priv.field) = { ... }
* @return Whether the maxItems field is set.
*/
@java.lang.Override
public boolean hasMaxItems() {
return ((bitField0_ & 0x00000002) != 0);
}
/**
*
* `max_items` denotes that this field must not exceed a
* certain number of items as the upper limit. If the field contains more
* items than specified, an error message will be generated, requiring the
* field to maintain no more than the specified number of items.
*
* ```proto
* message MyRepeated {
* // value must contain no more than 3 item(s)
* repeated string value = 1 [(buf.validate.field).repeated.max_items = 3];
* }
* ```
*
*
* optional uint64 max_items = 2 [json_name = "maxItems", (.buf.validate.priv.field) = { ... }
* @return The maxItems.
*/
@java.lang.Override
public long getMaxItems() {
return maxItems_;
}
public static final int UNIQUE_FIELD_NUMBER = 3;
private boolean unique_ = false;
/**
*
* `unique` indicates that all elements in this field must
* be unique. This constraint is strictly applicable to scalar and enum
* types, with message types not being supported.
*
* ```proto
* message MyRepeated {
* // repeated value must contain unique items
* repeated string value = 1 [(buf.validate.field).repeated.unique = true];
* }
* ```
*
*
* optional bool unique = 3 [json_name = "unique", (.buf.validate.priv.field) = { ... }
* @return Whether the unique field is set.
*/
@java.lang.Override
public boolean hasUnique() {
return ((bitField0_ & 0x00000004) != 0);
}
/**
*
* `unique` indicates that all elements in this field must
* be unique. This constraint is strictly applicable to scalar and enum
* types, with message types not being supported.
*
* ```proto
* message MyRepeated {
* // repeated value must contain unique items
* repeated string value = 1 [(buf.validate.field).repeated.unique = true];
* }
* ```
*
*
* optional bool unique = 3 [json_name = "unique", (.buf.validate.priv.field) = { ... }
* @return The unique.
*/
@java.lang.Override
public boolean getUnique() {
return unique_;
}
public static final int ITEMS_FIELD_NUMBER = 4;
private build.buf.validate.FieldConstraints items_;
/**
*
* `items` details the constraints to be applied to each item
* in the field. Even for repeated message fields, validation is executed
* against each item unless skip is explicitly specified.
*
* ```proto
* message MyRepeated {
* // The items in the field `value` must follow the specified constraints.
* repeated string value = 1 [(buf.validate.field).repeated.items = {
* string: {
* min_len: 3
* max_len: 10
* }
* }];
* }
* ```
*
*
* optional .buf.validate.FieldConstraints items = 4 [json_name = "items"];
* @return Whether the items field is set.
*/
@java.lang.Override
public boolean hasItems() {
return ((bitField0_ & 0x00000008) != 0);
}
/**
*
* `items` details the constraints to be applied to each item
* in the field. Even for repeated message fields, validation is executed
* against each item unless skip is explicitly specified.
*
* ```proto
* message MyRepeated {
* // The items in the field `value` must follow the specified constraints.
* repeated string value = 1 [(buf.validate.field).repeated.items = {
* string: {
* min_len: 3
* max_len: 10
* }
* }];
* }
* ```
*
*
* optional .buf.validate.FieldConstraints items = 4 [json_name = "items"];
* @return The items.
*/
@java.lang.Override
public build.buf.validate.FieldConstraints getItems() {
return items_ == null ? build.buf.validate.FieldConstraints.getDefaultInstance() : items_;
}
/**
*
* `items` details the constraints to be applied to each item
* in the field. Even for repeated message fields, validation is executed
* against each item unless skip is explicitly specified.
*
* ```proto
* message MyRepeated {
* // The items in the field `value` must follow the specified constraints.
* repeated string value = 1 [(buf.validate.field).repeated.items = {
* string: {
* min_len: 3
* max_len: 10
* }
* }];
* }
* ```
*
*
* optional .buf.validate.FieldConstraints items = 4 [json_name = "items"];
*/
@java.lang.Override
public build.buf.validate.FieldConstraintsOrBuilder getItemsOrBuilder() {
return items_ == null ? build.buf.validate.FieldConstraints.getDefaultInstance() : items_;
}
private byte memoizedIsInitialized = -1;
@java.lang.Override
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
if (((bitField0_ & 0x00000001) != 0)) {
output.writeUInt64(1, minItems_);
}
if (((bitField0_ & 0x00000002) != 0)) {
output.writeUInt64(2, maxItems_);
}
if (((bitField0_ & 0x00000004) != 0)) {
output.writeBool(3, unique_);
}
if (((bitField0_ & 0x00000008) != 0)) {
output.writeMessage(4, getItems());
}
getUnknownFields().writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (((bitField0_ & 0x00000001) != 0)) {
size += com.google.protobuf.CodedOutputStream
.computeUInt64Size(1, minItems_);
}
if (((bitField0_ & 0x00000002) != 0)) {
size += com.google.protobuf.CodedOutputStream
.computeUInt64Size(2, maxItems_);
}
if (((bitField0_ & 0x00000004) != 0)) {
size += com.google.protobuf.CodedOutputStream
.computeBoolSize(3, unique_);
}
if (((bitField0_ & 0x00000008) != 0)) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(4, getItems());
}
size += getUnknownFields().getSerializedSize();
memoizedSize = size;
return size;
}
@java.lang.Override
public boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof build.buf.validate.RepeatedRules)) {
return super.equals(obj);
}
build.buf.validate.RepeatedRules other = (build.buf.validate.RepeatedRules) obj;
if (hasMinItems() != other.hasMinItems()) return false;
if (hasMinItems()) {
if (getMinItems()
!= other.getMinItems()) return false;
}
if (hasMaxItems() != other.hasMaxItems()) return false;
if (hasMaxItems()) {
if (getMaxItems()
!= other.getMaxItems()) return false;
}
if (hasUnique() != other.hasUnique()) return false;
if (hasUnique()) {
if (getUnique()
!= other.getUnique()) return false;
}
if (hasItems() != other.hasItems()) return false;
if (hasItems()) {
if (!getItems()
.equals(other.getItems())) return false;
}
if (!getUnknownFields().equals(other.getUnknownFields())) return false;
return true;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
if (hasMinItems()) {
hash = (37 * hash) + MIN_ITEMS_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
getMinItems());
}
if (hasMaxItems()) {
hash = (37 * hash) + MAX_ITEMS_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
getMaxItems());
}
if (hasUnique()) {
hash = (37 * hash) + UNIQUE_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(
getUnique());
}
if (hasItems()) {
hash = (37 * hash) + ITEMS_FIELD_NUMBER;
hash = (53 * hash) + getItems().hashCode();
}
hash = (29 * hash) + getUnknownFields().hashCode();
memoizedHashCode = hash;
return hash;
}
public static build.buf.validate.RepeatedRules parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static build.buf.validate.RepeatedRules parseFrom(
java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static build.buf.validate.RepeatedRules parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static build.buf.validate.RepeatedRules parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static build.buf.validate.RepeatedRules parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static build.buf.validate.RepeatedRules parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static build.buf.validate.RepeatedRules parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessage
.parseWithIOException(PARSER, input);
}
public static build.buf.validate.RepeatedRules parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessage
.parseWithIOException(PARSER, input, extensionRegistry);
}
public static build.buf.validate.RepeatedRules parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessage
.parseDelimitedWithIOException(PARSER, input);
}
public static build.buf.validate.RepeatedRules parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessage
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
}
public static build.buf.validate.RepeatedRules parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessage
.parseWithIOException(PARSER, input);
}
public static build.buf.validate.RepeatedRules parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessage
.parseWithIOException(PARSER, input, extensionRegistry);
}
@java.lang.Override
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(build.buf.validate.RepeatedRules prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
@java.lang.Override
public Builder toBuilder() {
return this == DEFAULT_INSTANCE
? new Builder() : new Builder().mergeFrom(this);
}
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessage.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
*
* RepeatedRules describe the constraints applied to `repeated` values.
*
*
* Protobuf type {@code buf.validate.RepeatedRules}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessage.Builder implements
// @@protoc_insertion_point(builder_implements:buf.validate.RepeatedRules)
build.buf.validate.RepeatedRulesOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return build.buf.validate.ValidateProto.internal_static_buf_validate_RepeatedRules_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return build.buf.validate.ValidateProto.internal_static_buf_validate_RepeatedRules_fieldAccessorTable
.ensureFieldAccessorsInitialized(
build.buf.validate.RepeatedRules.class, build.buf.validate.RepeatedRules.Builder.class);
}
// Construct using build.buf.validate.RepeatedRules.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessage.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessage
.alwaysUseFieldBuilders) {
getItemsFieldBuilder();
}
}
@java.lang.Override
public Builder clear() {
super.clear();
bitField0_ = 0;
minItems_ = 0L;
maxItems_ = 0L;
unique_ = false;
items_ = null;
if (itemsBuilder_ != null) {
itemsBuilder_.dispose();
itemsBuilder_ = null;
}
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return build.buf.validate.ValidateProto.internal_static_buf_validate_RepeatedRules_descriptor;
}
@java.lang.Override
public build.buf.validate.RepeatedRules getDefaultInstanceForType() {
return build.buf.validate.RepeatedRules.getDefaultInstance();
}
@java.lang.Override
public build.buf.validate.RepeatedRules build() {
build.buf.validate.RepeatedRules result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public build.buf.validate.RepeatedRules buildPartial() {
build.buf.validate.RepeatedRules result = new build.buf.validate.RepeatedRules(this);
if (bitField0_ != 0) { buildPartial0(result); }
onBuilt();
return result;
}
private void buildPartial0(build.buf.validate.RepeatedRules result) {
int from_bitField0_ = bitField0_;
int to_bitField0_ = 0;
if (((from_bitField0_ & 0x00000001) != 0)) {
result.minItems_ = minItems_;
to_bitField0_ |= 0x00000001;
}
if (((from_bitField0_ & 0x00000002) != 0)) {
result.maxItems_ = maxItems_;
to_bitField0_ |= 0x00000002;
}
if (((from_bitField0_ & 0x00000004) != 0)) {
result.unique_ = unique_;
to_bitField0_ |= 0x00000004;
}
if (((from_bitField0_ & 0x00000008) != 0)) {
result.items_ = itemsBuilder_ == null
? items_
: itemsBuilder_.build();
to_bitField0_ |= 0x00000008;
}
result.bitField0_ |= to_bitField0_;
}
@java.lang.Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof build.buf.validate.RepeatedRules) {
return mergeFrom((build.buf.validate.RepeatedRules)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(build.buf.validate.RepeatedRules other) {
if (other == build.buf.validate.RepeatedRules.getDefaultInstance()) return this;
if (other.hasMinItems()) {
setMinItems(other.getMinItems());
}
if (other.hasMaxItems()) {
setMaxItems(other.getMaxItems());
}
if (other.hasUnique()) {
setUnique(other.getUnique());
}
if (other.hasItems()) {
mergeItems(other.getItems());
}
this.mergeUnknownFields(other.getUnknownFields());
onChanged();
return this;
}
@java.lang.Override
public final boolean isInitialized() {
return true;
}
@java.lang.Override
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 8: {
minItems_ = input.readUInt64();
bitField0_ |= 0x00000001;
break;
} // case 8
case 16: {
maxItems_ = input.readUInt64();
bitField0_ |= 0x00000002;
break;
} // case 16
case 24: {
unique_ = input.readBool();
bitField0_ |= 0x00000004;
break;
} // case 24
case 34: {
input.readMessage(
getItemsFieldBuilder().getBuilder(),
extensionRegistry);
bitField0_ |= 0x00000008;
break;
} // case 34
default: {
if (!super.parseUnknownField(input, extensionRegistry, tag)) {
done = true; // was an endgroup tag
}
break;
} // default:
} // switch (tag)
} // while (!done)
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.unwrapIOException();
} finally {
onChanged();
} // finally
return this;
}
private int bitField0_;
private long minItems_ ;
/**
*
* `min_items` requires that this field must contain at least the specified
* minimum number of items.
*
* Note that `min_items = 1` is equivalent to setting a field as `required`.
*
* ```proto
* message MyRepeated {
* // value must contain at least 2 items
* repeated string value = 1 [(buf.validate.field).repeated.min_items = 2];
* }
* ```
*
*
* optional uint64 min_items = 1 [json_name = "minItems", (.buf.validate.priv.field) = { ... }
* @return Whether the minItems field is set.
*/
@java.lang.Override
public boolean hasMinItems() {
return ((bitField0_ & 0x00000001) != 0);
}
/**
*
* `min_items` requires that this field must contain at least the specified
* minimum number of items.
*
* Note that `min_items = 1` is equivalent to setting a field as `required`.
*
* ```proto
* message MyRepeated {
* // value must contain at least 2 items
* repeated string value = 1 [(buf.validate.field).repeated.min_items = 2];
* }
* ```
*
*
* optional uint64 min_items = 1 [json_name = "minItems", (.buf.validate.priv.field) = { ... }
* @return The minItems.
*/
@java.lang.Override
public long getMinItems() {
return minItems_;
}
/**
*
* `min_items` requires that this field must contain at least the specified
* minimum number of items.
*
* Note that `min_items = 1` is equivalent to setting a field as `required`.
*
* ```proto
* message MyRepeated {
* // value must contain at least 2 items
* repeated string value = 1 [(buf.validate.field).repeated.min_items = 2];
* }
* ```
*
*
* optional uint64 min_items = 1 [json_name = "minItems", (.buf.validate.priv.field) = { ... }
* @param value The minItems to set.
* @return This builder for chaining.
*/
public Builder setMinItems(long value) {
minItems_ = value;
bitField0_ |= 0x00000001;
onChanged();
return this;
}
/**
*
* `min_items` requires that this field must contain at least the specified
* minimum number of items.
*
* Note that `min_items = 1` is equivalent to setting a field as `required`.
*
* ```proto
* message MyRepeated {
* // value must contain at least 2 items
* repeated string value = 1 [(buf.validate.field).repeated.min_items = 2];
* }
* ```
*
*
* optional uint64 min_items = 1 [json_name = "minItems", (.buf.validate.priv.field) = { ... }
* @return This builder for chaining.
*/
public Builder clearMinItems() {
bitField0_ = (bitField0_ & ~0x00000001);
minItems_ = 0L;
onChanged();
return this;
}
private long maxItems_ ;
/**
*
* `max_items` denotes that this field must not exceed a
* certain number of items as the upper limit. If the field contains more
* items than specified, an error message will be generated, requiring the
* field to maintain no more than the specified number of items.
*
* ```proto
* message MyRepeated {
* // value must contain no more than 3 item(s)
* repeated string value = 1 [(buf.validate.field).repeated.max_items = 3];
* }
* ```
*
*
* optional uint64 max_items = 2 [json_name = "maxItems", (.buf.validate.priv.field) = { ... }
* @return Whether the maxItems field is set.
*/
@java.lang.Override
public boolean hasMaxItems() {
return ((bitField0_ & 0x00000002) != 0);
}
/**
*
* `max_items` denotes that this field must not exceed a
* certain number of items as the upper limit. If the field contains more
* items than specified, an error message will be generated, requiring the
* field to maintain no more than the specified number of items.
*
* ```proto
* message MyRepeated {
* // value must contain no more than 3 item(s)
* repeated string value = 1 [(buf.validate.field).repeated.max_items = 3];
* }
* ```
*
*
* optional uint64 max_items = 2 [json_name = "maxItems", (.buf.validate.priv.field) = { ... }
* @return The maxItems.
*/
@java.lang.Override
public long getMaxItems() {
return maxItems_;
}
/**
*
* `max_items` denotes that this field must not exceed a
* certain number of items as the upper limit. If the field contains more
* items than specified, an error message will be generated, requiring the
* field to maintain no more than the specified number of items.
*
* ```proto
* message MyRepeated {
* // value must contain no more than 3 item(s)
* repeated string value = 1 [(buf.validate.field).repeated.max_items = 3];
* }
* ```
*
*
* optional uint64 max_items = 2 [json_name = "maxItems", (.buf.validate.priv.field) = { ... }
* @param value The maxItems to set.
* @return This builder for chaining.
*/
public Builder setMaxItems(long value) {
maxItems_ = value;
bitField0_ |= 0x00000002;
onChanged();
return this;
}
/**
*
* `max_items` denotes that this field must not exceed a
* certain number of items as the upper limit. If the field contains more
* items than specified, an error message will be generated, requiring the
* field to maintain no more than the specified number of items.
*
* ```proto
* message MyRepeated {
* // value must contain no more than 3 item(s)
* repeated string value = 1 [(buf.validate.field).repeated.max_items = 3];
* }
* ```
*
*
* optional uint64 max_items = 2 [json_name = "maxItems", (.buf.validate.priv.field) = { ... }
* @return This builder for chaining.
*/
public Builder clearMaxItems() {
bitField0_ = (bitField0_ & ~0x00000002);
maxItems_ = 0L;
onChanged();
return this;
}
private boolean unique_ ;
/**
*
* `unique` indicates that all elements in this field must
* be unique. This constraint is strictly applicable to scalar and enum
* types, with message types not being supported.
*
* ```proto
* message MyRepeated {
* // repeated value must contain unique items
* repeated string value = 1 [(buf.validate.field).repeated.unique = true];
* }
* ```
*
*
* optional bool unique = 3 [json_name = "unique", (.buf.validate.priv.field) = { ... }
* @return Whether the unique field is set.
*/
@java.lang.Override
public boolean hasUnique() {
return ((bitField0_ & 0x00000004) != 0);
}
/**
*
* `unique` indicates that all elements in this field must
* be unique. This constraint is strictly applicable to scalar and enum
* types, with message types not being supported.
*
* ```proto
* message MyRepeated {
* // repeated value must contain unique items
* repeated string value = 1 [(buf.validate.field).repeated.unique = true];
* }
* ```
*
*
* optional bool unique = 3 [json_name = "unique", (.buf.validate.priv.field) = { ... }
* @return The unique.
*/
@java.lang.Override
public boolean getUnique() {
return unique_;
}
/**
*
* `unique` indicates that all elements in this field must
* be unique. This constraint is strictly applicable to scalar and enum
* types, with message types not being supported.
*
* ```proto
* message MyRepeated {
* // repeated value must contain unique items
* repeated string value = 1 [(buf.validate.field).repeated.unique = true];
* }
* ```
*
*
* optional bool unique = 3 [json_name = "unique", (.buf.validate.priv.field) = { ... }
* @param value The unique to set.
* @return This builder for chaining.
*/
public Builder setUnique(boolean value) {
unique_ = value;
bitField0_ |= 0x00000004;
onChanged();
return this;
}
/**
*
* `unique` indicates that all elements in this field must
* be unique. This constraint is strictly applicable to scalar and enum
* types, with message types not being supported.
*
* ```proto
* message MyRepeated {
* // repeated value must contain unique items
* repeated string value = 1 [(buf.validate.field).repeated.unique = true];
* }
* ```
*
*
* optional bool unique = 3 [json_name = "unique", (.buf.validate.priv.field) = { ... }
* @return This builder for chaining.
*/
public Builder clearUnique() {
bitField0_ = (bitField0_ & ~0x00000004);
unique_ = false;
onChanged();
return this;
}
private build.buf.validate.FieldConstraints items_;
private com.google.protobuf.SingleFieldBuilder<
build.buf.validate.FieldConstraints, build.buf.validate.FieldConstraints.Builder, build.buf.validate.FieldConstraintsOrBuilder> itemsBuilder_;
/**
*
* `items` details the constraints to be applied to each item
* in the field. Even for repeated message fields, validation is executed
* against each item unless skip is explicitly specified.
*
* ```proto
* message MyRepeated {
* // The items in the field `value` must follow the specified constraints.
* repeated string value = 1 [(buf.validate.field).repeated.items = {
* string: {
* min_len: 3
* max_len: 10
* }
* }];
* }
* ```
*
*
* optional .buf.validate.FieldConstraints items = 4 [json_name = "items"];
* @return Whether the items field is set.
*/
public boolean hasItems() {
return ((bitField0_ & 0x00000008) != 0);
}
/**
*
* `items` details the constraints to be applied to each item
* in the field. Even for repeated message fields, validation is executed
* against each item unless skip is explicitly specified.
*
* ```proto
* message MyRepeated {
* // The items in the field `value` must follow the specified constraints.
* repeated string value = 1 [(buf.validate.field).repeated.items = {
* string: {
* min_len: 3
* max_len: 10
* }
* }];
* }
* ```
*
*
* optional .buf.validate.FieldConstraints items = 4 [json_name = "items"];
* @return The items.
*/
public build.buf.validate.FieldConstraints getItems() {
if (itemsBuilder_ == null) {
return items_ == null ? build.buf.validate.FieldConstraints.getDefaultInstance() : items_;
} else {
return itemsBuilder_.getMessage();
}
}
/**
*
* `items` details the constraints to be applied to each item
* in the field. Even for repeated message fields, validation is executed
* against each item unless skip is explicitly specified.
*
* ```proto
* message MyRepeated {
* // The items in the field `value` must follow the specified constraints.
* repeated string value = 1 [(buf.validate.field).repeated.items = {
* string: {
* min_len: 3
* max_len: 10
* }
* }];
* }
* ```
*
*
* optional .buf.validate.FieldConstraints items = 4 [json_name = "items"];
*/
public Builder setItems(build.buf.validate.FieldConstraints value) {
if (itemsBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
items_ = value;
} else {
itemsBuilder_.setMessage(value);
}
bitField0_ |= 0x00000008;
onChanged();
return this;
}
/**
*
* `items` details the constraints to be applied to each item
* in the field. Even for repeated message fields, validation is executed
* against each item unless skip is explicitly specified.
*
* ```proto
* message MyRepeated {
* // The items in the field `value` must follow the specified constraints.
* repeated string value = 1 [(buf.validate.field).repeated.items = {
* string: {
* min_len: 3
* max_len: 10
* }
* }];
* }
* ```
*
*
* optional .buf.validate.FieldConstraints items = 4 [json_name = "items"];
*/
public Builder setItems(
build.buf.validate.FieldConstraints.Builder builderForValue) {
if (itemsBuilder_ == null) {
items_ = builderForValue.build();
} else {
itemsBuilder_.setMessage(builderForValue.build());
}
bitField0_ |= 0x00000008;
onChanged();
return this;
}
/**
*
* `items` details the constraints to be applied to each item
* in the field. Even for repeated message fields, validation is executed
* against each item unless skip is explicitly specified.
*
* ```proto
* message MyRepeated {
* // The items in the field `value` must follow the specified constraints.
* repeated string value = 1 [(buf.validate.field).repeated.items = {
* string: {
* min_len: 3
* max_len: 10
* }
* }];
* }
* ```
*
*
* optional .buf.validate.FieldConstraints items = 4 [json_name = "items"];
*/
public Builder mergeItems(build.buf.validate.FieldConstraints value) {
if (itemsBuilder_ == null) {
if (((bitField0_ & 0x00000008) != 0) &&
items_ != null &&
items_ != build.buf.validate.FieldConstraints.getDefaultInstance()) {
getItemsBuilder().mergeFrom(value);
} else {
items_ = value;
}
} else {
itemsBuilder_.mergeFrom(value);
}
if (items_ != null) {
bitField0_ |= 0x00000008;
onChanged();
}
return this;
}
/**
*
* `items` details the constraints to be applied to each item
* in the field. Even for repeated message fields, validation is executed
* against each item unless skip is explicitly specified.
*
* ```proto
* message MyRepeated {
* // The items in the field `value` must follow the specified constraints.
* repeated string value = 1 [(buf.validate.field).repeated.items = {
* string: {
* min_len: 3
* max_len: 10
* }
* }];
* }
* ```
*
*
* optional .buf.validate.FieldConstraints items = 4 [json_name = "items"];
*/
public Builder clearItems() {
bitField0_ = (bitField0_ & ~0x00000008);
items_ = null;
if (itemsBuilder_ != null) {
itemsBuilder_.dispose();
itemsBuilder_ = null;
}
onChanged();
return this;
}
/**
*
* `items` details the constraints to be applied to each item
* in the field. Even for repeated message fields, validation is executed
* against each item unless skip is explicitly specified.
*
* ```proto
* message MyRepeated {
* // The items in the field `value` must follow the specified constraints.
* repeated string value = 1 [(buf.validate.field).repeated.items = {
* string: {
* min_len: 3
* max_len: 10
* }
* }];
* }
* ```
*
*
* optional .buf.validate.FieldConstraints items = 4 [json_name = "items"];
*/
public build.buf.validate.FieldConstraints.Builder getItemsBuilder() {
bitField0_ |= 0x00000008;
onChanged();
return getItemsFieldBuilder().getBuilder();
}
/**
*
* `items` details the constraints to be applied to each item
* in the field. Even for repeated message fields, validation is executed
* against each item unless skip is explicitly specified.
*
* ```proto
* message MyRepeated {
* // The items in the field `value` must follow the specified constraints.
* repeated string value = 1 [(buf.validate.field).repeated.items = {
* string: {
* min_len: 3
* max_len: 10
* }
* }];
* }
* ```
*
*
* optional .buf.validate.FieldConstraints items = 4 [json_name = "items"];
*/
public build.buf.validate.FieldConstraintsOrBuilder getItemsOrBuilder() {
if (itemsBuilder_ != null) {
return itemsBuilder_.getMessageOrBuilder();
} else {
return items_ == null ?
build.buf.validate.FieldConstraints.getDefaultInstance() : items_;
}
}
/**
*
* `items` details the constraints to be applied to each item
* in the field. Even for repeated message fields, validation is executed
* against each item unless skip is explicitly specified.
*
* ```proto
* message MyRepeated {
* // The items in the field `value` must follow the specified constraints.
* repeated string value = 1 [(buf.validate.field).repeated.items = {
* string: {
* min_len: 3
* max_len: 10
* }
* }];
* }
* ```
*
*
* optional .buf.validate.FieldConstraints items = 4 [json_name = "items"];
*/
private com.google.protobuf.SingleFieldBuilder<
build.buf.validate.FieldConstraints, build.buf.validate.FieldConstraints.Builder, build.buf.validate.FieldConstraintsOrBuilder>
getItemsFieldBuilder() {
if (itemsBuilder_ == null) {
itemsBuilder_ = new com.google.protobuf.SingleFieldBuilder<
build.buf.validate.FieldConstraints, build.buf.validate.FieldConstraints.Builder, build.buf.validate.FieldConstraintsOrBuilder>(
getItems(),
getParentForChildren(),
isClean());
items_ = null;
}
return itemsBuilder_;
}
// @@protoc_insertion_point(builder_scope:buf.validate.RepeatedRules)
}
// @@protoc_insertion_point(class_scope:buf.validate.RepeatedRules)
private static final build.buf.validate.RepeatedRules DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new build.buf.validate.RepeatedRules();
}
public static build.buf.validate.RepeatedRules getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser
PARSER = new com.google.protobuf.AbstractParser() {
@java.lang.Override
public RepeatedRules parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
Builder builder = newBuilder();
try {
builder.mergeFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(builder.buildPartial());
} catch (com.google.protobuf.UninitializedMessageException e) {
throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(e)
.setUnfinishedMessage(builder.buildPartial());
}
return builder.buildPartial();
}
};
public static com.google.protobuf.Parser parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser getParserForType() {
return PARSER;
}
@java.lang.Override
public build.buf.validate.RepeatedRules getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}