Configuration - the type of BufferConfiguration.BuilderType - the type of Builder that builds BufferConfiguration subclasses of type `Configuration`.public abstract static class BufferConfiguration.Builder<Configuration extends BufferConfiguration<Configuration>,BuilderType extends BufferConfiguration.Builder<Configuration,BuilderType>>
extends java.lang.Object
| Constructor and Description |
|---|
Builder() |
| Modifier and Type | Method and Description |
|---|---|
abstract Configuration |
build()
Creates a new BufferConfiguration from the Builder's current settings.
|
BufferConfiguration.DataHandler |
getDataHandler() |
int |
getInitialBufferSize() |
int |
getMaximumBufferSize() |
abstract int |
getMinimumMaximumBufferSize()
Gets the minimum allowed maximum buffer size.
|
abstract BufferConfiguration.DataHandler |
getNoOpDataHandler() |
abstract BufferConfiguration.OversizedValueHandler |
getNoOpOversizedValueHandler() |
BufferConfiguration.OversizedValueHandler |
getOversizedValueHandler() |
abstract BufferConfiguration.OversizedValueHandler |
getThrowingOversizedValueHandler() |
BuilderType |
onData(BufferConfiguration.DataHandler handler)
Sets the handler that will be notified when data is processed.
|
BuilderType |
onOversizedValue(BufferConfiguration.OversizedValueHandler handler)
Sets the handler that will be notified when oversized values are encountered.
|
BuilderType |
withInitialBufferSize(int initialBufferSizeInBytes)
Sets the initial size of the buffer that will be used to hold the data between top-level values.
|
BuilderType |
withMaximumBufferSize(int maximumBufferSizeInBytes)
Set the maximum size of the buffer.
|
public final BuilderType withInitialBufferSize(int initialBufferSizeInBytes)
initialBufferSizeInBytes - the value.public final int getInitialBufferSize()
public final BuilderType onOversizedValue(BufferConfiguration.OversizedValueHandler handler)
withMaximumBufferSize(int), this handler is required to be non-null.handler - the handler.public final BuilderType onData(BufferConfiguration.DataHandler handler)
handler - the handler.public final BufferConfiguration.OversizedValueHandler getOversizedValueHandler()
public final BufferConfiguration.DataHandler getDataHandler()
public final BuilderType withMaximumBufferSize(int maximumBufferSizeInBytes)
maximumBufferSizeInBytes - the value.public int getMaximumBufferSize()
public abstract int getMinimumMaximumBufferSize()
public abstract BufferConfiguration.OversizedValueHandler getNoOpOversizedValueHandler()
BufferConfiguration.OversizedValueHandler for the type of BufferConfiguration that this Builder builds.public abstract BufferConfiguration.OversizedValueHandler getThrowingOversizedValueHandler()
BufferConfiguration.OversizedValueHandler that always throws a runtime exception.public abstract BufferConfiguration.DataHandler getNoOpDataHandler()
BufferConfiguration.DataHandler for the type of BufferConfiguration that this Builder builds.public abstract Configuration build()