Fix PMD warnings
This commit is contained in:
parent
74cdaa851f
commit
f596984fa5
5 changed files with 9 additions and 3 deletions
|
@ -28,7 +28,7 @@ package net.kemitix.conditional;
|
|||
*/
|
||||
final class FalseCondition implements Condition {
|
||||
|
||||
protected static final Condition FALSE = new net.kemitix.conditional.FalseCondition();
|
||||
public static final Condition FALSE = new net.kemitix.conditional.FalseCondition();
|
||||
|
||||
@Override
|
||||
public Condition and(final boolean clause) {
|
||||
|
@ -36,6 +36,7 @@ final class FalseCondition implements Condition {
|
|||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("PMD.ShortMethodName")
|
||||
public Condition or(final boolean secondClause) {
|
||||
return Condition.where(secondClause);
|
||||
}
|
||||
|
|
|
@ -45,6 +45,7 @@ class FalseValueClause<T> implements Value.ValueClause<T> {
|
|||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("PMD.ShortMethodName")
|
||||
public Value.ValueClause<T> or(final boolean clause) {
|
||||
return Value.where(clause);
|
||||
}
|
||||
|
|
|
@ -28,7 +28,7 @@ package net.kemitix.conditional;
|
|||
*/
|
||||
final class TrueCondition implements Condition {
|
||||
|
||||
protected static final Condition TRUE = new net.kemitix.conditional.TrueCondition();
|
||||
public static final Condition TRUE = new net.kemitix.conditional.TrueCondition();
|
||||
|
||||
@Override
|
||||
public Condition and(final boolean clause) {
|
||||
|
@ -36,6 +36,7 @@ final class TrueCondition implements Condition {
|
|||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("PMD.ShortMethodName")
|
||||
public Condition or(final boolean secondClause) {
|
||||
return TRUE;
|
||||
}
|
||||
|
|
|
@ -47,6 +47,7 @@ class TrueValueClause<T> implements Value.ValueClause<T> {
|
|||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("PMD.ShortMethodName")
|
||||
public Value.ValueClause<T> or(final boolean clause) {
|
||||
return this;
|
||||
}
|
||||
|
@ -57,7 +58,7 @@ class TrueValueClause<T> implements Value.ValueClause<T> {
|
|||
@RequiredArgsConstructor
|
||||
private class TrueValueSupplier implements ValueSupplier<T> {
|
||||
|
||||
private final Supplier<T> valueSupplier;
|
||||
private final transient Supplier<T> valueSupplier;
|
||||
|
||||
@Override
|
||||
public T otherwise(final Supplier<T> falseSupplier) {
|
||||
|
|
|
@ -41,6 +41,7 @@ public interface Value {
|
|||
*
|
||||
* @return the value from either the trueSupplier or the falseSupplier
|
||||
*/
|
||||
@SuppressWarnings("PMD.LawOfDemeter")
|
||||
static <T> T where(
|
||||
boolean clause,
|
||||
Supplier<T> trueSupplier,
|
||||
|
@ -123,6 +124,7 @@ public interface Value {
|
|||
*
|
||||
* @return a true or false value clause
|
||||
*/
|
||||
@SuppressWarnings("PMD.ShortMethodName")
|
||||
ValueClause<T> or(boolean clause);
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue