Class ChatKitThread.Status
-
- All Implemented Interfaces:
public final class ChatKitThread.StatusCurrent status for the thread. Defaults to
activefor newly created threads.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceChatKitThread.Status.VisitorAn interface that defines how to map each variant of Status to a value of type T.
public final classChatKitThread.Status.LockedIndicates that a thread is locked and cannot accept new input.
public final classChatKitThread.Status.ClosedIndicates that a thread has been closed.
-
Method Summary
Modifier and Type Method Description final Optional<JsonValue>active()Indicates that a thread is active. final Optional<ChatKitThread.Status.Locked>locked()Indicates that a thread is locked and cannot accept new input. final Optional<ChatKitThread.Status.Closed>closed()Indicates that a thread has been closed. final BooleanisActive()final BooleanisLocked()final BooleanisClosed()final JsonValueasActive()Indicates that a thread is active. final ChatKitThread.Status.LockedasLocked()Indicates that a thread is locked and cannot accept new input. final ChatKitThread.Status.ClosedasClosed()Indicates that a thread has been closed. final Optional<JsonValue>_json()final <T extends Any> Taccept(ChatKitThread.Status.Visitor<T> visitor)Maps this instance's current variant to a value of type T using the given visitor. final ChatKitThread.Statusvalidate()Validates that the types of all values in this object match their expected types recursively. final BooleanisValid()Booleanequals(Object other)IntegerhashCode()StringtoString()final static ChatKitThread.StatusofActive()Indicates that a thread is active. final static ChatKitThread.StatusofLocked(ChatKitThread.Status.Locked locked)Indicates that a thread is locked and cannot accept new input. final static ChatKitThread.StatusofClosed(ChatKitThread.Status.Closed closed)Indicates that a thread has been closed. -
-
Method Detail
-
locked
final Optional<ChatKitThread.Status.Locked> locked()
Indicates that a thread is locked and cannot accept new input.
-
closed
final Optional<ChatKitThread.Status.Closed> closed()
Indicates that a thread has been closed.
-
asLocked
final ChatKitThread.Status.Locked asLocked()
Indicates that a thread is locked and cannot accept new input.
-
asClosed
final ChatKitThread.Status.Closed asClosed()
Indicates that a thread has been closed.
-
accept
final <T extends Any> T accept(ChatKitThread.Status.Visitor<T> visitor)
Maps this instance's current variant to a value of type T using the given visitor.
Note that this method is not forwards compatible with new variants from the API, unless visitor overrides Visitor.unknown. To handle variants not known to this version of the SDK gracefully, consider overriding Visitor.unknown:
import com.openai.core.JsonValue; import java.util.Optional; Optional<String> result = status.accept(new Status.Visitor<Optional<String>>() { @Override public Optional<String> visitActive(JsonValue active) { return Optional.of(active.toString()); } // ... @Override public Optional<String> unknown(JsonValue json) { // Or inspect the `json`. return Optional.empty(); } });
-
validate
final ChatKitThread.Status validate()
Validates that the types of all values in this object match their expected types recursively.
This method is not forwards compatible with new types from the API for existing fields.
-
ofActive
final static ChatKitThread.Status ofActive()
Indicates that a thread is active.
-
ofLocked
final static ChatKitThread.Status ofLocked(ChatKitThread.Status.Locked locked)
Indicates that a thread is locked and cannot accept new input.
-
ofClosed
final static ChatKitThread.Status ofClosed(ChatKitThread.Status.Closed closed)
Indicates that a thread has been closed.
-
-
-
-