Class Violation.Builder

java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder
com.google.protobuf.AbstractMessage.Builder<BuilderT>
com.google.protobuf.GeneratedMessageV3.Builder<Violation.Builder>
build.buf.validate.Violation.Builder
All Implemented Interfaces:
ViolationOrBuilder, com.google.protobuf.Message.Builder, com.google.protobuf.MessageLite.Builder, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, Cloneable
Enclosing class:
Violation

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
  • Method Summary

    Modifier and Type
    Method
    Description
    addRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value)
     
     
     
     
    `constraint_id` is the unique identifier of the `Constraint` that was not fulfilled.
    clearField(com.google.protobuf.Descriptors.FieldDescriptor field)
     
    `field_path` is a machine-readable identifier that points to the specific field that failed the validation.
    `for_key` indicates whether the violation was caused by a map key, rather than a value.
    `message` is a human-readable error message that describes the nature of the violation.
    clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)
     
     
    `constraint_id` is the unique identifier of the `Constraint` that was not fulfilled.
    com.google.protobuf.ByteString
    `constraint_id` is the unique identifier of the `Constraint` that was not fulfilled.
     
    static final com.google.protobuf.Descriptors.Descriptor
     
    com.google.protobuf.Descriptors.Descriptor
     
    `field_path` is a machine-readable identifier that points to the specific field that failed the validation.
    com.google.protobuf.ByteString
    `field_path` is a machine-readable identifier that points to the specific field that failed the validation.
    boolean
    `for_key` indicates whether the violation was caused by a map key, rather than a value.
    `message` is a human-readable error message that describes the nature of the violation.
    com.google.protobuf.ByteString
    `message` is a human-readable error message that describes the nature of the violation.
    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
     
    final boolean
     
     
    mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
     
    mergeFrom(com.google.protobuf.Message other)
     
    mergeUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)
     
    `constraint_id` is the unique identifier of the `Constraint` that was not fulfilled.
    setConstraintIdBytes(com.google.protobuf.ByteString value)
    `constraint_id` is the unique identifier of the `Constraint` that was not fulfilled.
    setField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value)
     
    `field_path` is a machine-readable identifier that points to the specific field that failed the validation.
    setFieldPathBytes(com.google.protobuf.ByteString value)
    `field_path` is a machine-readable identifier that points to the specific field that failed the validation.
    setForKey(boolean value)
    `for_key` indicates whether the violation was caused by a map key, rather than a value.
    `message` is a human-readable error message that describes the nature of the violation.
    setMessageBytes(com.google.protobuf.ByteString value)
    `message` is a human-readable error message that describes the nature of the violation.
    setRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, int index, Object value)
     
    setUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)
     

    Methods inherited from class com.google.protobuf.GeneratedMessageV3.Builder

    getAllFields, getField, getFieldBuilder, getOneofFieldDescriptor, getParentForChildren, getRepeatedField, getRepeatedFieldBuilder, getRepeatedFieldCount, getUnknownFields, getUnknownFieldSetBuilder, hasField, hasOneof, internalGetMapField, internalGetMapFieldReflection, internalGetMutableMapField, internalGetMutableMapFieldReflection, isClean, markClean, mergeUnknownLengthDelimitedField, mergeUnknownVarintField, newBuilderForField, onBuilt, onChanged, parseUnknownField, 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 Details

    • getDescriptor

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

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

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

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

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

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

      public Violation.Builder clone()
      Specified by:
      clone in interface com.google.protobuf.Message.Builder
      Specified by:
      clone in interface com.google.protobuf.MessageLite.Builder
      Overrides:
      clone in class com.google.protobuf.GeneratedMessageV3.Builder<Violation.Builder>
    • setField

      public Violation.Builder setField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value)
      Specified by:
      setField in interface com.google.protobuf.Message.Builder
      Overrides:
      setField in class com.google.protobuf.GeneratedMessageV3.Builder<Violation.Builder>
    • clearField

      public Violation.Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field)
      Specified by:
      clearField in interface com.google.protobuf.Message.Builder
      Overrides:
      clearField in class com.google.protobuf.GeneratedMessageV3.Builder<Violation.Builder>
    • clearOneof

      public Violation.Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)
      Specified by:
      clearOneof in interface com.google.protobuf.Message.Builder
      Overrides:
      clearOneof in class com.google.protobuf.GeneratedMessageV3.Builder<Violation.Builder>
    • setRepeatedField

      public Violation.Builder setRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, int index, Object value)
      Specified by:
      setRepeatedField in interface com.google.protobuf.Message.Builder
      Overrides:
      setRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<Violation.Builder>
    • addRepeatedField

      public Violation.Builder addRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value)
      Specified by:
      addRepeatedField in interface com.google.protobuf.Message.Builder
      Overrides:
      addRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<Violation.Builder>
    • mergeFrom

      public Violation.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<Violation.Builder>
    • mergeFrom

      public Violation.Builder mergeFrom(Violation other)
    • isInitialized

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

      public Violation.Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws 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<Violation.Builder>
      Throws:
      IOException
    • getFieldPath

      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"];
      Specified by:
      getFieldPath in interface ViolationOrBuilder
      Returns:
      The fieldPath.
    • getFieldPathBytes

      public 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"];
      Specified by:
      getFieldPathBytes in interface ViolationOrBuilder
      Returns:
      The bytes for fieldPath.
    • setFieldPath

      public 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"];
      Parameters:
      value - The fieldPath to set.
      Returns:
      This builder for chaining.
    • clearFieldPath

      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"];
      Returns:
      This builder for chaining.
    • setFieldPathBytes

      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"];
      Parameters:
      value - The bytes for fieldPath to set.
      Returns:
      This builder for chaining.
    • getConstraintId

      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"];
      Specified by:
      getConstraintId in interface ViolationOrBuilder
      Returns:
      The constraintId.
    • getConstraintIdBytes

      public 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"];
      Specified by:
      getConstraintIdBytes in interface ViolationOrBuilder
      Returns:
      The bytes for constraintId.
    • setConstraintId

      public 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"];
      Parameters:
      value - The constraintId to set.
      Returns:
      This builder for chaining.
    • clearConstraintId

      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"];
      Returns:
      This builder for chaining.
    • setConstraintIdBytes

      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"];
      Parameters:
      value - The bytes for constraintId to set.
      Returns:
      This builder for chaining.
    • getMessage

      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"];
      Specified by:
      getMessage in interface ViolationOrBuilder
      Returns:
      The message.
    • getMessageBytes

      public 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"];
      Specified by:
      getMessageBytes in interface ViolationOrBuilder
      Returns:
      The bytes for message.
    • setMessage

      public 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"];
      Parameters:
      value - The message to set.
      Returns:
      This builder for chaining.
    • clearMessage

      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"];
      Returns:
      This builder for chaining.
    • setMessageBytes

      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"];
      Parameters:
      value - The bytes for message to set.
      Returns:
      This builder for chaining.
    • getForKey

      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"];
      Specified by:
      getForKey in interface ViolationOrBuilder
      Returns:
      The forKey.
    • setForKey

      public 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"];
      Parameters:
      value - The forKey to set.
      Returns:
      This builder for chaining.
    • clearForKey

      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"];
      Returns:
      This builder for chaining.
    • setUnknownFields

      public final Violation.Builder setUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)
      Specified by:
      setUnknownFields in interface com.google.protobuf.Message.Builder
      Overrides:
      setUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<Violation.Builder>
    • mergeUnknownFields

      public final Violation.Builder mergeUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)
      Specified by:
      mergeUnknownFields in interface com.google.protobuf.Message.Builder
      Overrides:
      mergeUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<Violation.Builder>