Class Headers


  • public class Headers
    extends Object
    Represents a set of headers of a request / response or a message.
    Since:
    1.0.0
    Author:
    Marcin Grzejszczak, Olga Maciaszek-Sharma, Tim Ysewyn
    • Constructor Detail

      • Headers

        public Headers()
    • Method Detail

      • header

        public void header​(String headerKey,
                           Object headerValue)
      • executeForEachHeader

        public void executeForEachHeader​(Consumer<Header> consumer)
      • headers

        public void headers​(Set<Header> headers)
      • accept

        public void accept​(String contentType)
      • contentType

        public void contentType​(String contentType)
      • messagingContentType

        public void messagingContentType​(String contentType)
      • matching

        public DslProperty matching​(String value)
        If for the consumer / producer you want to match exactly only the root of content type. I.e. application/json;charset=UTF8 you care only about application/json then you should use this method
        Parameters:
        value - regex as String
        Returns:
        dsl property
      • asStubSideMap

        public Map<String,​Object> asStubSideMap()
        Converts the headers into their stub side representations and returns as a map of String key => Object value.
        Returns:
        converted map
      • asTestSideMap

        public Map<String,​Object> asTestSideMap()
        Converts the headers into their stub side representations and returns as a map of String key => Object value.
        Returns:
        converted map
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • getEntries

        public Set<Header> getEntries()
      • setEntries

        public void setEntries​(Set<Header> entries)
      • messagingContentType

        public String messagingContentType()
      • accept

        public String accept()
      • acceptCharset

        public String acceptCharset()
      • acceptEncoding

        public String acceptEncoding()
      • acceptLanguage

        public String acceptLanguage()
      • acceptRanges

        public String acceptRanges()
      • accessControlAllowCredentials

        public String accessControlAllowCredentials()
      • accessControlAllowHeaders

        public String accessControlAllowHeaders()
      • accessControlAllowMethods

        public String accessControlAllowMethods()
      • accessControlAllowOrigin

        public String accessControlAllowOrigin()
      • accessControlExposeHeaders

        public String accessControlExposeHeaders()
      • accessControlMaxAge

        public String accessControlMaxAge()
      • accessControlRequestHeaders

        public String accessControlRequestHeaders()
      • accessControlRequestMethod

        public String accessControlRequestMethod()
      • allow

        public String allow()
      • authorization

        public String authorization()
      • cacheControl

        public String cacheControl()
      • connection

        public String connection()
      • contentEncoding

        public String contentEncoding()
      • contentDisposition

        public String contentDisposition()
      • contentLanguage

        public String contentLanguage()
      • contentLength

        public String contentLength()
      • contentLocation

        public String contentLocation()
      • contentRange

        public String contentRange()
      • contentType

        public String contentType()
      • cookie

        public String cookie()
      • expect

        public String expect()
      • expires

        public String expires()
      • ifMatch

        public String ifMatch()
      • ifModifiedSince

        public String ifModifiedSince()
      • ifNoneMatch

        public String ifNoneMatch()
      • ifRange

        public String ifRange()
      • ifUnmodifiedSince

        public String ifUnmodifiedSince()
      • lastModified

        public String lastModified()
      • location

        public String location()
      • max_forwards

        public String max_forwards()
      • origin

        public String origin()
      • pragma

        public String pragma()
      • proxyAuthenticate

        public String proxyAuthenticate()
      • proxyAuthorization

        public String proxyAuthorization()
      • range

        public String range()
      • referer

        public String referer()
      • retryAfter

        public String retryAfter()
      • server

        public String server()
      • setCookie

        public String setCookie()
      • setCookie2

        public String setCookie2()
      • trailer

        public String trailer()
      • transferEncoding

        public String transferEncoding()
      • upgrade

        public String upgrade()
      • user_agent

        public String user_agent()
      • warning

        public String warning()
      • wwwAuthenticate

        public String wwwAuthenticate()
      • allValue

        public String allValue()
      • applicationAtomXml

        public String applicationAtomXml()
      • applicationFormUrlencoded

        public String applicationFormUrlencoded()
      • applicationJson

        public String applicationJson()
      • applicationJsonUtf8

        public String applicationJsonUtf8()
      • applicationOctetStream

        public String applicationOctetStream()
      • applicationPdf

        public String applicationPdf()
      • applicationXhtmlXml

        public String applicationXhtmlXml()
      • applicationXml

        public String applicationXml()
      • imageGif

        public String imageGif()
      • imageJpeg

        public String imageJpeg()
      • imagePng

        public String imagePng()
      • multipartFormData

        public String multipartFormData()
      • textHtml

        public String textHtml()
      • textMarkdown

        public String textMarkdown()
      • textPlain

        public String textPlain()
      • textXml

        public String textXml()