Class PieChartDataBuilder
java.lang.Object
io.github.sosuisen.jfxbuilder.controls.PieChartDataBuilder
The
PieChartDataBuilder
class constructs instances of the Data
class
and offers a fluent interface for creating and configuring it.
This class includes a static create
method that accepts the same arguments as the original Data
constructor
and returns an instance of the PieChartDataBuilder
.
You can use method chaining to call the builder methods for configuring the Data
.
Finally, invoke the build
method to generate an instance of the Data
class.
Note that intermediate builder methods are not evaluated until the build
method
is called, meaning they are evaluated lazily.
- Author:
- Hidekazu Kubota <hidekazu.kubota@gmail.com>
-
Method Summary
Modifier and TypeMethodDescriptionapply
(Consumer<PieChart.Data> func) Applies a function to the Data instance being constructed.build()
Builds and returns an instance of theData
class.Applies a function to thechartProperty
of the instance being constructed.static PieChartDataBuilder
Accepts the constructor arguments ofData(String, double)
and returns an instance ofPieChartDataBuilder
.A builder method that invokes thesetName
method on the instance being constructed.Applies a function to thenameProperty
of the instance being constructed.Applies a function to thenodeProperty
of the instance being constructed.pieValue
(double value) A builder method that invokes thesetPieValue
method on the instance being constructed.Applies a function to thepieValueProperty
of the instance being constructed.
-
Method Details
-
create
Accepts the constructor arguments ofData(String, double)
and returns an instance ofPieChartDataBuilder
.- Returns:
- an instance of the
PieChartDataBuilder
.
-
build
-
apply
Applies a function to the Data instance being constructed. Most operations on the instance can be performed using this method.- Returns:
- builder instance
-
name
A builder method that invokes thesetName
method on the instance being constructed.- Returns:
- builder instance
-
pieValue
A builder method that invokes thesetPieValue
method on the instance being constructed.- Returns:
- builder instance
-
chartPropertyApply
Applies a function to thechartProperty
of the instance being constructed. This serves as a shorthand form of theapply
method.Example:
// Use apply .apply(obj -> obj.chartProperty().bind(anotherProperty)) // Use shorthand form .chartPropertyApply(prop -> prop.bind(anotherProperty))
- Returns:
- builder instance
-
namePropertyApply
Applies a function to thenameProperty
of the instance being constructed. This serves as a shorthand form of theapply
method.Example:
// Use apply .apply(obj -> obj.nameProperty().bind(anotherProperty)) // Use shorthand form .namePropertyApply(prop -> prop.bind(anotherProperty))
- Returns:
- builder instance
-
nodePropertyApply
Applies a function to thenodeProperty
of the instance being constructed. This serves as a shorthand form of theapply
method.Example:
// Use apply .apply(obj -> obj.nodeProperty().bind(anotherProperty)) // Use shorthand form .nodePropertyApply(prop -> prop.bind(anotherProperty))
- Returns:
- builder instance
-
pieValuePropertyApply
Applies a function to thepieValueProperty
of the instance being constructed. This serves as a shorthand form of theapply
method.Example:
// Use apply .apply(obj -> obj.pieValueProperty().bind(anotherProperty)) // Use shorthand form .pieValuePropertyApply(prop -> prop.bind(anotherProperty))
- Returns:
- builder instance
-