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
Modifier and TypeMethodDescriptionbuild()Creates a new BufferConfiguration from the Builder's current settings.from(IonBufferConfiguration existingConfiguration) Provides a new builder that would build IonBufferConfiguration instances with configuration identical to the given configuration.intGets the minimum allowed maximum buffer size.Sets the handler that will be notified when oversized symbol tables are encountered.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 Details
-
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
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
- Returns:
- the handler that will be notified when oversized symbol tables are encountered.
-
getMinimumMaximumBufferSize
public int getMinimumMaximumBufferSize()Description copied from class:BufferConfiguration.BuilderGets the minimum allowed maximum buffer size.- Specified by:
getMinimumMaximumBufferSizein classBufferConfiguration.Builder<IonBufferConfiguration,IonBufferConfiguration.Builder> - Returns:
- the value.
-
getNoOpOversizedValueHandler
- Specified by:
getNoOpOversizedValueHandlerin classBufferConfiguration.Builder<IonBufferConfiguration,IonBufferConfiguration.Builder> - Returns:
- the no-op
BufferConfiguration.OversizedValueHandlerfor the type of BufferConfiguration that this Builder builds.
-
getThrowingOversizedValueHandler
- Specified by:
getThrowingOversizedValueHandlerin classBufferConfiguration.Builder<IonBufferConfiguration,IonBufferConfiguration.Builder> - Returns:
- an
BufferConfiguration.OversizedValueHandlerthat always throws a runtime exception.
-
getNoOpDataHandler
- Specified by:
getNoOpDataHandlerin classBufferConfiguration.Builder<IonBufferConfiguration,IonBufferConfiguration.Builder> - Returns:
- the no-op
BufferConfiguration.DataHandlerfor the type of BufferConfiguration that this Builder builds.
-
getNoOpOversizedSymbolTableHandler
- Returns:
- an OversizedSymbolTableHandler that does nothing.
-
getThrowingOversizedSymbolTableHandler
- Returns:
- an OversizedSymbolTableHandler that always throws
IonException.
-
build
Description copied from class:BufferConfiguration.BuilderCreates a new BufferConfiguration from the Builder's current settings.- Specified by:
buildin classBufferConfiguration.Builder<IonBufferConfiguration,IonBufferConfiguration.Builder> - Returns:
- a new instance.
-