@Header(value="Max-Forwards") public class MaxForwards extends BasicIntegerHeader
Limit the number of times the message can be forwarded through proxies or gateways.
Max-Forwards: 10
Max-Forwards = "Max-Forwards" ":" 1*DIGIT
The Max-Forwards value is a decimal integer indicating the remaining number of times this request message may be forwarded.
Each proxy or gateway recipient of a TRACE or OPTIONS request containing a Max-Forwards header field MUST check and update its value prior to forwarding the request. If the received value is zero (0), the recipient MUST NOT forward the request; instead, it MUST respond as the final recipient. If the received Max-Forwards value is greater than zero, then the forwarded message MUST contain an updated Max-Forwards field with a value decremented by one (1).
The Max-Forwards header field MAY be ignored for all other methods defined by this specification and for any extension methods for which it is not explicitly referred to as part of that method definition.
Constructor and Description |
---|
MaxForwards(Object value)
Constructor.
|
MaxForwards(String value)
Constructor
|
Modifier and Type | Method and Description |
---|---|
static MaxForwards |
of(Object value)
Convenience creator.
|
static MaxForwards |
of(Supplier<?> value)
Convenience creator using supplier.
|
asInt, assertInteger, getValue, of, of
assertName, assertValue, canCast, cast, eqIC, equals, getElements, getName, getRawValue, hashCode, isSupplier, of, ofPair, toString, unwrap
public MaxForwards(Object value)
value
- The header value.
Number
- Converted to an integer using Number.intValue()
.
String
- Parsed using Integer.parseInt(String)
.
Supplier
of anything on this list.
public MaxForwards(String value)
value
- The header value.public static MaxForwards of(Object value)
value
- The header value.
Number
- Converted to an integer using Number.intValue()
.
String
- Parsed using Integer.parseInt(String)
.
BasicIntegerHeader
object.public static MaxForwards of(Supplier<?> value)
Header value is re-evaluated on each call to BasicIntegerHeader.getValue()
.
value
- The header value supplier.
Number
- Converted to an integer using Number.intValue()
.
String
- Parsed using Integer.parseInt(String)
.
BasicIntegerHeader
object.Copyright © 2016–2020 The Apache Software Foundation. All rights reserved.