You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@fineract.apache.org by GitBox <gi...@apache.org> on 2022/09/02 01:20:41 UTC

[GitHub] [fineract] vidakovic commented on a diff in pull request #2554: FINERACT-1713: Introduce lombok to adhocquery module

vidakovic commented on code in PR #2554:
URL: https://github.com/apache/fineract/pull/2554#discussion_r961212877


##########
fineract-provider/src/main/java/org/apache/fineract/adhocquery/domain/AdHoc.java:
##########
@@ -86,7 +79,10 @@ public static AdHoc fromJson(final JsonCommand command) {
         final Long reportRunFrequency = command.longValueOfParameterNamed(AdHocJsonInputParams.REPORT_RUN_FREQUENCY.getValue());
         final Long reportRunEvery = command.longValueOfParameterNamed(AdHocJsonInputParams.REPORT_RUN_EVERY.getValue());
         final boolean isActive = command.booleanPrimitiveValueOfParameterNamed(AdHocJsonInputParams.ISACTIVE.getValue());
-        return new AdHoc(name, query, tableName, tableFields, email, reportRunFrequency, reportRunEvery, isActive);
+        return new AdHoc().setName(StringUtils.defaultIfEmpty(name, null)).setQuery(StringUtils.defaultIfEmpty(query, null))
+                .setTableName(StringUtils.defaultIfEmpty(tableName, null)).setTableFields(StringUtils.defaultIfEmpty(tableFields, null))
+                .setEmail(StringUtils.defaultIfEmpty(email, null)).setReportRunFrequency(reportRunFrequency)
+                .setReportRunEvery(reportRunEvery).setActive(BooleanUtils.toBooleanDefaultIfNull(isActive, false));

Review Comment:
   You can remove "BooleanUtils" and just pass the variable "isActive". If you look closely this function call is completely unnecessary.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org