Package org.mockserver.model
Class KeysToMultiValues<T extends KeyToMultiValue,K extends KeysToMultiValues>
java.lang.Object
org.mockserver.model.ObjectWithReflectiveEqualsHashCodeToString
org.mockserver.model.ObjectWithJsonToString
org.mockserver.model.KeysToMultiValues<T,K>
- Direct Known Subclasses:
Headers,Parameters
public abstract class KeysToMultiValues<T extends KeyToMultiValue,K extends KeysToMultiValues>
extends ObjectWithJsonToString
- Author:
- jamesdbloom
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedprotectedKeysToMultiValues(com.google.common.collect.Multimap<NottableString, NottableString> multimap) -
Method Summary
Modifier and TypeMethodDescriptionabstract Tbuild(NottableString name, Collection<NottableString> values) protected voidabstract Kclone()booleancontainsEntry(String name) booleancontainsEntry(String name, String value) booleangetConvertedMatcher(boolean controlPlaneMatcher) Returns the memoized request-side conversion for the given control-plane flag, ornullif not yet built.com.google.common.collect.Multimap<NottableString,NottableString> getValues(NottableString key) inthashCode()booleanisEmpty()protected voidInvoked from every mutating method before the underlying multimap is changed.keySet()booleanbooleanremove(NottableString name) replaceEntry(String name, String... values) replaceEntry(T entry) replaceEntryIfExists(T entry) voidsetConvertedMatcher(boolean controlPlaneMatcher, Object converted) Stores the memoized request-side conversion for the given control-plane flag.withEntries(List<T> entries) withEntries(Map<String, List<String>> entries) final KwithEntries(T... entries) withEntry(NottableString name, List<NottableString> values) withEntry(NottableString name, NottableString... values) withKeyMatchStyle(KeyMatchStyle keyMatchStyle) Methods inherited from class org.mockserver.model.ObjectWithJsonToString
toStringMethods inherited from class org.mockserver.model.ObjectWithReflectiveEqualsHashCodeToString
fieldsExcludedFromEqualsAndHashCode
-
Constructor Details
-
KeysToMultiValues
protected KeysToMultiValues() -
KeysToMultiValues
protected KeysToMultiValues(com.google.common.collect.Multimap<NottableString, NottableString> multimap)
-
-
Method Details
-
getConvertedMatcher
Returns the memoized request-side conversion for the given control-plane flag, ornullif not yet built. The conversion is intentionally keyed bycontrolPlaneMatcherbecause the converted form embeds a control-plane-sensitive matcher; a data-plane conversion must never be served to a control-plane caller or vice versa. -
setConvertedMatcher
Stores the memoized request-side conversion for the given control-plane flag. The cache is cleared automatically on any mutation (see #isModified), so callers may safely reuse the value for the lifetime of an unmutated collection (e.g. across a single request's expectation scan). -
clearConvertedMatcher
protected void clearConvertedMatcher() -
build
-
isModified
protected void isModified()Invoked from every mutating method before the underlying multimap is changed. Clears the memoized request-side conversion so a mutated collection never serves a stale conversion. Subclasses that override this MUST callsuper.isModified(). -
getKeyMatchStyle
-
withKeyMatchStyle
-
withEntries
-
withEntries
-
withEntries
-
withEntry
-
withEntry
-
withEntry
-
withEntry
-
withEntry
-
remove
-
remove
-
replaceEntry
-
replaceEntryIfExists
-
replaceEntry
-
getEntries
-
keySet
-
getValues
-
getMultimap
-
getValues
-
containsEntry
-
containsEntry
-
isEmpty
public boolean isEmpty() -
clone
-
equals
- Overrides:
equalsin classObjectWithReflectiveEqualsHashCodeToString
-
hashCode
public int hashCode()- Overrides:
hashCodein classObjectWithReflectiveEqualsHashCodeToString
-