Class KeysToMultiValues<T extends KeyToMultiValue,K extends KeysToMultiValues>

Direct Known Subclasses:
Headers, Parameters

public abstract class KeysToMultiValues<T extends KeyToMultiValue,K extends KeysToMultiValues> extends ObjectWithJsonToString
Author:
jamesdbloom
  • Constructor Details

    • KeysToMultiValues

      protected KeysToMultiValues()
    • KeysToMultiValues

      protected KeysToMultiValues(com.google.common.collect.Multimap<NottableString,NottableString> multimap)
  • Method Details

    • getConvertedMatcher

      public Object getConvertedMatcher(boolean controlPlaneMatcher)
      Returns the memoized request-side conversion for the given control-plane flag, or null if not yet built. The conversion is intentionally keyed by controlPlaneMatcher because 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

      public void setConvertedMatcher(boolean controlPlaneMatcher, Object converted)
      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

      public abstract T build(NottableString name, Collection<NottableString> values)
    • 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 call super.isModified().
    • getKeyMatchStyle

      public KeyMatchStyle getKeyMatchStyle()
    • withKeyMatchStyle

      public KeysToMultiValues<T,K> withKeyMatchStyle(KeyMatchStyle keyMatchStyle)
    • withEntries

      public K withEntries(Map<String,List<String>> entries)
    • withEntries

      public K withEntries(List<T> entries)
    • withEntries

      @SafeVarargs public final K withEntries(T... entries)
    • withEntry

      public K withEntry(T entry)
    • withEntry

      public K withEntry(String name, String... values)
    • withEntry

      public K withEntry(String name, List<String> values)
    • withEntry

      public K withEntry(NottableString name, List<NottableString> values)
    • withEntry

      public K withEntry(NottableString name, NottableString... values)
    • remove

      public boolean remove(String name)
    • remove

      public boolean remove(NottableString name)
    • replaceEntry

      public K replaceEntry(T entry)
    • replaceEntryIfExists

      public K replaceEntryIfExists(T entry)
    • replaceEntry

      public K replaceEntry(String name, String... values)
    • getEntries

      public List<T> getEntries()
    • keySet

      public Set<NottableString> keySet()
    • getValues

      public Collection<NottableString> getValues(NottableString key)
    • getMultimap

      public com.google.common.collect.Multimap<NottableString,NottableString> getMultimap()
    • getValues

      public List<String> getValues(String name)
    • containsEntry

      public boolean containsEntry(String name)
    • containsEntry

      public boolean containsEntry(String name, String value)
    • isEmpty

      public boolean isEmpty()
    • clone

      public abstract K clone()
      Overrides:
      clone in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class ObjectWithReflectiveEqualsHashCodeToString
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class ObjectWithReflectiveEqualsHashCodeToString