Interface Headers

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void addHeader​(java.lang.String name, java.lang.String value)
      Add a header with the given name and value.
      boolean containsHeader​(java.lang.String name)
      Return a boolean indicating whether the named header has already been set.
      java.lang.String getHeader​(java.lang.String name)
      Returns the value of the first specified message header as a String.
      java.util.Collection<java.lang.String> getHeaderNames()
      Get the names of the headers.
      java.util.Collection<java.lang.String> getHeaders​(java.lang.String name)
      Return all the values of the specified message header as a List of String objects.
      HeaderType getHeaderType()
      Return the type of header key syntax used for this.
      void setHeader​(java.lang.String name, java.lang.String value)
      Set a header with the given name and value.
    • Method Detail

      • getHeader

        java.lang.String getHeader​(java.lang.String name)
        Returns the value of the first specified message header as a String. If the message does not include a header with the specified input name, then this method returns null.
        Specified by:
        getHeader in interface InboundHeaders
        Parameters:
        name - The name of the desired message header.
        Returns:
        A String containing the value of the requested header, or null if the message header is not present.
      • getHeaders

        java.util.Collection<java.lang.String> getHeaders​(java.lang.String name)
        Return all the values of the specified message header as a List of String objects. If the message does not include any headers of the specified name, this method returns an empty list.

        Changes to the returned collection must not affect the Headers instance.

        Parameters:
        name - The name of the desired message header.
        Returns:
        A List containing the values of the requested header, or an empty list of the message header is not present.
      • setHeader

        void setHeader​(java.lang.String name,
                       java.lang.String value)
        Set a header with the given name and value. If the header had already been set, the new value overwrites the previous one. containsHeader(String) can be used to test for the presence of a header before setting its value.
        Specified by:
        setHeader in interface OutboundHeaders
        Parameters:
        name - The name of the header.
        value - The value of the header.
      • addHeader

        void addHeader​(java.lang.String name,
                       java.lang.String value)
        Add a header with the given name and value. This method allows headers to have multiple values.
        Parameters:
        name - The name of the header.
        value - The value of the header.
      • getHeaderNames

        java.util.Collection<java.lang.String> getHeaderNames()
        Get the names of the headers.

        Changes to the returned collection must not affect the Headers instance.

        Returns:
        A possibly empty Collection of the names of present headers.
      • containsHeader

        boolean containsHeader​(java.lang.String name)
        Return a boolean indicating whether the named header has already been set.
        Parameters:
        name - The name of the header.
        Returns:
        true if the header has already been set, false otherwise.