All Implemented Interfaces:
Serializable, Header, NameValuePair

@Header("Thrown") public class Thrown extends BasicCsvHeader
Represents a parsed Thrown HTTP response header.

Contains exception information including name and optionally a message.

Example

Thrown: org.apache.juneau.http.classic.response.NotFound;Resource was not found

This header isn't part of the RFC2616 specification, but is provided to allow for Java exception information to be delivered to remote REST Java interfaces.

This header supports comma-delimited values for multiple thrown values.

Thrown: org.apache.juneau.http.classic.response.NotFound;Resource was not found,RuntimeException;foo

Note that this is equivalent to specifying multiple header values.

Thrown: org.apache.juneau.http.classic.response.NotFound;Resource was not found Thrown: RuntimeException;foo

See Also:
  • Field Details

    • EMPTY

      public static final Thrown EMPTY
      An empty unmodifiable Thrown header.
  • Constructor Details

    • Thrown

      public Thrown(List<Thrown.Part> value)
      Constructor.
      Parameters:
      value - The header value.
    • Thrown

      public Thrown(String value)
      Constructor.
      Parameters:
      value - The header value.
    • Thrown

      public Thrown(String... value)
      Constructor.
      Parameters:
      value - The header value.
      Can be null or empty to create a header with no value.
  • Method Details

    • of

      public static Thrown of(String value)
      Static creator.
      Parameters:
      value - The header value.
      Can be null.
      Returns:
      A new header bean, or null if the value is null.
    • of

      public static Thrown of(Throwable... values)
      Static creator.
      Parameters:
      values - The header value.
      Can be null or empty (treated as no thrown values).
      Returns:
      A new header bean, or null if the value is null.
    • of

      public static Thrown of(String... value)
      Static creator.
      Parameters:
      value - The header value.
      Can be null or empty to create a header with no value.
      Returns:
      A new header bean, or null if the value is null.
    • of

      public static Thrown of(String value1, String value2)
      Static creator for two CSV tokens.

      This distinct fixed-arity overload ensures two literal String arguments resolve to this class's own factory (returning a Thrown) rather than the inherited fixed-arity BasicCsvHeader.of(String,String), which Java overload resolution would otherwise prefer.

      Parameters:
      value1 - The first CSV token.
      value2 - The second CSV token.
      Returns:
      A new header bean.
    • asParts

      Returns the parts in this header.
      Returns:
      The parts in this header, or an empty Optional if the header value was null.