Class NormalizationOptions
ConversationPredicates substring/regex comparisons are evaluated.
Agent prompts are dynamically assembled, so exact-byte matching is brittle. Normalisation makes matching tolerant of cosmetic differences (whitespace, JSON key ordering, volatile ids/timestamps) while remaining fully deterministic — the same input always normalises to the same output.
Boolean options are nullable on purpose: an unset (null) flag means "use the
default", and that default is applied uniformly wherever the options are
consumed (see PromptNormalizer). This keeps the
behaviour identical whether the options arrive via the REST/JSON API (Jackson
leaves absent fields null) or the MCP tool (which sets only the fields present
in the request). Defaults: collapseWhitespace and sortJsonKeys
on; lowercase and dropBuiltInVolatileFields off.
Follows the same field/withX/getter convention as the other model
classes (Completion, ConversationPredicates) so it round-trips
through the MockServer JSON API without a bespoke (de)serializer.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final booleanstatic final booleanstatic final booleanstatic final boolean -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleaninthashCode()static NormalizationOptionsReturns an options object with all flags unset — i.e. the defaults (whitespace collapsing and JSON key sorting on, lowercasing and volatile-field stripping off) apply when it is consumed.withCollapseWhitespace(boolean collapseWhitespace) withDropBuiltInVolatileFields(boolean dropBuiltInVolatileFields) When true, strip a built-in set of volatile values from the text before matching: ISO-8601 timestamps, UUIDs, andprefix_…style ids (e.g.withDropVolatileFields(List<String> dropVolatileFields) Names of JSON fields to drop from the prompt before matching (applied when the prompt text is valid JSON).withLowercase(boolean lowercase) withSortJsonKeys(boolean sortJsonKeys) Methods inherited from class org.mockserver.model.ObjectWithJsonToString
toStringMethods inherited from class org.mockserver.model.ObjectWithReflectiveEqualsHashCodeToString
fieldsExcludedFromEqualsAndHashCode
-
Field Details
-
DEFAULT_COLLAPSE_WHITESPACE
public static final boolean DEFAULT_COLLAPSE_WHITESPACE- See Also:
-
DEFAULT_LOWERCASE
public static final boolean DEFAULT_LOWERCASE- See Also:
-
DEFAULT_SORT_JSON_KEYS
public static final boolean DEFAULT_SORT_JSON_KEYS- See Also:
-
DEFAULT_DROP_BUILT_IN_VOLATILE_FIELDS
public static final boolean DEFAULT_DROP_BUILT_IN_VOLATILE_FIELDS- See Also:
-
-
Constructor Details
-
NormalizationOptions
public NormalizationOptions()
-
-
Method Details
-
normalizationOptions
Returns an options object with all flags unset — i.e. the defaults (whitespace collapsing and JSON key sorting on, lowercasing and volatile-field stripping off) apply when it is consumed. -
withCollapseWhitespace
-
getCollapseWhitespace
-
withLowercase
-
getLowercase
-
withSortJsonKeys
-
getSortJsonKeys
-
withDropBuiltInVolatileFields
When true, strip a built-in set of volatile values from the text before matching: ISO-8601 timestamps, UUIDs, andprefix_…style ids (e.g.req_…,msg_…,call_…). -
getDropBuiltInVolatileFields
-
withDropVolatileFields
Names of JSON fields to drop from the prompt before matching (applied when the prompt text is valid JSON). Use for caller-specific volatile fields not covered bywithDropBuiltInVolatileFields(boolean). -
getDropVolatileFields
-
equals
- Overrides:
equalsin classObjectWithReflectiveEqualsHashCodeToString
-
hashCode
public int hashCode()- Overrides:
hashCodein classObjectWithReflectiveEqualsHashCodeToString
-