Interface ResponseTrailers


public interface ResponseTrailers

Represents the HTTP trailers of a server response in a server exchange as defined by RFC 7230 Section 4.3.

Since:
1.0
Author:
Jeremy Kuhn
See Also:
  • Method Details

    • add

      Adds a trailer with the specified name and value.

      Parameters:
      name - the trailer name
      value - the trailer value
      Returns:
      the response trailers
    • add

      ResponseTrailers add(Header... trailers)

      Adds the specified trailers.

      Parameters:
      trailers - the trailers to add
      Returns:
      the response trailers
    • set

      Sets the value of the trailer with the specified name.

      Parameters:
      name - the trailer name
      value - the trailer value
      Returns:
      the response trailers
    • set

      ResponseTrailers set(Header... trailers)

      Sets the specified trailers.

      Parameters:
      trailers - the trailers to set
      Returns:
      the response trailers
    • remove

      ResponseTrailers remove(CharSequence... names)

      Removes the trailers with the specified names.

      Parameters:
      names - the names of the trailers to remove
      Returns:
      the response trailers
    • contains

      boolean contains(CharSequence name)

      Determines whether a trailer with the specified name is present.

      Parameters:
      name - a trailer name
      Returns:
      true if a trailer is present, false otherwise
    • contains

      boolean contains(CharSequence name, CharSequence value)

      Determines whether a trailer with the specified name and value is present.

      Parameters:
      name - a trailer name
      value - a trailer value
      Returns:
      true if a trailer is present, false otherwise
    • getNames

      Set<String> getNames()

      Returns the names of the trailers in the response.

      Returns:
      a list of trailer names
    • get

      Returns the value of the trailer with the specified name.

      If there are multiple trailers with the same name, this method returns the first one.

      Parameters:
      name - a trailer name
      Returns:
      an optional returning the value of the trailer or an empty optional if there's no trailer with the specified name
    • getAll

      List<String> getAll(CharSequence name)

      Returns the values of all trailers with the specified name.

      Parameters:
      name - a trailer name
      Returns:
      a list of trailer values or an empty list if there's no trailer with the specified name
    • getAll

      Returns all trailers in the response.

      Returns:
      a list of trailer entries or an empty list if there's no trailer
    • getHeader

      <T extends Header> Optional<T> getHeader(CharSequence name)

      Decodes and returns the trailer with the specified name.

      If there are multiple trailers with the same name, this method returns the first one.

      Type Parameters:
      T - the decoded trailer type
      Parameters:
      name - a trailer name
      Returns:
      an optional returning the decoded trailer or an empty optional if there's no trailer with the specified name
    • getAllHeader

      <T extends Header> List<T> getAllHeader(CharSequence name)

      Decodes and returns all trailers with the specified name.

      Type Parameters:
      T - the decoded trailer type
      Parameters:
      name - a trailer name
      Returns:
      a list of trailer values or an empty list if there's no trailer with the specified name
    • getAllHeader

      List<Header> getAllHeader()

      Decodes and returns all trailers in the response.

      Returns:
      a list of trailers or an empty list if there's no trailer
    • getParameter

      Optional<Parameter> getParameter(CharSequence name)

      Returns the trailer with the specified name as a parameter.

      If there are multiple trailers with the same name, this method returns the first one.

      Parameters:
      name - a trailer name
      Returns:
      an optional returning the parameter or an empty optional if there's no trailer with the specified name
    • getAllParameter

      List<Parameter> getAllParameter(CharSequence name)

      Returns all trailers with the specified name as parameters.

      Parameters:
      name - a trailer name
      Returns:
      a list of parameters or an empty list if there's no trailer with the specified name
    • getAllParameter

      List<Parameter> getAllParameter()

      Returns all trailers in the response as parameters.

      Returns:
      a list of parameters or an empty list if there's no trailer