java.lang.Object
io.github.sosuisen.jfxbuilder.controls.XYChartDataBuilder<X,Y>

public class XYChartDataBuilder<X,Y> extends Object
The XYChartDataBuilder 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 XYChartDataBuilder.

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 Details

    • create

      public static <X, Y> XYChartDataBuilder<X,Y> create()
      Returns an instance of the XYChartDataBuilder<X, Y>.
      Returns:
      an instance of the XYChartDataBuilder<X, Y>.
    • create

      public static <X, Y> XYChartDataBuilder<X,Y> create(X xValue, Y yValue)
      Accepts the constructor arguments of Data(X, Y) and returns an instance of XYChartDataBuilder<X, Y>.
      Returns:
      an instance of the XYChartDataBuilder<X, Y>.
    • create

      public static <X, Y> XYChartDataBuilder<X,Y> create(X xValue, Y yValue, Object extraValue)
      Accepts the constructor arguments of Data(X, Y, Object) and returns an instance of XYChartDataBuilder<X, Y>.
      Returns:
      an instance of the XYChartDataBuilder<X, Y>.
    • build

      public XYChart.Data<X,Y> build()
      Builds and returns an instance of the Data class.

      Intermediate builder methods are not evaluated until the build method is called; in other words, they are evaluated lazily.

      Returns:
      new instance of the Data class
    • apply

      public XYChartDataBuilder<X,Y> apply(Consumer<XYChart.Data<X,Y>> func)
      Applies a function to the Data instance being constructed. Most operations on the instance can be performed using this method.
      Returns:
      builder instance
    • extraValue

      public XYChartDataBuilder<X,Y> extraValue(Object value)
      A builder method that invokes the setExtraValue method on the instance being constructed.
      Returns:
      builder instance
    • node

      public XYChartDataBuilder<X,Y> node(Node value)
      A builder method that invokes the setNode method on the instance being constructed.
      Returns:
      builder instance
    • xValue

      public XYChartDataBuilder<X,Y> xValue(X value)
      A builder method that invokes the setXValue method on the instance being constructed.
      Returns:
      builder instance
    • yValue

      public XYChartDataBuilder<X,Y> yValue(Y value)
      A builder method that invokes the setYValue method on the instance being constructed.
      Returns:
      builder instance
    • XValuePropertyApply

      public XYChartDataBuilder<X,Y> XValuePropertyApply(Consumer<ObjectProperty<X>> op)
      Applies a function to the XValueProperty of the instance being constructed. This serves as a shorthand form of the apply method.

      Example:

      Returns:
      builder instance
    • YValuePropertyApply

      public XYChartDataBuilder<X,Y> YValuePropertyApply(Consumer<ObjectProperty<Y>> op)
      Applies a function to the YValueProperty of the instance being constructed. This serves as a shorthand form of the apply method.

      Example:

      Returns:
      builder instance
    • extraValuePropertyApply

      public XYChartDataBuilder<X,Y> extraValuePropertyApply(Consumer<ObjectProperty<Object>> op)
      Applies a function to the extraValueProperty of the instance being constructed. This serves as a shorthand form of the apply method.

      Example:

      Returns:
      builder instance
    • nodePropertyApply

      public XYChartDataBuilder<X,Y> nodePropertyApply(Consumer<ObjectProperty<Node>> op)
      Applies a function to the nodeProperty of the instance being constructed. This serves as a shorthand form of the apply method.

      Example:

      Returns:
      builder instance