Class Messages.Attachment.Builder

  • All Implemented Interfaces:
    com.google.protobuf.Message.Builder, com.google.protobuf.MessageLite.Builder, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, Messages.AttachmentOrBuilder, Cloneable
    Enclosing class:
    Messages.Attachment

    public static final class Messages.Attachment.Builder
    extends com.google.protobuf.GeneratedMessageV3.Builder<Messages.Attachment.Builder>
    implements Messages.AttachmentOrBuilder
    
     An attachment represents any kind of data associated with a line in a
     [Source](#io.cucumber.messages.Source) file. It can be used for:
     * Syntax errors during parse time
     * Screenshots captured and attached during execution
     * Logs captured and attached during execution
     It is not to be used for runtime errors raised/thrown during execution. This
     is captured in `TestResult`.
     
    Protobuf type io.cucumber.messages.Attachment
    • Method Detail

      • 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<Messages.Attachment.Builder>
      • clear

        public Messages.Attachment.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<Messages.Attachment.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<Messages.Attachment.Builder>
      • getDefaultInstanceForType

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

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

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

        public Messages.Attachment.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<Messages.Attachment.Builder>
      • setField

        public Messages.Attachment.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<Messages.Attachment.Builder>
      • clearField

        public Messages.Attachment.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<Messages.Attachment.Builder>
      • clearOneof

        public Messages.Attachment.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<Messages.Attachment.Builder>
      • setRepeatedField

        public Messages.Attachment.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<Messages.Attachment.Builder>
      • addRepeatedField

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

        public Messages.Attachment.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<Messages.Attachment.Builder>
      • isInitialized

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

        public Messages.Attachment.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<Messages.Attachment.Builder>
        Throws:
        IOException
      • setTestStepIdBytes

        public Messages.Attachment.Builder setTestStepIdBytes​(com.google.protobuf.ByteString value)
        string test_step_id = 2;
      • setTestCaseStartedIdBytes

        public Messages.Attachment.Builder setTestCaseStartedIdBytes​(com.google.protobuf.ByteString value)
        string test_case_started_id = 3;
      • getBody

        public String getBody()
        
         The body of the attachment. If `content_encoding` is `IDENTITY`, the attachment
         is simply the string. If it's `BASE64`, the string should be Base64 decoded to
         obtain the attachment.
         
        string body = 4;
        Specified by:
        getBody in interface Messages.AttachmentOrBuilder
      • getBodyBytes

        public com.google.protobuf.ByteString getBodyBytes()
        
         The body of the attachment. If `content_encoding` is `IDENTITY`, the attachment
         is simply the string. If it's `BASE64`, the string should be Base64 decoded to
         obtain the attachment.
         
        string body = 4;
        Specified by:
        getBodyBytes in interface Messages.AttachmentOrBuilder
      • setBody

        public Messages.Attachment.Builder setBody​(String value)
        
         The body of the attachment. If `content_encoding` is `IDENTITY`, the attachment
         is simply the string. If it's `BASE64`, the string should be Base64 decoded to
         obtain the attachment.
         
        string body = 4;
      • clearBody

        public Messages.Attachment.Builder clearBody()
        
         The body of the attachment. If `content_encoding` is `IDENTITY`, the attachment
         is simply the string. If it's `BASE64`, the string should be Base64 decoded to
         obtain the attachment.
         
        string body = 4;
      • setBodyBytes

        public Messages.Attachment.Builder setBodyBytes​(com.google.protobuf.ByteString value)
        
         The body of the attachment. If `content_encoding` is `IDENTITY`, the attachment
         is simply the string. If it's `BASE64`, the string should be Base64 decoded to
         obtain the attachment.
         
        string body = 4;
      • getMediaType

        public String getMediaType()
        
         The media type of the data. This can be any valid
         [IANA Media Type](https://www.iana.org/assignments/media-types/media-types.xhtml)
         as well as Cucumber-specific media types such as `text/x.cucumber.gherkin+plain`
         and `text/x.cucumber.stacktrace+plain`
         
        string media_type = 5;
        Specified by:
        getMediaType in interface Messages.AttachmentOrBuilder
      • getMediaTypeBytes

        public com.google.protobuf.ByteString getMediaTypeBytes()
        
         The media type of the data. This can be any valid
         [IANA Media Type](https://www.iana.org/assignments/media-types/media-types.xhtml)
         as well as Cucumber-specific media types such as `text/x.cucumber.gherkin+plain`
         and `text/x.cucumber.stacktrace+plain`
         
        string media_type = 5;
        Specified by:
        getMediaTypeBytes in interface Messages.AttachmentOrBuilder
      • setMediaType

        public Messages.Attachment.Builder setMediaType​(String value)
        
         The media type of the data. This can be any valid
         [IANA Media Type](https://www.iana.org/assignments/media-types/media-types.xhtml)
         as well as Cucumber-specific media types such as `text/x.cucumber.gherkin+plain`
         and `text/x.cucumber.stacktrace+plain`
         
        string media_type = 5;
      • clearMediaType

        public Messages.Attachment.Builder clearMediaType()
        
         The media type of the data. This can be any valid
         [IANA Media Type](https://www.iana.org/assignments/media-types/media-types.xhtml)
         as well as Cucumber-specific media types such as `text/x.cucumber.gherkin+plain`
         and `text/x.cucumber.stacktrace+plain`
         
        string media_type = 5;
      • setMediaTypeBytes

        public Messages.Attachment.Builder setMediaTypeBytes​(com.google.protobuf.ByteString value)
        
         The media type of the data. This can be any valid
         [IANA Media Type](https://www.iana.org/assignments/media-types/media-types.xhtml)
         as well as Cucumber-specific media types such as `text/x.cucumber.gherkin+plain`
         and `text/x.cucumber.stacktrace+plain`
         
        string media_type = 5;
      • getContentEncodingValue

        public int getContentEncodingValue()
        
         Whether to interpret `body` "as-is" (IDENTITY) or if it needs to be Base64-decoded (BASE64).
         Content encoding is *not* determined by the media type, but rather by the type
         of the object being attached:
         - string => IDENTITY
         - byte array => BASE64
         - stream => BASE64
         
        .io.cucumber.messages.Attachment.ContentEncoding content_encoding = 6;
        Specified by:
        getContentEncodingValue in interface Messages.AttachmentOrBuilder
      • setContentEncodingValue

        public Messages.Attachment.Builder setContentEncodingValue​(int value)
        
         Whether to interpret `body` "as-is" (IDENTITY) or if it needs to be Base64-decoded (BASE64).
         Content encoding is *not* determined by the media type, but rather by the type
         of the object being attached:
         - string => IDENTITY
         - byte array => BASE64
         - stream => BASE64
         
        .io.cucumber.messages.Attachment.ContentEncoding content_encoding = 6;
      • getContentEncoding

        public Messages.Attachment.ContentEncoding getContentEncoding()
        
         Whether to interpret `body` "as-is" (IDENTITY) or if it needs to be Base64-decoded (BASE64).
         Content encoding is *not* determined by the media type, but rather by the type
         of the object being attached:
         - string => IDENTITY
         - byte array => BASE64
         - stream => BASE64
         
        .io.cucumber.messages.Attachment.ContentEncoding content_encoding = 6;
        Specified by:
        getContentEncoding in interface Messages.AttachmentOrBuilder
      • setContentEncoding

        public Messages.Attachment.Builder setContentEncoding​(Messages.Attachment.ContentEncoding value)
        
         Whether to interpret `body` "as-is" (IDENTITY) or if it needs to be Base64-decoded (BASE64).
         Content encoding is *not* determined by the media type, but rather by the type
         of the object being attached:
         - string => IDENTITY
         - byte array => BASE64
         - stream => BASE64
         
        .io.cucumber.messages.Attachment.ContentEncoding content_encoding = 6;
      • clearContentEncoding

        public Messages.Attachment.Builder clearContentEncoding()
        
         Whether to interpret `body` "as-is" (IDENTITY) or if it needs to be Base64-decoded (BASE64).
         Content encoding is *not* determined by the media type, but rather by the type
         of the object being attached:
         - string => IDENTITY
         - byte array => BASE64
         - stream => BASE64
         
        .io.cucumber.messages.Attachment.ContentEncoding content_encoding = 6;
      • getFileNameBytes

        public com.google.protobuf.ByteString getFileNameBytes()
        
         Suggested file name of the attachment. (Provided by the user as an argument to `attach`)
         
        string file_name = 7;
        Specified by:
        getFileNameBytes in interface Messages.AttachmentOrBuilder
      • setFileName

        public Messages.Attachment.Builder setFileName​(String value)
        
         Suggested file name of the attachment. (Provided by the user as an argument to `attach`)
         
        string file_name = 7;
      • clearFileName

        public Messages.Attachment.Builder clearFileName()
        
         Suggested file name of the attachment. (Provided by the user as an argument to `attach`)
         
        string file_name = 7;
      • setFileNameBytes

        public Messages.Attachment.Builder setFileNameBytes​(com.google.protobuf.ByteString value)
        
         Suggested file name of the attachment. (Provided by the user as an argument to `attach`)
         
        string file_name = 7;
      • getUrl

        public String getUrl()
        
         A URL where the attachment can be retrieved. This field should not be set by Cucumber.
         It should be set by a program that reads a message stream and does the following for
         each Attachment message:
         - Writes the body (after base64 decoding if necessary) to a new file.
         - Sets `body` and `content_encoding` to `null`
         - Writes out the new attachment message
         This will result in a smaller message stream, which can improve performance and
         reduce bandwidth of message consumers. It also makes it easier to process and download attachments
         separately from reports.
         
        string url = 8;
        Specified by:
        getUrl in interface Messages.AttachmentOrBuilder
      • getUrlBytes

        public com.google.protobuf.ByteString getUrlBytes()
        
         A URL where the attachment can be retrieved. This field should not be set by Cucumber.
         It should be set by a program that reads a message stream and does the following for
         each Attachment message:
         - Writes the body (after base64 decoding if necessary) to a new file.
         - Sets `body` and `content_encoding` to `null`
         - Writes out the new attachment message
         This will result in a smaller message stream, which can improve performance and
         reduce bandwidth of message consumers. It also makes it easier to process and download attachments
         separately from reports.
         
        string url = 8;
        Specified by:
        getUrlBytes in interface Messages.AttachmentOrBuilder
      • setUrl

        public Messages.Attachment.Builder setUrl​(String value)
        
         A URL where the attachment can be retrieved. This field should not be set by Cucumber.
         It should be set by a program that reads a message stream and does the following for
         each Attachment message:
         - Writes the body (after base64 decoding if necessary) to a new file.
         - Sets `body` and `content_encoding` to `null`
         - Writes out the new attachment message
         This will result in a smaller message stream, which can improve performance and
         reduce bandwidth of message consumers. It also makes it easier to process and download attachments
         separately from reports.
         
        string url = 8;
      • clearUrl

        public Messages.Attachment.Builder clearUrl()
        
         A URL where the attachment can be retrieved. This field should not be set by Cucumber.
         It should be set by a program that reads a message stream and does the following for
         each Attachment message:
         - Writes the body (after base64 decoding if necessary) to a new file.
         - Sets `body` and `content_encoding` to `null`
         - Writes out the new attachment message
         This will result in a smaller message stream, which can improve performance and
         reduce bandwidth of message consumers. It also makes it easier to process and download attachments
         separately from reports.
         
        string url = 8;
      • setUrlBytes

        public Messages.Attachment.Builder setUrlBytes​(com.google.protobuf.ByteString value)
        
         A URL where the attachment can be retrieved. This field should not be set by Cucumber.
         It should be set by a program that reads a message stream and does the following for
         each Attachment message:
         - Writes the body (after base64 decoding if necessary) to a new file.
         - Sets `body` and `content_encoding` to `null`
         - Writes out the new attachment message
         This will result in a smaller message stream, which can improve performance and
         reduce bandwidth of message consumers. It also makes it easier to process and download attachments
         separately from reports.
         
        string url = 8;
      • setUnknownFields

        public final Messages.Attachment.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<Messages.Attachment.Builder>
      • mergeUnknownFields

        public final Messages.Attachment.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<Messages.Attachment.Builder>