public static class JsonEventMatcher.HeaderValue extends Object
Header
value to match.Constructor and Description |
---|
HeaderValue(String key,
String value)
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj)
Checks if the provided
obj is equal to this JsonEventMatcher.HeaderValue . |
String |
getKey()
Returns the key of the
JsonEventMatcher.HeaderValue . |
String |
getValue()
Returns the value of the
JsonEventMatcher.HeaderValue . |
int |
hashCode()
Computes the hash code associated to this
JsonEventMatcher.HeaderValue . |
static JsonEventMatcher.HeaderValue |
of(String key,
String value)
|
String |
toString()
Returns a
String representation of this JsonEventMatcher.HeaderValue . |
public HeaderValue(String key, String value)
key
- the key of the Header
to matchvalue
- the value of the Header
to matchNullPointerException
- if the provided key
or value
is null
of(String, String)
public static JsonEventMatcher.HeaderValue of(String key, String value)
JsonEventMatcher.HeaderValue
from the provided key
and value
.
This method is a shortcut for #HeaderValue(String, String)
.
key
- the key of the Header
to matchvalue
- the value of the Header
to matchJsonEventMatcher.HeaderValue
NullPointerException
- if the provided key
or value
is null
#HeaderValue(String, String)
public String getKey()
JsonEventMatcher.HeaderValue
.JsonEventMatcher.HeaderValue
public String getValue()
JsonEventMatcher.HeaderValue
.JsonEventMatcher.HeaderValue
public boolean equals(Object obj)
obj
is equal to this JsonEventMatcher.HeaderValue
.
Two JsonEventMatcher.HeaderValue
s are equal if their keys
and values
are respectively equal.
equals
in class Object
obj
- the Object
to checktrue
if the provided obj
is equal to this JsonEventMatcher.HeaderValue
, false
otherwisepublic int hashCode()
JsonEventMatcher.HeaderValue
.
JsonEventMatcher.HeaderValue
's hash code is computed by summing the hash codes of its key and value (key
.hashCode() + value.hashCode()
.
hashCode
in class Object
JsonEventMatcher.HeaderValue
String.hashCode()
public String toString()
String
representation of this JsonEventMatcher.HeaderValue
.
The returned String
follows the pattern "Header[key]=value"
.
toString
in class Object
String
representation of this JsonEventMatcher.HeaderValue
Copyright © 2020 SOM Research Lab. All rights reserved.