public IAutoSnappingPredicate<T>
A single check to be evaluated during autosnapping
boolean checkState(@NotNull
T param)
Run this check.
param - typed param that this implementation might need. Default is Unitwhether this predicate currently allows autosnap
Note some (bad) magic here:
to achieve ability to implement interface IAutoSnappingPredicate
with param or without it - we do unchecked cast here.
If interface IAutoSnappingPredicate's implementation explicitly defines some type to use
as param - this cast will fail if nothing provided:
For class Foo : IAutoSnappingPredicate
call myFoo.okDetected() will fail, as it expects myFoo.okDetected(myClassInstance).
To have implementation that does not need param, just use Unit and pass no parameter:
class Bar : IAutoSnappingPredicate, and then myBar.okDetected()