@Header(type="integer", format="int64") public class BasicLongHeader extends BasicHeader
Content-Length: 300
Constructor and Description |
---|
BasicLongHeader(String name,
Object value)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
Long |
asLong()
Returns the header value as a long.
|
FluentLongAssertion<BasicLongHeader> |
assertLong()
Provides the ability to perform fluent-style assertions on this header.
|
String |
getValue() |
static BasicLongHeader |
of(String name,
Object value)
Convenience creator.
|
static BasicLongHeader |
of(String name,
Supplier<?> value)
Convenience creator using supplier.
|
assertName, assertValue, canCast, cast, eqIC, equals, getElements, getName, getRawValue, hashCode, isSupplier, of, ofPair, toString, unwrap
public BasicLongHeader(String name, Object value)
name
- The header name.value
- The header value.
Number
- Converted to a long using Number.longValue()
.
String
- Parsed using Long.parseLong(String)
.
Supplier
of anything on this list.
public static BasicLongHeader of(String name, Object value)
name
- The header name.value
- The header value.
Number
- Converted to a long using Number.longValue()
.
String
- Parsed using Long.parseLong(String)
.
BasicLongHeader
object, or public static BasicLongHeader of(String name, Supplier<?> value)
Header value is re-evaluated on each call to getValue()
.
name
- The header name.value
- The header value supplier.
Number
- Converted to a long using Number.longValue()
.
String
- Parsed using Long.parseLong(String)
.
BasicLongHeader
object, or public String getValue()
getValue
in interface NameValuePair
getValue
in class BasicHeader
public Long asLong()
public FluentLongAssertion<BasicLongHeader> assertLong()
AssertionError
- If assertion failed.Copyright © 2016–2020 The Apache Software Foundation. All rights reserved.