SELF - the type of builder's chain call return typeT - the type of elements in this builded queuespublic abstract static class FileQueue.Builder<SELF extends FileQueue.Builder<SELF,T>,T> extends Object
| Constructor and Description |
|---|
Builder() |
| Modifier and Type | Method and Description |
|---|---|
FileQueue<T> |
build()
Builds a new queue with parameters from the builder.
|
SELF |
compressed(@NonNull CompressedFilesConfig value)
Sets the compression files configuration.
|
protected abstract FileQueue<T> |
createQueue()
The method for producing a new queue on each call based on builder's parameters.
|
SELF |
deserializer(@NonNull Deserializer<T> value)
Sets the
Deserializer implementation for queue elements. |
SELF |
folder(@NonNull Path value)
Sets a queue's folder path, which the queue uses
if the WAL and compressed configurations doesn't tell another.
|
SELF |
folder(@NonNull String value)
Sets a queue's folder path, which the queue uses
if the WAL and compressed configurations doesn't tell another.
|
SELF |
limit(@NonNull QueueLimit<T> value)
Sets the queue limits.
|
SELF |
name(@NonNull String value)
Sets the queue's name.
|
SELF |
restoreFromDisk(boolean value)
Tells to the queue to restore its state from the previous run files or not.
|
SELF |
serializer(@NonNull Serializer<T> value)
Sets the
Serializer implementation for queue elements. |
protected void |
validateAndSetDefaults()
The method for builder's parameters validation and setting the default values,
before creating a new queue.
|
SELF |
wal(@NonNull WalFilesConfig value)
Sets the WAL files configuration.
|
public SELF name(@NonNull @NonNull String value)
value - the new valuepublic SELF folder(@NonNull @NonNull String value)
value - the new valuepublic SELF folder(@NonNull @NonNull Path value)
value - the new valuepublic SELF serializer(@NonNull @NonNull Serializer<T> value)
Serializer implementation for queue elements.value - the new valuepublic SELF deserializer(@NonNull @NonNull Deserializer<T> value)
Deserializer implementation for queue elements.value - the new valuepublic SELF limit(@NonNull @NonNull QueueLimit<T> value)
The default value is an instance of QueueLimit.NoLimit.
value - the new valuepublic SELF wal(@NonNull @NonNull WalFilesConfig value)
The default value has:
100 max WAL files amount, before compressionvalue - the new valuepublic SELF compressed(@NonNull @NonNull CompressedFilesConfig value)
The default value has:
Long.MAX_VALUE max file size (unlimited, another words)value - the new valuepublic SELF restoreFromDisk(boolean value)
If it is set to false, the queue, before start, removes all previous run files (if they exist).
If it is set to true, the queue re-reads all the files and restores its state.
The default value is: true
value - the new valuepublic FileQueue<T> build()
protected abstract FileQueue<T> createQueue()
protected void validateAndSetDefaults()
Copyright © 2019 Infobip Ltd.. All rights reserved.