Package com.openai.core
Class JsonField
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interface
JsonField.Visitor
public final class
JsonField.IsMissing
public final class
JsonField.Deserializer
-
Method Summary
Modifier and Type Method Description final Boolean
isMissing()
final Boolean
isNull()
final Optional<out T>
asKnown()
final Optional<out JsonValue>
asUnknown()
If the "known" value (i.e. final Optional<Boolean>
asBoolean()
final Optional<Number>
asNumber()
final Optional<String>
asString()
final String
asStringOrThrow()
final Optional<List<JsonValue>>
asArray()
final Optional<Map<String, JsonValue>>
asObject()
final <R extends Any> R
accept(JsonField.Visitor<T, R> visitor)
final static <T extends Any> JsonField<T>
of(T value)
final static <T extends Any> JsonField<T>
ofNullable(T value)
-
-
Method Detail
-
asUnknown
final Optional<out JsonValue> asUnknown()
If the "known" value (i.e. matching the type that the SDK expects) is returned by the API then this method will return an empty
Optional
, otherwise the returnedOptional
is given aJsonValue
.
-
asStringOrThrow
final String asStringOrThrow()
-
ofNullable
final static <T extends Any> JsonField<T> ofNullable(T value)
-
-
-
-