Class CornerRadiiBuilder

java.lang.Object
io.github.sosuisen.jfxbuilder.graphics.CornerRadiiBuilder

public class CornerRadiiBuilder extends Object
The CornerRadiiBuilder class constructs instances of the CornerRadii 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 CornerRadii constructor and returns an instance of the CornerRadiiBuilder.

You can use method chaining to call the builder methods for configuring the CornerRadii. Finally, invoke the build method to generate an instance of the CornerRadii 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 CornerRadiiBuilder create(double radius)
      Accepts the constructor arguments of CornerRadii(double) and returns an instance of CornerRadiiBuilder.
      Returns:
      an instance of the CornerRadiiBuilder.
    • create

      public static CornerRadiiBuilder create(double radius, boolean asPercent)
      Accepts the constructor arguments of CornerRadii(double, boolean) and returns an instance of CornerRadiiBuilder.
      Returns:
      an instance of the CornerRadiiBuilder.
    • create

      public static CornerRadiiBuilder create(double topLeft, double topRight, double bottomRight, double bottomLeft, boolean asPercent)
      Accepts the constructor arguments of CornerRadii(double, double, double, double, boolean) and returns an instance of CornerRadiiBuilder.
      Returns:
      an instance of the CornerRadiiBuilder.
    • create

      public static CornerRadiiBuilder create(double topLeftHorizontalRadius, double topLeftVerticalRadius, double topRightVerticalRadius, double topRightHorizontalRadius, double bottomRightHorizontalRadius, double bottomRightVerticalRadius, double bottomLeftVerticalRadius, double bottomLeftHorizontalRadius, boolean topLeftHorizontalRadiusAsPercent, boolean topLeftVerticalRadiusAsPercent, boolean topRightVerticalRadiusAsPercent, boolean topRightHorizontalRadiusAsPercent, boolean bottomRightHorizontalRadiusAsPercent, boolean bottomRightVerticalRadiusAsPercent, boolean bottomLeftVerticalRadiusAsPercent, boolean bottomLeftHorizontalRadiusAsPercent)
      Returns:
      an instance of the CornerRadiiBuilder.
    • build

      public CornerRadii build()
      Builds and returns an instance of the CornerRadii 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 CornerRadii class
    • apply

      public CornerRadiiBuilder apply(Consumer<CornerRadii> func)
      Applies a function to the CornerRadii instance being constructed. Most operations on the instance can be performed using this method.
      Returns:
      builder instance