Top Description Fields Constructors Methods
tools.jackson.dataformat.avro

public final Enum AvroWriteFeature

extends Enum<AvroWriteFeature>
implements FormatFeature
Class Inheritance
All Implemented Interfaces
tools.jackson.core.FormatFeature, tools.jackson.core.util.JacksonFeature
Imports
tools.jackson.core.FormatFeature

Enumeration that defines all togglable features for Avro generators

Note

in Jackson 2.x this was named AvroGenerator.Feature.

Field Summary

Modifier and TypeField and Description
private final boolean
private final int
public static final AvroWriteFeature
ADD_NULL_AS_DEFAULT_VALUE_IN_SCHEMA

Feature that enables addition of null as default value in generated schema when no real default value is defined and null is legal value for type (union type with null included).

public static final AvroWriteFeature
AVRO_BUFFERING

Feature that can be disabled to prevent Avro from buffering any more data then absolutely necessary.

public static final AvroWriteFeature
AVRO_FILE_OUTPUT

Feature that tells Avro to write data in file format (i.e. including the schema with the data) rather than the RPC format which is otherwise default

Note

reader-side will have to be aware of distinction as well, since possible inclusion of this header is not 100% reliably auto-detectable (while header has distinct marker, "raw" Avro content has no limitations and could theoretically have same pre-amble from data).

Constructor Summary

AccessConstructor and Description
private
AvroWriteFeature(boolean defaultState)

Method Summary

Modifier and TypeMethod and Description
public static int
collectDefaults()

Method that calculates bit set (flags) of all features that are enabled by default.

public boolean
enabledByDefault()

Implements tools.jackson.core.util.JacksonFeature.enabledByDefault.

Accessor for checking whether this feature is enabled by default.

public boolean
enabledIn(int flags)

Implements tools.jackson.core.util.JacksonFeature.enabledIn.

Convenience method for checking whether feature is enabled in given bitmask.

public int
getMask()

Implements tools.jackson.core.util.JacksonFeature.getMask.

Returns bit mask for this feature instance; must be a single bit, that is of form 1 << N.

public static AvroWriteFeature
public static AvroWriteFeature[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

_defaultStateback to summary
private final boolean _defaultState
_maskback to summary
private final int _mask
ADD_NULL_AS_DEFAULT_VALUE_IN_SCHEMAback to summary
public static final AvroWriteFeature ADD_NULL_AS_DEFAULT_VALUE_IN_SCHEMA

Feature that enables addition of null as default value in generated schema when no real default value is defined and null is legal value for type (union type with null included).

Disabled by default.

Since
3.0
AVRO_BUFFERINGback to summary
public static final AvroWriteFeature AVRO_BUFFERING

Feature that can be disabled to prevent Avro from buffering any more data then absolutely necessary. This affects buffering by underlying codec. Note that disabling buffer is likely to reduce performance if the underlying input/output is unbuffered.

Enabled by default to preserve the existing behavior.

AVRO_FILE_OUTPUTback to summary
public static final AvroWriteFeature AVRO_FILE_OUTPUT

Feature that tells Avro to write data in file format (i.e. including the schema with the data) rather than the RPC format which is otherwise default

Note

reader-side will have to be aware of distinction as well, since possible inclusion of this header is not 100% reliably auto-detectable (while header has distinct marker, "raw" Avro content has no limitations and could theoretically have same pre-amble from data).

Constructor Detail

AvroWriteFeatureback to summary
private AvroWriteFeature(boolean defaultState)

Method Detail

collectDefaultsback to summary
public static int collectDefaults()

Method that calculates bit set (flags) of all features that are enabled by default.

enabledByDefaultback to summary
public boolean enabledByDefault()

Implements tools.jackson.core.util.JacksonFeature.enabledByDefault.

Doc from tools.jackson.core.util.JacksonFeature.enabledByDefault.

Accessor for checking whether this feature is enabled by default.

Annotations
@Override
enabledInback to summary
public boolean enabledIn(int flags)

Implements tools.jackson.core.util.JacksonFeature.enabledIn.

Doc from tools.jackson.core.util.JacksonFeature.enabledIn.

Convenience method for checking whether feature is enabled in given bitmask.

Annotations
@Override
getMaskback to summary
public int getMask()

Implements tools.jackson.core.util.JacksonFeature.getMask.

Doc from tools.jackson.core.util.JacksonFeature.getMask.

Returns bit mask for this feature instance; must be a single bit, that is of form 1 << N.

Annotations
@Override
valueOfback to summary
public static AvroWriteFeature valueOf(String name)
valuesback to summary
public static AvroWriteFeature[] values()