removing warnings after upgrade to java 7

This commit is contained in:
Vishwas Babu A J
2014-06-25 16:42:23 -07:00
parent 722aceccc7
commit b1cf0b5e59
405 changed files with 1523 additions and 1570 deletions
@@ -963,22 +963,22 @@ public class ClientLoanIntegrationTest {
private void verifyLoanRepaymentSchedule(final ArrayList<HashMap> loanSchedule) { private void verifyLoanRepaymentSchedule(final ArrayList<HashMap> loanSchedule) {
System.out.println("--------------------VERIFYING THE PRINCIPAL DUES,INTEREST DUE AND DUE DATE--------------------------"); System.out.println("--------------------VERIFYING THE PRINCIPAL DUES,INTEREST DUE AND DUE DATE--------------------------");
assertEquals("Checking for Due Date for 1st Month", new ArrayList<Integer>(Arrays.asList(2011, 10, 20)), assertEquals("Checking for Due Date for 1st Month", new ArrayList<>(Arrays.asList(2011, 10, 20)),
loanSchedule.get(1).get("dueDate")); loanSchedule.get(1).get("dueDate"));
assertEquals("Checking for Principal Due for 1st Month", new Float("2911.49"), loanSchedule.get(1).get("principalOriginalDue")); assertEquals("Checking for Principal Due for 1st Month", new Float("2911.49"), loanSchedule.get(1).get("principalOriginalDue"));
assertEquals("Checking for Interest Due for 1st Month", new Float("240.00"), loanSchedule.get(1).get("interestOriginalDue")); assertEquals("Checking for Interest Due for 1st Month", new Float("240.00"), loanSchedule.get(1).get("interestOriginalDue"));
assertEquals("Checking for Due Date for 2nd Month", new ArrayList<Integer>(Arrays.asList(2011, 11, 20)), assertEquals("Checking for Due Date for 2nd Month", new ArrayList<>(Arrays.asList(2011, 11, 20)),
loanSchedule.get(2).get("dueDate")); loanSchedule.get(2).get("dueDate"));
assertEquals("Checking for Principal Due for 2nd Month", new Float("2969.71"), loanSchedule.get(2).get("principalDue")); assertEquals("Checking for Principal Due for 2nd Month", new Float("2969.71"), loanSchedule.get(2).get("principalDue"));
assertEquals("Checking for Interest Due for 2nd Month", new Float("181.77"), loanSchedule.get(2).get("interestOriginalDue")); assertEquals("Checking for Interest Due for 2nd Month", new Float("181.77"), loanSchedule.get(2).get("interestOriginalDue"));
assertEquals("Checking for Due Date for 3rd Month", new ArrayList<Integer>(Arrays.asList(2011, 12, 20)), assertEquals("Checking for Due Date for 3rd Month", new ArrayList<>(Arrays.asList(2011, 12, 20)),
loanSchedule.get(3).get("dueDate")); loanSchedule.get(3).get("dueDate"));
assertEquals("Checking for Principal Due for 3rd Month", new Float("3029.1"), loanSchedule.get(3).get("principalDue")); assertEquals("Checking for Principal Due for 3rd Month", new Float("3029.1"), loanSchedule.get(3).get("principalDue"));
assertEquals("Checking for Interest Due for 3rd Month", new Float("122.38"), loanSchedule.get(3).get("interestOriginalDue")); assertEquals("Checking for Interest Due for 3rd Month", new Float("122.38"), loanSchedule.get(3).get("interestOriginalDue"));
assertEquals("Checking for Due Date for 4th Month", new ArrayList<Integer>(Arrays.asList(2012, 1, 20)), assertEquals("Checking for Due Date for 4th Month", new ArrayList<>(Arrays.asList(2012, 1, 20)),
loanSchedule.get(4).get("dueDate")); loanSchedule.get(4).get("dueDate"));
assertEquals("Checking for Principal Due for 4th Month", new Float("3089.7"), loanSchedule.get(4).get("principalDue")); assertEquals("Checking for Principal Due for 4th Month", new Float("3089.7"), loanSchedule.get(4).get("principalDue"));
assertEquals("Checking for Interest Due for 4th Month", new Float("61.79"), loanSchedule.get(4).get("interestOriginalDue")); assertEquals("Checking for Interest Due for 4th Month", new Float("61.79"), loanSchedule.get(4).get("interestOriginalDue"));
@@ -987,47 +987,47 @@ public class ClientLoanIntegrationTest {
private void verifyLoanRepaymentScheduleForEqualPrincipal(final ArrayList<HashMap> loanSchedule) { private void verifyLoanRepaymentScheduleForEqualPrincipal(final ArrayList<HashMap> loanSchedule) {
System.out.println("--------------------VERIFYING THE PRINCIPAL DUES,INTEREST DUE AND DUE DATE--------------------------"); System.out.println("--------------------VERIFYING THE PRINCIPAL DUES,INTEREST DUE AND DUE DATE--------------------------");
assertEquals("Checking for Due Date for 1st Month", new ArrayList<Integer>(Arrays.asList(2014, 7, 2)), assertEquals("Checking for Due Date for 1st Month", new ArrayList<>(Arrays.asList(2014, 7, 2)),
loanSchedule.get(1).get("dueDate")); loanSchedule.get(1).get("dueDate"));
assertEquals("Checking for Principal Due for 1st Month", new Float("416700"), loanSchedule.get(1).get("principalOriginalDue")); assertEquals("Checking for Principal Due for 1st Month", new Float("416700"), loanSchedule.get(1).get("principalOriginalDue"));
assertEquals("Checking for Interest Due for 1st Month", new Float("200000"), loanSchedule.get(1).get("interestOriginalDue")); assertEquals("Checking for Interest Due for 1st Month", new Float("200000"), loanSchedule.get(1).get("interestOriginalDue"));
assertEquals("Checking for Due Date for 2nd Month", new ArrayList<Integer>(Arrays.asList(2014, 8, 2)), assertEquals("Checking for Due Date for 2nd Month", new ArrayList<>(Arrays.asList(2014, 8, 2)),
loanSchedule.get(2).get("dueDate")); loanSchedule.get(2).get("dueDate"));
assertEquals("Checking for Principal Due for 2nd Month", new Float("416700"), loanSchedule.get(2).get("principalDue")); assertEquals("Checking for Principal Due for 2nd Month", new Float("416700"), loanSchedule.get(2).get("principalDue"));
assertEquals("Checking for Interest Due for 2nd Month", new Float("191700"), loanSchedule.get(2).get("interestOriginalDue")); assertEquals("Checking for Interest Due for 2nd Month", new Float("191700"), loanSchedule.get(2).get("interestOriginalDue"));
assertEquals("Checking for Due Date for 3rd Month", new ArrayList<Integer>(Arrays.asList(2014, 9, 2)), assertEquals("Checking for Due Date for 3rd Month", new ArrayList<>(Arrays.asList(2014, 9, 2)),
loanSchedule.get(3).get("dueDate")); loanSchedule.get(3).get("dueDate"));
assertEquals("Checking for Principal Due for 3rd Month", new Float("416700"), loanSchedule.get(3).get("principalDue")); assertEquals("Checking for Principal Due for 3rd Month", new Float("416700"), loanSchedule.get(3).get("principalDue"));
assertEquals("Checking for Interest Due for 3rd Month", new Float("183300"), loanSchedule.get(3).get("interestOriginalDue")); assertEquals("Checking for Interest Due for 3rd Month", new Float("183300"), loanSchedule.get(3).get("interestOriginalDue"));
assertEquals("Checking for Due Date for 4th Month", new ArrayList<Integer>(Arrays.asList(2014, 10, 2)), assertEquals("Checking for Due Date for 4th Month", new ArrayList<>(Arrays.asList(2014, 10, 2)),
loanSchedule.get(4).get("dueDate")); loanSchedule.get(4).get("dueDate"));
assertEquals("Checking for Principal Due for 4th Month", new Float("416700"), loanSchedule.get(4).get("principalDue")); assertEquals("Checking for Principal Due for 4th Month", new Float("416700"), loanSchedule.get(4).get("principalDue"));
assertEquals("Checking for Interest Due for 4th Month", new Float("175000"), loanSchedule.get(4).get("interestOriginalDue")); assertEquals("Checking for Interest Due for 4th Month", new Float("175000"), loanSchedule.get(4).get("interestOriginalDue"));
assertEquals("Checking for Due Date for 5th Month", new ArrayList<Integer>(Arrays.asList(2014, 11, 2)), assertEquals("Checking for Due Date for 5th Month", new ArrayList<>(Arrays.asList(2014, 11, 2)),
loanSchedule.get(5).get("dueDate")); loanSchedule.get(5).get("dueDate"));
assertEquals("Checking for Principal Due for 5th Month", new Float("416700"), loanSchedule.get(5).get("principalDue")); assertEquals("Checking for Principal Due for 5th Month", new Float("416700"), loanSchedule.get(5).get("principalDue"));
assertEquals("Checking for Interest Due for 5th Month", new Float("166700"), loanSchedule.get(5).get("interestOriginalDue")); assertEquals("Checking for Interest Due for 5th Month", new Float("166700"), loanSchedule.get(5).get("interestOriginalDue"));
assertEquals("Checking for Due Date for 6th Month", new ArrayList<Integer>(Arrays.asList(2014, 12, 2)), assertEquals("Checking for Due Date for 6th Month", new ArrayList<>(Arrays.asList(2014, 12, 2)),
loanSchedule.get(6).get("dueDate")); loanSchedule.get(6).get("dueDate"));
assertEquals("Checking for Principal Due for 6th Month", new Float("416700"), loanSchedule.get(6).get("principalDue")); assertEquals("Checking for Principal Due for 6th Month", new Float("416700"), loanSchedule.get(6).get("principalDue"));
assertEquals("Checking for Interest Due for 6th Month", new Float("158300"), loanSchedule.get(6).get("interestOriginalDue")); assertEquals("Checking for Interest Due for 6th Month", new Float("158300"), loanSchedule.get(6).get("interestOriginalDue"));
assertEquals("Checking for Due Date for 10th Month", new ArrayList<Integer>(Arrays.asList(2015, 4, 2)), assertEquals("Checking for Due Date for 10th Month", new ArrayList<>(Arrays.asList(2015, 4, 2)),
loanSchedule.get(10).get("dueDate")); loanSchedule.get(10).get("dueDate"));
assertEquals("Checking for Principal Due for 10th Month", new Float("416700"), loanSchedule.get(10).get("principalDue")); assertEquals("Checking for Principal Due for 10th Month", new Float("416700"), loanSchedule.get(10).get("principalDue"));
assertEquals("Checking for Interest Due for 10th Month", new Float("125000"), loanSchedule.get(10).get("interestOriginalDue")); assertEquals("Checking for Interest Due for 10th Month", new Float("125000"), loanSchedule.get(10).get("interestOriginalDue"));
assertEquals("Checking for Due Date for 20th Month", new ArrayList<Integer>(Arrays.asList(2016, 2, 2)), assertEquals("Checking for Due Date for 20th Month", new ArrayList<>(Arrays.asList(2016, 2, 2)),
loanSchedule.get(20).get("dueDate")); loanSchedule.get(20).get("dueDate"));
assertEquals("Checking for Principal Due for 20th Month", new Float("416700"), loanSchedule.get(20).get("principalDue")); assertEquals("Checking for Principal Due for 20th Month", new Float("416700"), loanSchedule.get(20).get("principalDue"));
assertEquals("Checking for Interest Due for 20th Month", new Float("41700"), loanSchedule.get(20).get("interestOriginalDue")); assertEquals("Checking for Interest Due for 20th Month", new Float("41700"), loanSchedule.get(20).get("interestOriginalDue"));
assertEquals("Checking for Due Date for 24th Month", new ArrayList<Integer>(Arrays.asList(2016, 6, 2)), assertEquals("Checking for Due Date for 24th Month", new ArrayList<>(Arrays.asList(2016, 6, 2)),
loanSchedule.get(24).get("dueDate")); loanSchedule.get(24).get("dueDate"));
assertEquals("Checking for Principal Due for 24th Month", new Float("415900"), loanSchedule.get(24).get("principalDue")); assertEquals("Checking for Principal Due for 24th Month", new Float("415900"), loanSchedule.get(24).get("principalDue"));
assertEquals("Checking for Interest Due for 24th Month", new Float("8300"), loanSchedule.get(24).get("interestOriginalDue")); assertEquals("Checking for Interest Due for 24th Month", new Float("8300"), loanSchedule.get(24).get("interestOriginalDue"));
@@ -1037,54 +1037,54 @@ public class ClientLoanIntegrationTest {
private void verifyLoanRepaymentScheduleForEqualPrincipalWithGrace(final ArrayList<HashMap> loanSchedule) { private void verifyLoanRepaymentScheduleForEqualPrincipalWithGrace(final ArrayList<HashMap> loanSchedule) {
System.out.println("--------------------VERIFYING THE PRINCIPAL DUES,INTEREST DUE AND DUE DATE--------------------------"); System.out.println("--------------------VERIFYING THE PRINCIPAL DUES,INTEREST DUE AND DUE DATE--------------------------");
assertEquals("Checking for Due Date for 1st Month", new ArrayList<Integer>(Arrays.asList(2014, 7, 2)), assertEquals("Checking for Due Date for 1st Month", new ArrayList<>(Arrays.asList(2014, 7, 2)),
loanSchedule.get(1).get("dueDate")); loanSchedule.get(1).get("dueDate"));
validateNumberForEqualWithMsg("Checking for Principal Due for 1st Month", "0.0", validateNumberForEqualWithMsg("Checking for Principal Due for 1st Month", "0.0",
String.valueOf(loanSchedule.get(1).get("principalOriginalDue"))); String.valueOf(loanSchedule.get(1).get("principalOriginalDue")));
assertEquals("Checking for Interest Due for 1st Month", new Float("200000"), loanSchedule.get(1).get("interestOriginalDue")); assertEquals("Checking for Interest Due for 1st Month", new Float("200000"), loanSchedule.get(1).get("interestOriginalDue"));
assertEquals("Checking for Due Date for 2nd Month", new ArrayList<Integer>(Arrays.asList(2014, 8, 2)), assertEquals("Checking for Due Date for 2nd Month", new ArrayList<>(Arrays.asList(2014, 8, 2)),
loanSchedule.get(2).get("dueDate")); loanSchedule.get(2).get("dueDate"));
validateNumberForEqualWithMsg("Checking for Principal Due for 2nd Month", "0.0", validateNumberForEqualWithMsg("Checking for Principal Due for 2nd Month", "0.0",
String.valueOf(loanSchedule.get(2).get("principalOriginalDue"))); String.valueOf(loanSchedule.get(2).get("principalOriginalDue")));
assertEquals("Checking for Interest Due for 2nd Month", new Float("200000"), loanSchedule.get(2).get("interestOriginalDue")); assertEquals("Checking for Interest Due for 2nd Month", new Float("200000"), loanSchedule.get(2).get("interestOriginalDue"));
assertEquals("Checking for Due Date for 3rd Month", new ArrayList<Integer>(Arrays.asList(2014, 9, 2)), assertEquals("Checking for Due Date for 3rd Month", new ArrayList<>(Arrays.asList(2014, 9, 2)),
loanSchedule.get(3).get("dueDate")); loanSchedule.get(3).get("dueDate"));
validateNumberForEqualWithMsg("Checking for Principal Due for 3rd Month", "0.0", String.valueOf(loanSchedule.get(3).get("principalDue"))); validateNumberForEqualWithMsg("Checking for Principal Due for 3rd Month", "0.0", String.valueOf(loanSchedule.get(3).get("principalDue")));
assertEquals("Checking for Interest Due for 3rd Month", new Float("200000"), loanSchedule.get(3).get("interestOriginalDue")); assertEquals("Checking for Interest Due for 3rd Month", new Float("200000"), loanSchedule.get(3).get("interestOriginalDue"));
assertEquals("Checking for Due Date for 4th Month", new ArrayList<Integer>(Arrays.asList(2014, 10, 2)), assertEquals("Checking for Due Date for 4th Month", new ArrayList<>(Arrays.asList(2014, 10, 2)),
loanSchedule.get(4).get("dueDate")); loanSchedule.get(4).get("dueDate"));
validateNumberForEqualWithMsg("Checking for Principal Due for 4th Month", "0", String.valueOf(loanSchedule.get(4).get("principalDue"))); validateNumberForEqualWithMsg("Checking for Principal Due for 4th Month", "0", String.valueOf(loanSchedule.get(4).get("principalDue")));
assertEquals("Checking for Interest Due for 4th Month", new Float("200000"), loanSchedule.get(4).get("interestOriginalDue")); assertEquals("Checking for Interest Due for 4th Month", new Float("200000"), loanSchedule.get(4).get("interestOriginalDue"));
assertEquals("Checking for Due Date for 5th Month", new ArrayList<Integer>(Arrays.asList(2014, 11, 2)), assertEquals("Checking for Due Date for 5th Month", new ArrayList<>(Arrays.asList(2014, 11, 2)),
loanSchedule.get(5).get("dueDate")); loanSchedule.get(5).get("dueDate"));
validateNumberForEqualWithMsg("Checking for Principal Due for 5th Month", "0", String.valueOf(loanSchedule.get(5).get("principalDue"))); validateNumberForEqualWithMsg("Checking for Principal Due for 5th Month", "0", String.valueOf(loanSchedule.get(5).get("principalDue")));
assertEquals("Checking for Interest Due for 5th Month", new Float("200000"), loanSchedule.get(5).get("interestOriginalDue")); assertEquals("Checking for Interest Due for 5th Month", new Float("200000"), loanSchedule.get(5).get("interestOriginalDue"));
assertEquals("Checking for Due Date for 6th Month", new ArrayList<Integer>(Arrays.asList(2014, 12, 2)), assertEquals("Checking for Due Date for 6th Month", new ArrayList<>(Arrays.asList(2014, 12, 2)),
loanSchedule.get(6).get("dueDate")); loanSchedule.get(6).get("dueDate"));
assertEquals("Checking for Principal Due for 6th Month", new Float("526300"), loanSchedule.get(6).get("principalDue")); assertEquals("Checking for Principal Due for 6th Month", new Float("526300"), loanSchedule.get(6).get("principalDue"));
assertEquals("Checking for Interest Due for 6th Month", new Float("200000"), loanSchedule.get(6).get("interestOriginalDue")); assertEquals("Checking for Interest Due for 6th Month", new Float("200000"), loanSchedule.get(6).get("interestOriginalDue"));
assertEquals("Checking for Due Date for 7th Month", new ArrayList<Integer>(Arrays.asList(2015, 1, 2)), assertEquals("Checking for Due Date for 7th Month", new ArrayList<>(Arrays.asList(2015, 1, 2)),
loanSchedule.get(7).get("dueDate")); loanSchedule.get(7).get("dueDate"));
assertEquals("Checking for Principal Due for 7th Month", new Float("526300"), loanSchedule.get(7).get("principalDue")); assertEquals("Checking for Principal Due for 7th Month", new Float("526300"), loanSchedule.get(7).get("principalDue"));
assertEquals("Checking for Interest Due for 7th Month", new Float("189500"), loanSchedule.get(7).get("interestOriginalDue")); assertEquals("Checking for Interest Due for 7th Month", new Float("189500"), loanSchedule.get(7).get("interestOriginalDue"));
assertEquals("Checking for Due Date for 10th Month", new ArrayList<Integer>(Arrays.asList(2015, 4, 2)), assertEquals("Checking for Due Date for 10th Month", new ArrayList<>(Arrays.asList(2015, 4, 2)),
loanSchedule.get(10).get("dueDate")); loanSchedule.get(10).get("dueDate"));
assertEquals("Checking for Principal Due for 10th Month", new Float("526300"), loanSchedule.get(10).get("principalDue")); assertEquals("Checking for Principal Due for 10th Month", new Float("526300"), loanSchedule.get(10).get("principalDue"));
assertEquals("Checking for Interest Due for 10th Month", new Float("157900"), loanSchedule.get(10).get("interestOriginalDue")); assertEquals("Checking for Interest Due for 10th Month", new Float("157900"), loanSchedule.get(10).get("interestOriginalDue"));
assertEquals("Checking for Due Date for 20th Month", new ArrayList<Integer>(Arrays.asList(2016, 2, 2)), assertEquals("Checking for Due Date for 20th Month", new ArrayList<>(Arrays.asList(2016, 2, 2)),
loanSchedule.get(20).get("dueDate")); loanSchedule.get(20).get("dueDate"));
assertEquals("Checking for Principal Due for 20th Month", new Float("526300"), loanSchedule.get(20).get("principalDue")); assertEquals("Checking for Principal Due for 20th Month", new Float("526300"), loanSchedule.get(20).get("principalDue"));
assertEquals("Checking for Interest Due for 20th Month", new Float("52600"), loanSchedule.get(20).get("interestOriginalDue")); assertEquals("Checking for Interest Due for 20th Month", new Float("52600"), loanSchedule.get(20).get("interestOriginalDue"));
assertEquals("Checking for Due Date for 24th Month", new ArrayList<Integer>(Arrays.asList(2016, 6, 2)), assertEquals("Checking for Due Date for 24th Month", new ArrayList<>(Arrays.asList(2016, 6, 2)),
loanSchedule.get(24).get("dueDate")); loanSchedule.get(24).get("dueDate"));
assertEquals("Checking for Principal Due for 24th Month", new Float("526600"), loanSchedule.get(24).get("principalDue")); assertEquals("Checking for Principal Due for 24th Month", new Float("526600"), loanSchedule.get(24).get("principalDue"));
assertEquals("Checking for Interest Due for 24th Month", new Float("10500"), loanSchedule.get(24).get("interestOriginalDue")); assertEquals("Checking for Interest Due for 24th Month", new Float("10500"), loanSchedule.get(24).get("interestOriginalDue"));
@@ -93,22 +93,22 @@ public class GroupLoanIntegrationTest {
private void verifyLoanRepaymentSchedule(final ArrayList<HashMap> loanSchedule) { private void verifyLoanRepaymentSchedule(final ArrayList<HashMap> loanSchedule) {
System.out.println("--------------------VERIFYING THE PRINCIPAL DUES,INTEREST DUE AND DUE DATE--------------------------"); System.out.println("--------------------VERIFYING THE PRINCIPAL DUES,INTEREST DUE AND DUE DATE--------------------------");
assertEquals("Checking for Due Date for 1st Month", new ArrayList<Integer>(Arrays.asList(2011, 10, 20)), assertEquals("Checking for Due Date for 1st Month", new ArrayList<>(Arrays.asList(2011, 10, 20)),
loanSchedule.get(1).get("dueDate")); loanSchedule.get(1).get("dueDate"));
assertEquals("Checking for Principal Due for 1st Month", new Float("2911.49"), loanSchedule.get(1).get("principalOriginalDue")); assertEquals("Checking for Principal Due for 1st Month", new Float("2911.49"), loanSchedule.get(1).get("principalOriginalDue"));
assertEquals("Checking for Interest Due for 1st Month", new Float("240.00"), loanSchedule.get(1).get("interestOriginalDue")); assertEquals("Checking for Interest Due for 1st Month", new Float("240.00"), loanSchedule.get(1).get("interestOriginalDue"));
assertEquals("Checking for Due Date for 2nd Month", new ArrayList<Integer>(Arrays.asList(2011, 11, 20)), assertEquals("Checking for Due Date for 2nd Month", new ArrayList<>(Arrays.asList(2011, 11, 20)),
loanSchedule.get(2).get("dueDate")); loanSchedule.get(2).get("dueDate"));
assertEquals("Checking for Principal Due for 2nd Month", new Float("2969.71"), loanSchedule.get(2).get("principalDue")); assertEquals("Checking for Principal Due for 2nd Month", new Float("2969.71"), loanSchedule.get(2).get("principalDue"));
assertEquals("Checking for Interest Due for 2nd Month", new Float("181.77"), loanSchedule.get(2).get("interestOriginalDue")); assertEquals("Checking for Interest Due for 2nd Month", new Float("181.77"), loanSchedule.get(2).get("interestOriginalDue"));
assertEquals("Checking for Due Date for 3rd Month", new ArrayList<Integer>(Arrays.asList(2011, 12, 20)), assertEquals("Checking for Due Date for 3rd Month", new ArrayList<>(Arrays.asList(2011, 12, 20)),
loanSchedule.get(3).get("dueDate")); loanSchedule.get(3).get("dueDate"));
assertEquals("Checking for Principal Due for 3rd Month", new Float("3029.1"), loanSchedule.get(3).get("principalDue")); assertEquals("Checking for Principal Due for 3rd Month", new Float("3029.1"), loanSchedule.get(3).get("principalDue"));
assertEquals("Checking for Interest Due for 3rd Month", new Float("122.38"), loanSchedule.get(3).get("interestOriginalDue")); assertEquals("Checking for Interest Due for 3rd Month", new Float("122.38"), loanSchedule.get(3).get("interestOriginalDue"));
assertEquals("Checking for Due Date for 4th Month", new ArrayList<Integer>(Arrays.asList(2012, 1, 20)), assertEquals("Checking for Due Date for 4th Month", new ArrayList<>(Arrays.asList(2012, 1, 20)),
loanSchedule.get(4).get("dueDate")); loanSchedule.get(4).get("dueDate"));
assertEquals("Checking for Principal Due for 4th Month", new Float("3089.7"), loanSchedule.get(4).get("principalDue")); assertEquals("Checking for Principal Due for 4th Month", new Float("3089.7"), loanSchedule.get(4).get("principalDue"));
assertEquals("Checking for Interest Due for 4th Month", new Float("61.79"), loanSchedule.get(4).get("interestOriginalDue")); assertEquals("Checking for Interest Due for 4th Month", new Float("61.79"), loanSchedule.get(4).get("interestOriginalDue"));
@@ -38,9 +38,9 @@ public class TemplateIntegrationTest {
@Test @Test
public void test() { public void test() {
final HashMap<String, String> metadata = new HashMap<String, String>(); final HashMap<String, String> metadata = new HashMap<>();
metadata.put("user", "resource_url"); metadata.put("user", "resource_url");
final HashMap<String, Object> map = new HashMap<String, Object>(); final HashMap<String, Object> map = new HashMap<>();
map.put("name", "foo"); map.put("name", "foo");
map.put("text", "Hello {{template}}"); map.put("text", "Hello {{template}}");
map.put("mappers", metadata); map.put("mappers", metadata);
@@ -29,7 +29,7 @@ public class ClientHelper {
} }
public static String getTestClientAsJSON(final String dateOfJoining, final String officeId) { public static String getTestClientAsJSON(final String dateOfJoining, final String officeId) {
final HashMap<String, String> map = new HashMap<String, String>(); final HashMap<String, String> map = new HashMap<>();
map.put("officeId", officeId); map.put("officeId", officeId);
map.put("firstname", Utils.randomNameGenerator("Client_FirstName_", 5)); map.put("firstname", Utils.randomNameGenerator("Client_FirstName_", 5));
map.put("lastname", Utils.randomNameGenerator("Client_LastName_", 4)); map.put("lastname", Utils.randomNameGenerator("Client_LastName_", 4));
@@ -67,7 +67,7 @@ public class GlobalConfigurationHelper {
} }
public static String updateGlobalConfigUpdateValueAsJSON(final String value) { public static String updateGlobalConfigUpdateValueAsJSON(final String value) {
final HashMap<String, String> map = new HashMap<String, String>(); final HashMap<String, String> map = new HashMap<>();
map.put("value", value); map.put("value", value);
System.out.println("map : " + map); System.out.println("map : " + map);
return new Gson().toJson(map); return new Gson().toJson(map);
@@ -81,7 +81,7 @@ public class GlobalConfigurationHelper {
} }
public static String updateIsCacheEnabledGlobalConfigUpdateAsJSON(final String cacheType) { public static String updateIsCacheEnabledGlobalConfigUpdateAsJSON(final String cacheType) {
final HashMap<String, String> map = new HashMap<String, String>(); final HashMap<String, String> map = new HashMap<>();
map.put("cacheType", cacheType); map.put("cacheType", cacheType);
System.out.println("map : " + map); System.out.println("map : " + map);
return new Gson().toJson(map); return new Gson().toJson(map);
@@ -72,7 +72,7 @@ public class GroupHelper {
} }
public static String getTestGroupAsJSON(final boolean active, final String activationDate) { public static String getTestGroupAsJSON(final boolean active, final String activationDate) {
final HashMap<String, String> map = new HashMap<String, String>(); final HashMap<String, String> map = new HashMap<>();
map.put("officeId", "1"); map.put("officeId", "1");
map.put("name", randomNameGenerator("Group_Name_", 5)); map.put("name", randomNameGenerator("Group_Name_", 5));
map.put("externalId", randomIDGenerator("ID_", 7)); map.put("externalId", randomIDGenerator("ID_", 7));
@@ -93,7 +93,7 @@ public class GroupHelper {
public static String associateClientAsJSON(final String clientMember) { public static String associateClientAsJSON(final String clientMember) {
final HashMap<String, List<String>> map = new HashMap<String, List<String>>(); final HashMap<String, List<String>> map = new HashMap<String, List<String>>();
final List<String> list = new ArrayList<String>(); final List<String> list = new ArrayList<>();
list.add(clientMember); list.add(clientMember);
map.put("clientMembers", list); map.put("clientMembers", list);
System.out.println("map : " + map); System.out.println("map : " + map);
@@ -101,7 +101,7 @@ public class GroupHelper {
} }
public static String activateGroupAsJSON(final String activationDate) { public static String activateGroupAsJSON(final String activationDate) {
final HashMap<String, String> map = new HashMap<String, String>(); final HashMap<String, String> map = new HashMap<>();
map.put("dateFormat", "dd MMMM yyyy"); map.put("dateFormat", "dd MMMM yyyy");
map.put("locale", "en"); map.put("locale", "en");
if (StringUtils.isNotEmpty(activationDate)) { if (StringUtils.isNotEmpty(activationDate)) {
@@ -115,7 +115,7 @@ public class GroupHelper {
} }
public static String updateGroupAsJSON(final String name) { public static String updateGroupAsJSON(final String name) {
final HashMap<String, String> map = new HashMap<String, String>(); final HashMap<String, String> map = new HashMap<>();
map.put("name", name); map.put("name", name);
System.out.println("map : " + map); System.out.println("map : " + map);
return new Gson().toJson(map); return new Gson().toJson(map);
@@ -147,7 +147,7 @@ public class GroupHelper {
public static void verifyGroupMembers(final RequestSpecification requestSpec, final ResponseSpecification responseSpec, public static void verifyGroupMembers(final RequestSpecification requestSpec, final ResponseSpecification responseSpec,
final Integer generatedGroupID, final Integer groupMember) { final Integer generatedGroupID, final Integer groupMember) {
List<String> list = new ArrayList<String>(); List<String> list = new ArrayList<>();
System.out.println("------------------------------CHECK GROUP MEMBERS------------------------------------\n"); System.out.println("------------------------------CHECK GROUP MEMBERS------------------------------------\n");
final String GROUP_URL = "/mifosng-provider/api/v1/groups/" + generatedGroupID final String GROUP_URL = "/mifosng-provider/api/v1/groups/" + generatedGroupID
+ "?associations=clientMembers&tenantIdentifier=default"; + "?associations=clientMembers&tenantIdentifier=default";
@@ -157,7 +157,7 @@ public class GroupHelper {
public static void verifyEmptyGroupMembers(final RequestSpecification requestSpec, final ResponseSpecification responseSpec, public static void verifyEmptyGroupMembers(final RequestSpecification requestSpec, final ResponseSpecification responseSpec,
final Integer generatedGroupID) { final Integer generatedGroupID) {
List<String> list = new ArrayList<String>(); List<String> list = new ArrayList<>();
System.out.println("------------------------------CHECK EMPTY GROUP MEMBER LIST------------------------------------\n"); System.out.println("------------------------------CHECK EMPTY GROUP MEMBER LIST------------------------------------\n");
final String GROUP_URL = "/mifosng-provider/api/v1/groups/" + generatedGroupID final String GROUP_URL = "/mifosng-provider/api/v1/groups/" + generatedGroupID
+ "?associations=clientMembers&tenantIdentifier=default"; + "?associations=clientMembers&tenantIdentifier=default";
@@ -167,7 +167,7 @@ public class GroupHelper {
public static void verifyGroupDeleted(final RequestSpecification requestSpec, final ResponseSpecification responseSpec, public static void verifyGroupDeleted(final RequestSpecification requestSpec, final ResponseSpecification responseSpec,
final Integer generatedGroupID) { final Integer generatedGroupID) {
List<String> list = new ArrayList<String>(); List<String> list = new ArrayList<>();
System.out.println("------------------------------CHECK GROUP DELETED------------------------------------\n"); System.out.println("------------------------------CHECK GROUP DELETED------------------------------------\n");
final String GROUP_URL = "/mifosng-provider/api/v1/groups/?tenantIdentifier=default"; final String GROUP_URL = "/mifosng-provider/api/v1/groups/?tenantIdentifier=default";
list = Utils.performServerGet(requestSpec, responseSpec, GROUP_URL, "pageItems"); list = Utils.performServerGet(requestSpec, responseSpec, GROUP_URL, "pageItems");
@@ -28,9 +28,9 @@ public class HolidayHelper {
} }
public static String getCreateHolidayDataAsJSON() { public static String getCreateHolidayDataAsJSON() {
final HashMap<String, Object> map = new HashMap<String, Object>(); final HashMap<String, Object> map = new HashMap<>();
List<HashMap<String, String>> offices = new ArrayList<HashMap<String, String>>(); List<HashMap<String, String>> offices = new ArrayList<HashMap<String, String>>();
HashMap<String, String> officeMap = new HashMap<String, String>(); HashMap<String, String> officeMap = new HashMap<>();
officeMap.put("officeId", OFFICE_ID); officeMap.put("officeId", OFFICE_ID);
offices.add(officeMap); offices.add(officeMap);
@@ -48,7 +48,7 @@ public class HolidayHelper {
} }
public static String getActivateHolidayDataAsJSON() { public static String getActivateHolidayDataAsJSON() {
final HashMap<String, String> map = new HashMap<String, String>(); final HashMap<String, String> map = new HashMap<>();
String activateHoliday = new Gson().toJson(map); String activateHoliday = new Gson().toJson(map);
System.out.println(activateHoliday); System.out.println(activateHoliday);
return activateHoliday; return activateHoliday;
@@ -26,7 +26,7 @@ public class OfficeHelper {
public static String getAsJSON(final String openingDate) { public static String getAsJSON(final String openingDate) {
final HashMap<String, String> map = new HashMap<String, String>(); final HashMap<String, String> map = new HashMap<>();
map.put("parentId", "1"); map.put("parentId", "1");
map.put("name", Utils.randomNameGenerator("Office_", 4)); map.put("name", Utils.randomNameGenerator("Office_", 4));
map.put("dateFormat", "dd MMMM yyyy"); map.put("dateFormat", "dd MMMM yyyy");
@@ -60,7 +60,7 @@ public class SchedulerJobHelper {
} }
public static String updateSchedulerJobAsJSON(final String active) { public static String updateSchedulerJobAsJSON(final String active) {
final HashMap<String, String> map = new HashMap<String, String>(); final HashMap<String, String> map = new HashMap<>();
map.put("active", active); map.put("active", active);
System.out.println("map : " + map); System.out.println("map : " + map);
return new Gson().toJson(map); return new Gson().toJson(map);
@@ -82,7 +82,7 @@ public class SchedulerJobHelper {
} }
public static String runSchedulerJobAsJSON() { public static String runSchedulerJobAsJSON() {
final HashMap<String, String> map = new HashMap<String, String>(); final HashMap<String, String> map = new HashMap<>();
String runSchedulerJob = new Gson().toJson(map); String runSchedulerJob = new Gson().toJson(map);
System.out.println(runSchedulerJob); System.out.println(runSchedulerJob);
return runSchedulerJob; return runSchedulerJob;
@@ -48,7 +48,7 @@ public class StandingInstructionsHelper {
public String build(final String clientId, final String fromAccountId, final String toAccountId, final String fromAccountType, public String build(final String clientId, final String fromAccountId, final String toAccountId, final String fromAccountType,
final String toAccountType, final String validFrom, final String validTo, final String monthDay) { final String toAccountType, final String validFrom, final String validTo, final String monthDay) {
final HashMap<String, String> map = new HashMap<String, String>(); final HashMap<String, String> map = new HashMap<>();
map.put("name", Utils.randomNameGenerator("STANDING_INSTRUCTION_", 5)); map.put("name", Utils.randomNameGenerator("STANDING_INSTRUCTION_", 5));
map.put("dateFormat", "dd MMMM yyyy"); map.put("dateFormat", "dd MMMM yyyy");
map.put("monthDayFormat", "dd MMMM"); map.put("monthDayFormat", "dd MMMM");
@@ -23,7 +23,7 @@ public class SurveyHelper {
} }
public static String getTestPPIAsJSON() { public static String getTestPPIAsJSON() {
final HashMap<String, String> map = new HashMap<String, String>(); final HashMap<String, String> map = new HashMap<>();
map.put("date", "2014-05-19 00:00:00"); map.put("date", "2014-05-19 00:00:00");
map.put("ppi_household_members_cd_q1_householdmembers","107"); map.put("ppi_household_members_cd_q1_householdmembers","107");
@@ -7,7 +7,7 @@ import com.google.gson.Gson;
public class FinancialActivityAccountsMappingBuilder { public class FinancialActivityAccountsMappingBuilder {
public static String build(Integer financialActivityId, Integer glAccountId) { public static String build(Integer financialActivityId, Integer glAccountId) {
final HashMap<String, Object> map = new HashMap<String, Object>(); final HashMap<String, Object> map = new HashMap<>();
map.put("financialActivityId", financialActivityId); map.put("financialActivityId", financialActivityId);
map.put("glAccountId", glAccountId); map.put("glAccountId", glAccountId);
return new Gson().toJson(map); return new Gson().toJson(map);
@@ -29,7 +29,7 @@ public class GLAccountBuilder {
private static String description = "DEFAULT_DESCRIPTION"; private static String description = "DEFAULT_DESCRIPTION";
public String build() { public String build() {
final HashMap<String, String> map = new HashMap<String, String>(); final HashMap<String, String> map = new HashMap<>();
map.put("name", GLAccountBuilder.name); map.put("name", GLAccountBuilder.name);
map.put("glCode", GLAccountBuilder.GLCode); map.put("glCode", GLAccountBuilder.GLCode);
map.put("manualEntriesAllowed", GLAccountBuilder.manualEntriesAllowed); map.put("manualEntriesAllowed", GLAccountBuilder.manualEntriesAllowed);
@@ -112,7 +112,7 @@ public class ChargesHelper {
} }
public static HashMap<String, Object> populateDefaultsForSavings() { public static HashMap<String, Object> populateDefaultsForSavings() {
final HashMap<String, Object> map = new HashMap<String, Object>(); final HashMap<String, Object> map = new HashMap<>();
map.put("active", ChargesHelper.active); map.put("active", ChargesHelper.active);
map.put("amount", ChargesHelper.amount); map.put("amount", ChargesHelper.amount);
map.put("chargeAppliesTo", ChargesHelper.CHARGE_APPLIES_TO_SAVINGS); map.put("chargeAppliesTo", ChargesHelper.CHARGE_APPLIES_TO_SAVINGS);
@@ -219,7 +219,7 @@ public class ChargesHelper {
} }
public static HashMap<String, Object> populateDefaultsForLoan() { public static HashMap<String, Object> populateDefaultsForLoan() {
final HashMap<String, Object> map = new HashMap<String, Object>(); final HashMap<String, Object> map = new HashMap<>();
map.put("active", ChargesHelper.active); map.put("active", ChargesHelper.active);
map.put("amount", ChargesHelper.amount); map.put("amount", ChargesHelper.amount);
map.put("chargeAppliesTo", ChargesHelper.CHARGE_APPLIES_TO_LOAN); map.put("chargeAppliesTo", ChargesHelper.CHARGE_APPLIES_TO_LOAN);
@@ -264,7 +264,7 @@ public class ChargesHelper {
} }
public static String getModifyChargeJSON() { public static String getModifyChargeJSON() {
final HashMap<String, Object> map = new HashMap<String, Object>(); final HashMap<String, Object> map = new HashMap<>();
map.put("locale", CommonConstants.locale); map.put("locale", CommonConstants.locale);
map.put("amount", "200.0"); map.put("amount", "200.0");
String json = new Gson().toJson(map); String json = new Gson().toJson(map);
@@ -273,7 +273,7 @@ public class ChargesHelper {
} }
public static String getModifyWithdrawalFeeSavingsChargeJSON() { public static String getModifyWithdrawalFeeSavingsChargeJSON() {
final HashMap<String, Object> map = new HashMap<String, Object>(); final HashMap<String, Object> map = new HashMap<>();
map.put("locale", CommonConstants.locale); map.put("locale", CommonConstants.locale);
map.put("chargeCalculationType", CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT); map.put("chargeCalculationType", CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT);
String json = new Gson().toJson(map); String json = new Gson().toJson(map);
@@ -282,7 +282,7 @@ public class ChargesHelper {
} }
public static String getModifyChargeAsPecentageAmountJSON() { public static String getModifyChargeAsPecentageAmountJSON() {
final HashMap<String, Object> map = new HashMap<String, Object>(); final HashMap<String, Object> map = new HashMap<>();
map.put("locale", CommonConstants.locale); map.put("locale", CommonConstants.locale);
map.put("chargeCalculationType", CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT); map.put("chargeCalculationType", CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT);
map.put("chargePaymentMode", CHARGE_PAYMENT_MODE_ACCOUNT_TRANSFER); map.put("chargePaymentMode", CHARGE_PAYMENT_MODE_ACCOUNT_TRANSFER);
@@ -292,7 +292,7 @@ public class ChargesHelper {
} }
public static String getModifyChargeAsPecentageLoanAmountWithInterestJSON() { public static String getModifyChargeAsPecentageLoanAmountWithInterestJSON() {
final HashMap<String, Object> map = new HashMap<String, Object>(); final HashMap<String, Object> map = new HashMap<>();
map.put("locale", CommonConstants.locale); map.put("locale", CommonConstants.locale);
map.put("chargeCalculationType", CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT_AND_INTEREST); map.put("chargeCalculationType", CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT_AND_INTEREST);
map.put("chargePaymentMode", CHARGE_PAYMENT_MODE_ACCOUNT_TRANSFER); map.put("chargePaymentMode", CHARGE_PAYMENT_MODE_ACCOUNT_TRANSFER);
@@ -302,7 +302,7 @@ public class ChargesHelper {
} }
public static String getModifyChargeAsPercentageInterestJSON() { public static String getModifyChargeAsPercentageInterestJSON() {
final HashMap<String, Object> map = new HashMap<String, Object>(); final HashMap<String, Object> map = new HashMap<>();
map.put("locale", CommonConstants.locale); map.put("locale", CommonConstants.locale);
map.put("chargeCalculationType", CHARGE_CALCULATION_TYPE_PERCENTAGE_INTEREST); map.put("chargeCalculationType", CHARGE_CALCULATION_TYPE_PERCENTAGE_INTEREST);
map.put("chargePaymentMode", CHARGE_PAYMENT_MODE_ACCOUNT_TRANSFER); map.put("chargePaymentMode", CHARGE_PAYMENT_MODE_ACCOUNT_TRANSFER);
@@ -312,7 +312,7 @@ public class ChargesHelper {
} }
public static String getModifyChargeFeeFrequencyAsDaysJSON() { public static String getModifyChargeFeeFrequencyAsDaysJSON() {
final HashMap<String, Object> map = new HashMap<String, Object>(); final HashMap<String, Object> map = new HashMap<>();
map.put("locale", CommonConstants.locale); map.put("locale", CommonConstants.locale);
map.put("feeFrequency", ChargesHelper.CHARGE_FEE_FREQUENCY_DAYS); map.put("feeFrequency", ChargesHelper.CHARGE_FEE_FREQUENCY_DAYS);
map.put("feeInterval", 2); map.put("feeInterval", 2);
@@ -322,7 +322,7 @@ public class ChargesHelper {
} }
public static String getModifyChargeFeeFrequencyAsWeeksJSON() { public static String getModifyChargeFeeFrequencyAsWeeksJSON() {
final HashMap<String, Object> map = new HashMap<String, Object>(); final HashMap<String, Object> map = new HashMap<>();
map.put("locale", CommonConstants.locale); map.put("locale", CommonConstants.locale);
map.put("feeFrequency", ChargesHelper.CHARGE_FEE_FREQUENCY_WEEKS); map.put("feeFrequency", ChargesHelper.CHARGE_FEE_FREQUENCY_WEEKS);
map.put("feeInterval", 2); map.put("feeInterval", 2);
@@ -332,7 +332,7 @@ public class ChargesHelper {
} }
public static String getModifyChargeFeeFrequencyAsMonthsJSON() { public static String getModifyChargeFeeFrequencyAsMonthsJSON() {
final HashMap<String, Object> map = new HashMap<String, Object>(); final HashMap<String, Object> map = new HashMap<>();
map.put("locale", CommonConstants.locale); map.put("locale", CommonConstants.locale);
map.put("feeFrequency", ChargesHelper.CHARGE_FEE_FREQUENCY_MONTHS); map.put("feeFrequency", ChargesHelper.CHARGE_FEE_FREQUENCY_MONTHS);
map.put("feeInterval", 2); map.put("feeInterval", 2);
@@ -342,7 +342,7 @@ public class ChargesHelper {
} }
public static String getModifyChargeFeeFrequencyAsYearsJSON() { public static String getModifyChargeFeeFrequencyAsYearsJSON() {
final HashMap<String, Object> map = new HashMap<String, Object>(); final HashMap<String, Object> map = new HashMap<>();
map.put("locale", CommonConstants.locale); map.put("locale", CommonConstants.locale);
map.put("feeFrequency", ChargesHelper.CHARGE_FEE_FREQUENCY_YEARS); map.put("feeFrequency", ChargesHelper.CHARGE_FEE_FREQUENCY_YEARS);
map.put("feeInterval", 2); map.put("feeInterval", 2);
@@ -80,10 +80,10 @@ public class FixedDepositAccountHelper {
public String build(final String clientId, final String productId, final String validFrom, final String validTo, public String build(final String clientId, final String productId, final String validFrom, final String validTo,
final String penalInterestType) { final String penalInterestType) {
final HashMap<String, Object> map = new HashMap<String, Object>(); final HashMap<String, Object> map = new HashMap<>();
List<HashMap<String, String>> chartSlabs = new ArrayList<HashMap<String, String>>(); List<HashMap<String, String>> chartSlabs = new ArrayList<HashMap<String, String>>();
HashMap<String, String> chartSlabsMap1 = new HashMap<String, String>(); HashMap<String, String> chartSlabsMap1 = new HashMap<>();
chartSlabsMap1.put("description", "First"); chartSlabsMap1.put("description", "First");
chartSlabsMap1.put("periodType", MONTHS); chartSlabsMap1.put("periodType", MONTHS);
chartSlabsMap1.put("fromPeriod", "1"); chartSlabsMap1.put("fromPeriod", "1");
@@ -92,7 +92,7 @@ public class FixedDepositAccountHelper {
chartSlabsMap1.put("locale", LOCALE); chartSlabsMap1.put("locale", LOCALE);
chartSlabs.add(0, chartSlabsMap1); chartSlabs.add(0, chartSlabsMap1);
HashMap<String, String> chartSlabsMap2 = new HashMap<String, String>(); HashMap<String, String> chartSlabsMap2 = new HashMap<>();
chartSlabsMap2.put("description", "Second"); chartSlabsMap2.put("description", "Second");
chartSlabsMap2.put("periodType", MONTHS); chartSlabsMap2.put("periodType", MONTHS);
chartSlabsMap2.put("fromPeriod", "7"); chartSlabsMap2.put("fromPeriod", "7");
@@ -101,7 +101,7 @@ public class FixedDepositAccountHelper {
chartSlabsMap2.put("locale", LOCALE); chartSlabsMap2.put("locale", LOCALE);
chartSlabs.add(1, chartSlabsMap2); chartSlabs.add(1, chartSlabsMap2);
HashMap<String, String> chartSlabsMap3 = new HashMap<String, String>(); HashMap<String, String> chartSlabsMap3 = new HashMap<>();
chartSlabsMap3.put("description", "Third"); chartSlabsMap3.put("description", "Third");
chartSlabsMap3.put("periodType", MONTHS); chartSlabsMap3.put("periodType", MONTHS);
chartSlabsMap3.put("fromPeriod", "13"); chartSlabsMap3.put("fromPeriod", "13");
@@ -110,7 +110,7 @@ public class FixedDepositAccountHelper {
chartSlabsMap3.put("locale", LOCALE); chartSlabsMap3.put("locale", LOCALE);
chartSlabs.add(2, chartSlabsMap3); chartSlabs.add(2, chartSlabsMap3);
HashMap<String, String> chartSlabsMap4 = new HashMap<String, String>(); HashMap<String, String> chartSlabsMap4 = new HashMap<>();
chartSlabsMap4.put("description", "Fourth"); chartSlabsMap4.put("description", "Fourth");
chartSlabsMap4.put("periodType", MONTHS); chartSlabsMap4.put("periodType", MONTHS);
chartSlabsMap4.put("fromPeriod", "19"); chartSlabsMap4.put("fromPeriod", "19");
@@ -120,7 +120,7 @@ public class FixedDepositAccountHelper {
chartSlabs.add(3, chartSlabsMap4); chartSlabs.add(3, chartSlabsMap4);
List<HashMap<String, Object>> charts = new ArrayList<HashMap<String, Object>>(); List<HashMap<String, Object>> charts = new ArrayList<HashMap<String, Object>>();
HashMap<String, Object> chartsMap = new HashMap<String, Object>(); HashMap<String, Object> chartsMap = new HashMap<>();
chartsMap.put("fromDate", validFrom); chartsMap.put("fromDate", validFrom);
chartsMap.put("endDate", validTo); chartsMap.put("endDate", validTo);
chartsMap.put("dateFormat", "dd MMMM yyyy"); chartsMap.put("dateFormat", "dd MMMM yyyy");
@@ -324,7 +324,7 @@ public class FixedDepositAccountHelper {
} }
private String getApproveFixedDepositAccountAsJSON(final String approvedOnDate) { private String getApproveFixedDepositAccountAsJSON(final String approvedOnDate) {
final HashMap<String, Object> map = new HashMap<String, Object>(); final HashMap<String, Object> map = new HashMap<>();
map.put("locale", CommonConstants.locale); map.put("locale", CommonConstants.locale);
map.put("dateFormat", CommonConstants.dateFormat); map.put("dateFormat", CommonConstants.dateFormat);
map.put("approvedOnDate", approvedOnDate); map.put("approvedOnDate", approvedOnDate);
@@ -335,7 +335,7 @@ public class FixedDepositAccountHelper {
} }
private String getRejectedFixedDepositAsJSON(final String rejectedOnDate) { private String getRejectedFixedDepositAsJSON(final String rejectedOnDate) {
final HashMap<String, Object> map = new HashMap<String, Object>(); final HashMap<String, Object> map = new HashMap<>();
map.put("locale", CommonConstants.locale); map.put("locale", CommonConstants.locale);
map.put("dateFormat", CommonConstants.dateFormat); map.put("dateFormat", CommonConstants.dateFormat);
map.put("rejectedOnDate", rejectedOnDate); map.put("rejectedOnDate", rejectedOnDate);
@@ -346,7 +346,7 @@ public class FixedDepositAccountHelper {
} }
private String getWithdrawnFixedDepositAccountAsJSON(final String withdrawnApplicationOnDate) { private String getWithdrawnFixedDepositAccountAsJSON(final String withdrawnApplicationOnDate) {
final HashMap<String, Object> map = new HashMap<String, Object>(); final HashMap<String, Object> map = new HashMap<>();
map.put("locale", CommonConstants.locale); map.put("locale", CommonConstants.locale);
map.put("dateFormat", CommonConstants.dateFormat); map.put("dateFormat", CommonConstants.dateFormat);
map.put("withdrawnOnDate", withdrawnApplicationOnDate); map.put("withdrawnOnDate", withdrawnApplicationOnDate);
@@ -357,7 +357,7 @@ public class FixedDepositAccountHelper {
} }
private String getActivatedFixedDepositAccountAsJSON(final String activationDate) { private String getActivatedFixedDepositAccountAsJSON(final String activationDate) {
final HashMap<String, Object> map = new HashMap<String, Object>(); final HashMap<String, Object> map = new HashMap<>();
map.put("locale", CommonConstants.locale); map.put("locale", CommonConstants.locale);
map.put("dateFormat", CommonConstants.dateFormat); map.put("dateFormat", CommonConstants.dateFormat);
map.put("activatedOnDate", activationDate); map.put("activatedOnDate", activationDate);
@@ -367,14 +367,14 @@ public class FixedDepositAccountHelper {
} }
private String getCalculatedInterestForFixedDepositApplicationAsJSON() { private String getCalculatedInterestForFixedDepositApplicationAsJSON() {
final HashMap<String, String> map = new HashMap<String, String>(); final HashMap<String, String> map = new HashMap<>();
String fixedDepositAccountCalculatedInterestJson = new Gson().toJson(map); String fixedDepositAccountCalculatedInterestJson = new Gson().toJson(map);
System.out.println(fixedDepositAccountCalculatedInterestJson); System.out.println(fixedDepositAccountCalculatedInterestJson);
return fixedDepositAccountCalculatedInterestJson; return fixedDepositAccountCalculatedInterestJson;
} }
private String getCalculatedPrematureAmountForFixedDepositAccountAsJSON(final String closedOnDate) { private String getCalculatedPrematureAmountForFixedDepositAccountAsJSON(final String closedOnDate) {
final HashMap<String, Object> map = new HashMap<String, Object>(); final HashMap<String, Object> map = new HashMap<>();
map.put("locale", CommonConstants.locale); map.put("locale", CommonConstants.locale);
map.put("dateFormat", CommonConstants.dateFormat); map.put("dateFormat", CommonConstants.dateFormat);
map.put("closedOnDate", closedOnDate); map.put("closedOnDate", closedOnDate);
@@ -385,7 +385,7 @@ public class FixedDepositAccountHelper {
private String getPrematureCloseForFixedDepositAccountAsJSON(final String closedOnDate, final String closureType, private String getPrematureCloseForFixedDepositAccountAsJSON(final String closedOnDate, final String closureType,
final Integer toSavingsId) { final Integer toSavingsId) {
final HashMap<String, Object> map = new HashMap<String, Object>(); final HashMap<String, Object> map = new HashMap<>();
map.put("locale", CommonConstants.locale); map.put("locale", CommonConstants.locale);
map.put("dateFormat", CommonConstants.dateFormat); map.put("dateFormat", CommonConstants.dateFormat);
map.put("closedOnDate", closedOnDate); map.put("closedOnDate", closedOnDate);
@@ -81,10 +81,10 @@ public class FixedDepositProductHelper {
private Account[] accountList = null; private Account[] accountList = null;
public String build(final String validFrom, final String validTo) { public String build(final String validFrom, final String validTo) {
final HashMap<String, Object> map = new HashMap<String, Object>(); final HashMap<String, Object> map = new HashMap<>();
List<HashMap<String, String>> chartSlabs = new ArrayList<HashMap<String, String>>(); List<HashMap<String, String>> chartSlabs = new ArrayList<HashMap<String, String>>();
HashMap<String, String> chartSlabsMap1 = new HashMap<String, String>(); HashMap<String, String> chartSlabsMap1 = new HashMap<>();
chartSlabsMap1.put("description", "First"); chartSlabsMap1.put("description", "First");
chartSlabsMap1.put("periodType", MONTHS); chartSlabsMap1.put("periodType", MONTHS);
chartSlabsMap1.put("fromPeriod", "1"); chartSlabsMap1.put("fromPeriod", "1");
@@ -93,7 +93,7 @@ public class FixedDepositProductHelper {
chartSlabsMap1.put("locale", LOCALE); chartSlabsMap1.put("locale", LOCALE);
chartSlabs.add(0, chartSlabsMap1); chartSlabs.add(0, chartSlabsMap1);
HashMap<String, String> chartSlabsMap2 = new HashMap<String, String>(); HashMap<String, String> chartSlabsMap2 = new HashMap<>();
chartSlabsMap2.put("description", "Second"); chartSlabsMap2.put("description", "Second");
chartSlabsMap2.put("periodType", MONTHS); chartSlabsMap2.put("periodType", MONTHS);
chartSlabsMap2.put("fromPeriod", "7"); chartSlabsMap2.put("fromPeriod", "7");
@@ -102,7 +102,7 @@ public class FixedDepositProductHelper {
chartSlabsMap2.put("locale", LOCALE); chartSlabsMap2.put("locale", LOCALE);
chartSlabs.add(1, chartSlabsMap2); chartSlabs.add(1, chartSlabsMap2);
HashMap<String, String> chartSlabsMap3 = new HashMap<String, String>(); HashMap<String, String> chartSlabsMap3 = new HashMap<>();
chartSlabsMap3.put("description", "Third"); chartSlabsMap3.put("description", "Third");
chartSlabsMap3.put("periodType", MONTHS); chartSlabsMap3.put("periodType", MONTHS);
chartSlabsMap3.put("fromPeriod", "13"); chartSlabsMap3.put("fromPeriod", "13");
@@ -111,7 +111,7 @@ public class FixedDepositProductHelper {
chartSlabsMap3.put("locale", LOCALE); chartSlabsMap3.put("locale", LOCALE);
chartSlabs.add(2, chartSlabsMap3); chartSlabs.add(2, chartSlabsMap3);
HashMap<String, String> chartSlabsMap4 = new HashMap<String, String>(); HashMap<String, String> chartSlabsMap4 = new HashMap<>();
chartSlabsMap4.put("description", "Fourth"); chartSlabsMap4.put("description", "Fourth");
chartSlabsMap4.put("periodType", MONTHS); chartSlabsMap4.put("periodType", MONTHS);
chartSlabsMap4.put("fromPeriod", "19"); chartSlabsMap4.put("fromPeriod", "19");
@@ -121,7 +121,7 @@ public class FixedDepositProductHelper {
chartSlabs.add(3, chartSlabsMap4); chartSlabs.add(3, chartSlabsMap4);
List<HashMap<String, Object>> charts = new ArrayList<HashMap<String, Object>>(); List<HashMap<String, Object>> charts = new ArrayList<HashMap<String, Object>>();
HashMap<String, Object> chartsMap = new HashMap<String, Object>(); HashMap<String, Object> chartsMap = new HashMap<>();
chartsMap.put("fromDate", validFrom); chartsMap.put("fromDate", validFrom);
chartsMap.put("endDate", validTo); chartsMap.put("endDate", validTo);
chartsMap.put("dateFormat", "dd MMMM yyyy"); chartsMap.put("dateFormat", "dd MMMM yyyy");
@@ -177,7 +177,7 @@ public class FixedDepositProductHelper {
} }
private Map<String, String> getAccountMappingForCashBased() { private Map<String, String> getAccountMappingForCashBased() {
final Map<String, String> map = new HashMap<String, String>(); final Map<String, String> map = new HashMap<>();
if (accountList != null) { if (accountList != null) {
for (int i = 0; i < this.accountList.length; i++) { for (int i = 0; i < this.accountList.length; i++) {
if (this.accountList[i].getAccountType().equals(Account.AccountType.ASSET)) { if (this.accountList[i].getAccountType().equals(Account.AccountType.ASSET)) {
@@ -42,7 +42,7 @@ public class LoanApplicationTestBuilder {
public String build(final String ID, final String loanProductId, final String savingsID) { public String build(final String ID, final String loanProductId, final String savingsID) {
final HashMap<String, Object> map = new HashMap<String, Object>(); final HashMap<String, Object> map = new HashMap<>();
map.put("dateFormat", "dd MMMM yyyy"); map.put("dateFormat", "dd MMMM yyyy");
map.put("locale", "en_GB"); map.put("locale", "en_GB");
if (this.loanType == "group") { if (this.loanType == "group") {
@@ -60,11 +60,11 @@ public class LoanProductTestBuilder {
private String maxTrancheCount = "35000"; private String maxTrancheCount = "35000";
public String build(final String chargeId) { public String build(final String chargeId) {
final HashMap<String, Object> map = new HashMap<String, Object>(); final HashMap<String, Object> map = new HashMap<>();
if (chargeId != null) { if (chargeId != null) {
List<HashMap<String, String>> charges = new ArrayList<HashMap<String, String>>(); List<HashMap<String, String>> charges = new ArrayList<HashMap<String, String>>();
HashMap<String, String> chargeMap = new HashMap<String, String>(); HashMap<String, String> chargeMap = new HashMap<>();
chargeMap.put("id", chargeId); chargeMap.put("id", chargeId);
charges.add(chargeMap); charges.add(chargeMap);
map.put("charges", charges); map.put("charges", charges);
@@ -233,7 +233,7 @@ public class LoanProductTestBuilder {
} }
private Map<String, String> getAccountMappingForCashBased() { private Map<String, String> getAccountMappingForCashBased() {
final Map<String, String> map = new HashMap<String, String>(); final Map<String, String> map = new HashMap<>();
for (int i = 0; i < this.accountList.length; i++) { for (int i = 0; i < this.accountList.length; i++) {
if (this.accountList[i].getAccountType().equals(Account.AccountType.ASSET)) { if (this.accountList[i].getAccountType().equals(Account.AccountType.ASSET)) {
final String ID = this.accountList[i].getAccountID().toString(); final String ID = this.accountList[i].getAccountID().toString();
@@ -261,7 +261,7 @@ public class LoanProductTestBuilder {
} }
private Map<String, String> getAccountMappingForAccrualBased() { private Map<String, String> getAccountMappingForAccrualBased() {
final Map<String, String> map = new HashMap<String, String>(); final Map<String, String> map = new HashMap<>();
for (int i = 0; i < this.accountList.length; i++) { for (int i = 0; i < this.accountList.length; i++) {
if (this.accountList[i].getAccountType().equals(Account.AccountType.ASSET)) { if (this.accountList[i].getAccountType().equals(Account.AccountType.ASSET)) {
final String ID = this.accountList[i].getAccountID().toString(); final String ID = this.accountList[i].getAccountID().toString();
@@ -166,7 +166,7 @@ public class LoanTransactionHelper {
} }
private String getDisburseLoanAsJSON(final String actualDisbursementDate, final String transactionAmount) { private String getDisburseLoanAsJSON(final String actualDisbursementDate, final String transactionAmount) {
final HashMap<String, String> map = new HashMap<String, String>(); final HashMap<String, String> map = new HashMap<>();
map.put("locale", "en"); map.put("locale", "en");
map.put("dateFormat", "dd MMMM yyyy"); map.put("dateFormat", "dd MMMM yyyy");
map.put("actualDisbursementDate", actualDisbursementDate); map.put("actualDisbursementDate", actualDisbursementDate);
@@ -178,7 +178,7 @@ public class LoanTransactionHelper {
} }
private String getApproveLoanAsJSON(final String approvalDate) { private String getApproveLoanAsJSON(final String approvalDate) {
final HashMap<String, String> map = new HashMap<String, String>(); final HashMap<String, String> map = new HashMap<>();
map.put("locale", "en"); map.put("locale", "en");
map.put("dateFormat", "dd MMMM yyyy"); map.put("dateFormat", "dd MMMM yyyy");
map.put("approvedOnDate", approvalDate); map.put("approvedOnDate", approvalDate);
@@ -187,7 +187,7 @@ public class LoanTransactionHelper {
} }
private String getRepaymentBodyAsJSON(final String transactionDate, final Float transactionAmount) { private String getRepaymentBodyAsJSON(final String transactionDate, final Float transactionAmount) {
final HashMap<String, String> map = new HashMap<String, String>(); final HashMap<String, String> map = new HashMap<>();
map.put("locale", "en"); map.put("locale", "en");
map.put("dateFormat", "dd MMMM yyyy"); map.put("dateFormat", "dd MMMM yyyy");
map.put("transactionDate", transactionDate); map.put("transactionDate", transactionDate);
@@ -197,7 +197,7 @@ public class LoanTransactionHelper {
} }
private String getWriteOffBodyAsJSON(final String transactionDate) { private String getWriteOffBodyAsJSON(final String transactionDate) {
final HashMap<String, String> map = new HashMap<String, String>(); final HashMap<String, String> map = new HashMap<>();
map.put("dateFormat", "dd MMMM yyyy"); map.put("dateFormat", "dd MMMM yyyy");
map.put("locale", "en"); map.put("locale", "en");
map.put("note", " LOAN WRITE OFF!!!"); map.put("note", " LOAN WRITE OFF!!!");
@@ -206,7 +206,7 @@ public class LoanTransactionHelper {
} }
private String getWaiveBodyAsJSON(final String transactionDate, final String amountToBeWaived) { private String getWaiveBodyAsJSON(final String transactionDate, final String amountToBeWaived) {
final HashMap<String, String> map = new HashMap<String, String>(); final HashMap<String, String> map = new HashMap<>();
map.put("locale", "en"); map.put("locale", "en");
map.put("dateFormat", "dd MMMM yyyy"); map.put("dateFormat", "dd MMMM yyyy");
map.put("transactionDate", transactionDate); map.put("transactionDate", transactionDate);
@@ -216,7 +216,7 @@ public class LoanTransactionHelper {
} }
private String getWithdrawLoanApplicationBodyAsJSON(final String withdrawDate) { private String getWithdrawLoanApplicationBodyAsJSON(final String withdrawDate) {
final HashMap<String, String> map = new HashMap<String, String>(); final HashMap<String, String> map = new HashMap<>();
map.put("locale", "en"); map.put("locale", "en");
map.put("dateFormat", "dd MMMM yyyy"); map.put("dateFormat", "dd MMMM yyyy");
map.put("withdrawnOnDate", withdrawDate); map.put("withdrawnOnDate", withdrawDate);
@@ -230,7 +230,7 @@ public class LoanTransactionHelper {
} }
public static String getSpecifiedDueDateChargesForLoanAsJSON(final String chargeId, final String dueDate, final String amount) { public static String getSpecifiedDueDateChargesForLoanAsJSON(final String chargeId, final String dueDate, final String amount) {
final HashMap<String, String> map = new HashMap<String, String>(); final HashMap<String, String> map = new HashMap<>();
map.put("locale", "en_GB"); map.put("locale", "en_GB");
map.put("dateFormat", "dd MMMM yyyy"); map.put("dateFormat", "dd MMMM yyyy");
map.put("amount", amount); map.put("amount", amount);
@@ -246,7 +246,7 @@ public class LoanTransactionHelper {
} }
public static String getDisbursementChargesForLoanAsJSON(final String chargeId, String amount) { public static String getDisbursementChargesForLoanAsJSON(final String chargeId, String amount) {
final HashMap<String, String> map = new HashMap<String, String>(); final HashMap<String, String> map = new HashMap<>();
map.put("locale", "en_GB"); map.put("locale", "en_GB");
map.put("dateFormat", "dd MMMM yyyy"); map.put("dateFormat", "dd MMMM yyyy");
map.put("amount", amount); map.put("amount", amount);
@@ -257,7 +257,7 @@ public class LoanTransactionHelper {
} }
public static String getInstallmentChargesForLoanAsJSON(final String chargeId, final String amount) { public static String getInstallmentChargesForLoanAsJSON(final String chargeId, final String amount) {
final HashMap<String, String> map = new HashMap<String, String>(); final HashMap<String, String> map = new HashMap<>();
map.put("locale", "en_GB"); map.put("locale", "en_GB");
map.put("dateFormat", "dd MMMM yyyy"); map.put("dateFormat", "dd MMMM yyyy");
map.put("amount", amount); map.put("amount", amount);
@@ -268,7 +268,7 @@ public class LoanTransactionHelper {
} }
public static String getUpdateChargesForLoanAsJSON(String amount) { public static String getUpdateChargesForLoanAsJSON(String amount) {
final HashMap<String, String> map = new HashMap<String, String>(); final HashMap<String, String> map = new HashMap<>();
map.put("locale", "en_GB"); map.put("locale", "en_GB");
map.put("dateFormat", "dd MMMM yyyy"); map.put("dateFormat", "dd MMMM yyyy");
map.put("amount", amount); map.put("amount", amount);
@@ -278,7 +278,7 @@ public class LoanTransactionHelper {
} }
public static String getPayChargeJSON(final String date, final String installmentNumber) { public static String getPayChargeJSON(final String date, final String installmentNumber) {
final HashMap<String, String> map = new HashMap<String, String>(); final HashMap<String, String> map = new HashMap<>();
map.put("locale", "en_GB"); map.put("locale", "en_GB");
map.put("dateFormat", "dd MMMM yyyy"); map.put("dateFormat", "dd MMMM yyyy");
map.put("transactionDate", date); map.put("transactionDate", date);
@@ -291,7 +291,7 @@ public class LoanTransactionHelper {
} }
public static String getWaiveChargeJSON(final String installmentNumber) { public static String getWaiveChargeJSON(final String installmentNumber) {
final HashMap<String, String> map = new HashMap<String, String>(); final HashMap<String, String> map = new HashMap<>();
map.put("locale", "en_GB"); map.put("locale", "en_GB");
map.put("installmentNumber", installmentNumber); map.put("installmentNumber", installmentNumber);
String json = new Gson().toJson(map); String json = new Gson().toJson(map);
@@ -300,7 +300,7 @@ public class LoanTransactionHelper {
} }
public String getLoanCalculationBodyAsJSON(final String productID) { public String getLoanCalculationBodyAsJSON(final String productID) {
final HashMap<String, String> map = new HashMap<String, String>(); final HashMap<String, String> map = new HashMap<>();
map.put("dateFormat", "dd MMMM yyyy"); map.put("dateFormat", "dd MMMM yyyy");
map.put("locale", "en_GB"); map.put("locale", "en_GB");
map.put("productId", productID); map.put("productId", productID);
@@ -91,10 +91,10 @@ public class RecurringDepositAccountHelper {
public String build(final String clientId, final String productId, final String validFrom, final String validTo, public String build(final String clientId, final String productId, final String validFrom, final String validTo,
final String penalInterestType) { final String penalInterestType) {
final HashMap<String, Object> map = new HashMap<String, Object>(); final HashMap<String, Object> map = new HashMap<>();
List<HashMap<String, String>> chartSlabs = new ArrayList<HashMap<String, String>>(); List<HashMap<String, String>> chartSlabs = new ArrayList<HashMap<String, String>>();
HashMap<String, String> chartSlabsMap1 = new HashMap<String, String>(); HashMap<String, String> chartSlabsMap1 = new HashMap<>();
chartSlabsMap1.put("description", "First"); chartSlabsMap1.put("description", "First");
chartSlabsMap1.put("periodType", MONTHS); chartSlabsMap1.put("periodType", MONTHS);
chartSlabsMap1.put("fromPeriod", "1"); chartSlabsMap1.put("fromPeriod", "1");
@@ -103,7 +103,7 @@ public class RecurringDepositAccountHelper {
chartSlabsMap1.put("locale", LOCALE); chartSlabsMap1.put("locale", LOCALE);
chartSlabs.add(0, chartSlabsMap1); chartSlabs.add(0, chartSlabsMap1);
HashMap<String, String> chartSlabsMap2 = new HashMap<String, String>(); HashMap<String, String> chartSlabsMap2 = new HashMap<>();
chartSlabsMap2.put("description", "Second"); chartSlabsMap2.put("description", "Second");
chartSlabsMap2.put("periodType", MONTHS); chartSlabsMap2.put("periodType", MONTHS);
chartSlabsMap2.put("fromPeriod", "7"); chartSlabsMap2.put("fromPeriod", "7");
@@ -112,7 +112,7 @@ public class RecurringDepositAccountHelper {
chartSlabsMap2.put("locale", LOCALE); chartSlabsMap2.put("locale", LOCALE);
chartSlabs.add(1, chartSlabsMap2); chartSlabs.add(1, chartSlabsMap2);
HashMap<String, String> chartSlabsMap3 = new HashMap<String, String>(); HashMap<String, String> chartSlabsMap3 = new HashMap<>();
chartSlabsMap3.put("description", "Third"); chartSlabsMap3.put("description", "Third");
chartSlabsMap3.put("periodType", MONTHS); chartSlabsMap3.put("periodType", MONTHS);
chartSlabsMap3.put("fromPeriod", "13"); chartSlabsMap3.put("fromPeriod", "13");
@@ -121,7 +121,7 @@ public class RecurringDepositAccountHelper {
chartSlabsMap3.put("locale", LOCALE); chartSlabsMap3.put("locale", LOCALE);
chartSlabs.add(2, chartSlabsMap3); chartSlabs.add(2, chartSlabsMap3);
HashMap<String, String> chartSlabsMap4 = new HashMap<String, String>(); HashMap<String, String> chartSlabsMap4 = new HashMap<>();
chartSlabsMap4.put("description", "Fourth"); chartSlabsMap4.put("description", "Fourth");
chartSlabsMap4.put("periodType", MONTHS); chartSlabsMap4.put("periodType", MONTHS);
chartSlabsMap4.put("fromPeriod", "19"); chartSlabsMap4.put("fromPeriod", "19");
@@ -131,7 +131,7 @@ public class RecurringDepositAccountHelper {
chartSlabs.add(3, chartSlabsMap4); chartSlabs.add(3, chartSlabsMap4);
List<HashMap<String, Object>> charts = new ArrayList<HashMap<String, Object>>(); List<HashMap<String, Object>> charts = new ArrayList<HashMap<String, Object>>();
HashMap<String, Object> chartsMap = new HashMap<String, Object>(); HashMap<String, Object> chartsMap = new HashMap<>();
chartsMap.put("fromDate", validFrom); chartsMap.put("fromDate", validFrom);
chartsMap.put("endDate", validTo); chartsMap.put("endDate", validTo);
chartsMap.put("dateFormat", "dd MMMM yyyy"); chartsMap.put("dateFormat", "dd MMMM yyyy");
@@ -378,7 +378,7 @@ public class RecurringDepositAccountHelper {
} }
private String getApproveRecurringDepositAccountAsJSON(final String approvedOnDate) { private String getApproveRecurringDepositAccountAsJSON(final String approvedOnDate) {
final HashMap<String, Object> map = new HashMap<String, Object>(); final HashMap<String, Object> map = new HashMap<>();
map.put("locale", CommonConstants.locale); map.put("locale", CommonConstants.locale);
map.put("dateFormat", CommonConstants.dateFormat); map.put("dateFormat", CommonConstants.dateFormat);
map.put("approvedOnDate", approvedOnDate); map.put("approvedOnDate", approvedOnDate);
@@ -389,7 +389,7 @@ public class RecurringDepositAccountHelper {
} }
private String getUpdateTransactionAsJSON(final String transactionDate, final Float transactionAmount) { private String getUpdateTransactionAsJSON(final String transactionDate, final Float transactionAmount) {
final HashMap<String, Object> map = new HashMap<String, Object>(); final HashMap<String, Object> map = new HashMap<>();
map.put("locale", CommonConstants.locale); map.put("locale", CommonConstants.locale);
map.put("dateFormat", CommonConstants.dateFormat); map.put("dateFormat", CommonConstants.dateFormat);
map.put("transactionDate", transactionDate); map.put("transactionDate", transactionDate);
@@ -400,7 +400,7 @@ public class RecurringDepositAccountHelper {
} }
private String getRejectedRecurringDepositAsJSON(final String rejectedOnDate) { private String getRejectedRecurringDepositAsJSON(final String rejectedOnDate) {
final HashMap<String, Object> map = new HashMap<String, Object>(); final HashMap<String, Object> map = new HashMap<>();
map.put("locale", CommonConstants.locale); map.put("locale", CommonConstants.locale);
map.put("dateFormat", CommonConstants.dateFormat); map.put("dateFormat", CommonConstants.dateFormat);
map.put("rejectedOnDate", rejectedOnDate); map.put("rejectedOnDate", rejectedOnDate);
@@ -411,7 +411,7 @@ public class RecurringDepositAccountHelper {
} }
private String getWithdrawnRecurringDepositAccountAsJSON(final String withdrawnApplicationOnDate) { private String getWithdrawnRecurringDepositAccountAsJSON(final String withdrawnApplicationOnDate) {
final HashMap<String, Object> map = new HashMap<String, Object>(); final HashMap<String, Object> map = new HashMap<>();
map.put("locale", CommonConstants.locale); map.put("locale", CommonConstants.locale);
map.put("dateFormat", CommonConstants.dateFormat); map.put("dateFormat", CommonConstants.dateFormat);
map.put("withdrawnOnDate", withdrawnApplicationOnDate); map.put("withdrawnOnDate", withdrawnApplicationOnDate);
@@ -422,7 +422,7 @@ public class RecurringDepositAccountHelper {
} }
private String getActivatedRecurringDepositAccountAsJSON(final String activationDate) { private String getActivatedRecurringDepositAccountAsJSON(final String activationDate) {
final HashMap<String, Object> map = new HashMap<String, Object>(); final HashMap<String, Object> map = new HashMap<>();
map.put("locale", CommonConstants.locale); map.put("locale", CommonConstants.locale);
map.put("dateFormat", CommonConstants.dateFormat); map.put("dateFormat", CommonConstants.dateFormat);
map.put("activatedOnDate", activationDate); map.put("activatedOnDate", activationDate);
@@ -432,14 +432,14 @@ public class RecurringDepositAccountHelper {
} }
private String getCalculatedInterestForRecurringDepositApplicationAsJSON() { private String getCalculatedInterestForRecurringDepositApplicationAsJSON() {
final HashMap<String, String> map = new HashMap<String, String>(); final HashMap<String, String> map = new HashMap<>();
String recurringDepositAccountCalculatedInterestJson = new Gson().toJson(map); String recurringDepositAccountCalculatedInterestJson = new Gson().toJson(map);
System.out.println(recurringDepositAccountCalculatedInterestJson); System.out.println(recurringDepositAccountCalculatedInterestJson);
return recurringDepositAccountCalculatedInterestJson; return recurringDepositAccountCalculatedInterestJson;
} }
private String getCalculatedPrematureAmountForRecurringDepositAccountAsJSON(final String closedOnDate) { private String getCalculatedPrematureAmountForRecurringDepositAccountAsJSON(final String closedOnDate) {
final HashMap<String, Object> map = new HashMap<String, Object>(); final HashMap<String, Object> map = new HashMap<>();
map.put("locale", CommonConstants.locale); map.put("locale", CommonConstants.locale);
map.put("dateFormat", CommonConstants.dateFormat); map.put("dateFormat", CommonConstants.dateFormat);
map.put("closedOnDate", closedOnDate); map.put("closedOnDate", closedOnDate);
@@ -449,7 +449,7 @@ public class RecurringDepositAccountHelper {
} }
private String getDepositToRecurringDepositAccountAsJSON(final Float depositAmount, final String depositedOnDate) { private String getDepositToRecurringDepositAccountAsJSON(final Float depositAmount, final String depositedOnDate) {
final HashMap<String, Object> map = new HashMap<String, Object>(); final HashMap<String, Object> map = new HashMap<>();
map.put("locale", CommonConstants.locale); map.put("locale", CommonConstants.locale);
map.put("dateFormat", CommonConstants.dateFormat); map.put("dateFormat", CommonConstants.dateFormat);
map.put("transactionAmount", depositAmount); map.put("transactionAmount", depositAmount);
@@ -461,7 +461,7 @@ public class RecurringDepositAccountHelper {
private String getPrematureCloseForRecurringDepositAccountAsJSON(final String closedOnDate, final String closureType, private String getPrematureCloseForRecurringDepositAccountAsJSON(final String closedOnDate, final String closureType,
final Integer toSavingsId) { final Integer toSavingsId) {
final HashMap<String, Object> map = new HashMap<String, Object>(); final HashMap<String, Object> map = new HashMap<>();
map.put("locale", CommonConstants.locale); map.put("locale", CommonConstants.locale);
map.put("dateFormat", CommonConstants.dateFormat); map.put("dateFormat", CommonConstants.dateFormat);
map.put("closedOnDate", closedOnDate); map.put("closedOnDate", closedOnDate);
@@ -79,10 +79,10 @@ public class RecurringDepositProductHelper {
private Account[] accountList = null; private Account[] accountList = null;
public String build(final String validFrom, final String validTo) { public String build(final String validFrom, final String validTo) {
final HashMap<String, Object> map = new HashMap<String, Object>(); final HashMap<String, Object> map = new HashMap<>();
List<HashMap<String, String>> chartSlabs = new ArrayList<HashMap<String, String>>(); List<HashMap<String, String>> chartSlabs = new ArrayList<HashMap<String, String>>();
HashMap<String, String> chartSlabsMap1 = new HashMap<String, String>(); HashMap<String, String> chartSlabsMap1 = new HashMap<>();
chartSlabsMap1.put("description", "First"); chartSlabsMap1.put("description", "First");
chartSlabsMap1.put("periodType", MONTHS); chartSlabsMap1.put("periodType", MONTHS);
chartSlabsMap1.put("fromPeriod", "1"); chartSlabsMap1.put("fromPeriod", "1");
@@ -91,7 +91,7 @@ public class RecurringDepositProductHelper {
chartSlabsMap1.put("locale", LOCALE); chartSlabsMap1.put("locale", LOCALE);
chartSlabs.add(0, chartSlabsMap1); chartSlabs.add(0, chartSlabsMap1);
HashMap<String, String> chartSlabsMap2 = new HashMap<String, String>(); HashMap<String, String> chartSlabsMap2 = new HashMap<>();
chartSlabsMap2.put("description", "Second"); chartSlabsMap2.put("description", "Second");
chartSlabsMap2.put("periodType", MONTHS); chartSlabsMap2.put("periodType", MONTHS);
chartSlabsMap2.put("fromPeriod", "7"); chartSlabsMap2.put("fromPeriod", "7");
@@ -100,7 +100,7 @@ public class RecurringDepositProductHelper {
chartSlabsMap2.put("locale", LOCALE); chartSlabsMap2.put("locale", LOCALE);
chartSlabs.add(1, chartSlabsMap2); chartSlabs.add(1, chartSlabsMap2);
HashMap<String, String> chartSlabsMap3 = new HashMap<String, String>(); HashMap<String, String> chartSlabsMap3 = new HashMap<>();
chartSlabsMap3.put("description", "Third"); chartSlabsMap3.put("description", "Third");
chartSlabsMap3.put("periodType", MONTHS); chartSlabsMap3.put("periodType", MONTHS);
chartSlabsMap3.put("fromPeriod", "13"); chartSlabsMap3.put("fromPeriod", "13");
@@ -109,7 +109,7 @@ public class RecurringDepositProductHelper {
chartSlabsMap3.put("locale", LOCALE); chartSlabsMap3.put("locale", LOCALE);
chartSlabs.add(2, chartSlabsMap3); chartSlabs.add(2, chartSlabsMap3);
HashMap<String, String> chartSlabsMap4 = new HashMap<String, String>(); HashMap<String, String> chartSlabsMap4 = new HashMap<>();
chartSlabsMap4.put("description", "Fourth"); chartSlabsMap4.put("description", "Fourth");
chartSlabsMap4.put("periodType", MONTHS); chartSlabsMap4.put("periodType", MONTHS);
chartSlabsMap4.put("fromPeriod", "19"); chartSlabsMap4.put("fromPeriod", "19");
@@ -119,7 +119,7 @@ public class RecurringDepositProductHelper {
chartSlabs.add(3, chartSlabsMap4); chartSlabs.add(3, chartSlabsMap4);
List<HashMap<String, Object>> charts = new ArrayList<HashMap<String, Object>>(); List<HashMap<String, Object>> charts = new ArrayList<HashMap<String, Object>>();
HashMap<String, Object> chartsMap = new HashMap<String, Object>(); HashMap<String, Object> chartsMap = new HashMap<>();
chartsMap.put("fromDate", validFrom); chartsMap.put("fromDate", validFrom);
chartsMap.put("endDate", validTo); chartsMap.put("endDate", validTo);
chartsMap.put("dateFormat", "dd MMMM yyyy"); chartsMap.put("dateFormat", "dd MMMM yyyy");
@@ -181,7 +181,7 @@ public class RecurringDepositProductHelper {
} }
private Map<String, String> getAccountMappingForCashBased() { private Map<String, String> getAccountMappingForCashBased() {
final Map<String, String> map = new HashMap<String, String>(); final Map<String, String> map = new HashMap<>();
if (accountList != null) { if (accountList != null) {
for (int i = 0; i < this.accountList.length; i++) { for (int i = 0; i < this.accountList.length; i++) {
if (this.accountList[i].getAccountType().equals(Account.AccountType.ASSET)) { if (this.accountList[i].getAccountType().equals(Account.AccountType.ASSET)) {
@@ -31,7 +31,7 @@ public class AccountTransferHelper {
public String build(final String fromAccountId, final String fromClientId, final String toAccountId, final String toClientId, public String build(final String fromAccountId, final String fromClientId, final String toAccountId, final String toClientId,
final String fromAccountType, final String toAccountType, final String transferAmount) { final String fromAccountType, final String toAccountType, final String transferAmount) {
final HashMap<String, String> map = new HashMap<String, String>(); final HashMap<String, String> map = new HashMap<>();
map.put("dateFormat", "dd MMMM yyyy"); map.put("dateFormat", "dd MMMM yyyy");
map.put("locale", LOCALE); map.put("locale", LOCALE);
map.put("fromClientId", fromClientId); map.put("fromClientId", fromClientId);
@@ -179,7 +179,7 @@ public class SavingsAccountHelper {
} }
private String getApproveSavingsAsJSON() { private String getApproveSavingsAsJSON() {
final HashMap<String, String> map = new HashMap<String, String>(); final HashMap<String, String> map = new HashMap<>();
map.put("locale", CommonConstants.locale); map.put("locale", CommonConstants.locale);
map.put("dateFormat", CommonConstants.dateFormat); map.put("dateFormat", CommonConstants.dateFormat);
map.put("approvedOnDate", CREATED_DATE_PLUS_ONE); map.put("approvedOnDate", CREATED_DATE_PLUS_ONE);
@@ -190,7 +190,7 @@ public class SavingsAccountHelper {
} }
private String getRejectedSavingsAsJSON(final String rejectedOnDate) { private String getRejectedSavingsAsJSON(final String rejectedOnDate) {
final HashMap<String, String> map = new HashMap<String, String>(); final HashMap<String, String> map = new HashMap<>();
map.put("locale", CommonConstants.locale); map.put("locale", CommonConstants.locale);
map.put("dateFormat", CommonConstants.dateFormat); map.put("dateFormat", CommonConstants.dateFormat);
map.put("rejectedOnDate", rejectedOnDate); map.put("rejectedOnDate", rejectedOnDate);
@@ -201,7 +201,7 @@ public class SavingsAccountHelper {
} }
private String getWithdrawnSavingsAsJSON() { private String getWithdrawnSavingsAsJSON() {
final HashMap<String, String> map = new HashMap<String, String>(); final HashMap<String, String> map = new HashMap<>();
map.put("locale", CommonConstants.locale); map.put("locale", CommonConstants.locale);
map.put("dateFormat", CommonConstants.dateFormat); map.put("dateFormat", CommonConstants.dateFormat);
map.put("withdrawnOnDate", CREATED_DATE_PLUS_ONE); map.put("withdrawnOnDate", CREATED_DATE_PLUS_ONE);
@@ -212,7 +212,7 @@ public class SavingsAccountHelper {
} }
private String getActivatedSavingsAsJSON() { private String getActivatedSavingsAsJSON() {
final HashMap<String, String> map = new HashMap<String, String>(); final HashMap<String, String> map = new HashMap<>();
map.put("locale", CommonConstants.locale); map.put("locale", CommonConstants.locale);
map.put("dateFormat", CommonConstants.dateFormat); map.put("dateFormat", CommonConstants.dateFormat);
map.put("activatedOnDate", TRANSACTION_DATE); map.put("activatedOnDate", TRANSACTION_DATE);
@@ -222,7 +222,7 @@ public class SavingsAccountHelper {
} }
private String getSavingsTransactionJSON(final String amount, final String transactionDate) { private String getSavingsTransactionJSON(final String amount, final String transactionDate) {
final HashMap<String, String> map = new HashMap<String, String>(); final HashMap<String, String> map = new HashMap<>();
map.put("locale", CommonConstants.locale); map.put("locale", CommonConstants.locale);
map.put("dateFormat", CommonConstants.dateFormat); map.put("dateFormat", CommonConstants.dateFormat);
map.put("transactionDate", transactionDate); map.put("transactionDate", transactionDate);
@@ -233,14 +233,14 @@ public class SavingsAccountHelper {
} }
private String getCalculatedInterestForSavingsApplicationAsJSON() { private String getCalculatedInterestForSavingsApplicationAsJSON() {
final HashMap<String, String> map = new HashMap<String, String>(); final HashMap<String, String> map = new HashMap<>();
String savingsAccountCalculatedInterestJson = new Gson().toJson(map); String savingsAccountCalculatedInterestJson = new Gson().toJson(map);
System.out.println(savingsAccountCalculatedInterestJson); System.out.println(savingsAccountCalculatedInterestJson);
return savingsAccountCalculatedInterestJson; return savingsAccountCalculatedInterestJson;
} }
private String getSavingsPayChargeJSON(final String amount, final String dueDate) { private String getSavingsPayChargeJSON(final String amount, final String dueDate) {
final HashMap<String, Object> map = new HashMap<String, Object>(); final HashMap<String, Object> map = new HashMap<>();
map.put("locale", CommonConstants.locale); map.put("locale", CommonConstants.locale);
map.put("dateFormat", CommonConstants.dateFormat); map.put("dateFormat", CommonConstants.dateFormat);
map.put("amount", amount); map.put("amount", amount);
@@ -250,7 +250,7 @@ public class SavingsAccountHelper {
} }
private String getSavingsWaiveChargeJSON() { private String getSavingsWaiveChargeJSON() {
final HashMap<String, Object> map = new HashMap<String, Object>(); final HashMap<String, Object> map = new HashMap<>();
map.put("locale", CommonConstants.locale); map.put("locale", CommonConstants.locale);
map.put("dateFormat", CommonConstants.dateFormat); map.put("dateFormat", CommonConstants.dateFormat);
String josn = new Gson().toJson(map); String josn = new Gson().toJson(map);
@@ -258,7 +258,7 @@ public class SavingsAccountHelper {
} }
private String getModifyChargeJSON() { private String getModifyChargeJSON() {
final HashMap<String, Object> map = new HashMap<String, Object>(); final HashMap<String, Object> map = new HashMap<>();
map.put("locale", CommonConstants.locale); map.put("locale", CommonConstants.locale);
map.put("dateFormat", CommonConstants.dateFormat); map.put("dateFormat", CommonConstants.dateFormat);
map.put("amount", "50"); map.put("amount", "50");
@@ -267,7 +267,7 @@ public class SavingsAccountHelper {
} }
private String getCloseAccountJSON() { private String getCloseAccountJSON() {
final HashMap<String, Object> map = new HashMap<String, Object>(); final HashMap<String, Object> map = new HashMap<>();
map.put("locale", CommonConstants.locale); map.put("locale", CommonConstants.locale);
map.put("dateFormat", CommonConstants.dateFormat); map.put("dateFormat", CommonConstants.dateFormat);
map.put("closedOnDate", LAST_TRANSACTION_DATE); map.put("closedOnDate", LAST_TRANSACTION_DATE);
@@ -347,7 +347,7 @@ public class SavingsAccountHelper {
} }
private String getPeriodChargeRequestJSON(Integer chargeId) { private String getPeriodChargeRequestJSON(Integer chargeId) {
final HashMap<String, Object> map = new HashMap<String, Object>(); final HashMap<String, Object> map = new HashMap<>();
map.put("chargeId", chargeId); map.put("chargeId", chargeId);
map.put("amount", 100); map.put("amount", 100);
map.put("feeOnMonthDay", "15 January"); map.put("feeOnMonthDay", "15 January");
@@ -12,7 +12,7 @@ public class SavingsApplicationTestBuilder {
public String build(final String ID, final String savingsProductId, final String accountType) { public String build(final String ID, final String savingsProductId, final String accountType) {
final HashMap<String, String> map = new HashMap<String, String>(); final HashMap<String, String> map = new HashMap<>();
map.put("dateFormat", "dd MMMM yyyy"); map.put("dateFormat", "dd MMMM yyyy");
if (accountType == "GROUP") { if (accountType == "GROUP") {
map.put("groupId", ID); map.put("groupId", ID);
@@ -65,7 +65,7 @@ public class SavingsProductHelper {
private Account[] accountList = null; private Account[] accountList = null;
public String build() { public String build() {
final HashMap<String, String> map = new HashMap<String, String>(); final HashMap<String, String> map = new HashMap<>();
map.put("name", this.nameOfSavingsProduct); map.put("name", this.nameOfSavingsProduct);
map.put("shortName", this.shortName); map.put("shortName", this.shortName);
@@ -159,7 +159,7 @@ public class SavingsProductHelper {
} }
private Map<String, String> getAccountMappingForCashBased() { private Map<String, String> getAccountMappingForCashBased() {
final Map<String, String> map = new HashMap<String, String>(); final Map<String, String> map = new HashMap<>();
if (accountList != null) { if (accountList != null) {
for (int i = 0; i < this.accountList.length; i++) { for (int i = 0; i < this.accountList.length; i++) {
if (this.accountList[i].getAccountType().equals(Account.AccountType.ASSET)) { if (this.accountList[i].getAccountType().equals(Account.AccountType.ASSET)) {
@@ -66,13 +66,13 @@ public class CodeHelper {
} }
public static String getTestCodeAsJSON(final String codeName) { public static String getTestCodeAsJSON(final String codeName) {
final HashMap<String, String> map = new HashMap<String, String>(); final HashMap<String, String> map = new HashMap<>();
map.put(CODE_NAME_ATTRIBUTE_NAME, codeName); map.put(CODE_NAME_ATTRIBUTE_NAME, codeName);
return new Gson().toJson(map); return new Gson().toJson(map);
} }
public static String getTestCodeValueAsJSON(final String codeValueName, final Integer position) { public static String getTestCodeValueAsJSON(final String codeValueName, final Integer position) {
final HashMap<String, Object> map = new HashMap<String, Object>(); final HashMap<String, Object> map = new HashMap<>();
map.put(CODE_VALUE_NAME_ATTRIBUTE_NAME, codeValueName); map.put(CODE_VALUE_NAME_ATTRIBUTE_NAME, codeValueName);
map.put(CODE_VALUE_POSITION_ATTRIBUTE_NAME, position); map.put(CODE_VALUE_POSITION_ATTRIBUTE_NAME, position);
return new Gson().toJson(map); return new Gson().toJson(map);
@@ -20,7 +20,7 @@ public enum GLClosureJsonInputParams {
this.value = value; this.value = value;
} }
private static final Set<String> values = new HashSet<String>(); private static final Set<String> values = new HashSet<>();
static { static {
for (final GLClosureJsonInputParams type : GLClosureJsonInputParams.values()) { for (final GLClosureJsonInputParams type : GLClosureJsonInputParams.values()) {
values.add(type.value); values.add(type.value);
@@ -43,7 +43,7 @@ import org.springframework.stereotype.Component;
@Scope("singleton") @Scope("singleton")
public class GLClosuresApiResource { public class GLClosuresApiResource {
private static final Set<String> RESPONSE_DATA_PARAMETERS = new HashSet<String>(Arrays.asList("id", "officeId", "officeName", private static final Set<String> RESPONSE_DATA_PARAMETERS = new HashSet<>(Arrays.asList("id", "officeId", "officeName",
"closingDate", "deleted", "createdDate", "lastUpdatedDate", "createdByUserId", "createdByUsername", "lastUpdatedByUserId", "closingDate", "deleted", "createdDate", "lastUpdatedDate", "createdByUserId", "createdByUsername", "lastUpdatedByUserId",
"lastUpdatedByUsername")); "lastUpdatedByUsername"));
@@ -34,7 +34,7 @@ public class GLClosureCommand {
public void validateForCreate() { public void validateForCreate() {
final List<ApiParameterError> dataValidationErrors = new ArrayList<ApiParameterError>(); final List<ApiParameterError> dataValidationErrors = new ArrayList<>();
final DataValidatorBuilder baseDataValidator = new DataValidatorBuilder(dataValidationErrors).resource("GLClosure"); final DataValidatorBuilder baseDataValidator = new DataValidatorBuilder(dataValidationErrors).resource("GLClosure");
@@ -49,7 +49,7 @@ public class GLClosureCommand {
} }
public void validateForUpdate() { public void validateForUpdate() {
final List<ApiParameterError> dataValidationErrors = new ArrayList<ApiParameterError>(); final List<ApiParameterError> dataValidationErrors = new ArrayList<>();
final DataValidatorBuilder baseDataValidator = new DataValidatorBuilder(dataValidationErrors).resource("GLClosure"); final DataValidatorBuilder baseDataValidator = new DataValidatorBuilder(dataValidationErrors).resource("GLClosure");
@@ -44,7 +44,7 @@ public class GLClosureData {
@SuppressWarnings("unused") @SuppressWarnings("unused")
private final String comments; private final String comments;
private Collection<OfficeData> allowedOffices = new ArrayList<OfficeData>(); private Collection<OfficeData> allowedOffices = new ArrayList<>();
public GLClosureData(final Long id, final Long officeId, final String officeName, final LocalDate closingDate, final boolean deleted, public GLClosureData(final Long id, final Long officeId, final String officeName, final LocalDate closingDate, final boolean deleted,
final LocalDate createdDate, final LocalDate lastUpdatedDate, final Long createdByUserId, final String createdByUsername, final LocalDate createdDate, final LocalDate lastUpdatedDate, final Long createdByUserId, final String createdByUsername,
@@ -64,7 +64,7 @@ public class GLClosure extends AbstractAuditableCustom<AppUser, Long> {
} }
public Map<String, Object> update(final JsonCommand command) { public Map<String, Object> update(final JsonCommand command) {
final Map<String, Object> actualChanges = new LinkedHashMap<String, Object>(5); final Map<String, Object> actualChanges = new LinkedHashMap<>(5);
handlePropertyUpdate(command, actualChanges, GLClosureJsonInputParams.COMMENTS.getValue(), this.comments); handlePropertyUpdate(command, actualChanges, GLClosureJsonInputParams.COMMENTS.getValue(), this.comments);
return actualChanges; return actualChanges;
} }
@@ -35,7 +35,7 @@ public class AccountingConstants {
return this.value; return this.value;
} }
private static final Map<Integer, CASH_ACCOUNTS_FOR_LOAN> intToEnumMap = new HashMap<Integer, CASH_ACCOUNTS_FOR_LOAN>(); private static final Map<Integer, CASH_ACCOUNTS_FOR_LOAN> intToEnumMap = new HashMap<>();
static { static {
for (final CASH_ACCOUNTS_FOR_LOAN type : CASH_ACCOUNTS_FOR_LOAN.values()) { for (final CASH_ACCOUNTS_FOR_LOAN type : CASH_ACCOUNTS_FOR_LOAN.values()) {
intToEnumMap.put(type.value, type); intToEnumMap.put(type.value, type);
@@ -68,7 +68,7 @@ public class AccountingConstants {
return this.value; return this.value;
} }
private static final Map<Integer, ACCRUAL_ACCOUNTS_FOR_LOAN> intToEnumMap = new HashMap<Integer, ACCRUAL_ACCOUNTS_FOR_LOAN>(); private static final Map<Integer, ACCRUAL_ACCOUNTS_FOR_LOAN> intToEnumMap = new HashMap<>();
static { static {
for (final ACCRUAL_ACCOUNTS_FOR_LOAN type : ACCRUAL_ACCOUNTS_FOR_LOAN.values()) { for (final ACCRUAL_ACCOUNTS_FOR_LOAN type : ACCRUAL_ACCOUNTS_FOR_LOAN.values()) {
intToEnumMap.put(type.value, type); intToEnumMap.put(type.value, type);
@@ -155,7 +155,7 @@ public class AccountingConstants {
return this.value; return this.value;
} }
private static final Map<Integer, CASH_ACCOUNTS_FOR_SAVINGS> intToEnumMap = new HashMap<Integer, CASH_ACCOUNTS_FOR_SAVINGS>(); private static final Map<Integer, CASH_ACCOUNTS_FOR_SAVINGS> intToEnumMap = new HashMap<>();
static { static {
for (final CASH_ACCOUNTS_FOR_SAVINGS type : CASH_ACCOUNTS_FOR_SAVINGS.values()) { for (final CASH_ACCOUNTS_FOR_SAVINGS type : CASH_ACCOUNTS_FOR_SAVINGS.values()) {
intToEnumMap.put(type.value, type); intToEnumMap.put(type.value, type);
@@ -255,7 +255,7 @@ public class AccountingConstants {
return this.value.toString(); return this.value.toString();
} }
private static final Map<Integer, FINANCIAL_ACTIVITY> intToEnumMap = new HashMap<Integer, FINANCIAL_ACTIVITY>(); private static final Map<Integer, FINANCIAL_ACTIVITY> intToEnumMap = new HashMap<>();
static { static {
for (final FINANCIAL_ACTIVITY type : FINANCIAL_ACTIVITY.values()) { for (final FINANCIAL_ACTIVITY type : FINANCIAL_ACTIVITY.values()) {
intToEnumMap.put(type.value, type); intToEnumMap.put(type.value, type);
@@ -274,7 +274,7 @@ public class AccountingConstants {
public static List<FinancialActivityData> getAllFinancialActivities() { public static List<FinancialActivityData> getAllFinancialActivities() {
if (financialActivities == null) { if (financialActivities == null) {
financialActivities = new ArrayList<FinancialActivityData>(); financialActivities = new ArrayList<>();
for (final FINANCIAL_ACTIVITY type : FINANCIAL_ACTIVITY.values()) { for (final FINANCIAL_ACTIVITY type : FINANCIAL_ACTIVITY.values()) {
FinancialActivityData financialActivityData = convertToFinancialActivityData(type); FinancialActivityData financialActivityData = convertToFinancialActivityData(type);
financialActivities.add(financialActivityData); financialActivities.add(financialActivityData);
@@ -60,7 +60,7 @@ public class AccountingDropdownReadPlatformServiceImpl implements AccountingDrop
@Override @Override
public Map<String, List<GLAccountData>> retrieveAccountMappingOptions() { public Map<String, List<GLAccountData>> retrieveAccountMappingOptions() {
final Map<String, List<GLAccountData>> accountOptions = new HashMap<String, List<GLAccountData>>(); final Map<String, List<GLAccountData>> accountOptions = new HashMap<>();
List<GLAccountData> assetAccountOptions = this.accountReadPlatformService.retrieveAllEnabledDetailGLAccounts(GLAccountType.ASSET); List<GLAccountData> assetAccountOptions = this.accountReadPlatformService.retrieveAllEnabledDetailGLAccounts(GLAccountType.ASSET);
if (assetAccountOptions.isEmpty()) { if (assetAccountOptions.isEmpty()) {
assetAccountOptions = null; assetAccountOptions = null;
@@ -27,7 +27,7 @@ public class AccountingEnumerations {
} }
public static List<EnumOptionData> gLAccountType(final GLAccountType[] accountTypes) { public static List<EnumOptionData> gLAccountType(final GLAccountType[] accountTypes) {
final List<EnumOptionData> optionDatas = new ArrayList<EnumOptionData>(); final List<EnumOptionData> optionDatas = new ArrayList<>();
for (final GLAccountType accountType : accountTypes) { for (final GLAccountType accountType : accountTypes) {
optionDatas.add(gLAccountType(accountType)); optionDatas.add(gLAccountType(accountType));
} }
@@ -45,7 +45,7 @@ public class AccountingEnumerations {
} }
public static List<EnumOptionData> gLAccountUsage(final GLAccountUsage[] accountUsages) { public static List<EnumOptionData> gLAccountUsage(final GLAccountUsage[] accountUsages) {
final List<EnumOptionData> optionDatas = new ArrayList<EnumOptionData>(); final List<EnumOptionData> optionDatas = new ArrayList<>();
for (final GLAccountUsage accountUsage : accountUsages) { for (final GLAccountUsage accountUsage : accountUsages) {
optionDatas.add(gLAccountUsage(accountUsage)); optionDatas.add(gLAccountUsage(accountUsage));
} }
@@ -63,7 +63,7 @@ public class AccountingEnumerations {
} }
public static List<EnumOptionData> journalEntryTypes(final JournalEntryType[] journalEntryTypes) { public static List<EnumOptionData> journalEntryTypes(final JournalEntryType[] journalEntryTypes) {
final List<EnumOptionData> optionDatas = new ArrayList<EnumOptionData>(); final List<EnumOptionData> optionDatas = new ArrayList<>();
for (final JournalEntryType journalEntryType : journalEntryTypes) { for (final JournalEntryType journalEntryType : journalEntryTypes) {
optionDatas.add(journalEntryType(journalEntryType)); optionDatas.add(journalEntryType(journalEntryType));
} }
@@ -90,7 +90,7 @@ public class AccountingEnumerations {
} }
public static List<EnumOptionData> accountingRuleTypes(final AccountingRuleType[] accountingRuleTypes) { public static List<EnumOptionData> accountingRuleTypes(final AccountingRuleType[] accountingRuleTypes) {
final List<EnumOptionData> optionDatas = new ArrayList<EnumOptionData>(); final List<EnumOptionData> optionDatas = new ArrayList<>();
for (final AccountingRuleType accountingRuleType : accountingRuleTypes) { for (final AccountingRuleType accountingRuleType : accountingRuleTypes) {
optionDatas.add(accountingRuleType(accountingRuleType)); optionDatas.add(accountingRuleType(accountingRuleType));
} }
@@ -18,7 +18,7 @@ public enum AccountingRuleType {
private final Integer value; private final Integer value;
private final String code; private final String code;
private static final Map<Integer, AccountingRuleType> intToEnumMap = new HashMap<Integer, AccountingRuleType>(); private static final Map<Integer, AccountingRuleType> intToEnumMap = new HashMap<>();
static { static {
for (final AccountingRuleType type : AccountingRuleType.values()) { for (final AccountingRuleType type : AccountingRuleType.values()) {
intToEnumMap.put(type.value, type); intToEnumMap.put(type.value, type);
@@ -6,7 +6,7 @@ import java.util.Set;
public class FinancialActivityAccountsConstants { public class FinancialActivityAccountsConstants {
public static final Set<String> RESPONSE_DATA_PARAMETERS = new HashSet<String>(Arrays.asList("id", "financialActivityData", public static final Set<String> RESPONSE_DATA_PARAMETERS = new HashSet<>(Arrays.asList("id", "financialActivityData",
"glAccountData", "glAccountOptions", "financialActivityOptions")); "glAccountData", "glAccountOptions", "financialActivityOptions"));
public static final String resourceNameForPermission = "FINANCIALACTIVITYACCOUNT"; public static final String resourceNameForPermission = "FINANCIALACTIVITYACCOUNT";
@@ -20,7 +20,7 @@ public enum FinancialActivityAccountsJsonInputParams {
this.value = value; this.value = value;
} }
private static final Set<String> values = new HashSet<String>(); private static final Set<String> values = new HashSet<>();
static { static {
for (final FinancialActivityAccountsJsonInputParams type : FinancialActivityAccountsJsonInputParams.values()) { for (final FinancialActivityAccountsJsonInputParams type : FinancialActivityAccountsJsonInputParams.values()) {
values.add(type.value); values.add(type.value);
@@ -46,7 +46,7 @@ public final class FinancialActivityAccountDataValidator {
public void validateForCreate(final String json) { public void validateForCreate(final String json) {
validateJSONAndCheckForUnsupportedParams(json); validateJSONAndCheckForUnsupportedParams(json);
final List<ApiParameterError> dataValidationErrors = new ArrayList<ApiParameterError>(); final List<ApiParameterError> dataValidationErrors = new ArrayList<>();
final DataValidatorBuilder baseDataValidator = getDataValidator(dataValidationErrors); final DataValidatorBuilder baseDataValidator = getDataValidator(dataValidationErrors);
final JsonElement element = this.fromApiJsonHelper.parse(json); final JsonElement element = this.fromApiJsonHelper.parse(json);
@@ -69,7 +69,7 @@ public final class FinancialActivityAccountDataValidator {
public void validateForUpdate(final String json) { public void validateForUpdate(final String json) {
validateJSONAndCheckForUnsupportedParams(json); validateJSONAndCheckForUnsupportedParams(json);
final List<ApiParameterError> dataValidationErrors = new ArrayList<ApiParameterError>(); final List<ApiParameterError> dataValidationErrors = new ArrayList<>();
final DataValidatorBuilder baseDataValidator = getDataValidator(dataValidationErrors); final DataValidatorBuilder baseDataValidator = getDataValidator(dataValidationErrors);
final JsonElement element = this.fromApiJsonHelper.parse(json); final JsonElement element = this.fromApiJsonHelper.parse(json);
@@ -135,7 +135,7 @@ public class FinancialActivityAccountWritePlatformServiceImpl implements Financi
public Map<String, Object> findChanges(JsonCommand command, FinancialActivityAccount financialActivityAccount) { public Map<String, Object> findChanges(JsonCommand command, FinancialActivityAccount financialActivityAccount) {
Map<String, Object> changes = new HashMap<String, Object>(); Map<String, Object> changes = new HashMap<>();
Long existingGLAccountId = financialActivityAccount.getGlAccount().getId(); Long existingGLAccountId = financialActivityAccount.getGlAccount().getId();
Integer financialActivityType = financialActivityAccount.getFinancialActivityType(); Integer financialActivityType = financialActivityAccount.getFinancialActivityType();
@@ -21,7 +21,7 @@ public enum GLAccountJsonInputParams {
this.value = value; this.value = value;
} }
private static final Set<String> values = new HashSet<String>(); private static final Set<String> values = new HashSet<>();
static { static {
for (final GLAccountJsonInputParams type : GLAccountJsonInputParams.values()) { for (final GLAccountJsonInputParams type : GLAccountJsonInputParams.values()) {
values.add(type.value); values.add(type.value);
@@ -50,7 +50,7 @@ import org.springframework.stereotype.Component;
@Scope("singleton") @Scope("singleton")
public class GLAccountsApiResource { public class GLAccountsApiResource {
private static final Set<String> RESPONSE_DATA_PARAMETERS = new HashSet<String>(Arrays.asList("id", "name", "parentId", "glCode", private static final Set<String> RESPONSE_DATA_PARAMETERS = new HashSet<>(Arrays.asList("id", "name", "parentId", "glCode",
"disabled", "manualEntriesAllowed", "type", "usage", "description", "assetHeaderAccountOptions", "disabled", "manualEntriesAllowed", "type", "usage", "description", "assetHeaderAccountOptions",
"liabilityHeaderAccountOptions", "equityHeaderAccountOptions", "incomeHeaderAccountOptions", "expenseHeaderAccountOptions", "liabilityHeaderAccountOptions", "equityHeaderAccountOptions", "incomeHeaderAccountOptions", "expenseHeaderAccountOptions",
"nameDecorated", "tagId", "allowedAssetsTagOptions", "allowedLiabilitiesTagOptions", "allowedEquityTagOptions", "nameDecorated", "tagId", "allowedAssetsTagOptions", "allowedLiabilitiesTagOptions", "allowedEquityTagOptions",
@@ -48,7 +48,7 @@ public class GLAccountCommand {
public void validateForCreate() { public void validateForCreate() {
final List<ApiParameterError> dataValidationErrors = new ArrayList<ApiParameterError>(); final List<ApiParameterError> dataValidationErrors = new ArrayList<>();
final DataValidatorBuilder baseDataValidator = new DataValidatorBuilder(dataValidationErrors).resource("GLAccount"); final DataValidatorBuilder baseDataValidator = new DataValidatorBuilder(dataValidationErrors).resource("GLAccount");
@@ -80,7 +80,7 @@ public class GLAccountCommand {
} }
public void validateForUpdate() { public void validateForUpdate() {
final List<ApiParameterError> dataValidationErrors = new ArrayList<ApiParameterError>(); final List<ApiParameterError> dataValidationErrors = new ArrayList<>();
final DataValidatorBuilder baseDataValidator = new DataValidatorBuilder(dataValidationErrors).resource("GLAccount"); final DataValidatorBuilder baseDataValidator = new DataValidatorBuilder(dataValidationErrors).resource("GLAccount");
@@ -39,7 +39,7 @@ public class GLAccount extends AbstractPersistable<Long> {
@OneToMany(fetch = FetchType.LAZY) @OneToMany(fetch = FetchType.LAZY)
@JoinColumn(name = "parent_id") @JoinColumn(name = "parent_id")
private final List<GLAccount> children = new LinkedList<GLAccount>(); private final List<GLAccount> children = new LinkedList<>();
@Column(name = "name", nullable = false, length = 45) @Column(name = "name", nullable = false, length = 45)
private String name; private String name;
@@ -96,7 +96,7 @@ public class GLAccount extends AbstractPersistable<Long> {
} }
public Map<String, Object> update(final JsonCommand command) { public Map<String, Object> update(final JsonCommand command) {
final Map<String, Object> actualChanges = new LinkedHashMap<String, Object>(15); final Map<String, Object> actualChanges = new LinkedHashMap<>(15);
handlePropertyUpdate(command, actualChanges, GLAccountJsonInputParams.DESCRIPTION.getValue(), this.description); handlePropertyUpdate(command, actualChanges, GLAccountJsonInputParams.DESCRIPTION.getValue(), this.description);
handlePropertyUpdate(command, actualChanges, GLAccountJsonInputParams.DISABLED.getValue(), this.disabled); handlePropertyUpdate(command, actualChanges, GLAccountJsonInputParams.DISABLED.getValue(), this.disabled);
handlePropertyUpdate(command, actualChanges, GLAccountJsonInputParams.GL_CODE.getValue(), this.glCode); handlePropertyUpdate(command, actualChanges, GLAccountJsonInputParams.GL_CODE.getValue(), this.glCode);
@@ -28,7 +28,7 @@ public enum GLAccountType {
return this.code; return this.code;
} }
private static final Map<Integer, GLAccountType> intToEnumMap = new HashMap<Integer, GLAccountType>(); private static final Map<Integer, GLAccountType> intToEnumMap = new HashMap<>();
private static int minValue; private static int minValue;
private static int maxValue; private static int maxValue;
static { static {
@@ -28,7 +28,7 @@ public enum GLAccountUsage {
return this.code; return this.code;
} }
private static final Map<Integer, GLAccountUsage> intToEnumMap = new HashMap<Integer, GLAccountUsage>(); private static final Map<Integer, GLAccountUsage> intToEnumMap = new HashMap<>();
private static int minValue; private static int minValue;
private static int maxValue; private static int maxValue;
static { static {
@@ -45,7 +45,7 @@ import org.springframework.stereotype.Component;
@Scope("singleton") @Scope("singleton")
public class JournalEntriesApiResource { public class JournalEntriesApiResource {
private static final Set<String> RESPONSE_DATA_PARAMETERS = new HashSet<String>(Arrays.asList("id", "officeId", "officeName", private static final Set<String> RESPONSE_DATA_PARAMETERS = new HashSet<>(Arrays.asList("id", "officeId", "officeName",
"glAccountName", "glAccountId", "glAccountCode", "glAccountType", "transactionDate", "entryType", "amount", "transactionId", "glAccountName", "glAccountId", "glAccountCode", "glAccountType", "transactionDate", "entryType", "amount", "transactionId",
"manualEntry", "entityType", "entityId", "createdByUserId", "createdDate", "createdByUserName", "comments", "reversed", "manualEntry", "entityType", "entityId", "createdByUserId", "createdDate", "createdByUserName", "comments", "reversed",
"referenceNumber", "currency")); "referenceNumber", "currency"));
@@ -23,7 +23,7 @@ public enum JournalEntryJsonInputParams {
this.value = value; this.value = value;
} }
private static final Set<String> values = new HashSet<String>(); private static final Set<String> values = new HashSet<>();
static { static {
for (final JournalEntryJsonInputParams type : JournalEntryJsonInputParams.values()) { for (final JournalEntryJsonInputParams type : JournalEntryJsonInputParams.values()) {
values.add(type.value); values.add(type.value);
@@ -66,7 +66,7 @@ public class JournalEntryCommand {
public void validateForCreate() { public void validateForCreate() {
final List<ApiParameterError> dataValidationErrors = new ArrayList<ApiParameterError>(); final List<ApiParameterError> dataValidationErrors = new ArrayList<>();
final DataValidatorBuilder baseDataValidator = new DataValidatorBuilder(dataValidationErrors).resource("GLJournalEntry"); final DataValidatorBuilder baseDataValidator = new DataValidatorBuilder(dataValidationErrors).resource("GLJournalEntry");
@@ -24,7 +24,7 @@ public class JournalEntryDataValidator {
private final FromJsonHelper fromApiJsonHelper; private final FromJsonHelper fromApiJsonHelper;
public static final Set<String> RUNNING_BALANCE_UPDATE_REQUEST_DATA_PARAMETERS = new HashSet<String>( public static final Set<String> RUNNING_BALANCE_UPDATE_REQUEST_DATA_PARAMETERS = new HashSet<>(
Arrays.asList(JournalEntryJsonInputParams.OFFICE_ID.getValue())); Arrays.asList(JournalEntryJsonInputParams.OFFICE_ID.getValue()));
@Autowired @Autowired
@@ -35,7 +35,7 @@ public class JournalEntryDataValidator {
public void validateForUpdateRunningbalance(final JsonCommand command) { public void validateForUpdateRunningbalance(final JsonCommand command) {
final Type typeOfMap = new TypeToken<Map<String, Object>>() {}.getType(); final Type typeOfMap = new TypeToken<Map<String, Object>>() {}.getType();
this.fromApiJsonHelper.checkForUnsupportedParameters(typeOfMap, command.json(), RUNNING_BALANCE_UPDATE_REQUEST_DATA_PARAMETERS); this.fromApiJsonHelper.checkForUnsupportedParameters(typeOfMap, command.json(), RUNNING_BALANCE_UPDATE_REQUEST_DATA_PARAMETERS);
final List<ApiParameterError> dataValidationErrors = new ArrayList<ApiParameterError>(); final List<ApiParameterError> dataValidationErrors = new ArrayList<>();
final DataValidatorBuilder baseDataValidator = new DataValidatorBuilder(dataValidationErrors).resource("GLJournalEntry"); final DataValidatorBuilder baseDataValidator = new DataValidatorBuilder(dataValidationErrors).resource("GLJournalEntry");
if (this.fromApiJsonHelper.parameterExists(JournalEntryJsonInputParams.OFFICE_ID.getValue(), command.parsedJson())) { if (this.fromApiJsonHelper.parameterExists(JournalEntryJsonInputParams.OFFICE_ID.getValue(), command.parsedJson())) {
@@ -28,7 +28,7 @@ public enum JournalEntryType {
return this.code; return this.code;
} }
private static final Map<Integer, JournalEntryType> intToEnumMap = new HashMap<Integer, JournalEntryType>(); private static final Map<Integer, JournalEntryType> intToEnumMap = new HashMap<>();
static { static {
for (final JournalEntryType type : JournalEntryType.values()) { for (final JournalEntryType type : JournalEntryType.values()) {
intToEnumMap.put(type.value, type); intToEnumMap.put(type.value, type);
@@ -105,7 +105,7 @@ public final class JournalEntryCommandFromApiJsonDeserializer extends AbstractFr
for (int i = 0; i < array.size(); i++) { for (int i = 0; i < array.size(); i++) {
final JsonObject creditElement = array.get(i).getAsJsonObject(); final JsonObject creditElement = array.get(i).getAsJsonObject();
final Set<String> parametersPassedInForCreditsCommand = new HashSet<String>(); final Set<String> parametersPassedInForCreditsCommand = new HashSet<>();
final Long glAccountId = this.fromApiJsonHelper.extractLongNamed("glAccountId", creditElement); final Long glAccountId = this.fromApiJsonHelper.extractLongNamed("glAccountId", creditElement);
final String comments = this.fromApiJsonHelper.extractStringNamed("comments", creditElement); final String comments = this.fromApiJsonHelper.extractStringNamed("comments", creditElement);
@@ -90,7 +90,7 @@ public class AccountingProcessorHelper {
final Long loanProductId = (Long) accountingBridgeData.get("loanProductId"); final Long loanProductId = (Long) accountingBridgeData.get("loanProductId");
final Long officeId = (Long) accountingBridgeData.get("officeId"); final Long officeId = (Long) accountingBridgeData.get("officeId");
final CurrencyData currencyData = (CurrencyData) accountingBridgeData.get("currency"); final CurrencyData currencyData = (CurrencyData) accountingBridgeData.get("currency");
final List<LoanTransactionDTO> newLoanTransactions = new ArrayList<LoanTransactionDTO>(); final List<LoanTransactionDTO> newLoanTransactions = new ArrayList<>();
boolean isAccountTransfer = (Boolean) accountingBridgeData.get("isAccountTransfer"); boolean isAccountTransfer = (Boolean) accountingBridgeData.get("isAccountTransfer");
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
@@ -110,8 +110,8 @@ public class AccountingProcessorHelper {
final boolean reversed = (Boolean) map.get("reversed"); final boolean reversed = (Boolean) map.get("reversed");
final Long paymentTypeId = (Long) map.get("paymentTypeId"); final Long paymentTypeId = (Long) map.get("paymentTypeId");
final List<ChargePaymentDTO> feePaymentDetails = new ArrayList<ChargePaymentDTO>(); final List<ChargePaymentDTO> feePaymentDetails = new ArrayList<>();
final List<ChargePaymentDTO> penaltyPaymentDetails = new ArrayList<ChargePaymentDTO>(); final List<ChargePaymentDTO> penaltyPaymentDetails = new ArrayList<>();
// extract charge payment details (if exists) // extract charge payment details (if exists)
if (map.containsKey("loanChargesPaid")) { if (map.containsKey("loanChargesPaid")) {
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
@@ -152,7 +152,7 @@ public class AccountingProcessorHelper {
final Long loanProductId = (Long) accountingBridgeData.get("savingsProductId"); final Long loanProductId = (Long) accountingBridgeData.get("savingsProductId");
final Long officeId = (Long) accountingBridgeData.get("officeId"); final Long officeId = (Long) accountingBridgeData.get("officeId");
final CurrencyData currencyData = (CurrencyData) accountingBridgeData.get("currency"); final CurrencyData currencyData = (CurrencyData) accountingBridgeData.get("currency");
final List<SavingsTransactionDTO> newSavingsTransactions = new ArrayList<SavingsTransactionDTO>(); final List<SavingsTransactionDTO> newSavingsTransactions = new ArrayList<>();
boolean isAccountTransfer = (Boolean) accountingBridgeData.get("isAccountTransfer"); boolean isAccountTransfer = (Boolean) accountingBridgeData.get("isAccountTransfer");
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
@@ -168,8 +168,8 @@ public class AccountingProcessorHelper {
final Long paymentTypeId = (Long) map.get("paymentTypeId"); final Long paymentTypeId = (Long) map.get("paymentTypeId");
final BigDecimal overdraftAmount = (BigDecimal) map.get("overdraftAmount"); final BigDecimal overdraftAmount = (BigDecimal) map.get("overdraftAmount");
final List<ChargePaymentDTO> feePayments = new ArrayList<ChargePaymentDTO>(); final List<ChargePaymentDTO> feePayments = new ArrayList<>();
final List<ChargePaymentDTO> penaltyPayments = new ArrayList<ChargePaymentDTO>(); final List<ChargePaymentDTO> penaltyPayments = new ArrayList<>();
// extract charge payment details (if exists) // extract charge payment details (if exists)
if (map.containsKey("savingsChargesPaid")) { if (map.containsKey("savingsChargesPaid")) {
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
@@ -383,7 +383,7 @@ public class AccountingProcessorHelper {
* Map to track each account and the net credit to be made for a * Map to track each account and the net credit to be made for a
* particular account * particular account
***/ ***/
final Map<GLAccount, BigDecimal> creditDetailsMap = new LinkedHashMap<GLAccount, BigDecimal>(); final Map<GLAccount, BigDecimal> creditDetailsMap = new LinkedHashMap<>();
for (final ChargePaymentDTO chargePaymentDTO : chargePaymentDTOs) { for (final ChargePaymentDTO chargePaymentDTO : chargePaymentDTOs) {
final Long chargeId = chargePaymentDTO.getChargeId(); final Long chargeId = chargePaymentDTO.getChargeId();
final GLAccount chargeSpecificAccount = getLinkedGLAccountForLoanCharges(loanProductId, accountMappingTypeId, chargeId); final GLAccount chargeSpecificAccount = getLinkedGLAccountForLoanCharges(loanProductId, accountMappingTypeId, chargeId);
@@ -28,6 +28,7 @@ import org.mifosplatform.infrastructure.core.service.Page;
import org.mifosplatform.infrastructure.core.service.PaginationHelper; import org.mifosplatform.infrastructure.core.service.PaginationHelper;
import org.mifosplatform.infrastructure.core.service.RoutingDataSource; import org.mifosplatform.infrastructure.core.service.RoutingDataSource;
import org.mifosplatform.organisation.monetary.data.CurrencyData; import org.mifosplatform.organisation.monetary.data.CurrencyData;
import org.mifosplatform.portfolio.account.PortfolioAccountType;
import org.mifosplatform.portfolio.group.service.SearchParameters; import org.mifosplatform.portfolio.group.service.SearchParameters;
import org.mifosplatform.portfolio.loanaccount.data.LoanTransactionEnumData; import org.mifosplatform.portfolio.loanaccount.data.LoanTransactionEnumData;
import org.mifosplatform.portfolio.loanproduct.service.LoanEnumerations; import org.mifosplatform.portfolio.loanproduct.service.LoanEnumerations;
@@ -35,7 +36,6 @@ import org.mifosplatform.portfolio.note.data.NoteData;
import org.mifosplatform.portfolio.paymentdetail.data.PaymentDetailData; import org.mifosplatform.portfolio.paymentdetail.data.PaymentDetailData;
import org.mifosplatform.portfolio.savings.data.SavingsAccountTransactionEnumData; import org.mifosplatform.portfolio.savings.data.SavingsAccountTransactionEnumData;
import org.mifosplatform.portfolio.savings.service.SavingsEnumerations; import org.mifosplatform.portfolio.savings.service.SavingsEnumerations;
import org.mifosplatform.portfolio.account.PortfolioAccountType;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.dao.EmptyResultDataAccessException; import org.springframework.dao.EmptyResultDataAccessException;
import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.jdbc.core.JdbcTemplate;
@@ -47,7 +47,7 @@ public class JournalEntryReadPlatformServiceImpl implements JournalEntryReadPlat
private final JdbcTemplate jdbcTemplate; private final JdbcTemplate jdbcTemplate;
private final PaginationHelper<JournalEntryData> paginationHelper = new PaginationHelper<JournalEntryData>(); private final PaginationHelper<JournalEntryData> paginationHelper = new PaginationHelper<>();
@Autowired @Autowired
public JournalEntryReadPlatformServiceImpl(final RoutingDataSource dataSource) { public JournalEntryReadPlatformServiceImpl(final RoutingDataSource dataSource) {
@@ -120,8 +120,8 @@ public class JournalEntryRunningBalanceUpdateServiceImpl implements JournalEntry
@Transactional @Transactional
private void updateOrganizationRunningBalance(Date entityDate) { private void updateOrganizationRunningBalance(Date entityDate) {
Map<Long, BigDecimal> runningBalanceMap = new HashMap<Long, BigDecimal>(5); Map<Long, BigDecimal> runningBalanceMap = new HashMap<>(5);
Map<Long, Map<Long, BigDecimal>> officesRunningBalance = new HashMap<Long, Map<Long, BigDecimal>>(); Map<Long, Map<Long, BigDecimal>> officesRunningBalance = new HashMap<>();
List<Map<String, Object>> list = jdbcTemplate.queryForList(organizationRunningBalanceSql, entityDate, entityDate); List<Map<String, Object>> list = jdbcTemplate.queryForList(organizationRunningBalanceSql, entityDate, entityDate);
for (Map<String, Object> entries : list) { for (Map<String, Object> entries : list) {
@@ -139,7 +139,7 @@ public class JournalEntryRunningBalanceUpdateServiceImpl implements JournalEntry
if (officesRunningBalance.containsKey(officeId)) { if (officesRunningBalance.containsKey(officeId)) {
runningBalance = officesRunningBalance.get(officeId); runningBalance = officesRunningBalance.get(officeId);
} else { } else {
runningBalance = new HashMap<Long, BigDecimal>(); runningBalance = new HashMap<>();
officesRunningBalance.put(officeId, runningBalance); officesRunningBalance.put(officeId, runningBalance);
} }
if (!runningBalance.containsKey(accountId)) { if (!runningBalance.containsKey(accountId)) {
@@ -157,7 +157,7 @@ public class JournalEntryRunningBalanceUpdateServiceImpl implements JournalEntry
if (officesRunningBalance.containsKey(entryData.getOfficeId())) { if (officesRunningBalance.containsKey(entryData.getOfficeId())) {
officeRunningBalanceMap = officesRunningBalance.get(entryData.getOfficeId()); officeRunningBalanceMap = officesRunningBalance.get(entryData.getOfficeId());
} else { } else {
officeRunningBalanceMap = new HashMap<Long, BigDecimal>(); officeRunningBalanceMap = new HashMap<>();
officesRunningBalance.put(entryData.getOfficeId(), officeRunningBalanceMap); officesRunningBalance.put(entryData.getOfficeId(), officeRunningBalanceMap);
} }
BigDecimal officeRunningBalance = calculateRunningBalance(entryData, officeRunningBalanceMap); BigDecimal officeRunningBalance = calculateRunningBalance(entryData, officeRunningBalanceMap);
@@ -173,7 +173,7 @@ public class JournalEntryRunningBalanceUpdateServiceImpl implements JournalEntry
@Transactional @Transactional
private void updateRunningBalance(Long officeId, Date entityDate) { private void updateRunningBalance(Long officeId, Date entityDate) {
Map<Long, BigDecimal> runningBalanceMap = new HashMap<Long, BigDecimal>(5); Map<Long, BigDecimal> runningBalanceMap = new HashMap<>(5);
List<Map<String, Object>> list = jdbcTemplate.queryForList(officeRunningBalanceSql, officeId, entityDate, officeId, entityDate); List<Map<String, Object>> list = jdbcTemplate.queryForList(officeRunningBalanceSql, officeId, entityDate, officeId, entityDate);
for (Map<String, Object> entries : list) { for (Map<String, Object> entries : list) {
@@ -117,7 +117,7 @@ public class JournalEntryWritePlatformServiceJpaRepositoryImpl implements Journa
validateBusinessRulesForJournalEntries(journalEntryCommand); validateBusinessRulesForJournalEntries(journalEntryCommand);
/** Capture payment details **/ /** Capture payment details **/
final Map<String, Object> changes = new LinkedHashMap<String, Object>(); final Map<String, Object> changes = new LinkedHashMap<>();
final PaymentDetail paymentDetail = this.paymentDetailWritePlatformService.createAndPersistPaymentDetail(command, changes); final PaymentDetail paymentDetail = this.paymentDetailWritePlatformService.createAndPersistPaymentDetail(command, changes);
/** Set a transaction Id and save these Journal entries **/ /** Set a transaction Id and save these Journal entries **/
@@ -203,8 +203,8 @@ public class JournalEntryWritePlatformServiceJpaRepositoryImpl implements Journa
private void checkDebitOrCreditAccountsAreValid(final AccountingRule accountingRule, final SingleDebitOrCreditEntryCommand[] credits, private void checkDebitOrCreditAccountsAreValid(final AccountingRule accountingRule, final SingleDebitOrCreditEntryCommand[] credits,
final SingleDebitOrCreditEntryCommand[] debits) { final SingleDebitOrCreditEntryCommand[] debits) {
// Validate the debit and credit arrays are appropriate accounts // Validate the debit and credit arrays are appropriate accounts
List<GLAccountDataForLookup> allowedCreditGLAccounts = new ArrayList<GLAccountDataForLookup>(); List<GLAccountDataForLookup> allowedCreditGLAccounts = new ArrayList<>();
List<GLAccountDataForLookup> allowedDebitGLAccounts = new ArrayList<GLAccountDataForLookup>(); List<GLAccountDataForLookup> allowedDebitGLAccounts = new ArrayList<>();
final SingleDebitOrCreditEntryCommand[] validCredits = new SingleDebitOrCreditEntryCommand[credits.length]; final SingleDebitOrCreditEntryCommand[] validCredits = new SingleDebitOrCreditEntryCommand[credits.length];
final SingleDebitOrCreditEntryCommand[] validDebits = new SingleDebitOrCreditEntryCommand[debits.length]; final SingleDebitOrCreditEntryCommand[] validDebits = new SingleDebitOrCreditEntryCommand[debits.length];
@@ -32,7 +32,7 @@ public enum PortfolioProductType {
return this.code; return this.code;
} }
private static final Map<Integer, PortfolioProductType> intToEnumMap = new HashMap<Integer, PortfolioProductType>(); private static final Map<Integer, PortfolioProductType> intToEnumMap = new HashMap<>();
static { static {
for (final PortfolioProductType type : PortfolioProductType.values()) { for (final PortfolioProductType type : PortfolioProductType.values()) {
intToEnumMap.put(type.value, type); intToEnumMap.put(type.value, type);
@@ -67,7 +67,7 @@ public final class ProductToGLAccountMappingFromApiJsonDeserializer {
public void validateForLoanProductCreate(final String json) { public void validateForLoanProductCreate(final String json) {
if (StringUtils.isBlank(json)) { throw new InvalidJsonException(); } if (StringUtils.isBlank(json)) { throw new InvalidJsonException(); }
final List<ApiParameterError> dataValidationErrors = new ArrayList<ApiParameterError>(); final List<ApiParameterError> dataValidationErrors = new ArrayList<>();
final DataValidatorBuilder baseDataValidator = new DataValidatorBuilder(dataValidationErrors).resource("loanproduct"); final DataValidatorBuilder baseDataValidator = new DataValidatorBuilder(dataValidationErrors).resource("loanproduct");
final JsonElement element = this.fromApiJsonHelper.parse(json); final JsonElement element = this.fromApiJsonHelper.parse(json);
@@ -149,7 +149,7 @@ public final class ProductToGLAccountMappingFromApiJsonDeserializer {
public void validateForSavingsProductCreate(final String json, DepositAccountType accountType) { public void validateForSavingsProductCreate(final String json, DepositAccountType accountType) {
if (StringUtils.isBlank(json)) { throw new InvalidJsonException(); } if (StringUtils.isBlank(json)) { throw new InvalidJsonException(); }
final List<ApiParameterError> dataValidationErrors = new ArrayList<ApiParameterError>(); final List<ApiParameterError> dataValidationErrors = new ArrayList<>();
final DataValidatorBuilder baseDataValidator = new DataValidatorBuilder(dataValidationErrors) final DataValidatorBuilder baseDataValidator = new DataValidatorBuilder(dataValidationErrors)
.resource(SAVINGS_PRODUCT_RESOURCE_NAME); .resource(SAVINGS_PRODUCT_RESOURCE_NAME);
@@ -110,7 +110,7 @@ public class LoanProductToGLAccountMappingHelper extends ProductToGLAccountMappi
public Map<String, Object> populateChangesForNewLoanProductToGLAccountMappingCreation(final JsonElement element, public Map<String, Object> populateChangesForNewLoanProductToGLAccountMappingCreation(final JsonElement element,
final AccountingRuleType accountingRuleType) { final AccountingRuleType accountingRuleType) {
final Map<String, Object> changes = new HashMap<String, Object>(); final Map<String, Object> changes = new HashMap<>();
final Long fundAccountId = this.fromApiJsonHelper.extractLongNamed(LOAN_PRODUCT_ACCOUNTING_PARAMS.FUND_SOURCE.getValue(), element); final Long fundAccountId = this.fromApiJsonHelper.extractLongNamed(LOAN_PRODUCT_ACCOUNTING_PARAMS.FUND_SOURCE.getValue(), element);
final Long loanPortfolioAccountId = this.fromApiJsonHelper.extractLongNamed( final Long loanPortfolioAccountId = this.fromApiJsonHelper.extractLongNamed(
@@ -144,17 +144,18 @@ public class LoanProductToGLAccountMappingHelper extends ProductToGLAccountMappi
break; break;
case CASH_BASED: case CASH_BASED:
populateChangesForCashBasedAccounting(changes, fundAccountId, loanPortfolioAccountId, incomeFromInterestId, populateChangesForCashBasedAccounting(changes, fundAccountId, loanPortfolioAccountId, incomeFromInterestId,
incomeFromFeeId, incomeFromPenaltyId, writeOffAccountId, overPaymentAccountId, transfersInSuspenseAccountId,incomeFromRecoveryAccountId); incomeFromFeeId, incomeFromPenaltyId, writeOffAccountId, overPaymentAccountId, transfersInSuspenseAccountId,
incomeFromRecoveryAccountId);
break; break;
case ACCRUAL_PERIODIC: case ACCRUAL_PERIODIC:
populateChangesForAccrualBasedAccounting(changes, fundAccountId, loanPortfolioAccountId, incomeFromInterestId, populateChangesForAccrualBasedAccounting(changes, fundAccountId, loanPortfolioAccountId, incomeFromInterestId,
incomeFromFeeId, incomeFromPenaltyId, writeOffAccountId, overPaymentAccountId, transfersInSuspenseAccountId,incomeFromRecoveryAccountId, incomeFromFeeId, incomeFromPenaltyId, writeOffAccountId, overPaymentAccountId, transfersInSuspenseAccountId,
receivableInterestAccountId, receivableFeeAccountId, receivablePenaltyAccountId); incomeFromRecoveryAccountId, receivableInterestAccountId, receivableFeeAccountId, receivablePenaltyAccountId);
break; break;
case ACCRUAL_UPFRONT: case ACCRUAL_UPFRONT:
populateChangesForAccrualBasedAccounting(changes, fundAccountId, loanPortfolioAccountId, incomeFromInterestId, populateChangesForAccrualBasedAccounting(changes, fundAccountId, loanPortfolioAccountId, incomeFromInterestId,
incomeFromFeeId, incomeFromPenaltyId, writeOffAccountId, overPaymentAccountId, transfersInSuspenseAccountId,incomeFromRecoveryAccountId, incomeFromFeeId, incomeFromPenaltyId, writeOffAccountId, overPaymentAccountId, transfersInSuspenseAccountId,
receivableInterestAccountId, receivableFeeAccountId, receivablePenaltyAccountId); incomeFromRecoveryAccountId, receivableInterestAccountId, receivableFeeAccountId, receivablePenaltyAccountId);
break; break;
} }
@@ -163,21 +164,23 @@ public class LoanProductToGLAccountMappingHelper extends ProductToGLAccountMappi
private void populateChangesForAccrualBasedAccounting(final Map<String, Object> changes, final Long fundAccountId, private void populateChangesForAccrualBasedAccounting(final Map<String, Object> changes, final Long fundAccountId,
final Long loanPortfolioAccountId, final Long incomeFromInterestId, final Long incomeFromFeeId, final Long incomeFromPenaltyId, final Long loanPortfolioAccountId, final Long incomeFromInterestId, final Long incomeFromFeeId, final Long incomeFromPenaltyId,
final Long writeOffAccountId, final Long overPaymentAccountId, final Long transfersInSuspenseAccountId,final Long incomeFromRecoveryAccountId, final Long writeOffAccountId, final Long overPaymentAccountId, final Long transfersInSuspenseAccountId,
final Long receivableInterestAccountId, final Long receivableFeeAccountId, final Long receivablePenaltyAccountId) { final Long incomeFromRecoveryAccountId, final Long receivableInterestAccountId, final Long receivableFeeAccountId,
final Long receivablePenaltyAccountId) {
changes.put(LOAN_PRODUCT_ACCOUNTING_PARAMS.INTEREST_RECEIVABLE.getValue(), receivableInterestAccountId); changes.put(LOAN_PRODUCT_ACCOUNTING_PARAMS.INTEREST_RECEIVABLE.getValue(), receivableInterestAccountId);
changes.put(LOAN_PRODUCT_ACCOUNTING_PARAMS.FEES_RECEIVABLE.getValue(), receivableFeeAccountId); changes.put(LOAN_PRODUCT_ACCOUNTING_PARAMS.FEES_RECEIVABLE.getValue(), receivableFeeAccountId);
changes.put(LOAN_PRODUCT_ACCOUNTING_PARAMS.PENALTIES_RECEIVABLE.getValue(), receivablePenaltyAccountId); changes.put(LOAN_PRODUCT_ACCOUNTING_PARAMS.PENALTIES_RECEIVABLE.getValue(), receivablePenaltyAccountId);
populateChangesForCashBasedAccounting(changes, fundAccountId, loanPortfolioAccountId, incomeFromInterestId, incomeFromFeeId, populateChangesForCashBasedAccounting(changes, fundAccountId, loanPortfolioAccountId, incomeFromInterestId, incomeFromFeeId,
incomeFromPenaltyId, writeOffAccountId, overPaymentAccountId, transfersInSuspenseAccountId,incomeFromRecoveryAccountId); incomeFromPenaltyId, writeOffAccountId, overPaymentAccountId, transfersInSuspenseAccountId, incomeFromRecoveryAccountId);
} }
private void populateChangesForCashBasedAccounting(final Map<String, Object> changes, final Long fundAccountId, private void populateChangesForCashBasedAccounting(final Map<String, Object> changes, final Long fundAccountId,
final Long loanPortfolioAccountId, final Long incomeFromInterestId, final Long incomeFromFeeId, final Long incomeFromPenaltyId, final Long loanPortfolioAccountId, final Long incomeFromInterestId, final Long incomeFromFeeId, final Long incomeFromPenaltyId,
final Long writeOffAccountId, final Long overPaymentAccountId, final Long transfersInSuspenseAccountId,final Long incomeFromRecoveryAccountId) { final Long writeOffAccountId, final Long overPaymentAccountId, final Long transfersInSuspenseAccountId,
final Long incomeFromRecoveryAccountId) {
changes.put(LOAN_PRODUCT_ACCOUNTING_PARAMS.FUND_SOURCE.getValue(), fundAccountId); changes.put(LOAN_PRODUCT_ACCOUNTING_PARAMS.FUND_SOURCE.getValue(), fundAccountId);
changes.put(LOAN_PRODUCT_ACCOUNTING_PARAMS.LOAN_PORTFOLIO.getValue(), loanPortfolioAccountId); changes.put(LOAN_PRODUCT_ACCOUNTING_PARAMS.LOAN_PORTFOLIO.getValue(), loanPortfolioAccountId);
changes.put(LOAN_PRODUCT_ACCOUNTING_PARAMS.INTEREST_ON_LOANS.getValue(), incomeFromInterestId); changes.put(LOAN_PRODUCT_ACCOUNTING_PARAMS.INTEREST_ON_LOANS.getValue(), incomeFromInterestId);
@@ -175,12 +175,12 @@ public class ProductToGLAccountMappingHelper {
* associated income Id's (value) extracted from the passed in * associated income Id's (value) extracted from the passed in
* Jsoncommand * Jsoncommand
**/ **/
final Map<Long, Long> inputChargeToIncomeAccountMap = new HashMap<Long, Long>(); final Map<Long, Long> inputChargeToIncomeAccountMap = new HashMap<>();
/*** /***
* Variable stores all charges which have already been mapped to Income * Variable stores all charges which have already been mapped to Income
* Accounts in the system * Accounts in the system
**/ **/
final Set<Long> existingCharges = new HashSet<Long>(); final Set<Long> existingCharges = new HashSet<>();
if (chargeToIncomeAccountMappingArray != null && chargeToIncomeAccountMappingArray.size() > 0) { if (chargeToIncomeAccountMappingArray != null && chargeToIncomeAccountMappingArray.size() > 0) {
if (changes != null) { if (changes != null) {
changes.put(arrayFragmentName, command.jsonFragment(arrayFragmentName)); changes.put(arrayFragmentName, command.jsonFragment(arrayFragmentName));
@@ -253,12 +253,12 @@ public class ProductToGLAccountMappingHelper {
* Variable stores a map representation of Payment channels (key) and * Variable stores a map representation of Payment channels (key) and
* their fund sources (value) extracted from the passed in Jsoncommand * their fund sources (value) extracted from the passed in Jsoncommand
**/ **/
final Map<Long, Long> inputPaymentChannelFundSourceMap = new HashMap<Long, Long>(); final Map<Long, Long> inputPaymentChannelFundSourceMap = new HashMap<>();
/*** /***
* Variable stores all payment types which have already been mapped to * Variable stores all payment types which have already been mapped to
* Fund Sources in the system * Fund Sources in the system
**/ **/
final Set<Long> existingPaymentTypes = new HashSet<Long>(); final Set<Long> existingPaymentTypes = new HashSet<>();
if (paymentChannelMappingArray != null && paymentChannelMappingArray.size() > 0) { if (paymentChannelMappingArray != null && paymentChannelMappingArray.size() > 0) {
if (changes != null) { if (changes != null) {
changes.put(LOAN_PRODUCT_ACCOUNTING_PARAMS.PAYMENT_CHANNEL_FUND_SOURCE_MAPPING.getValue(), changes.put(LOAN_PRODUCT_ACCOUNTING_PARAMS.PAYMENT_CHANNEL_FUND_SOURCE_MAPPING.getValue(),
@@ -69,7 +69,7 @@ public class ProductToGLAccountMappingReadPlatformServiceImpl implements Product
final String chargeName = rs.getString("chargeName"); final String chargeName = rs.getString("chargeName");
final Boolean penalty = rs.getBoolean("penalty"); final Boolean penalty = rs.getBoolean("penalty");
final Map<String, Object> loanProductToGLAccountMap = new LinkedHashMap<String, Object>(5); final Map<String, Object> loanProductToGLAccountMap = new LinkedHashMap<>(5);
loanProductToGLAccountMap.put("id", id); loanProductToGLAccountMap.put("id", id);
loanProductToGLAccountMap.put("glAccountId", glAccountId); loanProductToGLAccountMap.put("glAccountId", glAccountId);
loanProductToGLAccountMap.put("productId", productId); loanProductToGLAccountMap.put("productId", productId);
@@ -89,7 +89,7 @@ public class ProductToGLAccountMappingReadPlatformServiceImpl implements Product
@Override @Override
public Map<String, Object> fetchAccountMappingDetailsForLoanProduct(final Long loanProductId, final Integer accountingType) { public Map<String, Object> fetchAccountMappingDetailsForLoanProduct(final Long loanProductId, final Integer accountingType) {
final Map<String, Object> accountMappingDetails = new LinkedHashMap<String, Object>(8); final Map<String, Object> accountMappingDetails = new LinkedHashMap<>(8);
final ProductToGLAccountMappingMapper rm = new ProductToGLAccountMappingMapper(); final ProductToGLAccountMappingMapper rm = new ProductToGLAccountMappingMapper();
final String sql = "select " + rm.schema() + " and product_id = ? and payment_type is null and mapping.charge_id is null"; final String sql = "select " + rm.schema() + " and product_id = ? and payment_type is null and mapping.charge_id is null";
@@ -175,7 +175,7 @@ public class ProductToGLAccountMappingReadPlatformServiceImpl implements Product
@Override @Override
public Map<String, Object> fetchAccountMappingDetailsForSavingsProduct(final Long savingsProductId, final Integer accountingType) { public Map<String, Object> fetchAccountMappingDetailsForSavingsProduct(final Long savingsProductId, final Integer accountingType) {
final Map<String, Object> accountMappingDetails = new LinkedHashMap<String, Object>(8); final Map<String, Object> accountMappingDetails = new LinkedHashMap<>(8);
final ProductToGLAccountMappingMapper rm = new ProductToGLAccountMappingMapper(); final ProductToGLAccountMappingMapper rm = new ProductToGLAccountMappingMapper();
final String sql = "select " + rm.schema() + " and product_id = ? and payment_type is null and mapping.charge_id is null "; final String sql = "select " + rm.schema() + " and product_id = ? and payment_type is null and mapping.charge_id is null ";
@@ -245,7 +245,7 @@ public class ProductToGLAccountMappingReadPlatformServiceImpl implements Product
List<PaymentTypeToGLAccountMapper> paymentTypeToGLAccountMappers = null; List<PaymentTypeToGLAccountMapper> paymentTypeToGLAccountMappers = null;
for (final Map<String, Object> productToGLAccountMap : paymentTypeToFundSourceMappingsList) { for (final Map<String, Object> productToGLAccountMap : paymentTypeToFundSourceMappingsList) {
if (paymentTypeToGLAccountMappers == null) { if (paymentTypeToGLAccountMappers == null) {
paymentTypeToGLAccountMappers = new ArrayList<PaymentTypeToGLAccountMapper>(); paymentTypeToGLAccountMappers = new ArrayList<>();
} }
final Long paymentTypeId = (Long) productToGLAccountMap.get("paymentTypeId"); final Long paymentTypeId = (Long) productToGLAccountMap.get("paymentTypeId");
final String paymentTypeValue = (String) productToGLAccountMap.get("paymentTypeValue"); final String paymentTypeValue = (String) productToGLAccountMap.get("paymentTypeValue");
@@ -296,7 +296,7 @@ public class ProductToGLAccountMappingReadPlatformServiceImpl implements Product
List<ChargeToGLAccountMapper> chargeToGLAccountMappers = null; List<ChargeToGLAccountMapper> chargeToGLAccountMappers = null;
for (final Map<String, Object> chargeToIncomeAccountMap : chargeToFundSourceMappingsList) { for (final Map<String, Object> chargeToIncomeAccountMap : chargeToFundSourceMappingsList) {
if (chargeToGLAccountMappers == null) { if (chargeToGLAccountMappers == null) {
chargeToGLAccountMappers = new ArrayList<ChargeToGLAccountMapper>(); chargeToGLAccountMappers = new ArrayList<>();
} }
final Long glAccountId = (Long) chargeToIncomeAccountMap.get("glAccountId"); final Long glAccountId = (Long) chargeToIncomeAccountMap.get("glAccountId");
final String glAccountName = (String) chargeToIncomeAccountMap.get("glAccountName"); final String glAccountName = (String) chargeToIncomeAccountMap.get("glAccountName");
@@ -225,7 +225,7 @@ public class ProductToGLAccountMappingWritePlatformServiceImpl implements Produc
* Variable tracks all accounting mapping properties that have been * Variable tracks all accounting mapping properties that have been
* updated * updated
***/ ***/
Map<String, Object> changes = new HashMap<String, Object>(); Map<String, Object> changes = new HashMap<>();
final JsonElement element = this.fromApiJsonHelper.parse(command.json()); final JsonElement element = this.fromApiJsonHelper.parse(command.json());
final AccountingRuleType accountingRuleType = AccountingRuleType.fromInt(accountingRuleTypeId); final AccountingRuleType accountingRuleType = AccountingRuleType.fromInt(accountingRuleTypeId);
@@ -256,7 +256,7 @@ public class ProductToGLAccountMappingWritePlatformServiceImpl implements Produc
* Variable tracks all accounting mapping properties that have been * Variable tracks all accounting mapping properties that have been
* updated * updated
***/ ***/
Map<String, Object> changes = new HashMap<String, Object>(); Map<String, Object> changes = new HashMap<>();
final JsonElement element = this.fromApiJsonHelper.parse(command.json()); final JsonElement element = this.fromApiJsonHelper.parse(command.json());
final AccountingRuleType accountingRuleType = AccountingRuleType.fromInt(accountingRuleTypeId); final AccountingRuleType accountingRuleType = AccountingRuleType.fromInt(accountingRuleTypeId);
@@ -110,7 +110,7 @@ public class SavingsProductToGLAccountMappingHelper extends ProductToGLAccountMa
public Map<String, Object> populateChangesForNewSavingsProductToGLAccountMappingCreation(final JsonElement element, public Map<String, Object> populateChangesForNewSavingsProductToGLAccountMappingCreation(final JsonElement element,
final AccountingRuleType accountingRuleType) { final AccountingRuleType accountingRuleType) {
final Map<String, Object> changes = new HashMap<String, Object>(); final Map<String, Object> changes = new HashMap<>();
final Long savingsReferenceId = this.fromApiJsonHelper.extractLongNamed( final Long savingsReferenceId = this.fromApiJsonHelper.extractLongNamed(
SAVINGS_PRODUCT_ACCOUNTING_PARAMS.SAVINGS_REFERENCE.getValue(), element); SAVINGS_PRODUCT_ACCOUNTING_PARAMS.SAVINGS_REFERENCE.getValue(), element);
@@ -55,7 +55,7 @@ import org.springframework.stereotype.Component;
@Scope("singleton") @Scope("singleton")
public class AccountingRuleApiResource { public class AccountingRuleApiResource {
private static final Set<String> RESPONSE_DATA_PARAMETERS = new HashSet<String>(Arrays.asList("id", "officeId", "officeName", private static final Set<String> RESPONSE_DATA_PARAMETERS = new HashSet<>(Arrays.asList("id", "officeId", "officeName",
"accountToDebitId", "accountToCreditId", "name", "description", "systemDefined", "allowedCreditTagOptions", "accountToDebitId", "accountToCreditId", "name", "description", "systemDefined", "allowedCreditTagOptions",
"allowedDebitTagOptions", "debitTags", "creditTags", "creditAccounts", "debitAccounts", "allowMultipleCreditEntries", "allowedDebitTagOptions", "debitTags", "creditTags", "creditAccounts", "debitAccounts", "allowMultipleCreditEntries",
"allowMultipleDebitEntries", "tag")); "allowMultipleDebitEntries", "tag"));
@@ -232,8 +232,8 @@ public class AccountingRuleApiResource {
private Collection<CodeValueData> retrieveSelectedTags(final Collection<CodeValueData> allowedTagOptions, private Collection<CodeValueData> retrieveSelectedTags(final Collection<CodeValueData> allowedTagOptions,
final List<AccountingTagRuleData> existedTags) { final List<AccountingTagRuleData> existedTags) {
final Collection<CodeValueData> tempOptions = new ArrayList<CodeValueData>(allowedTagOptions); final Collection<CodeValueData> tempOptions = new ArrayList<>(allowedTagOptions);
final Map<Long, CodeValueData> selectedTags = new HashMap<Long, CodeValueData>(); final Map<Long, CodeValueData> selectedTags = new HashMap<>();
for (final AccountingTagRuleData accountingTagRuleData : existedTags) { for (final AccountingTagRuleData accountingTagRuleData : existedTags) {
for (final CodeValueData codeValueData : tempOptions) { for (final CodeValueData codeValueData : tempOptions) {
if (codeValueData.getId().equals(accountingTagRuleData.getTag().getId())) { if (codeValueData.getId().equals(accountingTagRuleData.getTag().getId())) {
@@ -22,7 +22,7 @@ public enum AccountingRuleJsonInputParams {
this.value = value; this.value = value;
} }
private static final Set<String> values = new HashSet<String>(); private static final Set<String> values = new HashSet<>();
static { static {
for (final AccountingRuleJsonInputParams type : AccountingRuleJsonInputParams.values()) { for (final AccountingRuleJsonInputParams type : AccountingRuleJsonInputParams.values()) {
values.add(type.value); values.add(type.value);
@@ -58,7 +58,7 @@ public class AccountingRule extends AbstractPersistable<Long> {
@LazyCollection(LazyCollectionOption.FALSE) @LazyCollection(LazyCollectionOption.FALSE)
@OneToMany(cascade = CascadeType.ALL, mappedBy = "accountingRule", orphanRemoval = true) @OneToMany(cascade = CascadeType.ALL, mappedBy = "accountingRule", orphanRemoval = true)
private final List<AccountingTagRule> accountingTagRules = new ArrayList<AccountingTagRule>(); private final List<AccountingTagRule> accountingTagRules = new ArrayList<>();
@Column(name = "allow_multiple_credits", nullable = false) @Column(name = "allow_multiple_credits", nullable = false)
private boolean allowMultipleCreditEntries; private boolean allowMultipleCreditEntries;
@@ -94,7 +94,7 @@ public class AccountingRule extends AbstractPersistable<Long> {
} }
public Map<String, Object> update(final JsonCommand command) { public Map<String, Object> update(final JsonCommand command) {
final Map<String, Object> actualChanges = new LinkedHashMap<String, Object>(10); final Map<String, Object> actualChanges = new LinkedHashMap<>(10);
handlePropertyUpdate(command, actualChanges, AccountingRuleJsonInputParams.OFFICE_ID.getValue(), this.office == null ? 0L handlePropertyUpdate(command, actualChanges, AccountingRuleJsonInputParams.OFFICE_ID.getValue(), this.office == null ? 0L
: this.office.getId()); : this.office.getId());
handlePropertyUpdate(command, actualChanges, AccountingRuleJsonInputParams.ACCOUNT_TO_DEBIT.getValue(), handlePropertyUpdate(command, actualChanges, AccountingRuleJsonInputParams.ACCOUNT_TO_DEBIT.getValue(),
@@ -219,8 +219,8 @@ public class AccountingRule extends AbstractPersistable<Long> {
} }
public void updateTags(final JournalEntryType type) { public void updateTags(final JournalEntryType type) {
final Set<AccountingTagRule> existedCreditTags = new HashSet<AccountingTagRule>(); final Set<AccountingTagRule> existedCreditTags = new HashSet<>();
final Set<AccountingTagRule> existedDebitTags = new HashSet<AccountingTagRule>(); final Set<AccountingTagRule> existedDebitTags = new HashSet<>();
for (final AccountingTagRule accountingTagRule : this.accountingTagRules) { for (final AccountingTagRule accountingTagRule : this.accountingTagRules) {
if (accountingTagRule.isCreditAccount()) { if (accountingTagRule.isCreditAccount()) {
existedCreditTags.add(accountingTagRule); existedCreditTags.add(accountingTagRule);
@@ -238,7 +238,7 @@ public class AccountingRule extends AbstractPersistable<Long> {
} }
public Set<AccountingTagRule> getAccountingTagRulesByType(final JournalEntryType type) { public Set<AccountingTagRule> getAccountingTagRulesByType(final JournalEntryType type) {
final Set<AccountingTagRule> existedTags = new HashSet<AccountingTagRule>(); final Set<AccountingTagRule> existedTags = new HashSet<>();
for (final AccountingTagRule accountingTagRule : this.accountingTagRules) { for (final AccountingTagRule accountingTagRule : this.accountingTagRules) {
if (accountingTagRule.getAccountType().equals(type.getValue())) { if (accountingTagRule.getAccountType().equals(type.getValue())) {
existedTags.add(accountingTagRule); existedTags.add(accountingTagRule);
@@ -47,7 +47,7 @@ public class AccountingRuleCommandFromApiJsonDeserializer {
final Type typeOfMap = new TypeToken<Map<String, Object>>() {}.getType(); final Type typeOfMap = new TypeToken<Map<String, Object>>() {}.getType();
this.fromApiJsonHelper.checkForUnsupportedParameters(typeOfMap, json, this.supportedParameters); this.fromApiJsonHelper.checkForUnsupportedParameters(typeOfMap, json, this.supportedParameters);
final List<ApiParameterError> dataValidationErrors = new ArrayList<ApiParameterError>(); final List<ApiParameterError> dataValidationErrors = new ArrayList<>();
final DataValidatorBuilder baseDataValidator = new DataValidatorBuilder(dataValidationErrors).resource("AccountingRule"); final DataValidatorBuilder baseDataValidator = new DataValidatorBuilder(dataValidationErrors).resource("AccountingRule");
final JsonElement element = this.fromApiJsonHelper.parse(json); final JsonElement element = this.fromApiJsonHelper.parse(json);
@@ -149,7 +149,7 @@ public class AccountingRuleCommandFromApiJsonDeserializer {
final Type typeOfMap = new TypeToken<Map<String, Object>>() {}.getType(); final Type typeOfMap = new TypeToken<Map<String, Object>>() {}.getType();
this.fromApiJsonHelper.checkForUnsupportedParameters(typeOfMap, json, this.supportedParameters); this.fromApiJsonHelper.checkForUnsupportedParameters(typeOfMap, json, this.supportedParameters);
final List<ApiParameterError> dataValidationErrors = new ArrayList<ApiParameterError>(); final List<ApiParameterError> dataValidationErrors = new ArrayList<>();
final DataValidatorBuilder baseDataValidator = new DataValidatorBuilder(dataValidationErrors).resource("AccountingRule"); final DataValidatorBuilder baseDataValidator = new DataValidatorBuilder(dataValidationErrors).resource("AccountingRule");
final JsonElement element = this.fromApiJsonHelper.parse(json); final JsonElement element = this.fromApiJsonHelper.parse(json);
@@ -76,7 +76,7 @@ public class AccountingRuleReadPlatformServiceImpl implements AccountingRuleRead
@Override @Override
public Map<Long, AccountingRuleData> extractData(final ResultSet rs) throws SQLException, DataAccessException { public Map<Long, AccountingRuleData> extractData(final ResultSet rs) throws SQLException, DataAccessException {
final Map<Long, AccountingRuleData> extractedData = new HashMap<Long, AccountingRuleData>(); final Map<Long, AccountingRuleData> extractedData = new HashMap<>();
while (rs.next()) { while (rs.next()) {
final Long id = rs.getLong("id"); final Long id = rs.getLong("id");
@@ -110,7 +110,7 @@ public class AccountingRuleReadPlatformServiceImpl implements AccountingRuleRead
creditTags = null; creditTags = null;
final GLAccountDataForLookup creditAccount = new GLAccountDataForLookup(accountToCreditId, creditAccountName, final GLAccountDataForLookup creditAccount = new GLAccountDataForLookup(accountToCreditId, creditAccountName,
creditAccountGLCode); creditAccountGLCode);
creditAccounts = new ArrayList<GLAccountDataForLookup>(Arrays.asList(creditAccount)); creditAccounts = new ArrayList<>(Arrays.asList(creditAccount));
} }
if (accountToDebitId == null) { if (accountToDebitId == null) {
debitTags = !this.isAssociationParametersExists ? getCreditOrDebitTags(id, JournalEntryType.DEBIT.getValue()) debitTags = !this.isAssociationParametersExists ? getCreditOrDebitTags(id, JournalEntryType.DEBIT.getValue())
@@ -121,7 +121,7 @@ public class AccountingRuleReadPlatformServiceImpl implements AccountingRuleRead
debitTags = null; debitTags = null;
final GLAccountDataForLookup debitAccount = new GLAccountDataForLookup(accountToDebitId, debitAccountName, final GLAccountDataForLookup debitAccount = new GLAccountDataForLookup(accountToDebitId, debitAccountName,
debitAccountGLCode); debitAccountGLCode);
debitAccounts = new ArrayList<GLAccountDataForLookup>(Arrays.asList(debitAccount)); debitAccounts = new ArrayList<>(Arrays.asList(debitAccount));
} }
accountingRuleData = new AccountingRuleData(id, officeId, officeName, name, description, systemDefined, accountingRuleData = new AccountingRuleData(id, officeId, officeName, name, description, systemDefined,
allowMultipleDebitEntries, allowMultipleCreditEntries, creditTags, debitTags, creditAccounts, debitAccounts); allowMultipleDebitEntries, allowMultipleCreditEntries, creditTags, debitTags, creditAccounts, debitAccounts);
@@ -153,7 +153,7 @@ public class AccountingRuleReadPlatformServiceImpl implements AccountingRuleRead
} }
sql = sql + " order by rule.id asc"; sql = sql + " order by rule.id asc";
final Map<Long, AccountingRuleData> extractedData = this.jdbcTemplate.query(sql, resultSetExtractor, arguments); final Map<Long, AccountingRuleData> extractedData = this.jdbcTemplate.query(sql, resultSetExtractor, arguments);
return new ArrayList<AccountingRuleData>(extractedData.values()); return new ArrayList<>(extractedData.values());
} }
@Override @Override
@@ -112,8 +112,8 @@ public class AccountingRuleWritePlatformServiceJpaRepositoryImpl implements Acco
// get the GL Accounts or tags to Debit and Credit // get the GL Accounts or tags to Debit and Credit
final String[] debitTags = command.arrayValueOfParameterNamed(AccountingRuleJsonInputParams.DEBIT_ACCOUNT_TAGS.getValue()); final String[] debitTags = command.arrayValueOfParameterNamed(AccountingRuleJsonInputParams.DEBIT_ACCOUNT_TAGS.getValue());
final String[] creditTags = command.arrayValueOfParameterNamed(AccountingRuleJsonInputParams.CREDIT_ACCOUNT_TAGS.getValue()); final String[] creditTags = command.arrayValueOfParameterNamed(AccountingRuleJsonInputParams.CREDIT_ACCOUNT_TAGS.getValue());
final Set<String> incomingDebitTags = debitTags == null ? new HashSet<String>() : new HashSet<String>(Arrays.asList(debitTags)); final Set<String> incomingDebitTags = debitTags == null ? new HashSet<String>() : new HashSet<>(Arrays.asList(debitTags));
final Set<String> incomingCreditTags = creditTags == null ? new HashSet<String>() : new HashSet<String>(Arrays.asList(creditTags)); final Set<String> incomingCreditTags = creditTags == null ? new HashSet<String>() : new HashSet<>(Arrays.asList(creditTags));
final Long accountToDebitId = command.longValueOfParameterNamed(AccountingRuleJsonInputParams.ACCOUNT_TO_DEBIT.getValue()); final Long accountToDebitId = command.longValueOfParameterNamed(AccountingRuleJsonInputParams.ACCOUNT_TO_DEBIT.getValue());
final Long accountToCreditId = command.longValueOfParameterNamed(AccountingRuleJsonInputParams.ACCOUNT_TO_CREDIT.getValue()); final Long accountToCreditId = command.longValueOfParameterNamed(AccountingRuleJsonInputParams.ACCOUNT_TO_CREDIT.getValue());
@@ -121,7 +121,7 @@ public class AccountingRuleWritePlatformServiceJpaRepositoryImpl implements Acco
boolean allowMultipleDebitEntries = false; boolean allowMultipleDebitEntries = false;
GLAccount debitAccount = null; GLAccount debitAccount = null;
GLAccount creditAccount = null; GLAccount creditAccount = null;
List<AccountingTagRule> accountingTagRules = new ArrayList<AccountingTagRule>(); List<AccountingTagRule> accountingTagRules = new ArrayList<>();
if ((accountToDebitId != null && debitTags != null) || (accountToDebitId == null && debitTags == null)) { if ((accountToDebitId != null && debitTags != null) || (accountToDebitId == null && debitTags == null)) {
throw new AccountingRuleDataException(AccountingRuleJsonInputParams.ACCOUNT_TO_DEBIT.getValue(), throw new AccountingRuleDataException(AccountingRuleJsonInputParams.ACCOUNT_TO_DEBIT.getValue(),
@@ -226,7 +226,7 @@ public class AccountingRuleWritePlatformServiceJpaRepositoryImpl implements Acco
accountingRule); accountingRule);
if (!creditTagsToAdd.isEmpty()) { if (!creditTagsToAdd.isEmpty()) {
List<AccountingTagRule> accountingTagRules = new ArrayList<AccountingTagRule>(); List<AccountingTagRule> accountingTagRules = new ArrayList<>();
accountingTagRules = saveDebitOrCreditTags(creditTagsToAdd, JournalEntryType.CREDIT, accountingTagRules); accountingTagRules = saveDebitOrCreditTags(creditTagsToAdd, JournalEntryType.CREDIT, accountingTagRules);
accountingRule.updateAccountingRuleForTags(accountingTagRules); accountingRule.updateAccountingRuleForTags(accountingTagRules);
accountingRule.updateCreditAccount(null); accountingRule.updateCreditAccount(null);
@@ -243,7 +243,7 @@ public class AccountingRuleWritePlatformServiceJpaRepositoryImpl implements Acco
final Set<String> debitTagsToAdd = determineCreditTagToAddAndRemoveOldTags(debitTags, JournalEntryType.DEBIT, final Set<String> debitTagsToAdd = determineCreditTagToAddAndRemoveOldTags(debitTags, JournalEntryType.DEBIT,
accountingRule); accountingRule);
if (!debitTagsToAdd.isEmpty()) { if (!debitTagsToAdd.isEmpty()) {
List<AccountingTagRule> accountingTagRules = new ArrayList<AccountingTagRule>(); List<AccountingTagRule> accountingTagRules = new ArrayList<>();
accountingTagRules = saveDebitOrCreditTags(debitTagsToAdd, JournalEntryType.DEBIT, accountingTagRules); accountingTagRules = saveDebitOrCreditTags(debitTagsToAdd, JournalEntryType.DEBIT, accountingTagRules);
accountingRule.updateAccountingRuleForTags(accountingTagRules); accountingRule.updateAccountingRuleForTags(accountingTagRules);
accountingRule.updateDebitAccount(null); accountingRule.updateDebitAccount(null);
@@ -276,12 +276,12 @@ public class AccountingRuleWritePlatformServiceJpaRepositoryImpl implements Acco
private Set<String> determineCreditTagToAddAndRemoveOldTags(final String[] creditOrDebitTags, final JournalEntryType type, private Set<String> determineCreditTagToAddAndRemoveOldTags(final String[] creditOrDebitTags, final JournalEntryType type,
final AccountingRule accountingRule) { final AccountingRule accountingRule) {
final Set<String> incomingTags = new HashSet<String>(Arrays.asList(creditOrDebitTags)); final Set<String> incomingTags = new HashSet<>(Arrays.asList(creditOrDebitTags));
final Set<AccountingTagRule> existingTags = accountingRule.getAccountingTagRulesByType(type); final Set<AccountingTagRule> existingTags = accountingRule.getAccountingTagRulesByType(type);
final Set<String> existingTagIds = retrieveExistingTagIds(existingTags); final Set<String> existingTagIds = retrieveExistingTagIds(existingTags);
final Set<String> tagsToAdd = new HashSet<String>(); final Set<String> tagsToAdd = new HashSet<>();
final Set<String> tagsToRemove = existingTagIds; final Set<String> tagsToRemove = existingTagIds;
final Map<Long, AccountingTagRule> accountsToRemove = new HashMap<Long, AccountingTagRule>(); final Map<Long, AccountingTagRule> accountsToRemove = new HashMap<>();
for (final String tagId : incomingTags) { for (final String tagId : incomingTags) {
if (existingTagIds.contains(tagId)) { if (existingTagIds.contains(tagId)) {
@@ -299,13 +299,13 @@ public class AccountingRuleWritePlatformServiceJpaRepositoryImpl implements Acco
} }
} }
} }
accountingRule.removeOldTags(new ArrayList<AccountingTagRule>(accountsToRemove.values())); accountingRule.removeOldTags(new ArrayList<>(accountsToRemove.values()));
} }
return tagsToAdd; return tagsToAdd;
} }
private Set<String> retrieveExistingTagIds(final Set<AccountingTagRule> existingCreditTags) { private Set<String> retrieveExistingTagIds(final Set<AccountingTagRule> existingCreditTags) {
final Set<String> existingCreditTagIds = new HashSet<String>(); final Set<String> existingCreditTagIds = new HashSet<>();
for (final AccountingTagRule accountingTagRule : existingCreditTags) { for (final AccountingTagRule accountingTagRule : existingCreditTags) {
existingCreditTagIds.add(accountingTagRule.getTagId().toString()); existingCreditTagIds.add(accountingTagRule.getTagId().toString());
} }
@@ -40,7 +40,7 @@ import org.springframework.stereotype.Component;
@Scope("singleton") @Scope("singleton")
public class AuditsApiResource { public class AuditsApiResource {
private final Set<String> RESPONSE_DATA_PARAMETERS = new HashSet<String>(Arrays.asList("id", "actionName", "entityName", "resourceId", private final Set<String> RESPONSE_DATA_PARAMETERS = new HashSet<>(Arrays.asList("id", "actionName", "entityName", "resourceId",
"subresourceId", "maker", "madeOnDate", "checker", "checkedOnDate", "processingResult", "commandAsJson", "officeName", "subresourceId", "maker", "madeOnDate", "checker", "checkedOnDate", "processingResult", "commandAsJson", "officeName",
"groupLevelName", "groupName", "clientName", "loanAccountNo", "savingsAccountNo", "clientId", "loanId", "url")); "groupLevelName", "groupName", "clientName", "loanAccountNo", "savingsAccountNo", "clientId", "loanId", "url"));
@@ -123,7 +123,7 @@ public class AuditsApiResource {
final AuditSearchData auditSearchData = this.auditReadPlatformService.retrieveSearchTemplate("audit"); final AuditSearchData auditSearchData = this.auditReadPlatformService.retrieveSearchTemplate("audit");
final Set<String> RESPONSE_DATA_PARAMETERS_SEARCH_TEMPLATE = new HashSet<String>(Arrays.asList("appUsers", "actionNames", final Set<String> RESPONSE_DATA_PARAMETERS_SEARCH_TEMPLATE = new HashSet<>(Arrays.asList("appUsers", "actionNames",
"entityNames", "processingResults")); "entityNames", "processingResults"));
return this.toApiJsonSerializerSearchTemplate.serialize(settings, auditSearchData, RESPONSE_DATA_PARAMETERS_SEARCH_TEMPLATE); return this.toApiJsonSerializerSearchTemplate.serialize(settings, auditSearchData, RESPONSE_DATA_PARAMETERS_SEARCH_TEMPLATE);
@@ -42,7 +42,7 @@ import org.springframework.stereotype.Component;
@Scope("singleton") @Scope("singleton")
public class MakercheckersApiResource { public class MakercheckersApiResource {
private final Set<String> RESPONSE_DATA_PARAMETERS = new HashSet<String>(Arrays.asList("id", "actionName", "entityName", "resourceId", private final Set<String> RESPONSE_DATA_PARAMETERS = new HashSet<>(Arrays.asList("id", "actionName", "entityName", "resourceId",
"subresourceId", "maker", "madeOnDate", "checker", "checkedOnDate", "processingResult", "commandAsJson", "officeName", "subresourceId", "maker", "madeOnDate", "checker", "checkedOnDate", "processingResult", "commandAsJson", "officeName",
"groupLevelName", "groupName", "clientName", "loanAccountNo", "savingsAccountNo", "clientId", "loanId")); "groupLevelName", "groupName", "clientName", "loanAccountNo", "savingsAccountNo", "clientId", "loanId"));
@@ -95,7 +95,7 @@ public class MakercheckersApiResource {
final AuditSearchData auditSearchData = this.readPlatformService.retrieveSearchTemplate("makerchecker"); final AuditSearchData auditSearchData = this.readPlatformService.retrieveSearchTemplate("makerchecker");
final Set<String> RESPONSE_DATA_PARAMETERS_SEARCH_TEMPLATE = new HashSet<String>(Arrays.asList("appUsers", "actionNames", final Set<String> RESPONSE_DATA_PARAMETERS_SEARCH_TEMPLATE = new HashSet<>(Arrays.asList("appUsers", "actionNames",
"entityNames")); "entityNames"));
return this.toApiJsonSerializerSearchTemplate.serialize(settings, auditSearchData, RESPONSE_DATA_PARAMETERS_SEARCH_TEMPLATE); return this.toApiJsonSerializerSearchTemplate.serialize(settings, auditSearchData, RESPONSE_DATA_PARAMETERS_SEARCH_TEMPLATE);
@@ -62,9 +62,9 @@ import com.google.gson.JsonObject;
public class AuditReadPlatformServiceImpl implements AuditReadPlatformService { public class AuditReadPlatformServiceImpl implements AuditReadPlatformService {
private final static Logger logger = LoggerFactory.getLogger(AuditReadPlatformServiceImpl.class); private final static Logger logger = LoggerFactory.getLogger(AuditReadPlatformServiceImpl.class);
private final static Set<String> supportedOrderByValues = new HashSet<String>(Arrays.asList("id", "actionName", "entityName", private final static Set<String> supportedOrderByValues = new HashSet<>(Arrays.asList("id", "actionName", "entityName", "resourceId",
"resourceId", "subresourceId", "madeOnDate", "checkedOnDate", "officeName", "groupName", "clientName", "loanAccountNo", "subresourceId", "madeOnDate", "checkedOnDate", "officeName", "groupName", "clientName", "loanAccountNo", "savingsAccountNo",
"savingsAccountNo", "clientId", "loanId")); "clientId", "loanId"));
private final JdbcTemplate jdbcTemplate; private final JdbcTemplate jdbcTemplate;
private final PlatformSecurityContext context; private final PlatformSecurityContext context;
@@ -74,7 +74,7 @@ public class AuditReadPlatformServiceImpl implements AuditReadPlatformService {
private final ClientReadPlatformService clientReadPlatformService; private final ClientReadPlatformService clientReadPlatformService;
private final LoanProductReadPlatformService loanProductReadPlatformService; private final LoanProductReadPlatformService loanProductReadPlatformService;
private final StaffReadPlatformService staffReadPlatformService; private final StaffReadPlatformService staffReadPlatformService;
private final PaginationHelper<AuditData> paginationHelper = new PaginationHelper<AuditData>(); private final PaginationHelper<AuditData> paginationHelper = new PaginationHelper<>();
private final PaginationParametersDataValidator paginationParametersDataValidator; private final PaginationParametersDataValidator paginationParametersDataValidator;
private final SavingsProductReadPlatformService savingsProductReadPlatformService; private final SavingsProductReadPlatformService savingsProductReadPlatformService;
private final DepositProductReadPlatformService depositProductReadPlatformService; private final DepositProductReadPlatformService depositProductReadPlatformService;
@@ -8,6 +8,6 @@ public class CacheApiConstants {
public static final String RESOURCE_NAME = "CACHE"; public static final String RESOURCE_NAME = "CACHE";
public static final String cacheTypeParameter = "cacheType"; public static final String cacheTypeParameter = "cacheType";
public static final Set<String> REQUEST_DATA_PARAMETERS = new HashSet<String>(Arrays.asList(cacheTypeParameter)); public static final Set<String> REQUEST_DATA_PARAMETERS = new HashSet<>(Arrays.asList(cacheTypeParameter));
} }
@@ -41,7 +41,7 @@ import org.springframework.stereotype.Component;
@Scope("singleton") @Scope("singleton")
public class CacheApiResource { public class CacheApiResource {
private final Set<String> RESPONSE_DATA_PARAMETERS = new HashSet<String>(Arrays.asList("id")); private final Set<String> RESPONSE_DATA_PARAMETERS = new HashSet<>(Arrays.asList("id"));
private final String resourceNameForPermissions = "CACHE"; private final String resourceNameForPermissions = "CACHE";
private final PlatformSecurityContext context; private final PlatformSecurityContext context;
@@ -49,7 +49,7 @@ public class UpdateCacheCommandHandler implements NewCommandSourceHandler {
final Type typeOfMap = new TypeToken<Map<String, Object>>() {}.getType(); final Type typeOfMap = new TypeToken<Map<String, Object>>() {}.getType();
command.checkForUnsupportedParameters(typeOfMap, json, CacheApiConstants.REQUEST_DATA_PARAMETERS); command.checkForUnsupportedParameters(typeOfMap, json, CacheApiConstants.REQUEST_DATA_PARAMETERS);
final List<ApiParameterError> dataValidationErrors = new ArrayList<ApiParameterError>(); final List<ApiParameterError> dataValidationErrors = new ArrayList<>();
final DataValidatorBuilder baseDataValidator = new DataValidatorBuilder(dataValidationErrors) final DataValidatorBuilder baseDataValidator = new DataValidatorBuilder(dataValidationErrors)
.resource(CacheApiConstants.RESOURCE_NAME.toLowerCase()); .resource(CacheApiConstants.RESOURCE_NAME.toLowerCase());
@@ -18,7 +18,7 @@ public enum CacheType {
private final Integer value; private final Integer value;
private final String code; private final String code;
private static final Map<Integer, CacheType> intToEnumMap = new HashMap<Integer, CacheType>(); private static final Map<Integer, CacheType> intToEnumMap = new HashMap<>();
static { static {
for (final CacheType type : CacheType.values()) { for (final CacheType type : CacheType.values()) {
@@ -71,7 +71,7 @@ public class RuntimeDelegatingCacheManager implements CacheManager {
public Map<String, Object> switchToCache(final boolean ehcacheEnabled, final CacheType toCacheType) { public Map<String, Object> switchToCache(final boolean ehcacheEnabled, final CacheType toCacheType) {
final Map<String, Object> changes = new HashMap<String, Object>(); final Map<String, Object> changes = new HashMap<>();
final boolean noCacheEnabled = !ehcacheEnabled; final boolean noCacheEnabled = !ehcacheEnabled;
final boolean distributedCacheEnabled = !ehcacheEnabled; final boolean distributedCacheEnabled = !ehcacheEnabled;
@@ -23,7 +23,7 @@ public class CodeConstants {
this.value = value; this.value = value;
} }
private static final Set<String> values = new HashSet<String>(); private static final Set<String> values = new HashSet<>();
static { static {
for (final CODEVALUE_JSON_INPUT_PARAMS type : CODEVALUE_JSON_INPUT_PARAMS.values()) { for (final CODEVALUE_JSON_INPUT_PARAMS type : CODEVALUE_JSON_INPUT_PARAMS.values()) {
values.add(type.value); values.add(type.value);
@@ -45,7 +45,7 @@ public class CodeValuesApiResource {
/** /**
* The set of parameters that are supported in response for {@link CodeData} * The set of parameters that are supported in response for {@link CodeData}
*/ */
private final Set<String> RESPONSE_DATA_PARAMETERS = new HashSet<String>(Arrays.asList("id", "name", "position")); private final Set<String> RESPONSE_DATA_PARAMETERS = new HashSet<>(Arrays.asList("id", "name", "position"));
private final String resourceNameForPermissions = "CODEVALUE"; private final String resourceNameForPermissions = "CODEVALUE";
private final PlatformSecurityContext context; private final PlatformSecurityContext context;
@@ -44,7 +44,7 @@ public class CodesApiResource {
/** /**
* The set of parameters that are supported in response for {@link CodeData} * The set of parameters that are supported in response for {@link CodeData}
*/ */
private final Set<String> RESPONSE_DATA_PARAMETERS = new HashSet<String>(Arrays.asList("id", "name", "systemDefined")); private final Set<String> RESPONSE_DATA_PARAMETERS = new HashSet<>(Arrays.asList("id", "name", "systemDefined"));
private final String resourceNameForPermissions = "CODE"; private final String resourceNameForPermissions = "CODE";
private final PlatformSecurityContext context; private final PlatformSecurityContext context;
@@ -61,7 +61,7 @@ public class Code extends AbstractPersistable<Long> {
if (this.systemDefined) { throw new SystemDefinedCodeCannotBeChangedException(); } if (this.systemDefined) { throw new SystemDefinedCodeCannotBeChangedException(); }
final Map<String, Object> actualChanges = new LinkedHashMap<String, Object>(1); final Map<String, Object> actualChanges = new LinkedHashMap<>(1);
final String firstnameParamName = "name"; final String firstnameParamName = "name";
if (command.isChangeInStringParameterNamed(firstnameParamName, this.name)) { if (command.isChangeInStringParameterNamed(firstnameParamName, this.name)) {
@@ -69,7 +69,7 @@ public class CodeValue extends AbstractPersistable<Long> {
public Map<String, Object> update(final JsonCommand command) { public Map<String, Object> update(final JsonCommand command) {
final Map<String, Object> actualChanges = new LinkedHashMap<String, Object>(2); final Map<String, Object> actualChanges = new LinkedHashMap<>(2);
final String labelParamName = CODEVALUE_JSON_INPUT_PARAMS.NAME.getValue(); final String labelParamName = CODEVALUE_JSON_INPUT_PARAMS.NAME.getValue();
if (command.isChangeInStringParameterNamed(labelParamName, this.label)) { if (command.isChangeInStringParameterNamed(labelParamName, this.label)) {
@@ -34,7 +34,7 @@ public final class CodeCommandFromApiJsonDeserializer {
/** /**
* The parameters supported for this command. * The parameters supported for this command.
*/ */
private final Set<String> supportedParameters = new HashSet<String>(Arrays.asList("name")); private final Set<String> supportedParameters = new HashSet<>(Arrays.asList("name"));
private final FromJsonHelper fromApiJsonHelper; private final FromJsonHelper fromApiJsonHelper;
@Autowired @Autowired
@@ -48,7 +48,7 @@ public final class CodeCommandFromApiJsonDeserializer {
final Type typeOfMap = new TypeToken<Map<String, Object>>() {}.getType(); final Type typeOfMap = new TypeToken<Map<String, Object>>() {}.getType();
this.fromApiJsonHelper.checkForUnsupportedParameters(typeOfMap, json, this.supportedParameters); this.fromApiJsonHelper.checkForUnsupportedParameters(typeOfMap, json, this.supportedParameters);
final List<ApiParameterError> dataValidationErrors = new ArrayList<ApiParameterError>(); final List<ApiParameterError> dataValidationErrors = new ArrayList<>();
final DataValidatorBuilder baseDataValidator = new DataValidatorBuilder(dataValidationErrors).resource("code"); final DataValidatorBuilder baseDataValidator = new DataValidatorBuilder(dataValidationErrors).resource("code");
final JsonElement element = this.fromApiJsonHelper.parse(json); final JsonElement element = this.fromApiJsonHelper.parse(json);
@@ -65,7 +65,7 @@ public final class CodeCommandFromApiJsonDeserializer {
final Type typeOfMap = new TypeToken<Map<String, Object>>() {}.getType(); final Type typeOfMap = new TypeToken<Map<String, Object>>() {}.getType();
this.fromApiJsonHelper.checkForUnsupportedParameters(typeOfMap, json, this.supportedParameters); this.fromApiJsonHelper.checkForUnsupportedParameters(typeOfMap, json, this.supportedParameters);
final List<ApiParameterError> dataValidationErrors = new ArrayList<ApiParameterError>(); final List<ApiParameterError> dataValidationErrors = new ArrayList<>();
final DataValidatorBuilder baseDataValidator = new DataValidatorBuilder(dataValidationErrors).resource("code"); final DataValidatorBuilder baseDataValidator = new DataValidatorBuilder(dataValidationErrors).resource("code");
final JsonElement element = this.fromApiJsonHelper.parse(json); final JsonElement element = this.fromApiJsonHelper.parse(json);
@@ -47,7 +47,7 @@ public final class CodeValueCommandFromApiJsonDeserializer {
final Type typeOfMap = new TypeToken<Map<String, Object>>() {}.getType(); final Type typeOfMap = new TypeToken<Map<String, Object>>() {}.getType();
this.fromApiJsonHelper.checkForUnsupportedParameters(typeOfMap, json, this.supportedParameters); this.fromApiJsonHelper.checkForUnsupportedParameters(typeOfMap, json, this.supportedParameters);
final List<ApiParameterError> dataValidationErrors = new ArrayList<ApiParameterError>(); final List<ApiParameterError> dataValidationErrors = new ArrayList<>();
final DataValidatorBuilder baseDataValidator = new DataValidatorBuilder(dataValidationErrors).resource("code.value"); final DataValidatorBuilder baseDataValidator = new DataValidatorBuilder(dataValidationErrors).resource("code.value");
final JsonElement element = this.fromApiJsonHelper.parse(json); final JsonElement element = this.fromApiJsonHelper.parse(json);
@@ -69,7 +69,7 @@ public final class CodeValueCommandFromApiJsonDeserializer {
final Type typeOfMap = new TypeToken<Map<String, Object>>() {}.getType(); final Type typeOfMap = new TypeToken<Map<String, Object>>() {}.getType();
this.fromApiJsonHelper.checkForUnsupportedParameters(typeOfMap, json, this.supportedParameters); this.fromApiJsonHelper.checkForUnsupportedParameters(typeOfMap, json, this.supportedParameters);
final List<ApiParameterError> dataValidationErrors = new ArrayList<ApiParameterError>(); final List<ApiParameterError> dataValidationErrors = new ArrayList<>();
final DataValidatorBuilder baseDataValidator = new DataValidatorBuilder(dataValidationErrors).resource("code.value"); final DataValidatorBuilder baseDataValidator = new DataValidatorBuilder(dataValidationErrors).resource("code.value");
final JsonElement element = this.fromApiJsonHelper.parse(json); final JsonElement element = this.fromApiJsonHelper.parse(json);
@@ -11,6 +11,6 @@ public class GlobalConfigurationApiConstant {
public static final String ID = "id"; public static final String ID = "id";
public static final String CONFIGURATION_RESOURCE_NAME = "globalConfiguration"; public static final String CONFIGURATION_RESOURCE_NAME = "globalConfiguration";
public static final Set<String> UPDATE_CONFIGURATION_DATA_PARAMETERS = new HashSet<String>(Arrays.asList(ENABLED, VALUE)); public static final Set<String> UPDATE_CONFIGURATION_DATA_PARAMETERS = new HashSet<>(Arrays.asList(ENABLED, VALUE));
} }
@@ -34,7 +34,7 @@ import org.springframework.stereotype.Component;
@Scope("singleton") @Scope("singleton")
public class GlobalConfigurationApiResource { public class GlobalConfigurationApiResource {
private final Set<String> RESPONSE_DATA_PARAMETERS = new HashSet<String>(Arrays.asList("globalConfiguration")); private final Set<String> RESPONSE_DATA_PARAMETERS = new HashSet<>(Arrays.asList("globalConfiguration"));
private final String resourceNameForPermissions = "CONFIGURATION"; private final String resourceNameForPermissions = "CONFIGURATION";
@@ -40,7 +40,7 @@ public class GlobalConfigurationDataValidator {
final Type typeOfMap = new TypeToken<Map<String, Object>>() {}.getType(); final Type typeOfMap = new TypeToken<Map<String, Object>>() {}.getType();
this.fromApiJsonHelper.checkForUnsupportedParameters(typeOfMap, json, UPDATE_CONFIGURATION_DATA_PARAMETERS); this.fromApiJsonHelper.checkForUnsupportedParameters(typeOfMap, json, UPDATE_CONFIGURATION_DATA_PARAMETERS);
final List<ApiParameterError> dataValidationErrors = new ArrayList<ApiParameterError>(); final List<ApiParameterError> dataValidationErrors = new ArrayList<>();
final DataValidatorBuilder baseDataValidator = new DataValidatorBuilder(dataValidationErrors).resource(CONFIGURATION_RESOURCE_NAME); final DataValidatorBuilder baseDataValidator = new DataValidatorBuilder(dataValidationErrors).resource(CONFIGURATION_RESOURCE_NAME);
final JsonElement element = this.fromApiJsonHelper.parse(json); final JsonElement element = this.fromApiJsonHelper.parse(json);
@@ -56,7 +56,7 @@ public class GlobalConfigurationProperty extends AbstractPersistable<Long> {
public Map<String, Object> update(final JsonCommand command) { public Map<String, Object> update(final JsonCommand command) {
final Map<String, Object> actualChanges = new LinkedHashMap<String, Object>(7); final Map<String, Object> actualChanges = new LinkedHashMap<>(7);
final String enabledParamName = "enabled"; final String enabledParamName = "enabled";
if (command.isChangeInBooleanParameterNamed(enabledParamName, this.enabled)) { if (command.isChangeInBooleanParameterNamed(enabledParamName, this.enabled)) {
@@ -33,7 +33,7 @@ public final class GlobalConfigurationCommandFromApiJsonDeserializer extends
/** /**
* The parameters supported for this command. * The parameters supported for this command.
*/ */
private final Set<String> supportedParameters = new HashSet<String>(Arrays.asList("globalConfiguration")); private final Set<String> supportedParameters = new HashSet<>(Arrays.asList("globalConfiguration"));
private final FromJsonHelper fromApiJsonHelper; private final FromJsonHelper fromApiJsonHelper;
@Autowired @Autowired
@@ -32,24 +32,24 @@ public class ApiParameterHelper {
} }
public static Set<String> extractFieldsForResponseIfProvided(final MultivaluedMap<String, String> queryParams) { public static Set<String> extractFieldsForResponseIfProvided(final MultivaluedMap<String, String> queryParams) {
Set<String> fields = new HashSet<String>(); Set<String> fields = new HashSet<>();
String commaSerperatedParameters = ""; String commaSerperatedParameters = "";
if (queryParams.getFirst("fields") != null) { if (queryParams.getFirst("fields") != null) {
commaSerperatedParameters = queryParams.getFirst("fields"); commaSerperatedParameters = queryParams.getFirst("fields");
if (StringUtils.isNotBlank(commaSerperatedParameters)) { if (StringUtils.isNotBlank(commaSerperatedParameters)) {
fields = new HashSet<String>(Arrays.asList(commaSerperatedParameters.split("\\s*,\\s*"))); fields = new HashSet<>(Arrays.asList(commaSerperatedParameters.split("\\s*,\\s*")));
} }
} }
return fields; return fields;
} }
public static Set<String> extractAssociationsForResponseIfProvided(final MultivaluedMap<String, String> queryParams) { public static Set<String> extractAssociationsForResponseIfProvided(final MultivaluedMap<String, String> queryParams) {
Set<String> fields = new HashSet<String>(); Set<String> fields = new HashSet<>();
String commaSerperatedParameters = ""; String commaSerperatedParameters = "";
if (queryParams.getFirst("associations") != null) { if (queryParams.getFirst("associations") != null) {
commaSerperatedParameters = queryParams.getFirst("associations"); commaSerperatedParameters = queryParams.getFirst("associations");
if (StringUtils.isNotBlank(commaSerperatedParameters)) { if (StringUtils.isNotBlank(commaSerperatedParameters)) {
fields = new HashSet<String>(Arrays.asList(commaSerperatedParameters.split("\\s*,\\s*"))); fields = new HashSet<>(Arrays.asList(commaSerperatedParameters.split("\\s*,\\s*")));
} }
} }
return fields; return fields;
@@ -148,7 +148,7 @@ public class ApiParameterHelper {
public static Map<String, String> asMap(final MultivaluedMap<String, String> queryParameters) { public static Map<String, String> asMap(final MultivaluedMap<String, String> queryParameters) {
final Map<String, String> map = new HashMap<String, String>(queryParameters.size()); final Map<String, String> map = new HashMap<>(queryParameters.size());
for (final String parameterName : queryParameters.keySet()) { for (final String parameterName : queryParameters.keySet()) {
final List<String> values = queryParameters.get(parameterName); final List<String> values = queryParameters.get(parameterName);
@@ -44,7 +44,7 @@ public class ApiGlobalErrorResponse {
* they be needed. Typically used to express data validation errors with * they be needed. Typically used to express data validation errors with
* parameters passed to API. * parameters passed to API.
*/ */
private List<ApiParameterError> errors = new ArrayList<ApiParameterError>(); private List<ApiParameterError> errors = new ArrayList<>();
public static ApiGlobalErrorResponse unAuthenticated() { public static ApiGlobalErrorResponse unAuthenticated() {
@@ -76,7 +76,7 @@ public class ApiGlobalErrorResponse {
globalErrorResponse.setUserMessageGlobalisationCode("error.msg.not.authorized"); globalErrorResponse.setUserMessageGlobalisationCode("error.msg.not.authorized");
globalErrorResponse.setDefaultUserMessage("Insufficient privileges to perform this action."); globalErrorResponse.setDefaultUserMessage("Insufficient privileges to perform this action.");
final List<ApiParameterError> errors = new ArrayList<ApiParameterError>(); final List<ApiParameterError> errors = new ArrayList<>();
errors.add(ApiParameterError.generalError("error.msg.not.authorized", defaultUserMessage)); errors.add(ApiParameterError.generalError("error.msg.not.authorized", defaultUserMessage));
globalErrorResponse.setErrors(errors); globalErrorResponse.setErrors(errors);
@@ -91,7 +91,7 @@ public class ApiGlobalErrorResponse {
globalErrorResponse.setUserMessageGlobalisationCode("validation.msg.domain.rule.violation"); globalErrorResponse.setUserMessageGlobalisationCode("validation.msg.domain.rule.violation");
globalErrorResponse.setDefaultUserMessage("Errors contain reason for domain rule violation."); globalErrorResponse.setDefaultUserMessage("Errors contain reason for domain rule violation.");
final List<ApiParameterError> errors = new ArrayList<ApiParameterError>(); final List<ApiParameterError> errors = new ArrayList<>();
errors.add(ApiParameterError.generalError(globalisationMessageCode, defaultUserMessage, defaultUserMessageArgs)); errors.add(ApiParameterError.generalError(globalisationMessageCode, defaultUserMessage, defaultUserMessageArgs));
globalErrorResponse.setErrors(errors); globalErrorResponse.setErrors(errors);
@@ -107,7 +107,7 @@ public class ApiGlobalErrorResponse {
globalErrorResponse.setUserMessageGlobalisationCode("error.msg.resource.not.found"); globalErrorResponse.setUserMessageGlobalisationCode("error.msg.resource.not.found");
globalErrorResponse.setDefaultUserMessage("The requested resource is not available."); globalErrorResponse.setDefaultUserMessage("The requested resource is not available.");
final List<ApiParameterError> errors = new ArrayList<ApiParameterError>(); final List<ApiParameterError> errors = new ArrayList<>();
errors.add(ApiParameterError.resourceIdentifierNotFound(globalisationMessageCode, defaultUserMessage, defaultUserMessageArgs)); errors.add(ApiParameterError.resourceIdentifierNotFound(globalisationMessageCode, defaultUserMessage, defaultUserMessageArgs));
globalErrorResponse.setErrors(errors); globalErrorResponse.setErrors(errors);
@@ -123,7 +123,7 @@ public class ApiGlobalErrorResponse {
globalErrorResponse.setUserMessageGlobalisationCode(globalisationMessageCode); globalErrorResponse.setUserMessageGlobalisationCode(globalisationMessageCode);
globalErrorResponse.setDefaultUserMessage(defaultUserMessage); globalErrorResponse.setDefaultUserMessage(defaultUserMessage);
final List<ApiParameterError> errors = new ArrayList<ApiParameterError>(); final List<ApiParameterError> errors = new ArrayList<>();
errors.add(ApiParameterError.parameterError(globalisationMessageCode, defaultUserMessage, parameterName, defaultUserMessageArgs)); errors.add(ApiParameterError.parameterError(globalisationMessageCode, defaultUserMessage, parameterName, defaultUserMessageArgs));
globalErrorResponse.setErrors(errors); globalErrorResponse.setErrors(errors);
@@ -154,7 +154,7 @@ public class ApiGlobalErrorResponse {
globalErrorResponse.setUserMessageGlobalisationCode("error.msg.platform.server.side.error"); globalErrorResponse.setUserMessageGlobalisationCode("error.msg.platform.server.side.error");
globalErrorResponse.setDefaultUserMessage("An unexpected error occured on the platform server."); globalErrorResponse.setDefaultUserMessage("An unexpected error occured on the platform server.");
final List<ApiParameterError> errors = new ArrayList<ApiParameterError>(); final List<ApiParameterError> errors = new ArrayList<>();
errors.add(ApiParameterError.generalError(globalisationMessageCode, defaultUserMessage, defaultUserMessageArgs)); errors.add(ApiParameterError.generalError(globalisationMessageCode, defaultUserMessage, defaultUserMessageArgs));
globalErrorResponse.setErrors(errors); globalErrorResponse.setErrors(errors);
@@ -170,7 +170,7 @@ public class ApiGlobalErrorResponse {
globalErrorResponse.setUserMessageGlobalisationCode("error.msg.platform.service.unavailable"); globalErrorResponse.setUserMessageGlobalisationCode("error.msg.platform.service.unavailable");
globalErrorResponse.setDefaultUserMessage("The server is currently unable to handle the request , please try after some time."); globalErrorResponse.setDefaultUserMessage("The server is currently unable to handle the request , please try after some time.");
final List<ApiParameterError> errors = new ArrayList<ApiParameterError>(); final List<ApiParameterError> errors = new ArrayList<>();
errors.add(ApiParameterError.generalError(globalisationMessageCode, defaultUserMessage, defaultUserMessageArgs)); errors.add(ApiParameterError.generalError(globalisationMessageCode, defaultUserMessage, defaultUserMessageArgs));
globalErrorResponse.setErrors(errors); globalErrorResponse.setErrors(errors);
@@ -42,7 +42,7 @@ public class ApiParameterError {
/** /**
* Arguments related to the user error message. * Arguments related to the user error message.
*/ */
private List<ApiErrorMessageArg> args = new ArrayList<ApiErrorMessageArg>(); private List<ApiErrorMessageArg> args = new ArrayList<>();
public static ApiParameterError generalError(final String globalisationMessageCode, final String defaultUserMessage, public static ApiParameterError generalError(final String globalisationMessageCode, final String defaultUserMessage,
final Object... defaultUserMessageArgs) { final Object... defaultUserMessageArgs) {
@@ -70,7 +70,7 @@ public class ApiParameterError {
this.developerMessage = defaultUserMessage; this.developerMessage = defaultUserMessage;
this.defaultUserMessage = defaultUserMessage; this.defaultUserMessage = defaultUserMessage;
final List<ApiErrorMessageArg> messageArgs = new ArrayList<ApiErrorMessageArg>(); final List<ApiErrorMessageArg> messageArgs = new ArrayList<>();
if (defaultUserMessageArgs != null) { if (defaultUserMessageArgs != null) {
for (final Object object : defaultUserMessageArgs) { for (final Object object : defaultUserMessageArgs) {
messageArgs.add(ApiErrorMessageArg.from(object)); messageArgs.add(ApiErrorMessageArg.from(object));
@@ -81,7 +81,7 @@ public class CommandProcessingResult {
this.loanId = null; this.loanId = null;
this.savingsId = null; this.savingsId = null;
this.transactionId = null; this.transactionId = null;
this.changes = new HashMap<String, Object>(); this.changes = new HashMap<>();
this.productId = null; this.productId = null;
this.subResourceId = null; this.subResourceId = null;
} }
@@ -17,11 +17,11 @@ import org.springframework.stereotype.Component;
@Component @Component
public class PaginationParametersDataValidator { public class PaginationParametersDataValidator {
public static Set<String> sortOrderValues = new HashSet<String>(Arrays.asList("ASC", "DESC")); public static Set<String> sortOrderValues = new HashSet<>(Arrays.asList("ASC", "DESC"));
public void validateParameterValues(PaginationParameters parameters, final Set<String> supportedOrdeByValues, final String resourceName) { public void validateParameterValues(PaginationParameters parameters, final Set<String> supportedOrdeByValues, final String resourceName) {
final List<ApiParameterError> dataValidationErrors = new ArrayList<ApiParameterError>(); final List<ApiParameterError> dataValidationErrors = new ArrayList<>();
if (parameters.isOrderByRequested() && !supportedOrdeByValues.contains(parameters.getOrderBy())) { if (parameters.isOrderByRequested() && !supportedOrdeByValues.contains(parameters.getOrderBy())) {
final String defaultUserMessage = "The orderBy value '" + parameters.getOrderBy() final String defaultUserMessage = "The orderBy value '" + parameters.getOrderBy()
@@ -47,7 +47,7 @@ public class UnrecognizedQueryParamExceptionMapper implements ExceptionMapper<Un
final ApiParameterError error = ApiParameterError.parameterError(validationErrorCode.toString(), defaultEnglishMessage.toString(), final ApiParameterError error = ApiParameterError.parameterError(validationErrorCode.toString(), defaultEnglishMessage.toString(),
parameterName, parameterName, parameterValue, exception.getSupportedParams()); parameterName, parameterName, parameterValue, exception.getSupportedParams());
final List<ApiParameterError> errors = new ArrayList<ApiParameterError>(); final List<ApiParameterError> errors = new ArrayList<>();
errors.add(error); errors.add(error);
final ApiGlobalErrorResponse invalidParameterError = ApiGlobalErrorResponse.badClientRequest( final ApiGlobalErrorResponse invalidParameterError = ApiGlobalErrorResponse.badClientRequest(
@@ -32,7 +32,7 @@ public class UnsupportedCommandExceptionMapper implements ExceptionMapper<Unsupp
@Override @Override
public Response toResponse(final UnsupportedCommandException exception) { public Response toResponse(final UnsupportedCommandException exception) {
final List<ApiParameterError> errors = new ArrayList<ApiParameterError>(); final List<ApiParameterError> errors = new ArrayList<>();
final StringBuilder validationErrorCode = new StringBuilder("error.msg.command.unsupported"); final StringBuilder validationErrorCode = new StringBuilder("error.msg.command.unsupported");
final StringBuilder defaultEnglishMessage = new StringBuilder("The command ").append(exception.getUnsupportedCommandName()).append( final StringBuilder defaultEnglishMessage = new StringBuilder("The command ").append(exception.getUnsupportedCommandName()).append(
@@ -32,7 +32,7 @@ public class UnsupportedParameterExceptionMapper implements ExceptionMapper<Unsu
@Override @Override
public Response toResponse(final UnsupportedParameterException exception) { public Response toResponse(final UnsupportedParameterException exception) {
final List<ApiParameterError> errors = new ArrayList<ApiParameterError>(); final List<ApiParameterError> errors = new ArrayList<>();
for (final String parameterName : exception.getUnsupportedParameters()) { for (final String parameterName : exception.getUnsupportedParameters()) {
final StringBuilder validationErrorCode = new StringBuilder("error.msg.parameter.unsupported"); final StringBuilder validationErrorCode = new StringBuilder("error.msg.parameter.unsupported");
@@ -34,17 +34,17 @@ public class DatatableCommandFromApiJsonDeserializer {
/** /**
* The parameters supported for this command. * The parameters supported for this command.
*/ */
private final Set<String> supportedParametersForCreate = new HashSet<String>(Arrays.asList("datatableName", "apptableName", "multiRow", private final Set<String> supportedParametersForCreate = new HashSet<>(Arrays.asList("datatableName", "apptableName", "multiRow",
"columns")); "columns"));
private final Set<String> supportedParametersForCreateColumns = new HashSet<String>(Arrays.asList("name", "type", "length", private final Set<String> supportedParametersForCreateColumns = new HashSet<>(Arrays.asList("name", "type", "length",
"mandatory", "code")); "mandatory", "code"));
private final Set<String> supportedParametersForUpdate = new HashSet<String>(Arrays.asList("apptableName", "changeColumns", private final Set<String> supportedParametersForUpdate = new HashSet<>(Arrays.asList("apptableName", "changeColumns",
"addColumns", "dropColumns")); "addColumns", "dropColumns"));
private final Set<String> supportedParametersForAddColumns = new HashSet<String>(Arrays.asList("name", "type", "length", "mandatory", private final Set<String> supportedParametersForAddColumns = new HashSet<>(Arrays.asList("name", "type", "length", "mandatory",
"after", "code")); "after", "code"));
private final Set<String> supportedParametersForChangeColumns = new HashSet<String>(Arrays.asList("name", "newName", "length", private final Set<String> supportedParametersForChangeColumns = new HashSet<>(Arrays.asList("name", "newName", "length",
"mandatory", "after", "code", "newCode")); "mandatory", "after", "code", "newCode"));
private final Set<String> supportedParametersForDropColumns = new HashSet<String>(Arrays.asList("name")); private final Set<String> supportedParametersForDropColumns = new HashSet<>(Arrays.asList("name"));
private final Object[] supportedColumnTypes = { "string", "number", "decimal", "date", "text", "dropdown" }; private final Object[] supportedColumnTypes = { "string", "number", "decimal", "date", "text", "dropdown" };
private final Object[] supportedApptableNames = { "m_loan", "m_savings_account", "m_client", "m_group", "m_center", "m_office", private final Object[] supportedApptableNames = { "m_loan", "m_savings_account", "m_client", "m_group", "m_center", "m_office",
"m_savings_product", "m_product_loan" }; "m_savings_product", "m_product_loan" };
@@ -97,7 +97,7 @@ public class DatatableCommandFromApiJsonDeserializer {
final Type typeOfMap = new TypeToken<Map<String, Object>>() {}.getType(); final Type typeOfMap = new TypeToken<Map<String, Object>>() {}.getType();
this.fromApiJsonHelper.checkForUnsupportedParameters(typeOfMap, json, this.supportedParametersForCreate); this.fromApiJsonHelper.checkForUnsupportedParameters(typeOfMap, json, this.supportedParametersForCreate);
final List<ApiParameterError> dataValidationErrors = new ArrayList<ApiParameterError>(); final List<ApiParameterError> dataValidationErrors = new ArrayList<>();
final DataValidatorBuilder baseDataValidator = new DataValidatorBuilder(dataValidationErrors).resource("datatable"); final DataValidatorBuilder baseDataValidator = new DataValidatorBuilder(dataValidationErrors).resource("datatable");
final JsonElement element = this.fromApiJsonHelper.parse(json); final JsonElement element = this.fromApiJsonHelper.parse(json);
@@ -147,7 +147,7 @@ public class DatatableCommandFromApiJsonDeserializer {
final Type typeOfMap = new TypeToken<Map<String, Object>>() {}.getType(); final Type typeOfMap = new TypeToken<Map<String, Object>>() {}.getType();
this.fromApiJsonHelper.checkForUnsupportedParameters(typeOfMap, json, this.supportedParametersForUpdate); this.fromApiJsonHelper.checkForUnsupportedParameters(typeOfMap, json, this.supportedParametersForUpdate);
final List<ApiParameterError> dataValidationErrors = new ArrayList<ApiParameterError>(); final List<ApiParameterError> dataValidationErrors = new ArrayList<>();
final DataValidatorBuilder baseDataValidator = new DataValidatorBuilder(dataValidationErrors).resource("datatable"); final DataValidatorBuilder baseDataValidator = new DataValidatorBuilder(dataValidationErrors).resource("datatable");
final JsonElement element = this.fromApiJsonHelper.parse(json); final JsonElement element = this.fromApiJsonHelper.parse(json);
@@ -73,7 +73,7 @@ public class FromJsonHelper {
final Map<String, Object> requestMap = this.gsonConverter.fromJson(json, typeOfMap); final Map<String, Object> requestMap = this.gsonConverter.fromJson(json, typeOfMap);
final List<String> unsupportedParameterList = new ArrayList<String>(); final List<String> unsupportedParameterList = new ArrayList<>();
for (final String providedParameter : requestMap.keySet()) { for (final String providedParameter : requestMap.keySet()) {
if (!supportedParams.contains(providedParameter)) { if (!supportedParams.contains(providedParameter)) {
unsupportedParameterList.add(providedParameter); unsupportedParameterList.add(providedParameter);
@@ -87,7 +87,7 @@ public class FromJsonHelper {
if (object == null) { throw new InvalidParameterException(); } if (object == null) { throw new InvalidParameterException(); }
final Set<Entry<String, JsonElement>> entries = object.entrySet(); final Set<Entry<String, JsonElement>> entries = object.entrySet();
final List<String> unsupportedParameterList = new ArrayList<String>(); final List<String> unsupportedParameterList = new ArrayList<>();
for (final Entry<String, JsonElement> providedParameter : entries) { for (final Entry<String, JsonElement> providedParameter : entries) {
if (!supportedParams.contains(providedParameter.getKey())) { if (!supportedParams.contains(providedParameter.getKey())) {
@@ -227,8 +227,8 @@ public class FromJsonHelper {
return this.helperDelegator.extractMonthDayFormatParameter(element); return this.helperDelegator.extractMonthDayFormatParameter(element);
} }
public Gson getGsonConverter() { public Gson getGsonConverter() {
return this.gsonConverter; return this.gsonConverter;
} }
} }
@@ -58,16 +58,16 @@ public final class GoogleGsonSerializerHelper {
public Gson createGsonBuilderWithParameterExclusionSerializationStrategy(final Set<String> supportedParameters, public Gson createGsonBuilderWithParameterExclusionSerializationStrategy(final Set<String> supportedParameters,
final boolean prettyPrint, final Set<String> responseParameters) { final boolean prettyPrint, final Set<String> responseParameters) {
final Set<String> parameterNamesToSkip = new HashSet<String>(); final Set<String> parameterNamesToSkip = new HashSet<>();
if (!responseParameters.isEmpty()) { if (!responseParameters.isEmpty()) {
// strip out all known support parameters from expected response to // strip out all known support parameters from expected response to
// see if unsupported parameters requested for response. // see if unsupported parameters requested for response.
final Set<String> differentParametersDetectedSet = new HashSet<String>(responseParameters); final Set<String> differentParametersDetectedSet = new HashSet<>(responseParameters);
differentParametersDetectedSet.removeAll(supportedParameters); differentParametersDetectedSet.removeAll(supportedParameters);
if (!differentParametersDetectedSet.isEmpty()) { throw new UnsupportedParameterException(new ArrayList<String>( if (!differentParametersDetectedSet.isEmpty()) { throw new UnsupportedParameterException(new ArrayList<>(
differentParametersDetectedSet)); } differentParametersDetectedSet)); }
parameterNamesToSkip.addAll(supportedParameters); parameterNamesToSkip.addAll(supportedParameters);
@@ -298,7 +298,7 @@ public class JsonParserHelper {
final DateTimeFormatter formatter = DateTimeFormat.forPattern(dateFormat).withLocale(clientApplicationLocale); final DateTimeFormatter formatter = DateTimeFormat.forPattern(dateFormat).withLocale(clientApplicationLocale);
value = MonthDay.parse(valueAsString.toLowerCase(clientApplicationLocale), formatter); value = MonthDay.parse(valueAsString.toLowerCase(clientApplicationLocale), formatter);
} catch (final IllegalArgumentException e) { } catch (final IllegalArgumentException e) {
final List<ApiParameterError> dataValidationErrors = new ArrayList<ApiParameterError>(); final List<ApiParameterError> dataValidationErrors = new ArrayList<>();
final ApiParameterError error = ApiParameterError.parameterError("validation.msg.invalid.month.day", final ApiParameterError error = ApiParameterError.parameterError("validation.msg.invalid.month.day",
"The parameter " + parameterName + " is invalid based on the monthDayFormat: '" + dateFormat "The parameter " + parameterName + " is invalid based on the monthDayFormat: '" + dateFormat
+ "' and locale: '" + clientApplicationLocale + "' provided:", parameterName, valueAsString, + "' and locale: '" + clientApplicationLocale + "' provided:", parameterName, valueAsString,
@@ -356,7 +356,7 @@ public class JsonParserHelper {
if (StringUtils.isBlank(dateFormat) || clientApplicationLocale == null) { if (StringUtils.isBlank(dateFormat) || clientApplicationLocale == null) {
final List<ApiParameterError> dataValidationErrors = new ArrayList<ApiParameterError>(); final List<ApiParameterError> dataValidationErrors = new ArrayList<>();
if (StringUtils.isBlank(dateFormat)) { if (StringUtils.isBlank(dateFormat)) {
final String defaultMessage = new StringBuilder("The parameter '" + parameterName final String defaultMessage = new StringBuilder("The parameter '" + parameterName
+ "' requires a 'dateFormat' parameter to be passed with it.").toString(); + "' requires a 'dateFormat' parameter to be passed with it.").toString();
@@ -382,7 +382,7 @@ public class JsonParserHelper {
eventLocalDate = DateTimeFormat.forPattern(dateFormat).withLocale(clientApplicationLocale) eventLocalDate = DateTimeFormat.forPattern(dateFormat).withLocale(clientApplicationLocale)
.parseLocalDate(dateAsString.toLowerCase(clientApplicationLocale)); .parseLocalDate(dateAsString.toLowerCase(clientApplicationLocale));
} catch (final IllegalArgumentException e) { } catch (final IllegalArgumentException e) {
final List<ApiParameterError> dataValidationErrors = new ArrayList<ApiParameterError>(); final List<ApiParameterError> dataValidationErrors = new ArrayList<>();
final ApiParameterError error = ApiParameterError.parameterError("validation.msg.invalid.date.format", "The parameter " final ApiParameterError error = ApiParameterError.parameterError("validation.msg.invalid.date.format", "The parameter "
+ parameterName + " is invalid based on the dateFormat: '" + dateFormat + "' and locale: '" + parameterName + " is invalid based on the dateFormat: '" + dateFormat + "' and locale: '"
+ clientApplicationLocale + "' provided:", parameterName, dateAsString, dateFormat); + clientApplicationLocale + "' provided:", parameterName, dateAsString, dateFormat);
@@ -400,7 +400,7 @@ public class JsonParserHelper {
if (clientApplicationLocale == null) { if (clientApplicationLocale == null) {
final List<ApiParameterError> dataValidationErrors = new ArrayList<ApiParameterError>(); final List<ApiParameterError> dataValidationErrors = new ArrayList<>();
final String defaultMessage = new StringBuilder("The parameter '" + parameterName final String defaultMessage = new StringBuilder("The parameter '" + parameterName
+ "' requires a 'locale' parameter to be passed with it.").toString(); + "' requires a 'locale' parameter to be passed with it.").toString();
final ApiParameterError error = ApiParameterError.parameterError("validation.msg.missing.locale.parameter", defaultMessage, final ApiParameterError error = ApiParameterError.parameterError("validation.msg.missing.locale.parameter", defaultMessage,
@@ -445,7 +445,7 @@ public class JsonParserHelper {
return number; return number;
} catch (final ParseException e) { } catch (final ParseException e) {
final List<ApiParameterError> dataValidationErrors = new ArrayList<ApiParameterError>(); final List<ApiParameterError> dataValidationErrors = new ArrayList<>();
final ApiParameterError error = ApiParameterError.parameterError("validation.msg.invalid.integer.format", "The parameter " final ApiParameterError error = ApiParameterError.parameterError("validation.msg.invalid.integer.format", "The parameter "
+ parameterName + " has value: " + numericalValueFormatted + " which is invalid integer value for provided locale of [" + parameterName + " has value: " + numericalValueFormatted + " which is invalid integer value for provided locale of ["
+ clientApplicationLocale.toString() + "].", parameterName, numericalValueFormatted, clientApplicationLocale); + clientApplicationLocale.toString() + "].", parameterName, numericalValueFormatted, clientApplicationLocale);
@@ -469,7 +469,7 @@ public class JsonParserHelper {
return number; return number;
} catch (final NumberFormatException e) { } catch (final NumberFormatException e) {
final List<ApiParameterError> dataValidationErrors = new ArrayList<ApiParameterError>(); final List<ApiParameterError> dataValidationErrors = new ArrayList<>();
final ApiParameterError error = ApiParameterError.parameterError("validation.msg.invalid.integer", "The parameter " final ApiParameterError error = ApiParameterError.parameterError("validation.msg.invalid.integer", "The parameter "
+ parameterName + " has value: " + numericalValueFormatted + " which is invalid integer.", parameterName, + parameterName + " has value: " + numericalValueFormatted + " which is invalid integer.", parameterName,
numericalValueFormatted); numericalValueFormatted);
@@ -485,7 +485,7 @@ public class JsonParserHelper {
if (clientApplicationLocale == null) { if (clientApplicationLocale == null) {
final List<ApiParameterError> dataValidationErrors = new ArrayList<ApiParameterError>(); final List<ApiParameterError> dataValidationErrors = new ArrayList<>();
final String defaultMessage = new StringBuilder("The parameter '" + parameterName final String defaultMessage = new StringBuilder("The parameter '" + parameterName
+ "' requires a 'locale' parameter to be passed with it.").toString(); + "' requires a 'locale' parameter to be passed with it.").toString();
final ApiParameterError error = ApiParameterError.parameterError("validation.msg.missing.locale.parameter", defaultMessage, final ApiParameterError error = ApiParameterError.parameterError("validation.msg.missing.locale.parameter", defaultMessage,
@@ -524,7 +524,7 @@ public class JsonParserHelper {
return number; return number;
} catch (final ParseException e) { } catch (final ParseException e) {
final List<ApiParameterError> dataValidationErrors = new ArrayList<ApiParameterError>(); final List<ApiParameterError> dataValidationErrors = new ArrayList<>();
final ApiParameterError error = ApiParameterError.parameterError("validation.msg.invalid.decimal.format", "The parameter " final ApiParameterError error = ApiParameterError.parameterError("validation.msg.invalid.decimal.format", "The parameter "
+ parameterName + " has value: " + numericalValueFormatted + " which is invalid decimal value for provided locale of [" + parameterName + " has value: " + numericalValueFormatted + " which is invalid decimal value for provided locale of ["
+ clientApplicationLocale.toString() + "].", parameterName, numericalValueFormatted, clientApplicationLocale); + clientApplicationLocale.toString() + "].", parameterName, numericalValueFormatted, clientApplicationLocale);
@@ -540,7 +540,7 @@ public class JsonParserHelper {
public static Locale localeFromString(final String localeAsString) { public static Locale localeFromString(final String localeAsString) {
if (StringUtils.isBlank(localeAsString)) { if (StringUtils.isBlank(localeAsString)) {
final List<ApiParameterError> dataValidationErrors = new ArrayList<ApiParameterError>(); final List<ApiParameterError> dataValidationErrors = new ArrayList<>();
final ApiParameterError error = ApiParameterError.parameterError("validation.msg.invalid.locale.format", final ApiParameterError error = ApiParameterError.parameterError("validation.msg.invalid.locale.format",
"The parameter locale is invalid. It cannot be blank.", "locale"); "The parameter locale is invalid. It cannot be blank.", "locale");
dataValidationErrors.add(error); dataValidationErrors.add(error);
@@ -575,7 +575,7 @@ public class JsonParserHelper {
private static Locale localeFrom(final String languageCode, final String courntryCode, final String variantCode) { private static Locale localeFrom(final String languageCode, final String courntryCode, final String variantCode) {
final List<ApiParameterError> dataValidationErrors = new ArrayList<ApiParameterError>(); final List<ApiParameterError> dataValidationErrors = new ArrayList<>();
final List<String> allowedLanguages = Arrays.asList(Locale.getISOLanguages()); final List<String> allowedLanguages = Arrays.asList(Locale.getISOLanguages());
if (!allowedLanguages.contains(languageCode.toLowerCase())) { if (!allowedLanguages.contains(languageCode.toLowerCase())) {

Some files were not shown because too many files have changed in this diff Show More