Class ContextLocals
java.lang.Object
io.quarkiverse.langchain4j.runtime.ContextLocals
-
Method Summary
Modifier and TypeMethodDescriptionstatic booleanstatic <T> TGets the value from the context local associated with the given key.static <T> voidStores the given key/value in the context local.static booleanRemoves 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 benullvalue- 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:
trueif there were a value associated with the given key.falseotherwise.
-
duplicatedContextActive
public static boolean duplicatedContextActive()
-