Package com.openai.core
Class JsonField
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceJsonField.Visitorpublic final classJsonField.IsMissingThis class is a Jackson filter that can be used to exclude missing properties from objects. This filter should not be used directly and should instead use the @ExcludeMissing annotation.
public final classJsonField.Deserializer
-
Method Summary
Modifier and Type Method Description final BooleanisMissing()final BooleanisNull()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 StringasStringOrThrow()final Optional<List<JsonValue>>asArray()final Optional<Map<String, JsonValue>>asObject()final <R extends Any> Raccept(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 returnedOptionalis given aJsonValue.
-
asStringOrThrow
final String asStringOrThrow()
-
ofNullable
final static <T extends Any> JsonField<T> ofNullable(T value)
-
-
-
-