Value: clean up unneeded generics type parameters

This commit is contained in:
Paul Campbell 2017-04-23 17:55:08 +01:00
parent ce42e9dcbe
commit 47d0b8f78d

View file

@ -26,11 +26,9 @@ import java.util.function.Supplier;
/** /**
* A Value from an if-then-else in a functional-style. * A Value from an if-then-else in a functional-style.
* *
* @param <T> the type of the value
*
* @author Paul Campbell (pcampbell@kemitix.net). * @author Paul Campbell (pcampbell@kemitix.net).
*/ */
public interface Value<T> { public interface Value {
/** /**
* Create a new {@link ValueClause} for the clause. * Create a new {@link ValueClause} for the clause.
@ -144,12 +142,12 @@ public interface Value<T> {
@Override @Override
public ValueSupplier<T> then(final Supplier<T> trueSupplier) { public ValueSupplier<T> then(final Supplier<T> trueSupplier) {
return new TrueValueSupplier<T>(trueSupplier); return new TrueValueSupplier(trueSupplier);
} }
@Override @Override
public ValueClause<T> and(final boolean clause) { public ValueClause<T> and(final boolean clause) {
return Value.<T>where(clause); return Value.where(clause);
} }
@Override @Override
@ -159,10 +157,8 @@ public interface Value<T> {
/** /**
* An intermediate result of the {@link Value} where the clause has evaluated to true. * An intermediate result of the {@link Value} where the clause has evaluated to true.
*
* @param <T> the type of the value
*/ */
private class TrueValueSupplier<T> implements ValueSupplier<T> { private class TrueValueSupplier implements ValueSupplier<T> {
private final Supplier<T> valueSupplier; private final Supplier<T> valueSupplier;
@ -188,7 +184,7 @@ public interface Value<T> {
@Override @Override
public ValueSupplier<T> then(final Supplier<T> trueSupplier) { public ValueSupplier<T> then(final Supplier<T> trueSupplier) {
return new FalseValueSupplier<T>(); return new FalseValueSupplier();
} }
@Override @Override
@ -198,15 +194,13 @@ public interface Value<T> {
@Override @Override
public ValueClause<T> or(final boolean clause) { public ValueClause<T> or(final boolean clause) {
return Value.<T>where(clause); return Value.where(clause);
} }
/** /**
* An intermediate result of the {@link Value} where the clause has evaluated to false. * An intermediate result of the {@link Value} where the clause has evaluated to false.
*
* @param <T> the type of the value
*/ */
private class FalseValueSupplier<T> implements ValueSupplier<T> { private class FalseValueSupplier implements ValueSupplier<T> {
@Override @Override
public T otherwise(final Supplier<T> falseSupplier) { public T otherwise(final Supplier<T> falseSupplier) {