public final class Binary extends Object implements Scalar<Boolean>
There is no thread-safety guarantee.
This class implements Scalar
, which throws a checked
Exception
. This may not be convenient in many cases. To make
it more convenient and get rid of the checked exception you can
use the Unchecked
decorator. Or you may use
IoChecked
to wrap it in an IOException.
final AtomicInteger counter = new AtomicInteger();
new Binary(
() -> true,
() -> counter.incrementAndGet
).value() // will be equal true
Copyright © 2017–2021 Cactoos. All rights reserved.