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 nullof(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.FieldValueNullPointerException - if the provided key or value is null#FieldValue(String, String)public String getKey()
JsonEventMatcher.FieldValue.JsonEventMatcher.FieldValuepublic String getValue()
JsonEventMatcher.FieldValue.JsonEventMatcher.FieldValuepublic boolean equals(Object obj)
obj is equal to this JsonEventMatcher.FieldValue.
Two JsonEventMatcher.FieldValues are equal if their keys and values are respectively equal.
equals in class Objectobj - 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 ObjectJsonEventMatcher.FieldValueString.hashCode()public String toString()
String representation of this JsonEventMatcher.FieldValue.
The returned String follows the pattern "Field[key]=value".
toString in class ObjectString representation of this JsonEventMatcher.FieldValueCopyright © 2020 SOM Research Lab. All rights reserved.