Interface Schema.Builder
- Enclosing interface:
- Schema
public static interface Schema.Builder
Allows to build a
Schema
.-
Method Summary
Modifier and TypeMethodDescriptionbuild()
default Schema
build
(Comparator<Schema.Entry> order) Same asbuild()
but entries order is specified byorder
.default Schema.Builder
Move an entry after another one.default Schema.Builder
moveBefore
(String before, String name) Move an entry before another one.default Schema.Builder
Remove entry from builder.default Schema.Builder
remove
(Schema.Entry entry) Remove entry from builder.default Schema.Builder
Swap two entries.withElementSchema
(Schema schema) withEntry
(Schema.Entry entry) default Schema.Builder
withEntryAfter
(String after, Schema.Entry entry) Insert the entry after the specified entry.default Schema.Builder
withEntryBefore
(String before, Schema.Entry entry) Insert the entry before the specified entry.withType
(Schema.Type type)
-
Method Details
-
withType
- Parameters:
type
- schema type.- Returns:
- this builder.
-
withEntry
- Parameters:
entry
- element for either an array or record type.- Returns:
- this builder.
-
withEntryAfter
Insert the entry after the specified entry.- Parameters:
after
- the entry name referenceentry
- the entry name- Returns:
- this builder
-
withEntryBefore
Insert the entry before the specified entry.- Parameters:
before
- the entry name referenceentry
- the entry name- Returns:
- this builder
-
remove
Remove entry from builder.- Parameters:
name
- the entry name- Returns:
- this builder
-
remove
Remove entry from builder.- Parameters:
entry
- the entry- Returns:
- this builder
-
moveAfter
Move an entry after another one.- Parameters:
after
- the entry name referencename
- the entry name
-
moveBefore
Move an entry before another one.- Parameters:
before
- the entry name referencename
- the entry name
-
swap
Swap two entries.- Parameters:
name
- the entry namewith
- the other entry name
-
withElementSchema
- Parameters:
schema
- nested element schema.- Returns:
- this builder.
-
withProps
- Parameters:
props
- schema properties- Returns:
- this builder
-
withProp
- Parameters:
key
- the prop key namevalue
- the prop value- Returns:
- this builder
-
build
- Returns:
- the described schema.
-
build
Same asbuild()
but entries order is specified byorder
. This takes precedence on any previous defined order with builder and may void it.- Parameters:
order
- the wanted order for entries.- Returns:
- the described schema.
-