build.buf.validate.MessageConstraints 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;
/**
*
* 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 {@code buf.validate.MessageConstraints}
*/
public final class MessageConstraints extends
com.google.protobuf.GeneratedMessage implements
// @@protoc_insertion_point(message_implements:buf.validate.MessageConstraints)
MessageConstraintsOrBuilder {
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= */ "",
MessageConstraints.class.getName());
}
// Use MessageConstraints.newBuilder() to construct.
private MessageConstraints(com.google.protobuf.GeneratedMessage.Builder> builder) {
super(builder);
}
private MessageConstraints() {
cel_ = java.util.Collections.emptyList();
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return build.buf.validate.ValidateProto.internal_static_buf_validate_MessageConstraints_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return build.buf.validate.ValidateProto.internal_static_buf_validate_MessageConstraints_fieldAccessorTable
.ensureFieldAccessorsInitialized(
build.buf.validate.MessageConstraints.class, build.buf.validate.MessageConstraints.Builder.class);
}
private int bitField0_;
public static final int DISABLED_FIELD_NUMBER = 1;
private boolean disabled_ = false;
/**
*
* `disabled` is a boolean flag that, when set to true, nullifies any validation rules for this message.
* This includes any fields within the message that would otherwise support validation.
*
* ```proto
* message MyMessage {
* // validation will be bypassed for this message
* option (buf.validate.message).disabled = true;
* }
* ```
*
*
* optional bool disabled = 1 [json_name = "disabled"];
* @return Whether the disabled field is set.
*/
@java.lang.Override
public boolean hasDisabled() {
return ((bitField0_ & 0x00000001) != 0);
}
/**
*
* `disabled` is a boolean flag that, when set to true, nullifies any validation rules for this message.
* This includes any fields within the message that would otherwise support validation.
*
* ```proto
* message MyMessage {
* // validation will be bypassed for this message
* option (buf.validate.message).disabled = true;
* }
* ```
*
*
* optional bool disabled = 1 [json_name = "disabled"];
* @return The disabled.
*/
@java.lang.Override
public boolean getDisabled() {
return disabled_;
}
public static final int CEL_FIELD_NUMBER = 3;
@SuppressWarnings("serial")
private java.util.List cel_;
/**
*
* `cel` is a repeated field of type Constraint. Each Constraint specifies a validation rule to be applied to this message.
* These constraints are written in Common Expression Language (CEL) syntax. For more information on
* CEL, [see our documentation](https://github.com/bufbuild/protovalidate/blob/main/docs/cel.md).
*
*
* ```proto
* message MyMessage {
* // The field `foo` must be greater than 42.
* option (buf.validate.message).cel = {
* id: "my_message.value",
* message: "value must be greater than 42",
* expression: "this.foo > 42",
* };
* optional int32 foo = 1;
* }
* ```
*
*
* repeated .buf.validate.Constraint cel = 3 [json_name = "cel"];
*/
@java.lang.Override
public java.util.List getCelList() {
return cel_;
}
/**
*
* `cel` is a repeated field of type Constraint. Each Constraint specifies a validation rule to be applied to this message.
* These constraints are written in Common Expression Language (CEL) syntax. For more information on
* CEL, [see our documentation](https://github.com/bufbuild/protovalidate/blob/main/docs/cel.md).
*
*
* ```proto
* message MyMessage {
* // The field `foo` must be greater than 42.
* option (buf.validate.message).cel = {
* id: "my_message.value",
* message: "value must be greater than 42",
* expression: "this.foo > 42",
* };
* optional int32 foo = 1;
* }
* ```
*
*
* repeated .buf.validate.Constraint cel = 3 [json_name = "cel"];
*/
@java.lang.Override
public java.util.List extends build.buf.validate.ConstraintOrBuilder>
getCelOrBuilderList() {
return cel_;
}
/**
*
* `cel` is a repeated field of type Constraint. Each Constraint specifies a validation rule to be applied to this message.
* These constraints are written in Common Expression Language (CEL) syntax. For more information on
* CEL, [see our documentation](https://github.com/bufbuild/protovalidate/blob/main/docs/cel.md).
*
*
* ```proto
* message MyMessage {
* // The field `foo` must be greater than 42.
* option (buf.validate.message).cel = {
* id: "my_message.value",
* message: "value must be greater than 42",
* expression: "this.foo > 42",
* };
* optional int32 foo = 1;
* }
* ```
*
*
* repeated .buf.validate.Constraint cel = 3 [json_name = "cel"];
*/
@java.lang.Override
public int getCelCount() {
return cel_.size();
}
/**
*
* `cel` is a repeated field of type Constraint. Each Constraint specifies a validation rule to be applied to this message.
* These constraints are written in Common Expression Language (CEL) syntax. For more information on
* CEL, [see our documentation](https://github.com/bufbuild/protovalidate/blob/main/docs/cel.md).
*
*
* ```proto
* message MyMessage {
* // The field `foo` must be greater than 42.
* option (buf.validate.message).cel = {
* id: "my_message.value",
* message: "value must be greater than 42",
* expression: "this.foo > 42",
* };
* optional int32 foo = 1;
* }
* ```
*
*
* repeated .buf.validate.Constraint cel = 3 [json_name = "cel"];
*/
@java.lang.Override
public build.buf.validate.Constraint getCel(int index) {
return cel_.get(index);
}
/**
*
* `cel` is a repeated field of type Constraint. Each Constraint specifies a validation rule to be applied to this message.
* These constraints are written in Common Expression Language (CEL) syntax. For more information on
* CEL, [see our documentation](https://github.com/bufbuild/protovalidate/blob/main/docs/cel.md).
*
*
* ```proto
* message MyMessage {
* // The field `foo` must be greater than 42.
* option (buf.validate.message).cel = {
* id: "my_message.value",
* message: "value must be greater than 42",
* expression: "this.foo > 42",
* };
* optional int32 foo = 1;
* }
* ```
*
*
* repeated .buf.validate.Constraint cel = 3 [json_name = "cel"];
*/
@java.lang.Override
public build.buf.validate.ConstraintOrBuilder getCelOrBuilder(
int index) {
return cel_.get(index);
}
private byte memoizedIsInitialized = -1;
@java.lang.Override
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
if (((bitField0_ & 0x00000001) != 0)) {
output.writeBool(1, disabled_);
}
for (int i = 0; i < cel_.size(); i++) {
output.writeMessage(3, cel_.get(i));
}
getUnknownFields().writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (((bitField0_ & 0x00000001) != 0)) {
size += com.google.protobuf.CodedOutputStream
.computeBoolSize(1, disabled_);
}
for (int i = 0; i < cel_.size(); i++) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(3, cel_.get(i));
}
size += getUnknownFields().getSerializedSize();
memoizedSize = size;
return size;
}
@java.lang.Override
public boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof build.buf.validate.MessageConstraints)) {
return super.equals(obj);
}
build.buf.validate.MessageConstraints other = (build.buf.validate.MessageConstraints) obj;
if (hasDisabled() != other.hasDisabled()) return false;
if (hasDisabled()) {
if (getDisabled()
!= other.getDisabled()) return false;
}
if (!getCelList()
.equals(other.getCelList())) return false;
if (!getUnknownFields().equals(other.getUnknownFields())) return false;
return true;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
if (hasDisabled()) {
hash = (37 * hash) + DISABLED_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(
getDisabled());
}
if (getCelCount() > 0) {
hash = (37 * hash) + CEL_FIELD_NUMBER;
hash = (53 * hash) + getCelList().hashCode();
}
hash = (29 * hash) + getUnknownFields().hashCode();
memoizedHashCode = hash;
return hash;
}
public static build.buf.validate.MessageConstraints parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static build.buf.validate.MessageConstraints 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.MessageConstraints parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static build.buf.validate.MessageConstraints 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.MessageConstraints parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static build.buf.validate.MessageConstraints parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static build.buf.validate.MessageConstraints parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessage
.parseWithIOException(PARSER, input);
}
public static build.buf.validate.MessageConstraints 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.MessageConstraints parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessage
.parseDelimitedWithIOException(PARSER, input);
}
public static build.buf.validate.MessageConstraints 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.MessageConstraints parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessage
.parseWithIOException(PARSER, input);
}
public static build.buf.validate.MessageConstraints 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.MessageConstraints 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;
}
/**
*
* 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 {@code buf.validate.MessageConstraints}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessage.Builder implements
// @@protoc_insertion_point(builder_implements:buf.validate.MessageConstraints)
build.buf.validate.MessageConstraintsOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return build.buf.validate.ValidateProto.internal_static_buf_validate_MessageConstraints_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return build.buf.validate.ValidateProto.internal_static_buf_validate_MessageConstraints_fieldAccessorTable
.ensureFieldAccessorsInitialized(
build.buf.validate.MessageConstraints.class, build.buf.validate.MessageConstraints.Builder.class);
}
// Construct using build.buf.validate.MessageConstraints.newBuilder()
private Builder() {
}
private Builder(
com.google.protobuf.GeneratedMessage.BuilderParent parent) {
super(parent);
}
@java.lang.Override
public Builder clear() {
super.clear();
bitField0_ = 0;
disabled_ = false;
if (celBuilder_ == null) {
cel_ = java.util.Collections.emptyList();
} else {
cel_ = null;
celBuilder_.clear();
}
bitField0_ = (bitField0_ & ~0x00000002);
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return build.buf.validate.ValidateProto.internal_static_buf_validate_MessageConstraints_descriptor;
}
@java.lang.Override
public build.buf.validate.MessageConstraints getDefaultInstanceForType() {
return build.buf.validate.MessageConstraints.getDefaultInstance();
}
@java.lang.Override
public build.buf.validate.MessageConstraints build() {
build.buf.validate.MessageConstraints result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public build.buf.validate.MessageConstraints buildPartial() {
build.buf.validate.MessageConstraints result = new build.buf.validate.MessageConstraints(this);
buildPartialRepeatedFields(result);
if (bitField0_ != 0) { buildPartial0(result); }
onBuilt();
return result;
}
private void buildPartialRepeatedFields(build.buf.validate.MessageConstraints result) {
if (celBuilder_ == null) {
if (((bitField0_ & 0x00000002) != 0)) {
cel_ = java.util.Collections.unmodifiableList(cel_);
bitField0_ = (bitField0_ & ~0x00000002);
}
result.cel_ = cel_;
} else {
result.cel_ = celBuilder_.build();
}
}
private void buildPartial0(build.buf.validate.MessageConstraints result) {
int from_bitField0_ = bitField0_;
int to_bitField0_ = 0;
if (((from_bitField0_ & 0x00000001) != 0)) {
result.disabled_ = disabled_;
to_bitField0_ |= 0x00000001;
}
result.bitField0_ |= to_bitField0_;
}
@java.lang.Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof build.buf.validate.MessageConstraints) {
return mergeFrom((build.buf.validate.MessageConstraints)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(build.buf.validate.MessageConstraints other) {
if (other == build.buf.validate.MessageConstraints.getDefaultInstance()) return this;
if (other.hasDisabled()) {
setDisabled(other.getDisabled());
}
if (celBuilder_ == null) {
if (!other.cel_.isEmpty()) {
if (cel_.isEmpty()) {
cel_ = other.cel_;
bitField0_ = (bitField0_ & ~0x00000002);
} else {
ensureCelIsMutable();
cel_.addAll(other.cel_);
}
onChanged();
}
} else {
if (!other.cel_.isEmpty()) {
if (celBuilder_.isEmpty()) {
celBuilder_.dispose();
celBuilder_ = null;
cel_ = other.cel_;
bitField0_ = (bitField0_ & ~0x00000002);
celBuilder_ =
com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ?
getCelFieldBuilder() : null;
} else {
celBuilder_.addAllMessages(other.cel_);
}
}
}
this.mergeUnknownFields(other.getUnknownFields());
onChanged();
return this;
}
@java.lang.Override
public final boolean isInitialized() {
return true;
}
@java.lang.Override
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 8: {
disabled_ = input.readBool();
bitField0_ |= 0x00000001;
break;
} // case 8
case 26: {
build.buf.validate.Constraint m =
input.readMessage(
build.buf.validate.Constraint.parser(),
extensionRegistry);
if (celBuilder_ == null) {
ensureCelIsMutable();
cel_.add(m);
} else {
celBuilder_.addMessage(m);
}
break;
} // case 26
default: {
if (!super.parseUnknownField(input, extensionRegistry, tag)) {
done = true; // was an endgroup tag
}
break;
} // default:
} // switch (tag)
} // while (!done)
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.unwrapIOException();
} finally {
onChanged();
} // finally
return this;
}
private int bitField0_;
private boolean disabled_ ;
/**
*
* `disabled` is a boolean flag that, when set to true, nullifies any validation rules for this message.
* This includes any fields within the message that would otherwise support validation.
*
* ```proto
* message MyMessage {
* // validation will be bypassed for this message
* option (buf.validate.message).disabled = true;
* }
* ```
*
*
* optional bool disabled = 1 [json_name = "disabled"];
* @return Whether the disabled field is set.
*/
@java.lang.Override
public boolean hasDisabled() {
return ((bitField0_ & 0x00000001) != 0);
}
/**
*
* `disabled` is a boolean flag that, when set to true, nullifies any validation rules for this message.
* This includes any fields within the message that would otherwise support validation.
*
* ```proto
* message MyMessage {
* // validation will be bypassed for this message
* option (buf.validate.message).disabled = true;
* }
* ```
*
*
* optional bool disabled = 1 [json_name = "disabled"];
* @return The disabled.
*/
@java.lang.Override
public boolean getDisabled() {
return disabled_;
}
/**
*
* `disabled` is a boolean flag that, when set to true, nullifies any validation rules for this message.
* This includes any fields within the message that would otherwise support validation.
*
* ```proto
* message MyMessage {
* // validation will be bypassed for this message
* option (buf.validate.message).disabled = true;
* }
* ```
*
*
* optional bool disabled = 1 [json_name = "disabled"];
* @param value The disabled to set.
* @return This builder for chaining.
*/
public Builder setDisabled(boolean value) {
disabled_ = value;
bitField0_ |= 0x00000001;
onChanged();
return this;
}
/**
*
* `disabled` is a boolean flag that, when set to true, nullifies any validation rules for this message.
* This includes any fields within the message that would otherwise support validation.
*
* ```proto
* message MyMessage {
* // validation will be bypassed for this message
* option (buf.validate.message).disabled = true;
* }
* ```
*
*
* optional bool disabled = 1 [json_name = "disabled"];
* @return This builder for chaining.
*/
public Builder clearDisabled() {
bitField0_ = (bitField0_ & ~0x00000001);
disabled_ = false;
onChanged();
return this;
}
private java.util.List cel_ =
java.util.Collections.emptyList();
private void ensureCelIsMutable() {
if (!((bitField0_ & 0x00000002) != 0)) {
cel_ = new java.util.ArrayList(cel_);
bitField0_ |= 0x00000002;
}
}
private com.google.protobuf.RepeatedFieldBuilder<
build.buf.validate.Constraint, build.buf.validate.Constraint.Builder, build.buf.validate.ConstraintOrBuilder> celBuilder_;
/**
*
* `cel` is a repeated field of type Constraint. Each Constraint specifies a validation rule to be applied to this message.
* These constraints are written in Common Expression Language (CEL) syntax. For more information on
* CEL, [see our documentation](https://github.com/bufbuild/protovalidate/blob/main/docs/cel.md).
*
*
* ```proto
* message MyMessage {
* // The field `foo` must be greater than 42.
* option (buf.validate.message).cel = {
* id: "my_message.value",
* message: "value must be greater than 42",
* expression: "this.foo > 42",
* };
* optional int32 foo = 1;
* }
* ```
*
*
* repeated .buf.validate.Constraint cel = 3 [json_name = "cel"];
*/
public java.util.List getCelList() {
if (celBuilder_ == null) {
return java.util.Collections.unmodifiableList(cel_);
} else {
return celBuilder_.getMessageList();
}
}
/**
*
* `cel` is a repeated field of type Constraint. Each Constraint specifies a validation rule to be applied to this message.
* These constraints are written in Common Expression Language (CEL) syntax. For more information on
* CEL, [see our documentation](https://github.com/bufbuild/protovalidate/blob/main/docs/cel.md).
*
*
* ```proto
* message MyMessage {
* // The field `foo` must be greater than 42.
* option (buf.validate.message).cel = {
* id: "my_message.value",
* message: "value must be greater than 42",
* expression: "this.foo > 42",
* };
* optional int32 foo = 1;
* }
* ```
*
*
* repeated .buf.validate.Constraint cel = 3 [json_name = "cel"];
*/
public int getCelCount() {
if (celBuilder_ == null) {
return cel_.size();
} else {
return celBuilder_.getCount();
}
}
/**
*
* `cel` is a repeated field of type Constraint. Each Constraint specifies a validation rule to be applied to this message.
* These constraints are written in Common Expression Language (CEL) syntax. For more information on
* CEL, [see our documentation](https://github.com/bufbuild/protovalidate/blob/main/docs/cel.md).
*
*
* ```proto
* message MyMessage {
* // The field `foo` must be greater than 42.
* option (buf.validate.message).cel = {
* id: "my_message.value",
* message: "value must be greater than 42",
* expression: "this.foo > 42",
* };
* optional int32 foo = 1;
* }
* ```
*
*
* repeated .buf.validate.Constraint cel = 3 [json_name = "cel"];
*/
public build.buf.validate.Constraint getCel(int index) {
if (celBuilder_ == null) {
return cel_.get(index);
} else {
return celBuilder_.getMessage(index);
}
}
/**
*
* `cel` is a repeated field of type Constraint. Each Constraint specifies a validation rule to be applied to this message.
* These constraints are written in Common Expression Language (CEL) syntax. For more information on
* CEL, [see our documentation](https://github.com/bufbuild/protovalidate/blob/main/docs/cel.md).
*
*
* ```proto
* message MyMessage {
* // The field `foo` must be greater than 42.
* option (buf.validate.message).cel = {
* id: "my_message.value",
* message: "value must be greater than 42",
* expression: "this.foo > 42",
* };
* optional int32 foo = 1;
* }
* ```
*
*
* repeated .buf.validate.Constraint cel = 3 [json_name = "cel"];
*/
public Builder setCel(
int index, build.buf.validate.Constraint value) {
if (celBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureCelIsMutable();
cel_.set(index, value);
onChanged();
} else {
celBuilder_.setMessage(index, value);
}
return this;
}
/**
*
* `cel` is a repeated field of type Constraint. Each Constraint specifies a validation rule to be applied to this message.
* These constraints are written in Common Expression Language (CEL) syntax. For more information on
* CEL, [see our documentation](https://github.com/bufbuild/protovalidate/blob/main/docs/cel.md).
*
*
* ```proto
* message MyMessage {
* // The field `foo` must be greater than 42.
* option (buf.validate.message).cel = {
* id: "my_message.value",
* message: "value must be greater than 42",
* expression: "this.foo > 42",
* };
* optional int32 foo = 1;
* }
* ```
*
*
* repeated .buf.validate.Constraint cel = 3 [json_name = "cel"];
*/
public Builder setCel(
int index, build.buf.validate.Constraint.Builder builderForValue) {
if (celBuilder_ == null) {
ensureCelIsMutable();
cel_.set(index, builderForValue.build());
onChanged();
} else {
celBuilder_.setMessage(index, builderForValue.build());
}
return this;
}
/**
*
* `cel` is a repeated field of type Constraint. Each Constraint specifies a validation rule to be applied to this message.
* These constraints are written in Common Expression Language (CEL) syntax. For more information on
* CEL, [see our documentation](https://github.com/bufbuild/protovalidate/blob/main/docs/cel.md).
*
*
* ```proto
* message MyMessage {
* // The field `foo` must be greater than 42.
* option (buf.validate.message).cel = {
* id: "my_message.value",
* message: "value must be greater than 42",
* expression: "this.foo > 42",
* };
* optional int32 foo = 1;
* }
* ```
*
*
* repeated .buf.validate.Constraint cel = 3 [json_name = "cel"];
*/
public Builder addCel(build.buf.validate.Constraint value) {
if (celBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureCelIsMutable();
cel_.add(value);
onChanged();
} else {
celBuilder_.addMessage(value);
}
return this;
}
/**
*
* `cel` is a repeated field of type Constraint. Each Constraint specifies a validation rule to be applied to this message.
* These constraints are written in Common Expression Language (CEL) syntax. For more information on
* CEL, [see our documentation](https://github.com/bufbuild/protovalidate/blob/main/docs/cel.md).
*
*
* ```proto
* message MyMessage {
* // The field `foo` must be greater than 42.
* option (buf.validate.message).cel = {
* id: "my_message.value",
* message: "value must be greater than 42",
* expression: "this.foo > 42",
* };
* optional int32 foo = 1;
* }
* ```
*
*
* repeated .buf.validate.Constraint cel = 3 [json_name = "cel"];
*/
public Builder addCel(
int index, build.buf.validate.Constraint value) {
if (celBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureCelIsMutable();
cel_.add(index, value);
onChanged();
} else {
celBuilder_.addMessage(index, value);
}
return this;
}
/**
*
* `cel` is a repeated field of type Constraint. Each Constraint specifies a validation rule to be applied to this message.
* These constraints are written in Common Expression Language (CEL) syntax. For more information on
* CEL, [see our documentation](https://github.com/bufbuild/protovalidate/blob/main/docs/cel.md).
*
*
* ```proto
* message MyMessage {
* // The field `foo` must be greater than 42.
* option (buf.validate.message).cel = {
* id: "my_message.value",
* message: "value must be greater than 42",
* expression: "this.foo > 42",
* };
* optional int32 foo = 1;
* }
* ```
*
*
* repeated .buf.validate.Constraint cel = 3 [json_name = "cel"];
*/
public Builder addCel(
build.buf.validate.Constraint.Builder builderForValue) {
if (celBuilder_ == null) {
ensureCelIsMutable();
cel_.add(builderForValue.build());
onChanged();
} else {
celBuilder_.addMessage(builderForValue.build());
}
return this;
}
/**
*
* `cel` is a repeated field of type Constraint. Each Constraint specifies a validation rule to be applied to this message.
* These constraints are written in Common Expression Language (CEL) syntax. For more information on
* CEL, [see our documentation](https://github.com/bufbuild/protovalidate/blob/main/docs/cel.md).
*
*
* ```proto
* message MyMessage {
* // The field `foo` must be greater than 42.
* option (buf.validate.message).cel = {
* id: "my_message.value",
* message: "value must be greater than 42",
* expression: "this.foo > 42",
* };
* optional int32 foo = 1;
* }
* ```
*
*
* repeated .buf.validate.Constraint cel = 3 [json_name = "cel"];
*/
public Builder addCel(
int index, build.buf.validate.Constraint.Builder builderForValue) {
if (celBuilder_ == null) {
ensureCelIsMutable();
cel_.add(index, builderForValue.build());
onChanged();
} else {
celBuilder_.addMessage(index, builderForValue.build());
}
return this;
}
/**
*
* `cel` is a repeated field of type Constraint. Each Constraint specifies a validation rule to be applied to this message.
* These constraints are written in Common Expression Language (CEL) syntax. For more information on
* CEL, [see our documentation](https://github.com/bufbuild/protovalidate/blob/main/docs/cel.md).
*
*
* ```proto
* message MyMessage {
* // The field `foo` must be greater than 42.
* option (buf.validate.message).cel = {
* id: "my_message.value",
* message: "value must be greater than 42",
* expression: "this.foo > 42",
* };
* optional int32 foo = 1;
* }
* ```
*
*
* repeated .buf.validate.Constraint cel = 3 [json_name = "cel"];
*/
public Builder addAllCel(
java.lang.Iterable extends build.buf.validate.Constraint> values) {
if (celBuilder_ == null) {
ensureCelIsMutable();
com.google.protobuf.AbstractMessageLite.Builder.addAll(
values, cel_);
onChanged();
} else {
celBuilder_.addAllMessages(values);
}
return this;
}
/**
*
* `cel` is a repeated field of type Constraint. Each Constraint specifies a validation rule to be applied to this message.
* These constraints are written in Common Expression Language (CEL) syntax. For more information on
* CEL, [see our documentation](https://github.com/bufbuild/protovalidate/blob/main/docs/cel.md).
*
*
* ```proto
* message MyMessage {
* // The field `foo` must be greater than 42.
* option (buf.validate.message).cel = {
* id: "my_message.value",
* message: "value must be greater than 42",
* expression: "this.foo > 42",
* };
* optional int32 foo = 1;
* }
* ```
*
*
* repeated .buf.validate.Constraint cel = 3 [json_name = "cel"];
*/
public Builder clearCel() {
if (celBuilder_ == null) {
cel_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000002);
onChanged();
} else {
celBuilder_.clear();
}
return this;
}
/**
*
* `cel` is a repeated field of type Constraint. Each Constraint specifies a validation rule to be applied to this message.
* These constraints are written in Common Expression Language (CEL) syntax. For more information on
* CEL, [see our documentation](https://github.com/bufbuild/protovalidate/blob/main/docs/cel.md).
*
*
* ```proto
* message MyMessage {
* // The field `foo` must be greater than 42.
* option (buf.validate.message).cel = {
* id: "my_message.value",
* message: "value must be greater than 42",
* expression: "this.foo > 42",
* };
* optional int32 foo = 1;
* }
* ```
*
*
* repeated .buf.validate.Constraint cel = 3 [json_name = "cel"];
*/
public Builder removeCel(int index) {
if (celBuilder_ == null) {
ensureCelIsMutable();
cel_.remove(index);
onChanged();
} else {
celBuilder_.remove(index);
}
return this;
}
/**
*
* `cel` is a repeated field of type Constraint. Each Constraint specifies a validation rule to be applied to this message.
* These constraints are written in Common Expression Language (CEL) syntax. For more information on
* CEL, [see our documentation](https://github.com/bufbuild/protovalidate/blob/main/docs/cel.md).
*
*
* ```proto
* message MyMessage {
* // The field `foo` must be greater than 42.
* option (buf.validate.message).cel = {
* id: "my_message.value",
* message: "value must be greater than 42",
* expression: "this.foo > 42",
* };
* optional int32 foo = 1;
* }
* ```
*
*
* repeated .buf.validate.Constraint cel = 3 [json_name = "cel"];
*/
public build.buf.validate.Constraint.Builder getCelBuilder(
int index) {
return getCelFieldBuilder().getBuilder(index);
}
/**
*
* `cel` is a repeated field of type Constraint. Each Constraint specifies a validation rule to be applied to this message.
* These constraints are written in Common Expression Language (CEL) syntax. For more information on
* CEL, [see our documentation](https://github.com/bufbuild/protovalidate/blob/main/docs/cel.md).
*
*
* ```proto
* message MyMessage {
* // The field `foo` must be greater than 42.
* option (buf.validate.message).cel = {
* id: "my_message.value",
* message: "value must be greater than 42",
* expression: "this.foo > 42",
* };
* optional int32 foo = 1;
* }
* ```
*
*
* repeated .buf.validate.Constraint cel = 3 [json_name = "cel"];
*/
public build.buf.validate.ConstraintOrBuilder getCelOrBuilder(
int index) {
if (celBuilder_ == null) {
return cel_.get(index); } else {
return celBuilder_.getMessageOrBuilder(index);
}
}
/**
*
* `cel` is a repeated field of type Constraint. Each Constraint specifies a validation rule to be applied to this message.
* These constraints are written in Common Expression Language (CEL) syntax. For more information on
* CEL, [see our documentation](https://github.com/bufbuild/protovalidate/blob/main/docs/cel.md).
*
*
* ```proto
* message MyMessage {
* // The field `foo` must be greater than 42.
* option (buf.validate.message).cel = {
* id: "my_message.value",
* message: "value must be greater than 42",
* expression: "this.foo > 42",
* };
* optional int32 foo = 1;
* }
* ```
*
*
* repeated .buf.validate.Constraint cel = 3 [json_name = "cel"];
*/
public java.util.List extends build.buf.validate.ConstraintOrBuilder>
getCelOrBuilderList() {
if (celBuilder_ != null) {
return celBuilder_.getMessageOrBuilderList();
} else {
return java.util.Collections.unmodifiableList(cel_);
}
}
/**
*
* `cel` is a repeated field of type Constraint. Each Constraint specifies a validation rule to be applied to this message.
* These constraints are written in Common Expression Language (CEL) syntax. For more information on
* CEL, [see our documentation](https://github.com/bufbuild/protovalidate/blob/main/docs/cel.md).
*
*
* ```proto
* message MyMessage {
* // The field `foo` must be greater than 42.
* option (buf.validate.message).cel = {
* id: "my_message.value",
* message: "value must be greater than 42",
* expression: "this.foo > 42",
* };
* optional int32 foo = 1;
* }
* ```
*
*
* repeated .buf.validate.Constraint cel = 3 [json_name = "cel"];
*/
public build.buf.validate.Constraint.Builder addCelBuilder() {
return getCelFieldBuilder().addBuilder(
build.buf.validate.Constraint.getDefaultInstance());
}
/**
*
* `cel` is a repeated field of type Constraint. Each Constraint specifies a validation rule to be applied to this message.
* These constraints are written in Common Expression Language (CEL) syntax. For more information on
* CEL, [see our documentation](https://github.com/bufbuild/protovalidate/blob/main/docs/cel.md).
*
*
* ```proto
* message MyMessage {
* // The field `foo` must be greater than 42.
* option (buf.validate.message).cel = {
* id: "my_message.value",
* message: "value must be greater than 42",
* expression: "this.foo > 42",
* };
* optional int32 foo = 1;
* }
* ```
*
*
* repeated .buf.validate.Constraint cel = 3 [json_name = "cel"];
*/
public build.buf.validate.Constraint.Builder addCelBuilder(
int index) {
return getCelFieldBuilder().addBuilder(
index, build.buf.validate.Constraint.getDefaultInstance());
}
/**
*
* `cel` is a repeated field of type Constraint. Each Constraint specifies a validation rule to be applied to this message.
* These constraints are written in Common Expression Language (CEL) syntax. For more information on
* CEL, [see our documentation](https://github.com/bufbuild/protovalidate/blob/main/docs/cel.md).
*
*
* ```proto
* message MyMessage {
* // The field `foo` must be greater than 42.
* option (buf.validate.message).cel = {
* id: "my_message.value",
* message: "value must be greater than 42",
* expression: "this.foo > 42",
* };
* optional int32 foo = 1;
* }
* ```
*
*
* repeated .buf.validate.Constraint cel = 3 [json_name = "cel"];
*/
public java.util.List
getCelBuilderList() {
return getCelFieldBuilder().getBuilderList();
}
private com.google.protobuf.RepeatedFieldBuilder<
build.buf.validate.Constraint, build.buf.validate.Constraint.Builder, build.buf.validate.ConstraintOrBuilder>
getCelFieldBuilder() {
if (celBuilder_ == null) {
celBuilder_ = new com.google.protobuf.RepeatedFieldBuilder<
build.buf.validate.Constraint, build.buf.validate.Constraint.Builder, build.buf.validate.ConstraintOrBuilder>(
cel_,
((bitField0_ & 0x00000002) != 0),
getParentForChildren(),
isClean());
cel_ = null;
}
return celBuilder_;
}
// @@protoc_insertion_point(builder_scope:buf.validate.MessageConstraints)
}
// @@protoc_insertion_point(class_scope:buf.validate.MessageConstraints)
private static final build.buf.validate.MessageConstraints DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new build.buf.validate.MessageConstraints();
}
public static build.buf.validate.MessageConstraints getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser
PARSER = new com.google.protobuf.AbstractParser() {
@java.lang.Override
public MessageConstraints 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.MessageConstraints getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}