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 {
|
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
|
@Override
|
||||||
public Condition and(final boolean clause) {
|
public Condition and(final boolean clause) {
|
||||||
|
@ -36,6 +36,7 @@ final class FalseCondition implements Condition {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@SuppressWarnings("PMD.ShortMethodName")
|
||||||
public Condition or(final boolean secondClause) {
|
public Condition or(final boolean secondClause) {
|
||||||
return Condition.where(secondClause);
|
return Condition.where(secondClause);
|
||||||
}
|
}
|
||||||
|
|
|
@ -45,6 +45,7 @@ class FalseValueClause<T> implements Value.ValueClause<T> {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@SuppressWarnings("PMD.ShortMethodName")
|
||||||
public Value.ValueClause<T> or(final boolean clause) {
|
public Value.ValueClause<T> or(final boolean clause) {
|
||||||
return Value.where(clause);
|
return Value.where(clause);
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,7 +28,7 @@ package net.kemitix.conditional;
|
||||||
*/
|
*/
|
||||||
final class TrueCondition implements Condition {
|
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
|
@Override
|
||||||
public Condition and(final boolean clause) {
|
public Condition and(final boolean clause) {
|
||||||
|
@ -36,6 +36,7 @@ final class TrueCondition implements Condition {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@SuppressWarnings("PMD.ShortMethodName")
|
||||||
public Condition or(final boolean secondClause) {
|
public Condition or(final boolean secondClause) {
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,6 +47,7 @@ class TrueValueClause<T> implements Value.ValueClause<T> {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@SuppressWarnings("PMD.ShortMethodName")
|
||||||
public Value.ValueClause<T> or(final boolean clause) {
|
public Value.ValueClause<T> or(final boolean clause) {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
@ -57,7 +58,7 @@ class TrueValueClause<T> implements Value.ValueClause<T> {
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
private class TrueValueSupplier implements ValueSupplier<T> {
|
private class TrueValueSupplier implements ValueSupplier<T> {
|
||||||
|
|
||||||
private final Supplier<T> valueSupplier;
|
private final transient Supplier<T> valueSupplier;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public T otherwise(final Supplier<T> falseSupplier) {
|
public T otherwise(final Supplier<T> falseSupplier) {
|
||||||
|
|
|
@ -41,6 +41,7 @@ public interface Value {
|
||||||
*
|
*
|
||||||
* @return the value from either the trueSupplier or the falseSupplier
|
* @return the value from either the trueSupplier or the falseSupplier
|
||||||
*/
|
*/
|
||||||
|
@SuppressWarnings("PMD.LawOfDemeter")
|
||||||
static <T> T where(
|
static <T> T where(
|
||||||
boolean clause,
|
boolean clause,
|
||||||
Supplier<T> trueSupplier,
|
Supplier<T> trueSupplier,
|
||||||
|
@ -123,6 +124,7 @@ public interface Value {
|
||||||
*
|
*
|
||||||
* @return a true or false value clause
|
* @return a true or false value clause
|
||||||
*/
|
*/
|
||||||
|
@SuppressWarnings("PMD.ShortMethodName")
|
||||||
ValueClause<T> or(boolean clause);
|
ValueClause<T> or(boolean clause);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue