@Header(type="integer", format="int32") public class BasicIntegerHeader extends BasicHeader
Age: 300
Constructor and Description |
---|
BasicIntegerHeader(String name,
Object value)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
Integer |
asInt()
Returns the header value as an integer.
|
FluentIntegerAssertion<BasicIntegerHeader> |
assertInteger()
Provides the ability to perform fluent-style assertions on this header.
|
String |
getValue() |
static BasicIntegerHeader |
of(String name,
Object value)
Convenience creator.
|
static BasicIntegerHeader |
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 BasicIntegerHeader(String name, Object value)
name
- The header name.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 static BasicIntegerHeader of(String name, Object value)
name
- The header name.value
- The header value.
Number
- Converted to an integer using Number.intValue()
.
String
- Parsed using Integer.parseInt(String)
.
BasicIntegerHeader
object, or public static BasicIntegerHeader 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 an integer using Number.intValue()
.
String
- Parsed using Integer.parseInt(String)
.
BasicIntegerHeader
object, or public String getValue()
getValue
in interface NameValuePair
getValue
in class BasicHeader
public Integer asInt()
public FluentIntegerAssertion<BasicIntegerHeader> assertInteger()
AssertionError
- If assertion failed.Copyright © 2016–2020 The Apache Software Foundation. All rights reserved.