Interface Schema
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceSchema.BuilderAllows to build aSchema.static classSchema.EntriesOrderstatic interfaceSchema.Entrystatic classSchema.Type
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description static Schema.EntryavoidCollision(Schema.Entry newEntry, Supplier<Stream<Schema.Entry>> allEntriesSupplier, BiConsumer<String,Schema.Entry> replaceFunction)Stream<Schema.Entry>getAllEntries()SchemagetElementSchema()List<Schema.Entry>getEntries()default List<Schema.Entry>getEntriesOrdered()Get all entries sorted by schema designed order.default List<Schema.Entry>getEntriesOrdered(Comparator<Schema.Entry> comparator)Get all entries sorted using a custom comparator.default Schema.EntrygetEntry(String name)default javax.json.JsonValuegetJsonProp(String name)Get a property values from schema with its name.List<Schema.Entry>getMetadata()StringgetProp(String property)Map<String,String>getProps()Schema.TypegetType()default Schema.EntriesOrdernaturalOrder()Get the EntriesOrder defined with Builder.static StringsanitizeConnectionName(String name)Sanitize name to be avro compatible.default Schema.BuildertoBuilder()Get a Builder from the current schema.
-
-
-
Method Detail
-
getType
Schema.Type getType()
- Returns:
- the type of this schema.
-
getElementSchema
Schema getElementSchema()
- Returns:
- the nested element schema for arrays.
-
getEntries
List<Schema.Entry> getEntries()
- Returns:
- the data entries for records (not contains meta data entries).
-
getMetadata
List<Schema.Entry> getMetadata()
- Returns:
- the metadata entries for records (not contains ordinary data entries).
-
getAllEntries
Stream<Schema.Entry> getAllEntries()
- Returns:
- All entries, including data and metadata, of this schema.
-
toBuilder
default Schema.Builder toBuilder()
Get a Builder from the current schema.- Returns:
- a
Schema.Builder
-
getEntriesOrdered
default List<Schema.Entry> getEntriesOrdered()
Get all entries sorted by schema designed order.- Returns:
- all entries ordered
-
getEntriesOrdered
default List<Schema.Entry> getEntriesOrdered(Comparator<Schema.Entry> comparator)
Get all entries sorted using a custom comparator.- Parameters:
comparator- the comparator- Returns:
- all entries ordered with provided comparator
-
naturalOrder
default Schema.EntriesOrder naturalOrder()
Get the EntriesOrder defined with Builder.- Returns:
- the EntriesOrder
-
getEntry
default Schema.Entry getEntry(String name)
-
getProp
String getProp(String property)
- Parameters:
property- : property name.- Returns:
- the requested metadata prop
-
getJsonProp
default javax.json.JsonValue getJsonProp(String name)
Get a property values from schema with its name.- Parameters:
name- : property's name.- Returns:
- property's value.
-
sanitizeConnectionName
static String sanitizeConnectionName(String name)
Sanitize name to be avro compatible.- Parameters:
name- : original name.- Returns:
- avro compatible name.
-
avoidCollision
static Schema.Entry avoidCollision(Schema.Entry newEntry, Supplier<Stream<Schema.Entry>> allEntriesSupplier, BiConsumer<String,Schema.Entry> replaceFunction)
-
-