public static class Schema.Field extends JsonProperties
| Modifier and Type | Class and Description |
|---|---|
static class |
Schema.Field.Order
How values of this field should be ordered when sorting records.
|
JsonProperties.Null| Modifier and Type | Field and Description |
|---|---|
static Object |
NULL_DEFAULT_VALUE
For Schema unions with a "null" type as the first entry, this can be used to
specify that the default for the union is null.
|
NULL_VALUE| Constructor and Description |
|---|
Field(Schema.Field field,
Schema schema)
Constructs a new Field instance with the same
name, doc,
defaultValue, and order as field has with changing
the schema to the specified one. |
Field(String name,
Schema schema) |
Field(String name,
Schema schema,
String doc) |
Field(String name,
Schema schema,
String doc,
Object defaultValue) |
Field(String name,
Schema schema,
String doc,
Object defaultValue,
Schema.Field.Order order) |
| Modifier and Type | Method and Description |
|---|---|
void |
addAlias(String alias) |
Set<String> |
aliases()
Return the defined aliases as an unmodifiable Set.
|
Object |
defaultVal() |
String |
doc()
Field's documentation within the record, if set.
|
boolean |
equals(Object other) |
boolean |
hasDefaultValue() |
int |
hashCode() |
String |
name() |
Schema.Field.Order |
order() |
int |
pos()
The position of this field within the record.
|
Schema |
schema()
This field's
Schema. |
String |
toString() |
addAllProps, addProp, addProp, getObjectProp, getObjectProps, getProp, hasProps, putAllpublic static final Object NULL_DEFAULT_VALUE
public Field(Schema.Field field, Schema schema)
name, doc,
defaultValue, and order as field has with changing
the schema to the specified one. It also copies all the props and
aliases.public Field(String name, Schema schema, String doc, Object defaultValue)
defaultValue - the default value for this field specified using the
mapping in JsonPropertiespublic Field(String name, Schema schema, String doc, Object defaultValue, Schema.Field.Order order)
defaultValue - the default value for this field specified using the
mapping in JsonPropertiespublic String name()
public int pos()
public String doc()
public boolean hasDefaultValue()
public Object defaultVal()
JsonPropertiespublic Schema.Field.Order order()
public void addAlias(String alias)
Copyright © 2009–2020 The Apache Software Foundation. All rights reserved.