Class Violation.Builder

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

    public static final class Violation.Builder
    extends com.google.protobuf.GeneratedMessage.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

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      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 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.
      java.lang.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()  
      java.lang.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.
      java.lang.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.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()  
      boolean isInitialized()  
      Violation.Builder mergeFrom​(Violation other)  
      Violation.Builder mergeFrom​(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)  
      Violation.Builder mergeFrom​(com.google.protobuf.Message other)  
      Violation.Builder setConstraintId​(java.lang.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 setFieldPath​(java.lang.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​(java.lang.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.
      • Methods inherited from class com.google.protobuf.GeneratedMessage.Builder

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

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

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

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

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

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

        findInitializationErrors, getAllFields, getField, getInitializationErrorString, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof
    • Method Detail

      • getDescriptor

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

        protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()
        Specified by:
        internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessage.Builder<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.GeneratedMessage.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.GeneratedMessage.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
      • 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>
      • isInitialized

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

        public Violation.Builder mergeFrom​(com.google.protobuf.CodedInputStream input,
                                           com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                    throws java.io.IOException
        Specified by:
        mergeFrom in interface com.google.protobuf.Message.Builder
        Specified by:
        mergeFrom in interface com.google.protobuf.MessageLite.Builder
        Overrides:
        mergeFrom in class com.google.protobuf.AbstractMessage.Builder<Violation.Builder>
        Throws:
        java.io.IOException
      • getFieldPath

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

        public Violation.Builder setFieldPath​(java.lang.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;
        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;
        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;
        Parameters:
        value - The bytes for fieldPath to set.
        Returns:
        This builder for chaining.
      • getConstraintId

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

        public Violation.Builder setConstraintId​(java.lang.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;
        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;
        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;
        Parameters:
        value - The bytes for constraintId to set.
        Returns:
        This builder for chaining.
      • getMessage

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

        public Violation.Builder setMessage​(java.lang.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;
        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;
        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;
        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;
        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;
        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;
        Returns:
        This builder for chaining.