Class JsonDefaultValueConverter
java.lang.Object
io.confluent.kafka.schemaregistry.type.logical.json.JsonDefaultValueConverter
Encodes/decodes default values for JSON Schema.
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringtoIsoInstant(Instant instant) Convenience: encode and produce a string suitable for ISO timestamp etc.static ObjecttoJavaData(Schema type, Object value) Decode a JSON-schema default value back into a typed Java value.static ObjecttoJsonValue(Schema type, Object value) Encode a typed Java default value into a JSON-schema-friendly form.
-
Method Details
-
toJsonValue
Encode a typed Java default value into a JSON-schema-friendly form. -
toJavaData
Decode a JSON-schema default value back into a typed Java value. Returnsnullwhen the value's JSON type doesn't match the LT type — the caller (the schema reader's default-capture path) treats a null return as "drop this default" rather than failing the whole schema walk. This keeps in-the-wild schemas with malformed defaults parseable. -
toIsoInstant
Convenience: encode and produce a string suitable for ISO timestamp etc.
-