Class TaxCalculator.Builder
java.lang.Object
me.thiagorigonatti.capitalgains.core.TaxCalculator.Builder
- Enclosing class:
TaxCalculator
Builder for new instances of TaxCalculator.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds and returns a new instance ofTaxCalculatorwith the configured options.dumpTo(OutputStream outputStream, int bufferSizeOut) Sets the output stream and output buffer size.formattedWith(DecimalFormat decimalFormat) Sets the DecimalFormat to be used for formatting.from(InputStream inputStream, int bufferSizeIn) Sets the input stream and input buffer size.Sets a predicate to filter operations that should be considered.printEveryLine(boolean printEveryLine) Specifies whether each processed line should be printed.timings(boolean timings) Specifies whether timing metrics should be recorded.Sets the supplier responsible for creating Stock instances.
-
Constructor Details
-
Builder
Constructs a new
Builderinstance, initializing the builder with the provided arguments.- Parameters:
args- The array of arguments to initialize the builder.
-
Builder
public Builder()Constructs a new
Builderinstance.
-
-
Method Details
-
formattedWith
Sets the DecimalFormat to be used for formatting.- Parameters:
decimalFormat- the DecimalFormat instance- Returns:
- this builder instance
-
from
Sets the input stream and input buffer size.- Parameters:
inputStream- the input streambufferSizeIn- the buffer size for reading- Returns:
- this builder instance
-
dumpTo
Sets the output stream and output buffer size.- Parameters:
outputStream- the output streambufferSizeOut- the buffer size for writing- Returns:
- this builder instance
-
printEveryLine
Specifies whether each processed line should be printed.- Parameters:
printEveryLine- true to print every line, false otherwise- Returns:
- this builder instance
-
timings
Specifies whether timing metrics should be recorded.- Parameters:
timings- true to enable timings, false otherwise- Returns:
- this builder instance
-
onlyFor
Sets a predicate to filter operations that should be considered.- Parameters:
operationPredicate- the predicate to apply- Returns:
- this builder instance
-
with
Sets the supplier responsible for creating Stock instances.- Parameters:
stockSupplier- the stock supplier- Returns:
- this builder instance
-
build
Builds and returns a new instance ofTaxCalculatorwith the configured options.- Returns:
- a new TaxCalculator instance
-