Value: use lombok to replace constructor

This commit is contained in:
Paul Campbell 2017-04-24 13:34:36 +01:00
parent 09ae3b0257
commit 07f4af3425

View file

@ -21,6 +21,8 @@
package net.kemitix.conditional;
import lombok.RequiredArgsConstructor;
import java.util.function.Supplier;
/**
@ -158,14 +160,11 @@ public interface Value {
/**
* An intermediate result of the {@link Value} where the clause has evaluated to true.
*/
@RequiredArgsConstructor
private class TrueValueSupplier implements ValueSupplier<T> {
private final Supplier<T> valueSupplier;
TrueValueSupplier(final Supplier<T> valueSupplier) {
this.valueSupplier = valueSupplier;
}
@Override
public T otherwise(final Supplier<T> falseSupplier) {
return valueSupplier.get();