public static class JsonEventMatcher.FieldValue extends Object
Modifier and Type | Field and Description |
---|---|
static JsonEventMatcher.FieldValue |
EMPTY_FIELD_VALUE
A static
JsonEventMatcher.FieldValue used to match requests without inspecting its Json fields. |
Constructor and Description |
---|
FieldValue(String key,
String value)
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj)
Checks if the provided
obj is equal to this JsonEventMatcher.FieldValue . |
String |
getKey()
Returns the key of the
JsonEventMatcher.FieldValue . |
String |
getValue()
Returns the value of the
JsonEventMatcher.FieldValue . |
int |
hashCode()
Computes the hash code associated to this
JsonEventMatcher.FieldValue . |
static JsonEventMatcher.FieldValue |
of(String key,
String value)
|
String |
toString()
Returns a
String representation of this JsonEventMatcher.FieldValue . |
public static JsonEventMatcher.FieldValue EMPTY_FIELD_VALUE
JsonEventMatcher.FieldValue
used to match requests without inspecting its Json fields.
This JsonEventMatcher.FieldValue
should be used when the JsonEventMatcher.HeaderValue
provided in
JsonEventMatcher.addMatchableEvent(HeaderValue, FieldValue, String)
is sufficient to uniquely identify an event.
public FieldValue(String key, String value)
key
- the key of the field to matchvalue
- the value of the field to matchNullPointerException
- if the provided key
or value
is null
of(String, String)
public static JsonEventMatcher.FieldValue of(String key, String value)
JsonEventMatcher.FieldValue
from the provided key
and value
.
This method is a shortcut for #FieldValue(String, String)
.
key
- the key of the field to matchvalue
- the value of the field to matchJsonEventMatcher.FieldValue
NullPointerException
- if the provided key
or value
is null
#FieldValue(String, String)
public String getKey()
JsonEventMatcher.FieldValue
.JsonEventMatcher.FieldValue
public String getValue()
JsonEventMatcher.FieldValue
.JsonEventMatcher.FieldValue
public boolean equals(Object obj)
obj
is equal to this JsonEventMatcher.FieldValue
.
Two JsonEventMatcher.FieldValue
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.FieldValue
, false
otherwisepublic int hashCode()
JsonEventMatcher.FieldValue
.
JsonEventMatcher.FieldValue
's hash code is computed by summing the hash codes of its key and value (key
.hashCode() + value.hashCode()
.
hashCode
in class Object
JsonEventMatcher.FieldValue
String.hashCode()
public String toString()
String
representation of this JsonEventMatcher.FieldValue
.
The returned String
follows the pattern "Field[key]=value"
.
toString
in class Object
String
representation of this JsonEventMatcher.FieldValue
Copyright © 2020 SOM Research Lab. All rights reserved.