Package com.amazon.ion
Class IonBufferConfiguration.Builder
- java.lang.Object
-
- com.amazon.ion.BufferConfiguration.Builder<IonBufferConfiguration,IonBufferConfiguration.Builder>
-
- com.amazon.ion.IonBufferConfiguration.Builder
-
- Enclosing class:
- IonBufferConfiguration
public static final class IonBufferConfiguration.Builder extends BufferConfiguration.Builder<IonBufferConfiguration,IonBufferConfiguration.Builder>
Builds IonBufferConfiguration instances.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description IonBufferConfiguration
build()
Creates a new BufferConfiguration from the Builder's current settings.static IonBufferConfiguration.Builder
from(IonBufferConfiguration existingConfiguration)
Provides a new builder that would build IonBufferConfiguration instances with configuration identical to the given configuration.int
getMinimumMaximumBufferSize()
Gets the minimum allowed maximum buffer size.BufferConfiguration.DataHandler
getNoOpDataHandler()
IonBufferConfiguration.OversizedSymbolTableHandler
getNoOpOversizedSymbolTableHandler()
BufferConfiguration.OversizedValueHandler
getNoOpOversizedValueHandler()
IonBufferConfiguration.OversizedSymbolTableHandler
getOversizedSymbolTableHandler()
IonBufferConfiguration.Builder
onOversizedSymbolTable(IonBufferConfiguration.OversizedSymbolTableHandler handler)
Sets the handler that will be notified when oversized symbol tables are encountered.static IonBufferConfiguration.Builder
standard()
Provides the standard builder with the default initial buffer size, an unbounded maximum buffer size, and an event handler that does nothing.-
Methods inherited from class com.amazon.ion.BufferConfiguration.Builder
getDataHandler, getInitialBufferSize, getMaximumBufferSize, getOversizedValueHandler, onData, onOversizedValue, withInitialBufferSize, withMaximumBufferSize
-
-
-
-
Method Detail
-
standard
public static IonBufferConfiguration.Builder standard()
Provides the standard builder with the default initial buffer size, an unbounded maximum buffer size, and an event handler that does nothing.- Returns:
- a standard Builder.
-
from
public static IonBufferConfiguration.Builder from(IonBufferConfiguration existingConfiguration)
Provides a new builder that would build IonBufferConfiguration instances with configuration identical to the given configuration.- Parameters:
existingConfiguration
- an existing configuration.- Returns:
- a new mutable builder.
-
onOversizedSymbolTable
public IonBufferConfiguration.Builder onOversizedSymbolTable(IonBufferConfiguration.OversizedSymbolTableHandler handler)
Sets the handler that will be notified when oversized symbol tables are encountered. If the maximum buffer size is finite (seeBufferConfiguration.Builder.withMaximumBufferSize(int)
, this handler is required to be non-null.- Parameters:
handler
- the handler.- Returns:
- this builder.
-
getOversizedSymbolTableHandler
public IonBufferConfiguration.OversizedSymbolTableHandler getOversizedSymbolTableHandler()
- Returns:
- the handler that will be notified when oversized symbol tables are encountered.
-
getMinimumMaximumBufferSize
public int getMinimumMaximumBufferSize()
Description copied from class:BufferConfiguration.Builder
Gets the minimum allowed maximum buffer size.- Specified by:
getMinimumMaximumBufferSize
in classBufferConfiguration.Builder<IonBufferConfiguration,IonBufferConfiguration.Builder>
- Returns:
- the value.
-
getNoOpOversizedValueHandler
public BufferConfiguration.OversizedValueHandler getNoOpOversizedValueHandler()
- Specified by:
getNoOpOversizedValueHandler
in classBufferConfiguration.Builder<IonBufferConfiguration,IonBufferConfiguration.Builder>
- Returns:
- the no-op
BufferConfiguration.OversizedValueHandler
for the type of BufferConfiguration that this Builder builds.
-
getNoOpDataHandler
public BufferConfiguration.DataHandler getNoOpDataHandler()
- Specified by:
getNoOpDataHandler
in classBufferConfiguration.Builder<IonBufferConfiguration,IonBufferConfiguration.Builder>
- Returns:
- the no-op
BufferConfiguration.DataHandler
for the type of BufferConfiguration that this Builder builds.
-
getNoOpOversizedSymbolTableHandler
public IonBufferConfiguration.OversizedSymbolTableHandler getNoOpOversizedSymbolTableHandler()
- Returns:
- an OversizedSymbolTableHandler that does nothing.
-
build
public IonBufferConfiguration build()
Description copied from class:BufferConfiguration.Builder
Creates a new BufferConfiguration from the Builder's current settings.- Specified by:
build
in classBufferConfiguration.Builder<IonBufferConfiguration,IonBufferConfiguration.Builder>
- Returns:
- a new instance.
-
-