public interface ParsedSchema
Implementations of this interface are instantiated by a corresponding
SchemaProvider.
| Modifier and Type | Method and Description |
|---|---|
default boolean |
canLookup(ParsedSchema prev,
SchemaVersionFetcher fetcher)
Returns whether the schema can be used to lookup the specified schema.
|
String |
canonicalString()
Returns a canonical string representation of the schema.
|
ParsedSchema |
copy()
Returns a copy of this schema.
|
ParsedSchema |
copy(Integer version)
Returns a copy of this schema, but with the given version.
|
ParsedSchema |
copy(Map<SchemaEntity,Set<String>> tagsToAdd,
Map<SchemaEntity,Set<String>> tagsToRemove)
Returns a copy of this schema, but with the given tags.
|
ParsedSchema |
copy(Metadata metadata,
RuleSet ruleSet)
Returns a copy of this schema, but with the given metadata and rule set.
|
default Object |
copyMessage(Object message) |
default boolean |
deepEquals(ParsedSchema schema)
Deprecated.
use
equivalent(ParsedSchema) instead |
default boolean |
equivalent(ParsedSchema schema)
Returns whether the underlying raw representations are equivalent,
ignoring version and references.
|
default String |
formattedString(String format)
Returns a formatted string according to a type-specific format.
|
default Object |
fromJson(com.fasterxml.jackson.databind.JsonNode json) |
default Set<String> |
getReservedFields() |
default boolean |
hasTopLevelField(String field) |
default Map<SchemaEntity,Set<String>> |
inlineTaggedEntities()
Returns the inline tagged entities of the schema.
|
default Set<String> |
inlineTags()
Returns the set of inline tags embedded in the schema.
|
List<String> |
isBackwardCompatible(ParsedSchema previousSchema)
Checks the backward compatibility between this schema and the specified schema.
|
default List<String> |
isCompatible(CompatibilityLevel level,
List<ParsedSchemaHolder> previousSchemas)
Checks the compatibility between this schema and the specified schemas.
|
Metadata |
metadata()
Returns metadata.
|
String |
name()
Returns a name for the schema.
|
default ParsedSchema |
normalize()
Returns a normalized copy of this schema.
|
Object |
rawSchema()
Returns the underlying raw representation of the schema.
|
List<SchemaReference> |
references()
Returns a list of schema references.
|
RuleSet |
ruleSet()
Returns a rule set.
|
String |
schemaType()
Returns the schema type.
|
default Set<String> |
tags()
Returns the set of tags used by the schema.
|
default com.fasterxml.jackson.databind.JsonNode |
toJson(Object object) |
default Object |
transformMessage(RuleContext ctx,
FieldTransform transform,
Object message) |
default void |
validate()
Validates the schema and ensures all references are resolved properly.
|
default void |
validate(boolean strict)
Validates the schema and ensures all references are resolved properly.
|
Integer |
version()
Returns the version of the schema if set.
|
static final String RESERVED
String schemaType()
String name()
String canonicalString()
default String formattedString(String format)
Integer version()
List<SchemaReference> references()
Metadata metadata()
RuleSet ruleSet()
default Set<String> inlineTags()
default Map<SchemaEntity,Set<String>> inlineTaggedEntities()
ParsedSchema copy()
ParsedSchema copy(Integer version)
version - the versionParsedSchema copy(Metadata metadata, RuleSet ruleSet)
metadata - the metadataruleSet - the rule setParsedSchema copy(Map<SchemaEntity,Set<String>> tagsToAdd, Map<SchemaEntity,Set<String>> tagsToRemove)
tagsToAdd - map of tags to add to the schema record or field, where the key is the entity
and the value is the set of tags. If the tag already exists, do nothing.tagsToRemove - map of tags to remove from the schema record or field, where the key is
the entity and the value is the set of tags. If the tag does not exist,
do nothing.default ParsedSchema normalize()
default void validate()
default void validate(boolean strict)
List<String> isBackwardCompatible(ParsedSchema previousSchema)
Custom providers may choose to modify this schema during this check, to ensure that it is compatible with the specified schema.
previousSchema - previous schemadefault List<String> isCompatible(CompatibilityLevel level, List<ParsedSchemaHolder> previousSchemas)
Custom providers may choose to modify this schema during this check, to ensure that it is compatible with the specified schemas.
level - the compatibility levelpreviousSchemas - full schema history in chronological orderObject rawSchema()
default boolean hasTopLevelField(String field)
field - name of the field to checkdefault boolean deepEquals(ParsedSchema schema)
equivalent(ParsedSchema) insteaddefault boolean equivalent(ParsedSchema schema)
default Object fromJson(com.fasterxml.jackson.databind.JsonNode json) throws IOException
IOExceptiondefault com.fasterxml.jackson.databind.JsonNode toJson(Object object) throws IOException
IOExceptiondefault Object copyMessage(Object message) throws IOException
IOExceptiondefault Object transformMessage(RuleContext ctx, FieldTransform transform, Object message) throws RuleException
RuleExceptiondefault boolean canLookup(ParsedSchema prev, SchemaVersionFetcher fetcher)
prev - the schema to lookupCopyright © 2025 Confluent, Inc.. All rights reserved.