The SimpleButton is a template class, that you can use in your own Java-project.
The Template Class gives you the option to check the state of the button, and to create simple events if the button is pressed, depressed or while it is being pressed.
A simple example on how to use the Button-Class from the Hardware-Catalog:
// Initialize the button component
final var button = new SimpleButton(pi4j, PIN.D26, Boolean.FALSE);
// Register event handlers to print a message when pressed (onDown) and depressed (onUp)
button.onDown (() -> System.out.println("Button pressed"));
button.whilePressed(() -> System.out.println("Still pressing"), Duration.ofSeconds(1));
button.onUp (() -> System.out.println("Stopped pressing"));
// Wait for 15 seconds while handling events before exiting
System.out.println("Press the button to see it in action!");
delay(Duration.ofSeconds(15));
// Unregister all event handlers to exit this application in a clean way
button.reset();