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

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

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

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

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

      public MnemonicBuilder keyCombination(KeyCombination keyCombination)
      A builder method that invokes the setKeyCombination method on the instance being constructed.
      Returns:
      builder instance
    • node

      public MnemonicBuilder node(Node node)
      A builder method that invokes the setNode method on the instance being constructed.
      Returns:
      builder instance