Class EqualizerBandBuilder

java.lang.Object
io.github.sosuisen.jfxbuilder.media.EqualizerBandBuilder

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

You can use method chaining to call the builder methods for configuring the EqualizerBand. Finally, invoke the build method to generate an instance of the EqualizerBand 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 EqualizerBandBuilder create()
      Returns an instance of the EqualizerBandBuilder.
      Returns:
      an instance of the EqualizerBandBuilder.
    • create

      public static EqualizerBandBuilder create(double centerFrequency, double bandwidth, double gain)
      Accepts the constructor arguments of EqualizerBand(double, double, double) and returns an instance of EqualizerBandBuilder.
      Returns:
      an instance of the EqualizerBandBuilder.
    • build

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

      Applies a function to the EqualizerBand instance being constructed. Most operations on the instance can be performed using this method.
      Returns:
      builder instance
    • bandwidth

      public EqualizerBandBuilder bandwidth(double value)
      A builder method that invokes the setBandwidth method on the instance being constructed.
      Returns:
      builder instance
    • centerFrequency

      public EqualizerBandBuilder centerFrequency(double value)
      A builder method that invokes the setCenterFrequency method on the instance being constructed.
      Returns:
      builder instance
    • gain

      public EqualizerBandBuilder gain(double value)
      A builder method that invokes the setGain method on the instance being constructed.
      Returns:
      builder instance
    • bandwidthPropertyApply

      public EqualizerBandBuilder bandwidthPropertyApply(Consumer<DoubleProperty> op)
      Applies a function to the bandwidthProperty of the instance being constructed. This serves as a shorthand form of the apply method.

      Example:

      // Use apply
      .apply(obj -> obj.bandwidthProperty().bind(anotherProperty))
      
      // Use shorthand form
      .bandwidthPropertyApply(prop -> prop.bind(anotherProperty))
      
      Returns:
      builder instance
    • centerFrequencyPropertyApply

      public EqualizerBandBuilder centerFrequencyPropertyApply(Consumer<DoubleProperty> op)
      Applies a function to the centerFrequencyProperty of the instance being constructed. This serves as a shorthand form of the apply method.

      Example:

      // Use apply
      .apply(obj -> obj.centerFrequencyProperty().bind(anotherProperty))
      
      // Use shorthand form
      .centerFrequencyPropertyApply(prop -> prop.bind(anotherProperty))
      
      Returns:
      builder instance
    • gainPropertyApply

      public EqualizerBandBuilder gainPropertyApply(Consumer<DoubleProperty> op)
      Applies a function to the gainProperty of the instance being constructed. This serves as a shorthand form of the apply method.

      Example:

      // Use apply
      .apply(obj -> obj.gainProperty().bind(anotherProperty))
      
      // Use shorthand form
      .gainPropertyApply(prop -> prop.bind(anotherProperty))
      
      Returns:
      builder instance