Class IfChanged<T>

java.lang.Object
microsim.IfChanged<T>
All Implemented Interfaces:
Supplier<Boolean>

public class IfChanged<T> extends Object implements Supplier<Boolean>

Watch the ouput of a Supplier, checking whether the returned value changed since the last invocation.

This uses Object.equals(Object) to perform the comparison.

  • Constructor Details

    • IfChanged

      public IfChanged(Supplier<? extends T> source)
      Wrap the provided Supplier.
  • Method Details