public static final class Violation.Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Violation.Builder> implements ViolationOrBuilder
`Violation` represents a single instance where a validation rule, expressed
as a `Constraint`, was not met. It provides information about the field that
caused the violation, the specific constraint that wasn't fulfilled, and a
human-readable error message.
```json
{
"fieldPath": "bar",
"constraintId": "foo.bar",
"message": "bar must be greater than 0"
}
```
Protobuf type buf.validate.Violation| Modifier and Type | Method and Description |
|---|---|
Violation.Builder |
addRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field,
Object value) |
Violation |
build() |
Violation |
buildPartial() |
Violation.Builder |
clear() |
Violation.Builder |
clearConstraintId()
`constraint_id` is the unique identifier of the `Constraint` that was not fulfilled.
|
Violation.Builder |
clearField(com.google.protobuf.Descriptors.FieldDescriptor field) |
Violation.Builder |
clearFieldPath()
`field_path` is a machine-readable identifier that points to the specific field that failed the validation.
|
Violation.Builder |
clearForKey()
`for_key` indicates whether the violation was caused by a map key, rather than a value.
|
Violation.Builder |
clearMessage()
`message` is a human-readable error message that describes the nature of the violation.
|
Violation.Builder |
clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) |
Violation.Builder |
clone() |
String |
getConstraintId()
`constraint_id` is the unique identifier of the `Constraint` that was not fulfilled.
|
com.google.protobuf.ByteString |
getConstraintIdBytes()
`constraint_id` is the unique identifier of the `Constraint` that was not fulfilled.
|
Violation |
getDefaultInstanceForType() |
static com.google.protobuf.Descriptors.Descriptor |
getDescriptor() |
com.google.protobuf.Descriptors.Descriptor |
getDescriptorForType() |
String |
getFieldPath()
`field_path` is a machine-readable identifier that points to the specific field that failed the validation.
|
com.google.protobuf.ByteString |
getFieldPathBytes()
`field_path` is a machine-readable identifier that points to the specific field that failed the validation.
|
boolean |
getForKey()
`for_key` indicates whether the violation was caused by a map key, rather than a value.
|
String |
getMessage()
`message` is a human-readable error message that describes the nature of the violation.
|
com.google.protobuf.ByteString |
getMessageBytes()
`message` is a human-readable error message that describes the nature of the violation.
|
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable |
internalGetFieldAccessorTable() |
Violation.Builder |
mergeUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields) |
Violation.Builder |
setConstraintId(String value)
`constraint_id` is the unique identifier of the `Constraint` that was not fulfilled.
|
Violation.Builder |
setConstraintIdBytes(com.google.protobuf.ByteString value)
`constraint_id` is the unique identifier of the `Constraint` that was not fulfilled.
|
Violation.Builder |
setField(com.google.protobuf.Descriptors.FieldDescriptor field,
Object value) |
Violation.Builder |
setFieldPath(String value)
`field_path` is a machine-readable identifier that points to the specific field that failed the validation.
|
Violation.Builder |
setFieldPathBytes(com.google.protobuf.ByteString value)
`field_path` is a machine-readable identifier that points to the specific field that failed the validation.
|
Violation.Builder |
setForKey(boolean value)
`for_key` indicates whether the violation was caused by a map key, rather than a value.
|
Violation.Builder |
setMessage(String value)
`message` is a human-readable error message that describes the nature of the violation.
|
Violation.Builder |
setMessageBytes(com.google.protobuf.ByteString value)
`message` is a human-readable error message that describes the nature of the violation.
|
Violation.Builder |
setRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field,
int index,
Object value) |
Violation.Builder |
setUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields) |
getAllFields, getField, getFieldBuilder, getOneofFieldDescriptor, getParentForChildren, getRepeatedField, getRepeatedFieldBuilder, getRepeatedFieldCount, getUnknownFields, getUnknownFieldSetBuilder, hasField, hasOneof, internalGetMapField, internalGetMapFieldReflection, internalGetMutableMapField, internalGetMutableMapFieldReflection, isClean, isInitialized, markClean, mergeUnknownLengthDelimitedField, mergeUnknownVarintField, newBuilderForField, onBuilt, onChanged, parseUnknownField, setUnknownFieldSetBuilder, setUnknownFieldsProto3findInitializationErrors, getInitializationErrorString, internalMergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, newUninitializedMessageException, toStringaddAll, addAll, mergeDelimitedFrom, mergeDelimitedFrom, newUninitializedMessageExceptionequals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitpublic static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessageV3.Builder<Violation.Builder>public Violation.Builder clear()
clear in interface com.google.protobuf.Message.Builderclear in interface com.google.protobuf.MessageLite.Builderclear in class com.google.protobuf.GeneratedMessageV3.Builder<Violation.Builder>public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
getDescriptorForType in interface com.google.protobuf.Message.BuildergetDescriptorForType in interface com.google.protobuf.MessageOrBuildergetDescriptorForType in class com.google.protobuf.GeneratedMessageV3.Builder<Violation.Builder>public Violation getDefaultInstanceForType()
getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuildergetDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilderpublic Violation build()
build in interface com.google.protobuf.Message.Builderbuild in interface com.google.protobuf.MessageLite.Builderpublic Violation buildPartial()
buildPartial in interface com.google.protobuf.Message.BuilderbuildPartial in interface com.google.protobuf.MessageLite.Builderpublic Violation.Builder clone()
clone in interface com.google.protobuf.Message.Builderclone in interface com.google.protobuf.MessageLite.Builderclone in class com.google.protobuf.GeneratedMessageV3.Builder<Violation.Builder>public Violation.Builder setField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value)
setField in interface com.google.protobuf.Message.BuildersetField in class com.google.protobuf.GeneratedMessageV3.Builder<Violation.Builder>public Violation.Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field)
clearField in interface com.google.protobuf.Message.BuilderclearField in class com.google.protobuf.GeneratedMessageV3.Builder<Violation.Builder>public Violation.Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)
clearOneof in interface com.google.protobuf.Message.BuilderclearOneof in class com.google.protobuf.GeneratedMessageV3.Builder<Violation.Builder>public Violation.Builder setRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, int index, Object value)
setRepeatedField in interface com.google.protobuf.Message.BuildersetRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<Violation.Builder>public Violation.Builder addRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value)
addRepeatedField in interface com.google.protobuf.Message.BuilderaddRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<Violation.Builder>public String getFieldPath()
`field_path` is a machine-readable identifier that points to the specific field that failed the validation. This could be a nested field, in which case the path will include all the parent fields leading to the actual field that caused the violation.
string field_path = 1 [json_name = "fieldPath"];getFieldPath in interface ViolationOrBuilderpublic com.google.protobuf.ByteString getFieldPathBytes()
`field_path` is a machine-readable identifier that points to the specific field that failed the validation. This could be a nested field, in which case the path will include all the parent fields leading to the actual field that caused the violation.
string field_path = 1 [json_name = "fieldPath"];getFieldPathBytes in interface ViolationOrBuilderpublic Violation.Builder setFieldPath(String value)
`field_path` is a machine-readable identifier that points to the specific field that failed the validation. This could be a nested field, in which case the path will include all the parent fields leading to the actual field that caused the violation.
string field_path = 1 [json_name = "fieldPath"];value - The fieldPath to set.public Violation.Builder clearFieldPath()
`field_path` is a machine-readable identifier that points to the specific field that failed the validation. This could be a nested field, in which case the path will include all the parent fields leading to the actual field that caused the violation.
string field_path = 1 [json_name = "fieldPath"];public Violation.Builder setFieldPathBytes(com.google.protobuf.ByteString value)
`field_path` is a machine-readable identifier that points to the specific field that failed the validation. This could be a nested field, in which case the path will include all the parent fields leading to the actual field that caused the violation.
string field_path = 1 [json_name = "fieldPath"];value - The bytes for fieldPath to set.public String getConstraintId()
`constraint_id` is the unique identifier of the `Constraint` that was not fulfilled. This is the same `id` that was specified in the `Constraint` message, allowing easy tracing of which rule was violated.
string constraint_id = 2 [json_name = "constraintId"];getConstraintId in interface ViolationOrBuilderpublic com.google.protobuf.ByteString getConstraintIdBytes()
`constraint_id` is the unique identifier of the `Constraint` that was not fulfilled. This is the same `id` that was specified in the `Constraint` message, allowing easy tracing of which rule was violated.
string constraint_id = 2 [json_name = "constraintId"];getConstraintIdBytes in interface ViolationOrBuilderpublic Violation.Builder setConstraintId(String value)
`constraint_id` is the unique identifier of the `Constraint` that was not fulfilled. This is the same `id` that was specified in the `Constraint` message, allowing easy tracing of which rule was violated.
string constraint_id = 2 [json_name = "constraintId"];value - The constraintId to set.public Violation.Builder clearConstraintId()
`constraint_id` is the unique identifier of the `Constraint` that was not fulfilled. This is the same `id` that was specified in the `Constraint` message, allowing easy tracing of which rule was violated.
string constraint_id = 2 [json_name = "constraintId"];public Violation.Builder setConstraintIdBytes(com.google.protobuf.ByteString value)
`constraint_id` is the unique identifier of the `Constraint` that was not fulfilled. This is the same `id` that was specified in the `Constraint` message, allowing easy tracing of which rule was violated.
string constraint_id = 2 [json_name = "constraintId"];value - The bytes for constraintId to set.public String getMessage()
`message` is a human-readable error message that describes the nature of the violation. This can be the default error message from the violated `Constraint`, or it can be a custom message that gives more context about the violation.
string message = 3 [json_name = "message"];getMessage in interface ViolationOrBuilderpublic com.google.protobuf.ByteString getMessageBytes()
`message` is a human-readable error message that describes the nature of the violation. This can be the default error message from the violated `Constraint`, or it can be a custom message that gives more context about the violation.
string message = 3 [json_name = "message"];getMessageBytes in interface ViolationOrBuilderpublic Violation.Builder setMessage(String value)
`message` is a human-readable error message that describes the nature of the violation. This can be the default error message from the violated `Constraint`, or it can be a custom message that gives more context about the violation.
string message = 3 [json_name = "message"];value - The message to set.public Violation.Builder clearMessage()
`message` is a human-readable error message that describes the nature of the violation. This can be the default error message from the violated `Constraint`, or it can be a custom message that gives more context about the violation.
string message = 3 [json_name = "message"];public Violation.Builder setMessageBytes(com.google.protobuf.ByteString value)
`message` is a human-readable error message that describes the nature of the violation. This can be the default error message from the violated `Constraint`, or it can be a custom message that gives more context about the violation.
string message = 3 [json_name = "message"];value - The bytes for message to set.public boolean getForKey()
`for_key` indicates whether the violation was caused by a map key, rather than a value.
bool for_key = 4 [json_name = "forKey"];getForKey in interface ViolationOrBuilderpublic Violation.Builder setForKey(boolean value)
`for_key` indicates whether the violation was caused by a map key, rather than a value.
bool for_key = 4 [json_name = "forKey"];value - The forKey to set.public Violation.Builder clearForKey()
`for_key` indicates whether the violation was caused by a map key, rather than a value.
bool for_key = 4 [json_name = "forKey"];public final Violation.Builder setUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)
setUnknownFields in interface com.google.protobuf.Message.BuildersetUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<Violation.Builder>public final Violation.Builder mergeUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)
mergeUnknownFields in interface com.google.protobuf.Message.BuildermergeUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<Violation.Builder>Copyright © 2023. All rights reserved.