Class StandardSchemaDefinition

java.lang.Object
org.apache.nifi.schemaregistry.services.StandardSchemaDefinition
All Implemented Interfaces:
SchemaDefinition

public class StandardSchemaDefinition extends Object implements SchemaDefinition
Simple implementation of SchemaDefinition that holds a schema identifier, text, and references.
  • Field Details

  • Constructor Details

    • StandardSchemaDefinition

      public StandardSchemaDefinition(org.apache.nifi.serialization.record.SchemaIdentifier identifier, String text, SchemaDefinition.SchemaType schemaType, Map<String,SchemaDefinition> references)
      Creates a new StandardSchemaDefinition.
      Parameters:
      identifier - the schema identifier
      text - the schema text content
      references - map of schema references (key = reference name, value = referenced schema)
    • StandardSchemaDefinition

      public StandardSchemaDefinition(org.apache.nifi.serialization.record.SchemaIdentifier identifier, String text, SchemaDefinition.SchemaType schemaType)
      Creates a new StandardSchemaDefinition without references.
      Parameters:
      identifier - the schema identifier
      text - the schema text content
  • Method Details

    • getSchemaType

      public SchemaDefinition.SchemaType getSchemaType()
      Specified by:
      getSchemaType in interface SchemaDefinition
      Returns:
      the type of schema (e.g., AVRO, PROTOBUF, JSON, XML, OTHER)
    • getIdentifier

      public org.apache.nifi.serialization.record.SchemaIdentifier getIdentifier()
      Specified by:
      getIdentifier in interface SchemaDefinition
      Returns:
      the unique identifier for this schema
    • getText

      public String getText()
      Specified by:
      getText in interface SchemaDefinition
      Returns:
      the textual representation of the schema (e.g., Avro schema JSON, Protobuf definition)
    • getReferences

      public Map<String,SchemaDefinition> getReferences()
      Specified by:
      getReferences in interface SchemaDefinition
      Returns:
      a map of schema references where the key is the name by which the schema is referenced from its parent, and the value is the referenced schema definition
    • equals

      public final boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object