Condition

Collection of BooleanSupplier extensions for rising and falling edge detection.

Supports self-typing for type-safe chaining of boolean conditions.

Author

Lucas Bubner, 2024

Since

6.0.0

Parameters

<T>

self-type

Inheritors

Constructors

Link copied to clipboard
constructor(@NonNull edge: Condition.Edge, @NonNull condition: BooleanSupplier)
Creates a new self-type Condition with the given BooleanSupplier.
constructor(@NonNull condition: BooleanSupplier)
Creates a new self-type Condition with the given BooleanSupplier and no edge detection.

Types

Link copied to clipboard
enum Edge
Enum for edge detection.

Properties

Link copied to clipboard
The currently set edge detection to use for the BooleanSuppliergetAsBoolean method.

Functions

Link copied to clipboard
open fun and(@NonNull other: BooleanSupplier): T
Creates a new self-type Condition that is the logical AND of this Condition and another BooleanSupplier.
Link copied to clipboard
open fun getActive(): Boolean
Link copied to clipboard
Link copied to clipboard
open fun getAsBoolean(): Boolean
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
protected open fun newInstance(edge: Condition.Edge, supplier: BooleanSupplier): T
Override this method and construct a new instance of the subclass for self-typing.
Link copied to clipboard
open fun not(): T
Creates a new self-type Condition that is the logical NOT of this Condition.
Link copied to clipboard
open fun or(@NonNull other: BooleanSupplier): T
Creates a new self-type Condition that is the logical OR of this Condition and another BooleanSupplier.
Link copied to clipboard
open fun toString(): String
Link copied to clipboard
Mutates this Condition with a delay.
Link copied to clipboard
Mutates this Condition to adjust the edge detection for the BooleanSuppliergetAsBoolean method.
Link copied to clipboard
open fun xor(@NonNull other: BooleanSupplier): T
Creates a new self-type Condition that is the logical XOR of this Condition and another BooleanSupplier.