|
|
|
|
@ -252,7 +252,8 @@ public class ConditionalOperators {
@@ -252,7 +252,8 @@ public class ConditionalOperators {
|
|
|
|
|
/** |
|
|
|
|
* Creates new {@link IfNull}. |
|
|
|
|
* |
|
|
|
|
* @param fieldReference the field to check for a {@literal null} value, field reference must not be {@literal null}. |
|
|
|
|
* @param fieldReference the field to check for a {@literal null} value, field reference must not be |
|
|
|
|
* {@literal null}. |
|
|
|
|
* @return never {@literal null}. |
|
|
|
|
*/ |
|
|
|
|
public static ThenBuilder ifNull(String fieldReference) { |
|
|
|
|
@ -283,8 +284,8 @@ public class ConditionalOperators {
@@ -283,8 +284,8 @@ public class ConditionalOperators {
|
|
|
|
|
|
|
|
|
|
List<Object> list = new ArrayList<Object>(); |
|
|
|
|
|
|
|
|
|
if(condition instanceof Collection) { |
|
|
|
|
for(Object val : ((Collection)this.condition)) { |
|
|
|
|
if (condition instanceof Collection) { |
|
|
|
|
for (Object val : ((Collection) this.condition)) { |
|
|
|
|
list.add(mapCondition(val, context)); |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
@ -346,7 +347,8 @@ public class ConditionalOperators {
@@ -346,7 +347,8 @@ public class ConditionalOperators {
|
|
|
|
|
public interface OrBuilder { |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* @param fieldReference the field to check for a {@literal null} value, field reference must not be {@literal null}. |
|
|
|
|
* @param fieldReference the field to check for a {@literal null} value, field reference must not be |
|
|
|
|
* {@literal null}. |
|
|
|
|
* @return the {@link ThenBuilder} |
|
|
|
|
*/ |
|
|
|
|
ThenBuilder orIfNull(String fieldReference); |
|
|
|
|
@ -499,7 +501,7 @@ public class ConditionalOperators {
@@ -499,7 +501,7 @@ public class ConditionalOperators {
|
|
|
|
|
public static Switch switchCases(List<CaseOperator> conditions) { |
|
|
|
|
|
|
|
|
|
Assert.notNull(conditions, "Conditions must not be null!"); |
|
|
|
|
return new Switch(Collections.<String, Object>singletonMap("branches", new ArrayList<CaseOperator>(conditions))); |
|
|
|
|
return new Switch(Collections.<String, Object> singletonMap("branches", new ArrayList<CaseOperator>(conditions))); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
@ -902,8 +904,7 @@ public class ConditionalOperators {
@@ -902,8 +904,7 @@ public class ConditionalOperators {
|
|
|
|
|
private @Nullable Object condition; |
|
|
|
|
private @Nullable Object thenValue; |
|
|
|
|
|
|
|
|
|
private ConditionalExpressionBuilder() { |
|
|
|
|
} |
|
|
|
|
private ConditionalExpressionBuilder() {} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Creates a new builder for {@link Cond}. |
|
|
|
|
|