Class ContextLocals
java.lang.Object
io.quarkiverse.langchain4j.runtime.ContextLocals
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
static <T> T
Gets the value from the context local associated with the given key.static <T> void
Stores the given key/value in the context local.static boolean
Removes the value associated with the given key from the context locals.
-
Method Details
-
get
Gets the value from the context local associated with the given key. If there is no associated value or there is no duplicated context, it returnsnull
- Parameters:
key
- the key, must not benull
-
put
Stores the given key/value in the context local. This method overwrite the existing value if any. If there is no duplicated context, the method does nothing- Type Parameters:
T
- the expected type of the associated value- Parameters:
key
- the key, must not benull
value
- the value, must not benull
-
remove
Removes the value associated with the given key from the context locals. If there is no associated value or there is no duplicated context, it returnsfalse
- Parameters:
key
- the key, must not benull
- Returns:
true
if there were a value associated with the given key.false
otherwise.
-
duplicatedContextActive
public static boolean duplicatedContextActive()
-