Suppress unchecked cast
This commit is contained in:
parent
ca83e1c244
commit
1992db49f1
3 changed files with 6 additions and 5 deletions
|
@ -33,11 +33,11 @@ import java.util.function.Supplier;
|
||||||
*/
|
*/
|
||||||
class FalseValueClause<T> implements Value.ValueClause<T> {
|
class FalseValueClause<T> implements Value.ValueClause<T> {
|
||||||
|
|
||||||
protected static final Value.ValueClause FALSE = new FalseValueClause();
|
protected static final Value.ValueClause<?> FALSE = new FalseValueClause<>();
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ValueSupplier<T> then(final Supplier<T> trueSupplier) {
|
public ValueSupplier<T> then(final Supplier<T> trueSupplier) {
|
||||||
return new FalseValueSupplier();
|
return new FalseValueSupplier<>();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -35,7 +35,7 @@ import java.util.function.Supplier;
|
||||||
*/
|
*/
|
||||||
class TrueValueClause<T> implements Value.ValueClause<T> {
|
class TrueValueClause<T> implements Value.ValueClause<T> {
|
||||||
|
|
||||||
protected static final Value.ValueClause TRUE = new TrueValueClause<>();
|
protected static final Value.ValueClause<?> TRUE = new TrueValueClause<>();
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ValueSupplier<T> then(final Supplier<T> trueSupplier) {
|
public ValueSupplier<T> then(final Supplier<T> trueSupplier) {
|
||||||
|
|
|
@ -75,11 +75,12 @@ public interface Value {
|
||||||
*
|
*
|
||||||
* @return a true or false value clause
|
* @return a true or false value clause
|
||||||
*/
|
*/
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
static <T> ValueClause<T> where(final boolean clause) {
|
static <T> ValueClause<T> where(final boolean clause) {
|
||||||
if (clause) {
|
if (clause) {
|
||||||
return TrueValueClause.TRUE;
|
return (ValueClause<T>) TrueValueClause.TRUE;
|
||||||
}
|
}
|
||||||
return FalseValueClause.FALSE;
|
return (ValueClause<T>) FalseValueClause.FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue