Class ContextMapUtils
java.lang.Object
io.servicetalk.concurrent.internal.ContextMapUtils
Shared utilities for
ContextMap
.-
Method Summary
Modifier and TypeMethodDescriptionstatic void
ensureType
(ContextMap.Key<?> key, Object value) Make sure that thevalue
type matches with theContextMap.Key.type()
.static boolean
equals
(ContextMap first, ContextMap second) Objects.equals(Object, Object)
alternative forContextMap
.static String
toString
(ContextMap map) Object.toString()
implementation forContextMap
.
-
Method Details
-
toString
Object.toString()
implementation forContextMap
.- Parameters:
map
-ContextMap
to convert- Returns:
String
representation of the context map
-
equals
Objects.equals(Object, Object)
alternative forContextMap
.- Parameters:
first
- the firstContextMap
second
- the secondContextMap
to compare equality with the first one- Returns:
true
if bothContextMap
(s) are equal (contains the same elements),false
otherwise.
-
ensureType
Make sure that thevalue
type matches with theContextMap.Key.type()
.- Parameters:
key
- theContextMap.Key
to verifyvalue
- the value to verify- Throws:
NullPointerException
- ifkey == null
IllegalArgumentException
- if type of thevalue
does not match withContextMap.Key.type()
-