Module org.mockserver.client
Package org.mockserver.client
Record Class RequestExplanation.ExplainedExpectation
java.lang.Object
java.lang.Record
org.mockserver.client.RequestExplanation.ExplainedExpectation
- Record Components:
expectationId- the expectation's idexpectationMethod- the method it matches, ornullexpectationPath- the path it matches, ornullposition- its 1-based position in the order expectations are evaluatedpriority- its priorityreason- why it was passed over, ornullfor the matched expectation (never for a skipped one)explanation- why it was passed over, in plain language, ornullmatches- whether the request matches its request matcher, ornullwhen an earlier gate decideddifferingFieldCount- how many fields differ, ornullwhen it was not compared field by fielddifferences- for each differing field, the differences foundremediation- for each differing field, a hint on how to change the expectation
- Enclosing class:
- RequestExplanation
public static record RequestExplanation.ExplainedExpectation(String expectationId, String expectationMethod, String expectationPath, int position, int priority, RequestExplanation.Reason reason, String explanation, Boolean matches, Integer differingFieldCount, Map<String,List<String>> differences, Map<String,String> remediation)
extends Record
One expectation as it was evaluated. The matched expectation has no
reason; a skipped or shadowed one has
a reason and an explanation, and one compared field by field also has the differences and remediation hints.-
Constructor Summary
ConstructorsConstructorDescriptionExplainedExpectation(String expectationId, String expectationMethod, String expectationPath, int position, int priority, RequestExplanation.Reason reason, String explanation, Boolean matches, Integer differingFieldCount, Map<String, List<String>> differences, Map<String, String> remediation) Creates an instance of aExplainedExpectationrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thedifferencesrecord component.Returns the value of thedifferingFieldCountrecord component.final booleanIndicates whether some other object is "equal to" this one.Returns the value of theexpectationIdrecord component.Returns the value of theexpectationMethodrecord component.Returns the value of theexpectationPathrecord component.Returns the value of theexplanationrecord component.final inthashCode()Returns a hash code value for this object.matches()Returns the value of thematchesrecord component.intposition()Returns the value of thepositionrecord component.intpriority()Returns the value of thepriorityrecord component.reason()Returns the value of thereasonrecord component.Returns the value of theremediationrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
ExplainedExpectation
public ExplainedExpectation(String expectationId, String expectationMethod, String expectationPath, int position, int priority, RequestExplanation.Reason reason, String explanation, Boolean matches, Integer differingFieldCount, Map<String, List<String>> differences, Map<String, String> remediation) Creates an instance of aExplainedExpectationrecord class.- Parameters:
expectationId- the value for theexpectationIdrecord componentexpectationMethod- the value for theexpectationMethodrecord componentexpectationPath- the value for theexpectationPathrecord componentposition- the value for thepositionrecord componentpriority- the value for thepriorityrecord componentreason- the value for thereasonrecord componentexplanation- the value for theexplanationrecord componentmatches- the value for thematchesrecord componentdifferingFieldCount- the value for thedifferingFieldCountrecord componentdifferences- the value for thedifferencesrecord componentremediation- the value for theremediationrecord component
-
-
Method Details
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
expectationId
Returns the value of theexpectationIdrecord component.- Returns:
- the value of the
expectationIdrecord component
-
expectationMethod
Returns the value of theexpectationMethodrecord component.- Returns:
- the value of the
expectationMethodrecord component
-
expectationPath
Returns the value of theexpectationPathrecord component.- Returns:
- the value of the
expectationPathrecord component
-
position
public int position()Returns the value of thepositionrecord component.- Returns:
- the value of the
positionrecord component
-
priority
public int priority()Returns the value of thepriorityrecord component.- Returns:
- the value of the
priorityrecord component
-
reason
Returns the value of thereasonrecord component.- Returns:
- the value of the
reasonrecord component
-
explanation
Returns the value of theexplanationrecord component.- Returns:
- the value of the
explanationrecord component
-
matches
Returns the value of thematchesrecord component.- Returns:
- the value of the
matchesrecord component
-
differingFieldCount
Returns the value of thedifferingFieldCountrecord component.- Returns:
- the value of the
differingFieldCountrecord component
-
differences
Returns the value of thedifferencesrecord component.- Returns:
- the value of the
differencesrecord component
-
remediation
Returns the value of theremediationrecord component.- Returns:
- the value of the
remediationrecord component
-