java.lang.Object
io.confluent.kafka.schemaregistry.type.logical.Schema

public abstract class Schema extends Object
  • Field Details

  • Method Details

    • getType

      public Schema.Type getType()
    • isNullable

      public boolean isNullable()
    • setNullable

      public Schema setNullable(boolean nullable)
    • getDoc

      public String getDoc()
    • setDoc

      public Schema setDoc(String doc)
    • getTags

      public List<String> getTags()
    • setTags

      public Schema setTags(List<String> tags)
    • getParams

      public Map<String,Object> getParams()
    • setParams

      public Schema setParams(Map<String,Object> params)
    • getRules

      public List<Rule> getRules()
      Validation rules attached to this schema. For struct types this carries table-level CHECK constraints (constraints that may reference any field). Empty for non-struct schemas in the typical case.
    • setRules

      public Schema setRules(List<Rule> rules)
    • getFields

      public List<Schema.Field> getFields()
    • getField

      public Schema.Field getField(String name)
    • getEnumValues

      public List<Schema.EnumValue> getEnumValues()
    • getBranches

      public List<Schema.UnionBranch> getBranches()
    • getElementType

      public Schema getElementType()
    • getKeyType

      public Schema getKeyType()
    • getValueType

      public Schema getValueType()
    • getPrecision

      public int getPrecision()
    • getScale

      public int getScale()
    • getLength

      public int getLength()
    • getQualifiedName

      public String getQualifiedName()
    • toDdl

      public abstract String toDdl()
    • withNullableSuffix

      protected String withNullableSuffix(String ddl)
    • create

      public static Schema create(Schema.Type type)
    • createDecimal

      public static Schema createDecimal(int precision, int scale)
    • createString

      public static Schema createString()
      Creates an unbounded string type (alias for VARCHAR(MAX_LENGTH)).
    • createVarchar

      public static Schema createVarchar(int length)
    • createChar

      public static Schema createChar(int length)
    • createBytes

      public static Schema createBytes()
      Creates an unbounded bytes type (alias for VARBINARY(MAX_LENGTH)).
    • createBinary

      public static Schema createBinary(int length)
    • createVarbinary

      public static Schema createVarbinary(int length)
    • createTime

      public static Schema createTime(int precision)
    • createTimestamp

      public static Schema createTimestamp(int precision)
    • createTimestampLtz

      public static Schema createTimestampLtz(int precision)
    • createStruct

      public static Schema createStruct(List<Schema.Field> fields)
    • createEnum

      public static Schema createEnum(List<Schema.EnumValue> values)
    • createUnion

      public static Schema createUnion(List<Schema.UnionBranch> branches)
    • createArray

      public static Schema createArray(Schema elementType)
    • createMultiset

      public static Schema createMultiset(Schema elementType)
    • createMap

      public static Schema createMap(Schema keyType, Schema valueType)
    • createNamedTypeRef

      public static Schema createNamedTypeRef(String qualifiedName)
    • equals

      public 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
    • isCelReservedName

      public static boolean isCelReservedName(String name)
      True if name matches a CEL reserved word (case-insensitive). The translator uses this to switch between dot-syntax and index-syntax column-ref emit so reserved-name fields still produce valid CEL.
    • quoteIdentifierIfNeeded

      public static String quoteIdentifierIfNeeded(String name)
      Quote name as a DDL identifier if it would otherwise fail to tokenize as one — i.e. it's empty, contains non-identifier characters, matches a SQL keyword that the grammar doesn't accept as an identifier, or matches a CEL reserved word (so CHECK references emit cleanly). Quoted form: backtick-wrap and double internal backticks.

      Used by both toDdl() and the LT-to-DDL converter so identifier emission is consistent across paths.