Class RetryAfter

java.lang.Object
org.apache.juneau.http.header.HttpHeaderBean
org.apache.juneau.http.header.RetryAfter
All Implemented Interfaces:
HttpHeader

public class RetryAfter extends HttpHeaderBean
Represents an HTTP Retry-After header.

Delay before retrying, as a delta-seconds integer or an HTTP-date.

See Also:
Since:
9.2.1
  • Field Details

  • Constructor Details

    • RetryAfter

      public RetryAfter(Integer value)
      Constructor with delay seconds.
      Parameters:
      value - Seconds to wait. May be null.
    • RetryAfter

      public RetryAfter(String value)
      Constructor with a wire string (integer or HTTP-date).
      Parameters:
      value - The header value. May be null.
    • RetryAfter

      public RetryAfter(Supplier<?> valueSupplier)
      Constructor with a lazy supplier of Integer or ZonedDateTime.
      Parameters:
      valueSupplier - Supplier for the value. Must not be null.
    • RetryAfter

      public RetryAfter(ZonedDateTime value)
      Constructor with an HTTP-date.
      Parameters:
      value - The retry time. May be null.
  • Method Details

    • asInteger

      Returns:
      The value as seconds when encoded as a delta-seconds integer.
    • asZonedDateTime

      Returns:
      The value as ZonedDateTime when encoded as an HTTP-date.
    • getValue

      public String getValue()
      Description copied from interface: HttpHeader
      Returns the header value, or null if the header has no value.
      Specified by:
      getValue in interface HttpHeader
      Overrides:
      getValue in class HttpHeaderBean
      Returns:
      The header value, possibly null.
    • of

      public static RetryAfter of(Integer value)
      Parameters:
      value - Delay seconds. May be null, in which case null is returned.
      Returns:
      A new instance, or null if value is null.
    • of

      public static RetryAfter of(String value)
      Parameters:
      value - Wire string. May be null, in which case null is returned.
      Returns:
      A new instance, or null if value is null.
    • of

      public static RetryAfter of(Supplier<?> valueSupplier)
      Parameters:
      valueSupplier - Supplier of Integer or ZonedDateTime. Must not be null.
      Returns:
      A new instance. Never null.
    • of

      public static RetryAfter of(ZonedDateTime value)
      Parameters:
      value - HTTP-date. May be null, in which case null is returned.
      Returns:
      A new instance, or null if value is null.