removing warnings after upgrade to java 7
This commit is contained in:
+23
-23
@@ -963,22 +963,22 @@ public class ClientLoanIntegrationTest {
|
||||
private void verifyLoanRepaymentSchedule(final ArrayList<HashMap> loanSchedule) {
|
||||
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"));
|
||||
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 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"));
|
||||
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 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"));
|
||||
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 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"));
|
||||
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"));
|
||||
@@ -987,47 +987,47 @@ public class ClientLoanIntegrationTest {
|
||||
private void verifyLoanRepaymentScheduleForEqualPrincipal(final ArrayList<HashMap> loanSchedule) {
|
||||
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"));
|
||||
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 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"));
|
||||
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 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"));
|
||||
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 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"));
|
||||
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 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"));
|
||||
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 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"));
|
||||
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 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"));
|
||||
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 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"));
|
||||
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 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"));
|
||||
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"));
|
||||
@@ -1037,54 +1037,54 @@ public class ClientLoanIntegrationTest {
|
||||
private void verifyLoanRepaymentScheduleForEqualPrincipalWithGrace(final ArrayList<HashMap> loanSchedule) {
|
||||
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"));
|
||||
validateNumberForEqualWithMsg("Checking for Principal Due for 1st Month", "0.0",
|
||||
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 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"));
|
||||
validateNumberForEqualWithMsg("Checking for Principal Due for 2nd Month", "0.0",
|
||||
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 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"));
|
||||
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 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"));
|
||||
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 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"));
|
||||
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 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"));
|
||||
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 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"));
|
||||
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 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"));
|
||||
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 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"));
|
||||
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 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"));
|
||||
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"));
|
||||
|
||||
+4
-4
@@ -93,22 +93,22 @@ public class GroupLoanIntegrationTest {
|
||||
private void verifyLoanRepaymentSchedule(final ArrayList<HashMap> loanSchedule) {
|
||||
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"));
|
||||
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 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"));
|
||||
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 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"));
|
||||
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 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"));
|
||||
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"));
|
||||
|
||||
+2
-2
@@ -38,9 +38,9 @@ public class TemplateIntegrationTest {
|
||||
@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");
|
||||
final HashMap<String, Object> map = new HashMap<String, Object>();
|
||||
final HashMap<String, Object> map = new HashMap<>();
|
||||
map.put("name", "foo");
|
||||
map.put("text", "Hello {{template}}");
|
||||
map.put("mappers", metadata);
|
||||
|
||||
+1
-1
@@ -29,7 +29,7 @@ public class ClientHelper {
|
||||
}
|
||||
|
||||
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("firstname", Utils.randomNameGenerator("Client_FirstName_", 5));
|
||||
map.put("lastname", Utils.randomNameGenerator("Client_LastName_", 4));
|
||||
|
||||
+2
-2
@@ -67,7 +67,7 @@ public class GlobalConfigurationHelper {
|
||||
}
|
||||
|
||||
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);
|
||||
System.out.println("map : " + map);
|
||||
return new Gson().toJson(map);
|
||||
@@ -81,7 +81,7 @@ public class GlobalConfigurationHelper {
|
||||
}
|
||||
|
||||
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);
|
||||
System.out.println("map : " + map);
|
||||
return new Gson().toJson(map);
|
||||
|
||||
+7
-7
@@ -72,7 +72,7 @@ public class GroupHelper {
|
||||
}
|
||||
|
||||
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("name", randomNameGenerator("Group_Name_", 5));
|
||||
map.put("externalId", randomIDGenerator("ID_", 7));
|
||||
@@ -93,7 +93,7 @@ public class GroupHelper {
|
||||
|
||||
public static String associateClientAsJSON(final String clientMember) {
|
||||
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);
|
||||
map.put("clientMembers", list);
|
||||
System.out.println("map : " + map);
|
||||
@@ -101,7 +101,7 @@ public class GroupHelper {
|
||||
}
|
||||
|
||||
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("locale", "en");
|
||||
if (StringUtils.isNotEmpty(activationDate)) {
|
||||
@@ -115,7 +115,7 @@ public class GroupHelper {
|
||||
}
|
||||
|
||||
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);
|
||||
System.out.println("map : " + map);
|
||||
return new Gson().toJson(map);
|
||||
@@ -147,7 +147,7 @@ public class GroupHelper {
|
||||
|
||||
public static void verifyGroupMembers(final RequestSpecification requestSpec, final ResponseSpecification responseSpec,
|
||||
final Integer generatedGroupID, final Integer groupMember) {
|
||||
List<String> list = new ArrayList<String>();
|
||||
List<String> list = new ArrayList<>();
|
||||
System.out.println("------------------------------CHECK GROUP MEMBERS------------------------------------\n");
|
||||
final String GROUP_URL = "/mifosng-provider/api/v1/groups/" + generatedGroupID
|
||||
+ "?associations=clientMembers&tenantIdentifier=default";
|
||||
@@ -157,7 +157,7 @@ public class GroupHelper {
|
||||
|
||||
public static void verifyEmptyGroupMembers(final RequestSpecification requestSpec, final ResponseSpecification responseSpec,
|
||||
final Integer generatedGroupID) {
|
||||
List<String> list = new ArrayList<String>();
|
||||
List<String> list = new ArrayList<>();
|
||||
System.out.println("------------------------------CHECK EMPTY GROUP MEMBER LIST------------------------------------\n");
|
||||
final String GROUP_URL = "/mifosng-provider/api/v1/groups/" + generatedGroupID
|
||||
+ "?associations=clientMembers&tenantIdentifier=default";
|
||||
@@ -167,7 +167,7 @@ public class GroupHelper {
|
||||
|
||||
public static void verifyGroupDeleted(final RequestSpecification requestSpec, final ResponseSpecification responseSpec,
|
||||
final Integer generatedGroupID) {
|
||||
List<String> list = new ArrayList<String>();
|
||||
List<String> list = new ArrayList<>();
|
||||
System.out.println("------------------------------CHECK GROUP DELETED------------------------------------\n");
|
||||
final String GROUP_URL = "/mifosng-provider/api/v1/groups/?tenantIdentifier=default";
|
||||
list = Utils.performServerGet(requestSpec, responseSpec, GROUP_URL, "pageItems");
|
||||
|
||||
+3
-3
@@ -28,9 +28,9 @@ public class HolidayHelper {
|
||||
}
|
||||
|
||||
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>>();
|
||||
HashMap<String, String> officeMap = new HashMap<String, String>();
|
||||
HashMap<String, String> officeMap = new HashMap<>();
|
||||
officeMap.put("officeId", OFFICE_ID);
|
||||
offices.add(officeMap);
|
||||
|
||||
@@ -48,7 +48,7 @@ public class HolidayHelper {
|
||||
}
|
||||
|
||||
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);
|
||||
System.out.println(activateHoliday);
|
||||
return activateHoliday;
|
||||
|
||||
+1
-1
@@ -26,7 +26,7 @@ public class OfficeHelper {
|
||||
|
||||
|
||||
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("name", Utils.randomNameGenerator("Office_", 4));
|
||||
map.put("dateFormat", "dd MMMM yyyy");
|
||||
|
||||
+2
-2
@@ -60,7 +60,7 @@ public class SchedulerJobHelper {
|
||||
}
|
||||
|
||||
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);
|
||||
System.out.println("map : " + map);
|
||||
return new Gson().toJson(map);
|
||||
@@ -82,7 +82,7 @@ public class SchedulerJobHelper {
|
||||
}
|
||||
|
||||
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);
|
||||
System.out.println(runSchedulerJob);
|
||||
return runSchedulerJob;
|
||||
|
||||
+1
-1
@@ -48,7 +48,7 @@ public class StandingInstructionsHelper {
|
||||
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 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("dateFormat", "dd MMMM yyyy");
|
||||
map.put("monthDayFormat", "dd MMMM");
|
||||
|
||||
+1
-1
@@ -23,7 +23,7 @@ public class SurveyHelper {
|
||||
}
|
||||
|
||||
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("ppi_household_members_cd_q1_householdmembers","107");
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@ import com.google.gson.Gson;
|
||||
public class FinancialActivityAccountsMappingBuilder {
|
||||
|
||||
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("glAccountId", glAccountId);
|
||||
return new Gson().toJson(map);
|
||||
|
||||
+1
-1
@@ -29,7 +29,7 @@ public class GLAccountBuilder {
|
||||
private static String description = "DEFAULT_DESCRIPTION";
|
||||
|
||||
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("glCode", GLAccountBuilder.GLCode);
|
||||
map.put("manualEntriesAllowed", GLAccountBuilder.manualEntriesAllowed);
|
||||
|
||||
+11
-11
@@ -112,7 +112,7 @@ public class ChargesHelper {
|
||||
}
|
||||
|
||||
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("amount", ChargesHelper.amount);
|
||||
map.put("chargeAppliesTo", ChargesHelper.CHARGE_APPLIES_TO_SAVINGS);
|
||||
@@ -219,7 +219,7 @@ public class ChargesHelper {
|
||||
}
|
||||
|
||||
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("amount", ChargesHelper.amount);
|
||||
map.put("chargeAppliesTo", ChargesHelper.CHARGE_APPLIES_TO_LOAN);
|
||||
@@ -264,7 +264,7 @@ public class ChargesHelper {
|
||||
}
|
||||
|
||||
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("amount", "200.0");
|
||||
String json = new Gson().toJson(map);
|
||||
@@ -273,7 +273,7 @@ public class ChargesHelper {
|
||||
}
|
||||
|
||||
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("chargeCalculationType", CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT);
|
||||
String json = new Gson().toJson(map);
|
||||
@@ -282,7 +282,7 @@ public class ChargesHelper {
|
||||
}
|
||||
|
||||
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("chargeCalculationType", CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT);
|
||||
map.put("chargePaymentMode", CHARGE_PAYMENT_MODE_ACCOUNT_TRANSFER);
|
||||
@@ -292,7 +292,7 @@ public class ChargesHelper {
|
||||
}
|
||||
|
||||
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("chargeCalculationType", CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT_AND_INTEREST);
|
||||
map.put("chargePaymentMode", CHARGE_PAYMENT_MODE_ACCOUNT_TRANSFER);
|
||||
@@ -302,7 +302,7 @@ public class ChargesHelper {
|
||||
}
|
||||
|
||||
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("chargeCalculationType", CHARGE_CALCULATION_TYPE_PERCENTAGE_INTEREST);
|
||||
map.put("chargePaymentMode", CHARGE_PAYMENT_MODE_ACCOUNT_TRANSFER);
|
||||
@@ -312,7 +312,7 @@ public class ChargesHelper {
|
||||
}
|
||||
|
||||
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("feeFrequency", ChargesHelper.CHARGE_FEE_FREQUENCY_DAYS);
|
||||
map.put("feeInterval", 2);
|
||||
@@ -322,7 +322,7 @@ public class ChargesHelper {
|
||||
}
|
||||
|
||||
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("feeFrequency", ChargesHelper.CHARGE_FEE_FREQUENCY_WEEKS);
|
||||
map.put("feeInterval", 2);
|
||||
@@ -332,7 +332,7 @@ public class ChargesHelper {
|
||||
}
|
||||
|
||||
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("feeFrequency", ChargesHelper.CHARGE_FEE_FREQUENCY_MONTHS);
|
||||
map.put("feeInterval", 2);
|
||||
@@ -342,7 +342,7 @@ public class ChargesHelper {
|
||||
}
|
||||
|
||||
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("feeFrequency", ChargesHelper.CHARGE_FEE_FREQUENCY_YEARS);
|
||||
map.put("feeInterval", 2);
|
||||
|
||||
+13
-13
@@ -80,10 +80,10 @@ public class FixedDepositAccountHelper {
|
||||
|
||||
public String build(final String clientId, final String productId, final String validFrom, final String validTo,
|
||||
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>>();
|
||||
HashMap<String, String> chartSlabsMap1 = new HashMap<String, String>();
|
||||
HashMap<String, String> chartSlabsMap1 = new HashMap<>();
|
||||
chartSlabsMap1.put("description", "First");
|
||||
chartSlabsMap1.put("periodType", MONTHS);
|
||||
chartSlabsMap1.put("fromPeriod", "1");
|
||||
@@ -92,7 +92,7 @@ public class FixedDepositAccountHelper {
|
||||
chartSlabsMap1.put("locale", LOCALE);
|
||||
chartSlabs.add(0, chartSlabsMap1);
|
||||
|
||||
HashMap<String, String> chartSlabsMap2 = new HashMap<String, String>();
|
||||
HashMap<String, String> chartSlabsMap2 = new HashMap<>();
|
||||
chartSlabsMap2.put("description", "Second");
|
||||
chartSlabsMap2.put("periodType", MONTHS);
|
||||
chartSlabsMap2.put("fromPeriod", "7");
|
||||
@@ -101,7 +101,7 @@ public class FixedDepositAccountHelper {
|
||||
chartSlabsMap2.put("locale", LOCALE);
|
||||
chartSlabs.add(1, chartSlabsMap2);
|
||||
|
||||
HashMap<String, String> chartSlabsMap3 = new HashMap<String, String>();
|
||||
HashMap<String, String> chartSlabsMap3 = new HashMap<>();
|
||||
chartSlabsMap3.put("description", "Third");
|
||||
chartSlabsMap3.put("periodType", MONTHS);
|
||||
chartSlabsMap3.put("fromPeriod", "13");
|
||||
@@ -110,7 +110,7 @@ public class FixedDepositAccountHelper {
|
||||
chartSlabsMap3.put("locale", LOCALE);
|
||||
chartSlabs.add(2, chartSlabsMap3);
|
||||
|
||||
HashMap<String, String> chartSlabsMap4 = new HashMap<String, String>();
|
||||
HashMap<String, String> chartSlabsMap4 = new HashMap<>();
|
||||
chartSlabsMap4.put("description", "Fourth");
|
||||
chartSlabsMap4.put("periodType", MONTHS);
|
||||
chartSlabsMap4.put("fromPeriod", "19");
|
||||
@@ -120,7 +120,7 @@ public class FixedDepositAccountHelper {
|
||||
chartSlabs.add(3, chartSlabsMap4);
|
||||
|
||||
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("endDate", validTo);
|
||||
chartsMap.put("dateFormat", "dd MMMM yyyy");
|
||||
@@ -324,7 +324,7 @@ public class FixedDepositAccountHelper {
|
||||
}
|
||||
|
||||
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("dateFormat", CommonConstants.dateFormat);
|
||||
map.put("approvedOnDate", approvedOnDate);
|
||||
@@ -335,7 +335,7 @@ public class FixedDepositAccountHelper {
|
||||
}
|
||||
|
||||
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("dateFormat", CommonConstants.dateFormat);
|
||||
map.put("rejectedOnDate", rejectedOnDate);
|
||||
@@ -346,7 +346,7 @@ public class FixedDepositAccountHelper {
|
||||
}
|
||||
|
||||
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("dateFormat", CommonConstants.dateFormat);
|
||||
map.put("withdrawnOnDate", withdrawnApplicationOnDate);
|
||||
@@ -357,7 +357,7 @@ public class FixedDepositAccountHelper {
|
||||
}
|
||||
|
||||
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("dateFormat", CommonConstants.dateFormat);
|
||||
map.put("activatedOnDate", activationDate);
|
||||
@@ -367,14 +367,14 @@ public class FixedDepositAccountHelper {
|
||||
}
|
||||
|
||||
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);
|
||||
System.out.println(fixedDepositAccountCalculatedInterestJson);
|
||||
return fixedDepositAccountCalculatedInterestJson;
|
||||
}
|
||||
|
||||
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("dateFormat", CommonConstants.dateFormat);
|
||||
map.put("closedOnDate", closedOnDate);
|
||||
@@ -385,7 +385,7 @@ public class FixedDepositAccountHelper {
|
||||
|
||||
private String getPrematureCloseForFixedDepositAccountAsJSON(final String closedOnDate, final String closureType,
|
||||
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("dateFormat", CommonConstants.dateFormat);
|
||||
map.put("closedOnDate", closedOnDate);
|
||||
|
||||
+7
-7
@@ -81,10 +81,10 @@ public class FixedDepositProductHelper {
|
||||
private Account[] accountList = null;
|
||||
|
||||
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>>();
|
||||
HashMap<String, String> chartSlabsMap1 = new HashMap<String, String>();
|
||||
HashMap<String, String> chartSlabsMap1 = new HashMap<>();
|
||||
chartSlabsMap1.put("description", "First");
|
||||
chartSlabsMap1.put("periodType", MONTHS);
|
||||
chartSlabsMap1.put("fromPeriod", "1");
|
||||
@@ -93,7 +93,7 @@ public class FixedDepositProductHelper {
|
||||
chartSlabsMap1.put("locale", LOCALE);
|
||||
chartSlabs.add(0, chartSlabsMap1);
|
||||
|
||||
HashMap<String, String> chartSlabsMap2 = new HashMap<String, String>();
|
||||
HashMap<String, String> chartSlabsMap2 = new HashMap<>();
|
||||
chartSlabsMap2.put("description", "Second");
|
||||
chartSlabsMap2.put("periodType", MONTHS);
|
||||
chartSlabsMap2.put("fromPeriod", "7");
|
||||
@@ -102,7 +102,7 @@ public class FixedDepositProductHelper {
|
||||
chartSlabsMap2.put("locale", LOCALE);
|
||||
chartSlabs.add(1, chartSlabsMap2);
|
||||
|
||||
HashMap<String, String> chartSlabsMap3 = new HashMap<String, String>();
|
||||
HashMap<String, String> chartSlabsMap3 = new HashMap<>();
|
||||
chartSlabsMap3.put("description", "Third");
|
||||
chartSlabsMap3.put("periodType", MONTHS);
|
||||
chartSlabsMap3.put("fromPeriod", "13");
|
||||
@@ -111,7 +111,7 @@ public class FixedDepositProductHelper {
|
||||
chartSlabsMap3.put("locale", LOCALE);
|
||||
chartSlabs.add(2, chartSlabsMap3);
|
||||
|
||||
HashMap<String, String> chartSlabsMap4 = new HashMap<String, String>();
|
||||
HashMap<String, String> chartSlabsMap4 = new HashMap<>();
|
||||
chartSlabsMap4.put("description", "Fourth");
|
||||
chartSlabsMap4.put("periodType", MONTHS);
|
||||
chartSlabsMap4.put("fromPeriod", "19");
|
||||
@@ -121,7 +121,7 @@ public class FixedDepositProductHelper {
|
||||
chartSlabs.add(3, chartSlabsMap4);
|
||||
|
||||
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("endDate", validTo);
|
||||
chartsMap.put("dateFormat", "dd MMMM yyyy");
|
||||
@@ -177,7 +177,7 @@ public class FixedDepositProductHelper {
|
||||
}
|
||||
|
||||
private Map<String, String> getAccountMappingForCashBased() {
|
||||
final Map<String, String> map = new HashMap<String, String>();
|
||||
final Map<String, String> map = new HashMap<>();
|
||||
if (accountList != null) {
|
||||
for (int i = 0; i < this.accountList.length; i++) {
|
||||
if (this.accountList[i].getAccountType().equals(Account.AccountType.ASSET)) {
|
||||
|
||||
+1
-1
@@ -42,7 +42,7 @@ public class LoanApplicationTestBuilder {
|
||||
|
||||
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("locale", "en_GB");
|
||||
if (this.loanType == "group") {
|
||||
|
||||
+4
-4
@@ -60,11 +60,11 @@ public class LoanProductTestBuilder {
|
||||
private String maxTrancheCount = "35000";
|
||||
|
||||
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) {
|
||||
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);
|
||||
charges.add(chargeMap);
|
||||
map.put("charges", charges);
|
||||
@@ -233,7 +233,7 @@ public class LoanProductTestBuilder {
|
||||
}
|
||||
|
||||
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++) {
|
||||
if (this.accountList[i].getAccountType().equals(Account.AccountType.ASSET)) {
|
||||
final String ID = this.accountList[i].getAccountID().toString();
|
||||
@@ -261,7 +261,7 @@ public class LoanProductTestBuilder {
|
||||
}
|
||||
|
||||
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++) {
|
||||
if (this.accountList[i].getAccountType().equals(Account.AccountType.ASSET)) {
|
||||
final String ID = this.accountList[i].getAccountID().toString();
|
||||
|
||||
+13
-13
@@ -166,7 +166,7 @@ public class LoanTransactionHelper {
|
||||
}
|
||||
|
||||
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("dateFormat", "dd MMMM yyyy");
|
||||
map.put("actualDisbursementDate", actualDisbursementDate);
|
||||
@@ -178,7 +178,7 @@ public class LoanTransactionHelper {
|
||||
}
|
||||
|
||||
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("dateFormat", "dd MMMM yyyy");
|
||||
map.put("approvedOnDate", approvalDate);
|
||||
@@ -187,7 +187,7 @@ public class LoanTransactionHelper {
|
||||
}
|
||||
|
||||
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("dateFormat", "dd MMMM yyyy");
|
||||
map.put("transactionDate", transactionDate);
|
||||
@@ -197,7 +197,7 @@ public class LoanTransactionHelper {
|
||||
}
|
||||
|
||||
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("locale", "en");
|
||||
map.put("note", " LOAN WRITE OFF!!!");
|
||||
@@ -206,7 +206,7 @@ public class LoanTransactionHelper {
|
||||
}
|
||||
|
||||
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("dateFormat", "dd MMMM yyyy");
|
||||
map.put("transactionDate", transactionDate);
|
||||
@@ -216,7 +216,7 @@ public class LoanTransactionHelper {
|
||||
}
|
||||
|
||||
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("dateFormat", "dd MMMM yyyy");
|
||||
map.put("withdrawnOnDate", withdrawDate);
|
||||
@@ -230,7 +230,7 @@ public class LoanTransactionHelper {
|
||||
}
|
||||
|
||||
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("dateFormat", "dd MMMM yyyy");
|
||||
map.put("amount", amount);
|
||||
@@ -246,7 +246,7 @@ public class LoanTransactionHelper {
|
||||
}
|
||||
|
||||
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("dateFormat", "dd MMMM yyyy");
|
||||
map.put("amount", amount);
|
||||
@@ -257,7 +257,7 @@ public class LoanTransactionHelper {
|
||||
}
|
||||
|
||||
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("dateFormat", "dd MMMM yyyy");
|
||||
map.put("amount", amount);
|
||||
@@ -268,7 +268,7 @@ public class LoanTransactionHelper {
|
||||
}
|
||||
|
||||
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("dateFormat", "dd MMMM yyyy");
|
||||
map.put("amount", amount);
|
||||
@@ -278,7 +278,7 @@ public class LoanTransactionHelper {
|
||||
}
|
||||
|
||||
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("dateFormat", "dd MMMM yyyy");
|
||||
map.put("transactionDate", date);
|
||||
@@ -291,7 +291,7 @@ public class LoanTransactionHelper {
|
||||
}
|
||||
|
||||
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("installmentNumber", installmentNumber);
|
||||
String json = new Gson().toJson(map);
|
||||
@@ -300,7 +300,7 @@ public class LoanTransactionHelper {
|
||||
}
|
||||
|
||||
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("locale", "en_GB");
|
||||
map.put("productId", productID);
|
||||
|
||||
+15
-15
@@ -91,10 +91,10 @@ public class RecurringDepositAccountHelper {
|
||||
|
||||
public String build(final String clientId, final String productId, final String validFrom, final String validTo,
|
||||
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>>();
|
||||
HashMap<String, String> chartSlabsMap1 = new HashMap<String, String>();
|
||||
HashMap<String, String> chartSlabsMap1 = new HashMap<>();
|
||||
chartSlabsMap1.put("description", "First");
|
||||
chartSlabsMap1.put("periodType", MONTHS);
|
||||
chartSlabsMap1.put("fromPeriod", "1");
|
||||
@@ -103,7 +103,7 @@ public class RecurringDepositAccountHelper {
|
||||
chartSlabsMap1.put("locale", LOCALE);
|
||||
chartSlabs.add(0, chartSlabsMap1);
|
||||
|
||||
HashMap<String, String> chartSlabsMap2 = new HashMap<String, String>();
|
||||
HashMap<String, String> chartSlabsMap2 = new HashMap<>();
|
||||
chartSlabsMap2.put("description", "Second");
|
||||
chartSlabsMap2.put("periodType", MONTHS);
|
||||
chartSlabsMap2.put("fromPeriod", "7");
|
||||
@@ -112,7 +112,7 @@ public class RecurringDepositAccountHelper {
|
||||
chartSlabsMap2.put("locale", LOCALE);
|
||||
chartSlabs.add(1, chartSlabsMap2);
|
||||
|
||||
HashMap<String, String> chartSlabsMap3 = new HashMap<String, String>();
|
||||
HashMap<String, String> chartSlabsMap3 = new HashMap<>();
|
||||
chartSlabsMap3.put("description", "Third");
|
||||
chartSlabsMap3.put("periodType", MONTHS);
|
||||
chartSlabsMap3.put("fromPeriod", "13");
|
||||
@@ -121,7 +121,7 @@ public class RecurringDepositAccountHelper {
|
||||
chartSlabsMap3.put("locale", LOCALE);
|
||||
chartSlabs.add(2, chartSlabsMap3);
|
||||
|
||||
HashMap<String, String> chartSlabsMap4 = new HashMap<String, String>();
|
||||
HashMap<String, String> chartSlabsMap4 = new HashMap<>();
|
||||
chartSlabsMap4.put("description", "Fourth");
|
||||
chartSlabsMap4.put("periodType", MONTHS);
|
||||
chartSlabsMap4.put("fromPeriod", "19");
|
||||
@@ -131,7 +131,7 @@ public class RecurringDepositAccountHelper {
|
||||
chartSlabs.add(3, chartSlabsMap4);
|
||||
|
||||
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("endDate", validTo);
|
||||
chartsMap.put("dateFormat", "dd MMMM yyyy");
|
||||
@@ -378,7 +378,7 @@ public class RecurringDepositAccountHelper {
|
||||
}
|
||||
|
||||
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("dateFormat", CommonConstants.dateFormat);
|
||||
map.put("approvedOnDate", approvedOnDate);
|
||||
@@ -389,7 +389,7 @@ public class RecurringDepositAccountHelper {
|
||||
}
|
||||
|
||||
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("dateFormat", CommonConstants.dateFormat);
|
||||
map.put("transactionDate", transactionDate);
|
||||
@@ -400,7 +400,7 @@ public class RecurringDepositAccountHelper {
|
||||
}
|
||||
|
||||
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("dateFormat", CommonConstants.dateFormat);
|
||||
map.put("rejectedOnDate", rejectedOnDate);
|
||||
@@ -411,7 +411,7 @@ public class RecurringDepositAccountHelper {
|
||||
}
|
||||
|
||||
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("dateFormat", CommonConstants.dateFormat);
|
||||
map.put("withdrawnOnDate", withdrawnApplicationOnDate);
|
||||
@@ -422,7 +422,7 @@ public class RecurringDepositAccountHelper {
|
||||
}
|
||||
|
||||
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("dateFormat", CommonConstants.dateFormat);
|
||||
map.put("activatedOnDate", activationDate);
|
||||
@@ -432,14 +432,14 @@ public class RecurringDepositAccountHelper {
|
||||
}
|
||||
|
||||
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);
|
||||
System.out.println(recurringDepositAccountCalculatedInterestJson);
|
||||
return recurringDepositAccountCalculatedInterestJson;
|
||||
}
|
||||
|
||||
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("dateFormat", CommonConstants.dateFormat);
|
||||
map.put("closedOnDate", closedOnDate);
|
||||
@@ -449,7 +449,7 @@ public class RecurringDepositAccountHelper {
|
||||
}
|
||||
|
||||
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("dateFormat", CommonConstants.dateFormat);
|
||||
map.put("transactionAmount", depositAmount);
|
||||
@@ -461,7 +461,7 @@ public class RecurringDepositAccountHelper {
|
||||
|
||||
private String getPrematureCloseForRecurringDepositAccountAsJSON(final String closedOnDate, final String closureType,
|
||||
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("dateFormat", CommonConstants.dateFormat);
|
||||
map.put("closedOnDate", closedOnDate);
|
||||
|
||||
+7
-7
@@ -79,10 +79,10 @@ public class RecurringDepositProductHelper {
|
||||
private Account[] accountList = null;
|
||||
|
||||
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>>();
|
||||
HashMap<String, String> chartSlabsMap1 = new HashMap<String, String>();
|
||||
HashMap<String, String> chartSlabsMap1 = new HashMap<>();
|
||||
chartSlabsMap1.put("description", "First");
|
||||
chartSlabsMap1.put("periodType", MONTHS);
|
||||
chartSlabsMap1.put("fromPeriod", "1");
|
||||
@@ -91,7 +91,7 @@ public class RecurringDepositProductHelper {
|
||||
chartSlabsMap1.put("locale", LOCALE);
|
||||
chartSlabs.add(0, chartSlabsMap1);
|
||||
|
||||
HashMap<String, String> chartSlabsMap2 = new HashMap<String, String>();
|
||||
HashMap<String, String> chartSlabsMap2 = new HashMap<>();
|
||||
chartSlabsMap2.put("description", "Second");
|
||||
chartSlabsMap2.put("periodType", MONTHS);
|
||||
chartSlabsMap2.put("fromPeriod", "7");
|
||||
@@ -100,7 +100,7 @@ public class RecurringDepositProductHelper {
|
||||
chartSlabsMap2.put("locale", LOCALE);
|
||||
chartSlabs.add(1, chartSlabsMap2);
|
||||
|
||||
HashMap<String, String> chartSlabsMap3 = new HashMap<String, String>();
|
||||
HashMap<String, String> chartSlabsMap3 = new HashMap<>();
|
||||
chartSlabsMap3.put("description", "Third");
|
||||
chartSlabsMap3.put("periodType", MONTHS);
|
||||
chartSlabsMap3.put("fromPeriod", "13");
|
||||
@@ -109,7 +109,7 @@ public class RecurringDepositProductHelper {
|
||||
chartSlabsMap3.put("locale", LOCALE);
|
||||
chartSlabs.add(2, chartSlabsMap3);
|
||||
|
||||
HashMap<String, String> chartSlabsMap4 = new HashMap<String, String>();
|
||||
HashMap<String, String> chartSlabsMap4 = new HashMap<>();
|
||||
chartSlabsMap4.put("description", "Fourth");
|
||||
chartSlabsMap4.put("periodType", MONTHS);
|
||||
chartSlabsMap4.put("fromPeriod", "19");
|
||||
@@ -119,7 +119,7 @@ public class RecurringDepositProductHelper {
|
||||
chartSlabs.add(3, chartSlabsMap4);
|
||||
|
||||
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("endDate", validTo);
|
||||
chartsMap.put("dateFormat", "dd MMMM yyyy");
|
||||
@@ -181,7 +181,7 @@ public class RecurringDepositProductHelper {
|
||||
}
|
||||
|
||||
private Map<String, String> getAccountMappingForCashBased() {
|
||||
final Map<String, String> map = new HashMap<String, String>();
|
||||
final Map<String, String> map = new HashMap<>();
|
||||
if (accountList != null) {
|
||||
for (int i = 0; i < this.accountList.length; i++) {
|
||||
if (this.accountList[i].getAccountType().equals(Account.AccountType.ASSET)) {
|
||||
|
||||
+1
-1
@@ -31,7 +31,7 @@ public class AccountTransferHelper {
|
||||
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 HashMap<String, String> map = new HashMap<String, String>();
|
||||
final HashMap<String, String> map = new HashMap<>();
|
||||
map.put("dateFormat", "dd MMMM yyyy");
|
||||
map.put("locale", LOCALE);
|
||||
map.put("fromClientId", fromClientId);
|
||||
|
||||
+11
-11
@@ -179,7 +179,7 @@ public class SavingsAccountHelper {
|
||||
}
|
||||
|
||||
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("dateFormat", CommonConstants.dateFormat);
|
||||
map.put("approvedOnDate", CREATED_DATE_PLUS_ONE);
|
||||
@@ -190,7 +190,7 @@ public class SavingsAccountHelper {
|
||||
}
|
||||
|
||||
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("dateFormat", CommonConstants.dateFormat);
|
||||
map.put("rejectedOnDate", rejectedOnDate);
|
||||
@@ -201,7 +201,7 @@ public class SavingsAccountHelper {
|
||||
}
|
||||
|
||||
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("dateFormat", CommonConstants.dateFormat);
|
||||
map.put("withdrawnOnDate", CREATED_DATE_PLUS_ONE);
|
||||
@@ -212,7 +212,7 @@ public class SavingsAccountHelper {
|
||||
}
|
||||
|
||||
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("dateFormat", CommonConstants.dateFormat);
|
||||
map.put("activatedOnDate", TRANSACTION_DATE);
|
||||
@@ -222,7 +222,7 @@ public class SavingsAccountHelper {
|
||||
}
|
||||
|
||||
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("dateFormat", CommonConstants.dateFormat);
|
||||
map.put("transactionDate", transactionDate);
|
||||
@@ -233,14 +233,14 @@ public class SavingsAccountHelper {
|
||||
}
|
||||
|
||||
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);
|
||||
System.out.println(savingsAccountCalculatedInterestJson);
|
||||
return savingsAccountCalculatedInterestJson;
|
||||
}
|
||||
|
||||
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("dateFormat", CommonConstants.dateFormat);
|
||||
map.put("amount", amount);
|
||||
@@ -250,7 +250,7 @@ public class SavingsAccountHelper {
|
||||
}
|
||||
|
||||
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("dateFormat", CommonConstants.dateFormat);
|
||||
String josn = new Gson().toJson(map);
|
||||
@@ -258,7 +258,7 @@ public class SavingsAccountHelper {
|
||||
}
|
||||
|
||||
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("dateFormat", CommonConstants.dateFormat);
|
||||
map.put("amount", "50");
|
||||
@@ -267,7 +267,7 @@ public class SavingsAccountHelper {
|
||||
}
|
||||
|
||||
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("dateFormat", CommonConstants.dateFormat);
|
||||
map.put("closedOnDate", LAST_TRANSACTION_DATE);
|
||||
@@ -347,7 +347,7 @@ public class SavingsAccountHelper {
|
||||
}
|
||||
|
||||
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("amount", 100);
|
||||
map.put("feeOnMonthDay", "15 January");
|
||||
|
||||
+1
-1
@@ -12,7 +12,7 @@ public class SavingsApplicationTestBuilder {
|
||||
|
||||
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");
|
||||
if (accountType == "GROUP") {
|
||||
map.put("groupId", ID);
|
||||
|
||||
+2
-2
@@ -65,7 +65,7 @@ public class SavingsProductHelper {
|
||||
private Account[] accountList = null;
|
||||
|
||||
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("shortName", this.shortName);
|
||||
@@ -159,7 +159,7 @@ public class SavingsProductHelper {
|
||||
}
|
||||
|
||||
private Map<String, String> getAccountMappingForCashBased() {
|
||||
final Map<String, String> map = new HashMap<String, String>();
|
||||
final Map<String, String> map = new HashMap<>();
|
||||
if (accountList != null) {
|
||||
for (int i = 0; i < this.accountList.length; i++) {
|
||||
if (this.accountList[i].getAccountType().equals(Account.AccountType.ASSET)) {
|
||||
|
||||
+2
-2
@@ -66,13 +66,13 @@ public class CodeHelper {
|
||||
}
|
||||
|
||||
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);
|
||||
return new Gson().toJson(map);
|
||||
}
|
||||
|
||||
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_POSITION_ATTRIBUTE_NAME, position);
|
||||
return new Gson().toJson(map);
|
||||
|
||||
+1
-1
@@ -20,7 +20,7 @@ public enum GLClosureJsonInputParams {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
private static final Set<String> values = new HashSet<String>();
|
||||
private static final Set<String> values = new HashSet<>();
|
||||
static {
|
||||
for (final GLClosureJsonInputParams type : GLClosureJsonInputParams.values()) {
|
||||
values.add(type.value);
|
||||
|
||||
+1
-1
@@ -43,7 +43,7 @@ import org.springframework.stereotype.Component;
|
||||
@Scope("singleton")
|
||||
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",
|
||||
"lastUpdatedByUsername"));
|
||||
|
||||
|
||||
+2
-2
@@ -34,7 +34,7 @@ public class GLClosureCommand {
|
||||
|
||||
public void validateForCreate() {
|
||||
|
||||
final List<ApiParameterError> dataValidationErrors = new ArrayList<ApiParameterError>();
|
||||
final List<ApiParameterError> dataValidationErrors = new ArrayList<>();
|
||||
|
||||
final DataValidatorBuilder baseDataValidator = new DataValidatorBuilder(dataValidationErrors).resource("GLClosure");
|
||||
|
||||
@@ -49,7 +49,7 @@ public class GLClosureCommand {
|
||||
}
|
||||
|
||||
public void validateForUpdate() {
|
||||
final List<ApiParameterError> dataValidationErrors = new ArrayList<ApiParameterError>();
|
||||
final List<ApiParameterError> dataValidationErrors = new ArrayList<>();
|
||||
|
||||
final DataValidatorBuilder baseDataValidator = new DataValidatorBuilder(dataValidationErrors).resource("GLClosure");
|
||||
|
||||
|
||||
+1
-1
@@ -44,7 +44,7 @@ public class GLClosureData {
|
||||
@SuppressWarnings("unused")
|
||||
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,
|
||||
final LocalDate createdDate, final LocalDate lastUpdatedDate, final Long createdByUserId, final String createdByUsername,
|
||||
|
||||
+1
-1
@@ -64,7 +64,7 @@ public class GLClosure extends AbstractAuditableCustom<AppUser, Long> {
|
||||
}
|
||||
|
||||
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);
|
||||
return actualChanges;
|
||||
}
|
||||
|
||||
+5
-5
@@ -35,7 +35,7 @@ public class AccountingConstants {
|
||||
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 {
|
||||
for (final CASH_ACCOUNTS_FOR_LOAN type : CASH_ACCOUNTS_FOR_LOAN.values()) {
|
||||
intToEnumMap.put(type.value, type);
|
||||
@@ -68,7 +68,7 @@ public class AccountingConstants {
|
||||
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 {
|
||||
for (final ACCRUAL_ACCOUNTS_FOR_LOAN type : ACCRUAL_ACCOUNTS_FOR_LOAN.values()) {
|
||||
intToEnumMap.put(type.value, type);
|
||||
@@ -155,7 +155,7 @@ public class AccountingConstants {
|
||||
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 {
|
||||
for (final CASH_ACCOUNTS_FOR_SAVINGS type : CASH_ACCOUNTS_FOR_SAVINGS.values()) {
|
||||
intToEnumMap.put(type.value, type);
|
||||
@@ -255,7 +255,7 @@ public class AccountingConstants {
|
||||
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 {
|
||||
for (final FINANCIAL_ACTIVITY type : FINANCIAL_ACTIVITY.values()) {
|
||||
intToEnumMap.put(type.value, type);
|
||||
@@ -274,7 +274,7 @@ public class AccountingConstants {
|
||||
|
||||
public static List<FinancialActivityData> getAllFinancialActivities() {
|
||||
if (financialActivities == null) {
|
||||
financialActivities = new ArrayList<FinancialActivityData>();
|
||||
financialActivities = new ArrayList<>();
|
||||
for (final FINANCIAL_ACTIVITY type : FINANCIAL_ACTIVITY.values()) {
|
||||
FinancialActivityData financialActivityData = convertToFinancialActivityData(type);
|
||||
financialActivities.add(financialActivityData);
|
||||
|
||||
+1
-1
@@ -60,7 +60,7 @@ public class AccountingDropdownReadPlatformServiceImpl implements AccountingDrop
|
||||
|
||||
@Override
|
||||
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);
|
||||
if (assetAccountOptions.isEmpty()) {
|
||||
assetAccountOptions = null;
|
||||
|
||||
+4
-4
@@ -27,7 +27,7 @@ public class AccountingEnumerations {
|
||||
}
|
||||
|
||||
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) {
|
||||
optionDatas.add(gLAccountType(accountType));
|
||||
}
|
||||
@@ -45,7 +45,7 @@ public class AccountingEnumerations {
|
||||
}
|
||||
|
||||
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) {
|
||||
optionDatas.add(gLAccountUsage(accountUsage));
|
||||
}
|
||||
@@ -63,7 +63,7 @@ public class AccountingEnumerations {
|
||||
}
|
||||
|
||||
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) {
|
||||
optionDatas.add(journalEntryType(journalEntryType));
|
||||
}
|
||||
@@ -90,7 +90,7 @@ public class AccountingEnumerations {
|
||||
}
|
||||
|
||||
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) {
|
||||
optionDatas.add(accountingRuleType(accountingRuleType));
|
||||
}
|
||||
|
||||
+1
-1
@@ -18,7 +18,7 @@ public enum AccountingRuleType {
|
||||
private final Integer value;
|
||||
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 {
|
||||
for (final AccountingRuleType type : AccountingRuleType.values()) {
|
||||
intToEnumMap.put(type.value, type);
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@ import java.util.Set;
|
||||
|
||||
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"));
|
||||
|
||||
public static final String resourceNameForPermission = "FINANCIALACTIVITYACCOUNT";
|
||||
|
||||
+1
-1
@@ -20,7 +20,7 @@ public enum FinancialActivityAccountsJsonInputParams {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
private static final Set<String> values = new HashSet<String>();
|
||||
private static final Set<String> values = new HashSet<>();
|
||||
static {
|
||||
for (final FinancialActivityAccountsJsonInputParams type : FinancialActivityAccountsJsonInputParams.values()) {
|
||||
values.add(type.value);
|
||||
|
||||
+2
-2
@@ -46,7 +46,7 @@ public final class FinancialActivityAccountDataValidator {
|
||||
public void validateForCreate(final String json) {
|
||||
validateJSONAndCheckForUnsupportedParams(json);
|
||||
|
||||
final List<ApiParameterError> dataValidationErrors = new ArrayList<ApiParameterError>();
|
||||
final List<ApiParameterError> dataValidationErrors = new ArrayList<>();
|
||||
final DataValidatorBuilder baseDataValidator = getDataValidator(dataValidationErrors);
|
||||
|
||||
final JsonElement element = this.fromApiJsonHelper.parse(json);
|
||||
@@ -69,7 +69,7 @@ public final class FinancialActivityAccountDataValidator {
|
||||
public void validateForUpdate(final String json) {
|
||||
validateJSONAndCheckForUnsupportedParams(json);
|
||||
|
||||
final List<ApiParameterError> dataValidationErrors = new ArrayList<ApiParameterError>();
|
||||
final List<ApiParameterError> dataValidationErrors = new ArrayList<>();
|
||||
final DataValidatorBuilder baseDataValidator = getDataValidator(dataValidationErrors);
|
||||
|
||||
final JsonElement element = this.fromApiJsonHelper.parse(json);
|
||||
|
||||
+1
-1
@@ -135,7 +135,7 @@ public class FinancialActivityAccountWritePlatformServiceImpl implements Financi
|
||||
|
||||
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();
|
||||
Integer financialActivityType = financialActivityAccount.getFinancialActivityType();
|
||||
|
||||
+1
-1
@@ -21,7 +21,7 @@ public enum GLAccountJsonInputParams {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
private static final Set<String> values = new HashSet<String>();
|
||||
private static final Set<String> values = new HashSet<>();
|
||||
static {
|
||||
for (final GLAccountJsonInputParams type : GLAccountJsonInputParams.values()) {
|
||||
values.add(type.value);
|
||||
|
||||
+1
-1
@@ -50,7 +50,7 @@ import org.springframework.stereotype.Component;
|
||||
@Scope("singleton")
|
||||
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",
|
||||
"liabilityHeaderAccountOptions", "equityHeaderAccountOptions", "incomeHeaderAccountOptions", "expenseHeaderAccountOptions",
|
||||
"nameDecorated", "tagId", "allowedAssetsTagOptions", "allowedLiabilitiesTagOptions", "allowedEquityTagOptions",
|
||||
|
||||
+2
-2
@@ -48,7 +48,7 @@ public class GLAccountCommand {
|
||||
|
||||
public void validateForCreate() {
|
||||
|
||||
final List<ApiParameterError> dataValidationErrors = new ArrayList<ApiParameterError>();
|
||||
final List<ApiParameterError> dataValidationErrors = new ArrayList<>();
|
||||
|
||||
final DataValidatorBuilder baseDataValidator = new DataValidatorBuilder(dataValidationErrors).resource("GLAccount");
|
||||
|
||||
@@ -80,7 +80,7 @@ public class GLAccountCommand {
|
||||
}
|
||||
|
||||
public void validateForUpdate() {
|
||||
final List<ApiParameterError> dataValidationErrors = new ArrayList<ApiParameterError>();
|
||||
final List<ApiParameterError> dataValidationErrors = new ArrayList<>();
|
||||
|
||||
final DataValidatorBuilder baseDataValidator = new DataValidatorBuilder(dataValidationErrors).resource("GLAccount");
|
||||
|
||||
|
||||
+2
-2
@@ -39,7 +39,7 @@ public class GLAccount extends AbstractPersistable<Long> {
|
||||
|
||||
@OneToMany(fetch = FetchType.LAZY)
|
||||
@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)
|
||||
private String name;
|
||||
@@ -96,7 +96,7 @@ public class GLAccount extends AbstractPersistable<Long> {
|
||||
}
|
||||
|
||||
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.DISABLED.getValue(), this.disabled);
|
||||
handlePropertyUpdate(command, actualChanges, GLAccountJsonInputParams.GL_CODE.getValue(), this.glCode);
|
||||
|
||||
+1
-1
@@ -28,7 +28,7 @@ public enum GLAccountType {
|
||||
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 maxValue;
|
||||
static {
|
||||
|
||||
+1
-1
@@ -28,7 +28,7 @@ public enum GLAccountUsage {
|
||||
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 maxValue;
|
||||
static {
|
||||
|
||||
+1
-1
@@ -45,7 +45,7 @@ import org.springframework.stereotype.Component;
|
||||
@Scope("singleton")
|
||||
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",
|
||||
"manualEntry", "entityType", "entityId", "createdByUserId", "createdDate", "createdByUserName", "comments", "reversed",
|
||||
"referenceNumber", "currency"));
|
||||
|
||||
+1
-1
@@ -23,7 +23,7 @@ public enum JournalEntryJsonInputParams {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
private static final Set<String> values = new HashSet<String>();
|
||||
private static final Set<String> values = new HashSet<>();
|
||||
static {
|
||||
for (final JournalEntryJsonInputParams type : JournalEntryJsonInputParams.values()) {
|
||||
values.add(type.value);
|
||||
|
||||
+1
-1
@@ -66,7 +66,7 @@ public class JournalEntryCommand {
|
||||
|
||||
public void validateForCreate() {
|
||||
|
||||
final List<ApiParameterError> dataValidationErrors = new ArrayList<ApiParameterError>();
|
||||
final List<ApiParameterError> dataValidationErrors = new ArrayList<>();
|
||||
|
||||
final DataValidatorBuilder baseDataValidator = new DataValidatorBuilder(dataValidationErrors).resource("GLJournalEntry");
|
||||
|
||||
|
||||
+2
-2
@@ -24,7 +24,7 @@ public class JournalEntryDataValidator {
|
||||
|
||||
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()));
|
||||
|
||||
@Autowired
|
||||
@@ -35,7 +35,7 @@ public class JournalEntryDataValidator {
|
||||
public void validateForUpdateRunningbalance(final JsonCommand command) {
|
||||
final Type typeOfMap = new TypeToken<Map<String, Object>>() {}.getType();
|
||||
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");
|
||||
|
||||
if (this.fromApiJsonHelper.parameterExists(JournalEntryJsonInputParams.OFFICE_ID.getValue(), command.parsedJson())) {
|
||||
|
||||
+1
-1
@@ -28,7 +28,7 @@ public enum JournalEntryType {
|
||||
return this.code;
|
||||
}
|
||||
|
||||
private static final Map<Integer, JournalEntryType> intToEnumMap = new HashMap<Integer, JournalEntryType>();
|
||||
private static final Map<Integer, JournalEntryType> intToEnumMap = new HashMap<>();
|
||||
static {
|
||||
for (final JournalEntryType type : JournalEntryType.values()) {
|
||||
intToEnumMap.put(type.value, type);
|
||||
|
||||
+1
-1
@@ -105,7 +105,7 @@ public final class JournalEntryCommandFromApiJsonDeserializer extends AbstractFr
|
||||
for (int i = 0; i < array.size(); i++) {
|
||||
|
||||
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 String comments = this.fromApiJsonHelper.extractStringNamed("comments", creditElement);
|
||||
|
||||
+7
-7
@@ -90,7 +90,7 @@ public class AccountingProcessorHelper {
|
||||
final Long loanProductId = (Long) accountingBridgeData.get("loanProductId");
|
||||
final Long officeId = (Long) accountingBridgeData.get("officeId");
|
||||
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");
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@@ -110,8 +110,8 @@ public class AccountingProcessorHelper {
|
||||
final boolean reversed = (Boolean) map.get("reversed");
|
||||
final Long paymentTypeId = (Long) map.get("paymentTypeId");
|
||||
|
||||
final List<ChargePaymentDTO> feePaymentDetails = new ArrayList<ChargePaymentDTO>();
|
||||
final List<ChargePaymentDTO> penaltyPaymentDetails = new ArrayList<ChargePaymentDTO>();
|
||||
final List<ChargePaymentDTO> feePaymentDetails = new ArrayList<>();
|
||||
final List<ChargePaymentDTO> penaltyPaymentDetails = new ArrayList<>();
|
||||
// extract charge payment details (if exists)
|
||||
if (map.containsKey("loanChargesPaid")) {
|
||||
@SuppressWarnings("unchecked")
|
||||
@@ -152,7 +152,7 @@ public class AccountingProcessorHelper {
|
||||
final Long loanProductId = (Long) accountingBridgeData.get("savingsProductId");
|
||||
final Long officeId = (Long) accountingBridgeData.get("officeId");
|
||||
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");
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@@ -168,8 +168,8 @@ public class AccountingProcessorHelper {
|
||||
final Long paymentTypeId = (Long) map.get("paymentTypeId");
|
||||
final BigDecimal overdraftAmount = (BigDecimal) map.get("overdraftAmount");
|
||||
|
||||
final List<ChargePaymentDTO> feePayments = new ArrayList<ChargePaymentDTO>();
|
||||
final List<ChargePaymentDTO> penaltyPayments = new ArrayList<ChargePaymentDTO>();
|
||||
final List<ChargePaymentDTO> feePayments = new ArrayList<>();
|
||||
final List<ChargePaymentDTO> penaltyPayments = new ArrayList<>();
|
||||
// extract charge payment details (if exists)
|
||||
if (map.containsKey("savingsChargesPaid")) {
|
||||
@SuppressWarnings("unchecked")
|
||||
@@ -383,7 +383,7 @@ public class AccountingProcessorHelper {
|
||||
* Map to track each account and the net credit to be made for a
|
||||
* particular account
|
||||
***/
|
||||
final Map<GLAccount, BigDecimal> creditDetailsMap = new LinkedHashMap<GLAccount, BigDecimal>();
|
||||
final Map<GLAccount, BigDecimal> creditDetailsMap = new LinkedHashMap<>();
|
||||
for (final ChargePaymentDTO chargePaymentDTO : chargePaymentDTOs) {
|
||||
final Long chargeId = chargePaymentDTO.getChargeId();
|
||||
final GLAccount chargeSpecificAccount = getLinkedGLAccountForLoanCharges(loanProductId, accountMappingTypeId, chargeId);
|
||||
|
||||
+2
-2
@@ -28,6 +28,7 @@ import org.mifosplatform.infrastructure.core.service.Page;
|
||||
import org.mifosplatform.infrastructure.core.service.PaginationHelper;
|
||||
import org.mifosplatform.infrastructure.core.service.RoutingDataSource;
|
||||
import org.mifosplatform.organisation.monetary.data.CurrencyData;
|
||||
import org.mifosplatform.portfolio.account.PortfolioAccountType;
|
||||
import org.mifosplatform.portfolio.group.service.SearchParameters;
|
||||
import org.mifosplatform.portfolio.loanaccount.data.LoanTransactionEnumData;
|
||||
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.savings.data.SavingsAccountTransactionEnumData;
|
||||
import org.mifosplatform.portfolio.savings.service.SavingsEnumerations;
|
||||
import org.mifosplatform.portfolio.account.PortfolioAccountType;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.dao.EmptyResultDataAccessException;
|
||||
import org.springframework.jdbc.core.JdbcTemplate;
|
||||
@@ -47,7 +47,7 @@ public class JournalEntryReadPlatformServiceImpl implements JournalEntryReadPlat
|
||||
|
||||
private final JdbcTemplate jdbcTemplate;
|
||||
|
||||
private final PaginationHelper<JournalEntryData> paginationHelper = new PaginationHelper<JournalEntryData>();
|
||||
private final PaginationHelper<JournalEntryData> paginationHelper = new PaginationHelper<>();
|
||||
|
||||
@Autowired
|
||||
public JournalEntryReadPlatformServiceImpl(final RoutingDataSource dataSource) {
|
||||
|
||||
+5
-5
@@ -120,8 +120,8 @@ public class JournalEntryRunningBalanceUpdateServiceImpl implements JournalEntry
|
||||
|
||||
@Transactional
|
||||
private void updateOrganizationRunningBalance(Date entityDate) {
|
||||
Map<Long, BigDecimal> runningBalanceMap = new HashMap<Long, BigDecimal>(5);
|
||||
Map<Long, Map<Long, BigDecimal>> officesRunningBalance = new HashMap<Long, Map<Long, BigDecimal>>();
|
||||
Map<Long, BigDecimal> runningBalanceMap = new HashMap<>(5);
|
||||
Map<Long, Map<Long, BigDecimal>> officesRunningBalance = new HashMap<>();
|
||||
|
||||
List<Map<String, Object>> list = jdbcTemplate.queryForList(organizationRunningBalanceSql, entityDate, entityDate);
|
||||
for (Map<String, Object> entries : list) {
|
||||
@@ -139,7 +139,7 @@ public class JournalEntryRunningBalanceUpdateServiceImpl implements JournalEntry
|
||||
if (officesRunningBalance.containsKey(officeId)) {
|
||||
runningBalance = officesRunningBalance.get(officeId);
|
||||
} else {
|
||||
runningBalance = new HashMap<Long, BigDecimal>();
|
||||
runningBalance = new HashMap<>();
|
||||
officesRunningBalance.put(officeId, runningBalance);
|
||||
}
|
||||
if (!runningBalance.containsKey(accountId)) {
|
||||
@@ -157,7 +157,7 @@ public class JournalEntryRunningBalanceUpdateServiceImpl implements JournalEntry
|
||||
if (officesRunningBalance.containsKey(entryData.getOfficeId())) {
|
||||
officeRunningBalanceMap = officesRunningBalance.get(entryData.getOfficeId());
|
||||
} else {
|
||||
officeRunningBalanceMap = new HashMap<Long, BigDecimal>();
|
||||
officeRunningBalanceMap = new HashMap<>();
|
||||
officesRunningBalance.put(entryData.getOfficeId(), officeRunningBalanceMap);
|
||||
}
|
||||
BigDecimal officeRunningBalance = calculateRunningBalance(entryData, officeRunningBalanceMap);
|
||||
@@ -173,7 +173,7 @@ public class JournalEntryRunningBalanceUpdateServiceImpl implements JournalEntry
|
||||
|
||||
@Transactional
|
||||
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);
|
||||
for (Map<String, Object> entries : list) {
|
||||
|
||||
+3
-3
@@ -117,7 +117,7 @@ public class JournalEntryWritePlatformServiceJpaRepositoryImpl implements Journa
|
||||
validateBusinessRulesForJournalEntries(journalEntryCommand);
|
||||
|
||||
/** 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);
|
||||
|
||||
/** 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,
|
||||
final SingleDebitOrCreditEntryCommand[] debits) {
|
||||
// Validate the debit and credit arrays are appropriate accounts
|
||||
List<GLAccountDataForLookup> allowedCreditGLAccounts = new ArrayList<GLAccountDataForLookup>();
|
||||
List<GLAccountDataForLookup> allowedDebitGLAccounts = new ArrayList<GLAccountDataForLookup>();
|
||||
List<GLAccountDataForLookup> allowedCreditGLAccounts = new ArrayList<>();
|
||||
List<GLAccountDataForLookup> allowedDebitGLAccounts = new ArrayList<>();
|
||||
final SingleDebitOrCreditEntryCommand[] validCredits = new SingleDebitOrCreditEntryCommand[credits.length];
|
||||
final SingleDebitOrCreditEntryCommand[] validDebits = new SingleDebitOrCreditEntryCommand[debits.length];
|
||||
|
||||
|
||||
+1
-1
@@ -32,7 +32,7 @@ public enum PortfolioProductType {
|
||||
return this.code;
|
||||
}
|
||||
|
||||
private static final Map<Integer, PortfolioProductType> intToEnumMap = new HashMap<Integer, PortfolioProductType>();
|
||||
private static final Map<Integer, PortfolioProductType> intToEnumMap = new HashMap<>();
|
||||
static {
|
||||
for (final PortfolioProductType type : PortfolioProductType.values()) {
|
||||
intToEnumMap.put(type.value, type);
|
||||
|
||||
+2
-2
@@ -67,7 +67,7 @@ public final class ProductToGLAccountMappingFromApiJsonDeserializer {
|
||||
public void validateForLoanProductCreate(final String json) {
|
||||
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 JsonElement element = this.fromApiJsonHelper.parse(json);
|
||||
@@ -149,7 +149,7 @@ public final class ProductToGLAccountMappingFromApiJsonDeserializer {
|
||||
public void validateForSavingsProductCreate(final String json, DepositAccountType accountType) {
|
||||
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(SAVINGS_PRODUCT_RESOURCE_NAME);
|
||||
|
||||
|
||||
+13
-10
@@ -110,7 +110,7 @@ public class LoanProductToGLAccountMappingHelper extends ProductToGLAccountMappi
|
||||
|
||||
public Map<String, Object> populateChangesForNewLoanProductToGLAccountMappingCreation(final JsonElement element,
|
||||
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 loanPortfolioAccountId = this.fromApiJsonHelper.extractLongNamed(
|
||||
@@ -144,17 +144,18 @@ public class LoanProductToGLAccountMappingHelper extends ProductToGLAccountMappi
|
||||
break;
|
||||
case CASH_BASED:
|
||||
populateChangesForCashBasedAccounting(changes, fundAccountId, loanPortfolioAccountId, incomeFromInterestId,
|
||||
incomeFromFeeId, incomeFromPenaltyId, writeOffAccountId, overPaymentAccountId, transfersInSuspenseAccountId,incomeFromRecoveryAccountId);
|
||||
incomeFromFeeId, incomeFromPenaltyId, writeOffAccountId, overPaymentAccountId, transfersInSuspenseAccountId,
|
||||
incomeFromRecoveryAccountId);
|
||||
break;
|
||||
case ACCRUAL_PERIODIC:
|
||||
populateChangesForAccrualBasedAccounting(changes, fundAccountId, loanPortfolioAccountId, incomeFromInterestId,
|
||||
incomeFromFeeId, incomeFromPenaltyId, writeOffAccountId, overPaymentAccountId, transfersInSuspenseAccountId,incomeFromRecoveryAccountId,
|
||||
receivableInterestAccountId, receivableFeeAccountId, receivablePenaltyAccountId);
|
||||
incomeFromFeeId, incomeFromPenaltyId, writeOffAccountId, overPaymentAccountId, transfersInSuspenseAccountId,
|
||||
incomeFromRecoveryAccountId, receivableInterestAccountId, receivableFeeAccountId, receivablePenaltyAccountId);
|
||||
break;
|
||||
case ACCRUAL_UPFRONT:
|
||||
populateChangesForAccrualBasedAccounting(changes, fundAccountId, loanPortfolioAccountId, incomeFromInterestId,
|
||||
incomeFromFeeId, incomeFromPenaltyId, writeOffAccountId, overPaymentAccountId, transfersInSuspenseAccountId,incomeFromRecoveryAccountId,
|
||||
receivableInterestAccountId, receivableFeeAccountId, receivablePenaltyAccountId);
|
||||
incomeFromFeeId, incomeFromPenaltyId, writeOffAccountId, overPaymentAccountId, transfersInSuspenseAccountId,
|
||||
incomeFromRecoveryAccountId, receivableInterestAccountId, receivableFeeAccountId, receivablePenaltyAccountId);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -163,21 +164,23 @@ public class LoanProductToGLAccountMappingHelper extends ProductToGLAccountMappi
|
||||
|
||||
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 writeOffAccountId, final Long overPaymentAccountId, final Long transfersInSuspenseAccountId,final Long incomeFromRecoveryAccountId,
|
||||
final Long receivableInterestAccountId, final Long receivableFeeAccountId, final Long receivablePenaltyAccountId) {
|
||||
final Long writeOffAccountId, final Long overPaymentAccountId, final Long transfersInSuspenseAccountId,
|
||||
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.FEES_RECEIVABLE.getValue(), receivableFeeAccountId);
|
||||
changes.put(LOAN_PRODUCT_ACCOUNTING_PARAMS.PENALTIES_RECEIVABLE.getValue(), receivablePenaltyAccountId);
|
||||
|
||||
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,
|
||||
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.LOAN_PORTFOLIO.getValue(), loanPortfolioAccountId);
|
||||
changes.put(LOAN_PRODUCT_ACCOUNTING_PARAMS.INTEREST_ON_LOANS.getValue(), incomeFromInterestId);
|
||||
|
||||
+4
-4
@@ -175,12 +175,12 @@ public class ProductToGLAccountMappingHelper {
|
||||
* associated income Id's (value) extracted from the passed in
|
||||
* 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
|
||||
* Accounts in the system
|
||||
**/
|
||||
final Set<Long> existingCharges = new HashSet<Long>();
|
||||
final Set<Long> existingCharges = new HashSet<>();
|
||||
if (chargeToIncomeAccountMappingArray != null && chargeToIncomeAccountMappingArray.size() > 0) {
|
||||
if (changes != null) {
|
||||
changes.put(arrayFragmentName, command.jsonFragment(arrayFragmentName));
|
||||
@@ -253,12 +253,12 @@ public class ProductToGLAccountMappingHelper {
|
||||
* Variable stores a map representation of Payment channels (key) and
|
||||
* 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
|
||||
* 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 (changes != null) {
|
||||
changes.put(LOAN_PRODUCT_ACCOUNTING_PARAMS.PAYMENT_CHANNEL_FUND_SOURCE_MAPPING.getValue(),
|
||||
|
||||
+6
-6
@@ -69,7 +69,7 @@ public class ProductToGLAccountMappingReadPlatformServiceImpl implements Product
|
||||
final String chargeName = rs.getString("chargeName");
|
||||
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("glAccountId", glAccountId);
|
||||
loanProductToGLAccountMap.put("productId", productId);
|
||||
@@ -89,7 +89,7 @@ public class ProductToGLAccountMappingReadPlatformServiceImpl implements Product
|
||||
@Override
|
||||
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 String sql = "select " + rm.schema() + " and product_id = ? and payment_type is null and mapping.charge_id is null";
|
||||
@@ -127,7 +127,7 @@ public class ProductToGLAccountMappingReadPlatformServiceImpl implements Product
|
||||
accountMappingDetails.put(LOAN_PRODUCT_ACCOUNTING_DATA_PARAMS.OVERPAYMENT.getValue(), gLAccountData);
|
||||
} else if (glAccountForLoan.equals(CASH_ACCOUNTS_FOR_LOAN.INCOME_FROM_RECOVERY)) {
|
||||
accountMappingDetails.put(LOAN_PRODUCT_ACCOUNTING_DATA_PARAMS.INCOME_FROM_RECOVERY.getValue(), gLAccountData);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (AccountingRuleType.ACCRUAL_UPFRONT.getValue().equals(accountingType)
|
||||
|| AccountingRuleType.ACCRUAL_PERIODIC.getValue().equals(accountingType)) {
|
||||
@@ -175,7 +175,7 @@ public class ProductToGLAccountMappingReadPlatformServiceImpl implements Product
|
||||
|
||||
@Override
|
||||
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 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;
|
||||
for (final Map<String, Object> productToGLAccountMap : paymentTypeToFundSourceMappingsList) {
|
||||
if (paymentTypeToGLAccountMappers == null) {
|
||||
paymentTypeToGLAccountMappers = new ArrayList<PaymentTypeToGLAccountMapper>();
|
||||
paymentTypeToGLAccountMappers = new ArrayList<>();
|
||||
}
|
||||
final Long paymentTypeId = (Long) productToGLAccountMap.get("paymentTypeId");
|
||||
final String paymentTypeValue = (String) productToGLAccountMap.get("paymentTypeValue");
|
||||
@@ -296,7 +296,7 @@ public class ProductToGLAccountMappingReadPlatformServiceImpl implements Product
|
||||
List<ChargeToGLAccountMapper> chargeToGLAccountMappers = null;
|
||||
for (final Map<String, Object> chargeToIncomeAccountMap : chargeToFundSourceMappingsList) {
|
||||
if (chargeToGLAccountMappers == null) {
|
||||
chargeToGLAccountMappers = new ArrayList<ChargeToGLAccountMapper>();
|
||||
chargeToGLAccountMappers = new ArrayList<>();
|
||||
}
|
||||
final Long glAccountId = (Long) chargeToIncomeAccountMap.get("glAccountId");
|
||||
final String glAccountName = (String) chargeToIncomeAccountMap.get("glAccountName");
|
||||
|
||||
+2
-2
@@ -225,7 +225,7 @@ public class ProductToGLAccountMappingWritePlatformServiceImpl implements Produc
|
||||
* Variable tracks all accounting mapping properties that have been
|
||||
* updated
|
||||
***/
|
||||
Map<String, Object> changes = new HashMap<String, Object>();
|
||||
Map<String, Object> changes = new HashMap<>();
|
||||
final JsonElement element = this.fromApiJsonHelper.parse(command.json());
|
||||
final AccountingRuleType accountingRuleType = AccountingRuleType.fromInt(accountingRuleTypeId);
|
||||
|
||||
@@ -256,7 +256,7 @@ public class ProductToGLAccountMappingWritePlatformServiceImpl implements Produc
|
||||
* Variable tracks all accounting mapping properties that have been
|
||||
* updated
|
||||
***/
|
||||
Map<String, Object> changes = new HashMap<String, Object>();
|
||||
Map<String, Object> changes = new HashMap<>();
|
||||
final JsonElement element = this.fromApiJsonHelper.parse(command.json());
|
||||
final AccountingRuleType accountingRuleType = AccountingRuleType.fromInt(accountingRuleTypeId);
|
||||
|
||||
|
||||
+1
-1
@@ -110,7 +110,7 @@ public class SavingsProductToGLAccountMappingHelper extends ProductToGLAccountMa
|
||||
|
||||
public Map<String, Object> populateChangesForNewSavingsProductToGLAccountMappingCreation(final JsonElement element,
|
||||
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(
|
||||
SAVINGS_PRODUCT_ACCOUNTING_PARAMS.SAVINGS_REFERENCE.getValue(), element);
|
||||
|
||||
+3
-3
@@ -55,7 +55,7 @@ import org.springframework.stereotype.Component;
|
||||
@Scope("singleton")
|
||||
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",
|
||||
"allowedDebitTagOptions", "debitTags", "creditTags", "creditAccounts", "debitAccounts", "allowMultipleCreditEntries",
|
||||
"allowMultipleDebitEntries", "tag"));
|
||||
@@ -232,8 +232,8 @@ public class AccountingRuleApiResource {
|
||||
|
||||
private Collection<CodeValueData> retrieveSelectedTags(final Collection<CodeValueData> allowedTagOptions,
|
||||
final List<AccountingTagRuleData> existedTags) {
|
||||
final Collection<CodeValueData> tempOptions = new ArrayList<CodeValueData>(allowedTagOptions);
|
||||
final Map<Long, CodeValueData> selectedTags = new HashMap<Long, CodeValueData>();
|
||||
final Collection<CodeValueData> tempOptions = new ArrayList<>(allowedTagOptions);
|
||||
final Map<Long, CodeValueData> selectedTags = new HashMap<>();
|
||||
for (final AccountingTagRuleData accountingTagRuleData : existedTags) {
|
||||
for (final CodeValueData codeValueData : tempOptions) {
|
||||
if (codeValueData.getId().equals(accountingTagRuleData.getTag().getId())) {
|
||||
|
||||
+1
-1
@@ -22,7 +22,7 @@ public enum AccountingRuleJsonInputParams {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
private static final Set<String> values = new HashSet<String>();
|
||||
private static final Set<String> values = new HashSet<>();
|
||||
static {
|
||||
for (final AccountingRuleJsonInputParams type : AccountingRuleJsonInputParams.values()) {
|
||||
values.add(type.value);
|
||||
|
||||
+5
-5
@@ -58,7 +58,7 @@ public class AccountingRule extends AbstractPersistable<Long> {
|
||||
|
||||
@LazyCollection(LazyCollectionOption.FALSE)
|
||||
@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)
|
||||
private boolean allowMultipleCreditEntries;
|
||||
@@ -94,7 +94,7 @@ public class AccountingRule extends AbstractPersistable<Long> {
|
||||
}
|
||||
|
||||
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
|
||||
: this.office.getId());
|
||||
handlePropertyUpdate(command, actualChanges, AccountingRuleJsonInputParams.ACCOUNT_TO_DEBIT.getValue(),
|
||||
@@ -219,8 +219,8 @@ public class AccountingRule extends AbstractPersistable<Long> {
|
||||
}
|
||||
|
||||
public void updateTags(final JournalEntryType type) {
|
||||
final Set<AccountingTagRule> existedCreditTags = new HashSet<AccountingTagRule>();
|
||||
final Set<AccountingTagRule> existedDebitTags = new HashSet<AccountingTagRule>();
|
||||
final Set<AccountingTagRule> existedCreditTags = new HashSet<>();
|
||||
final Set<AccountingTagRule> existedDebitTags = new HashSet<>();
|
||||
for (final AccountingTagRule accountingTagRule : this.accountingTagRules) {
|
||||
if (accountingTagRule.isCreditAccount()) {
|
||||
existedCreditTags.add(accountingTagRule);
|
||||
@@ -238,7 +238,7 @@ public class AccountingRule extends AbstractPersistable<Long> {
|
||||
}
|
||||
|
||||
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) {
|
||||
if (accountingTagRule.getAccountType().equals(type.getValue())) {
|
||||
existedTags.add(accountingTagRule);
|
||||
|
||||
+2
-2
@@ -47,7 +47,7 @@ public class AccountingRuleCommandFromApiJsonDeserializer {
|
||||
final Type typeOfMap = new TypeToken<Map<String, Object>>() {}.getType();
|
||||
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 JsonElement element = this.fromApiJsonHelper.parse(json);
|
||||
@@ -149,7 +149,7 @@ public class AccountingRuleCommandFromApiJsonDeserializer {
|
||||
final Type typeOfMap = new TypeToken<Map<String, Object>>() {}.getType();
|
||||
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 JsonElement element = this.fromApiJsonHelper.parse(json);
|
||||
|
||||
+4
-4
@@ -76,7 +76,7 @@ public class AccountingRuleReadPlatformServiceImpl implements AccountingRuleRead
|
||||
|
||||
@Override
|
||||
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()) {
|
||||
final Long id = rs.getLong("id");
|
||||
@@ -110,7 +110,7 @@ public class AccountingRuleReadPlatformServiceImpl implements AccountingRuleRead
|
||||
creditTags = null;
|
||||
final GLAccountDataForLookup creditAccount = new GLAccountDataForLookup(accountToCreditId, creditAccountName,
|
||||
creditAccountGLCode);
|
||||
creditAccounts = new ArrayList<GLAccountDataForLookup>(Arrays.asList(creditAccount));
|
||||
creditAccounts = new ArrayList<>(Arrays.asList(creditAccount));
|
||||
}
|
||||
if (accountToDebitId == null) {
|
||||
debitTags = !this.isAssociationParametersExists ? getCreditOrDebitTags(id, JournalEntryType.DEBIT.getValue())
|
||||
@@ -121,7 +121,7 @@ public class AccountingRuleReadPlatformServiceImpl implements AccountingRuleRead
|
||||
debitTags = null;
|
||||
final GLAccountDataForLookup debitAccount = new GLAccountDataForLookup(accountToDebitId, debitAccountName,
|
||||
debitAccountGLCode);
|
||||
debitAccounts = new ArrayList<GLAccountDataForLookup>(Arrays.asList(debitAccount));
|
||||
debitAccounts = new ArrayList<>(Arrays.asList(debitAccount));
|
||||
}
|
||||
accountingRuleData = new AccountingRuleData(id, officeId, officeName, name, description, systemDefined,
|
||||
allowMultipleDebitEntries, allowMultipleCreditEntries, creditTags, debitTags, creditAccounts, debitAccounts);
|
||||
@@ -153,7 +153,7 @@ public class AccountingRuleReadPlatformServiceImpl implements AccountingRuleRead
|
||||
}
|
||||
sql = sql + " order by rule.id asc";
|
||||
final Map<Long, AccountingRuleData> extractedData = this.jdbcTemplate.query(sql, resultSetExtractor, arguments);
|
||||
return new ArrayList<AccountingRuleData>(extractedData.values());
|
||||
return new ArrayList<>(extractedData.values());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+10
-10
@@ -112,8 +112,8 @@ public class AccountingRuleWritePlatformServiceJpaRepositoryImpl implements Acco
|
||||
// get the GL Accounts or tags to Debit and Credit
|
||||
final String[] debitTags = command.arrayValueOfParameterNamed(AccountingRuleJsonInputParams.DEBIT_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> incomingCreditTags = creditTags == null ? new HashSet<String>() : new HashSet<String>(Arrays.asList(creditTags));
|
||||
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<>(Arrays.asList(creditTags));
|
||||
final Long accountToDebitId = command.longValueOfParameterNamed(AccountingRuleJsonInputParams.ACCOUNT_TO_DEBIT.getValue());
|
||||
final Long accountToCreditId = command.longValueOfParameterNamed(AccountingRuleJsonInputParams.ACCOUNT_TO_CREDIT.getValue());
|
||||
|
||||
@@ -121,7 +121,7 @@ public class AccountingRuleWritePlatformServiceJpaRepositoryImpl implements Acco
|
||||
boolean allowMultipleDebitEntries = false;
|
||||
GLAccount debitAccount = null;
|
||||
GLAccount creditAccount = null;
|
||||
List<AccountingTagRule> accountingTagRules = new ArrayList<AccountingTagRule>();
|
||||
List<AccountingTagRule> accountingTagRules = new ArrayList<>();
|
||||
|
||||
if ((accountToDebitId != null && debitTags != null) || (accountToDebitId == null && debitTags == null)) {
|
||||
throw new AccountingRuleDataException(AccountingRuleJsonInputParams.ACCOUNT_TO_DEBIT.getValue(),
|
||||
@@ -226,7 +226,7 @@ public class AccountingRuleWritePlatformServiceJpaRepositoryImpl implements Acco
|
||||
accountingRule);
|
||||
|
||||
if (!creditTagsToAdd.isEmpty()) {
|
||||
List<AccountingTagRule> accountingTagRules = new ArrayList<AccountingTagRule>();
|
||||
List<AccountingTagRule> accountingTagRules = new ArrayList<>();
|
||||
accountingTagRules = saveDebitOrCreditTags(creditTagsToAdd, JournalEntryType.CREDIT, accountingTagRules);
|
||||
accountingRule.updateAccountingRuleForTags(accountingTagRules);
|
||||
accountingRule.updateCreditAccount(null);
|
||||
@@ -243,7 +243,7 @@ public class AccountingRuleWritePlatformServiceJpaRepositoryImpl implements Acco
|
||||
final Set<String> debitTagsToAdd = determineCreditTagToAddAndRemoveOldTags(debitTags, JournalEntryType.DEBIT,
|
||||
accountingRule);
|
||||
if (!debitTagsToAdd.isEmpty()) {
|
||||
List<AccountingTagRule> accountingTagRules = new ArrayList<AccountingTagRule>();
|
||||
List<AccountingTagRule> accountingTagRules = new ArrayList<>();
|
||||
accountingTagRules = saveDebitOrCreditTags(debitTagsToAdd, JournalEntryType.DEBIT, accountingTagRules);
|
||||
accountingRule.updateAccountingRuleForTags(accountingTagRules);
|
||||
accountingRule.updateDebitAccount(null);
|
||||
@@ -276,12 +276,12 @@ public class AccountingRuleWritePlatformServiceJpaRepositoryImpl implements Acco
|
||||
private Set<String> determineCreditTagToAddAndRemoveOldTags(final String[] creditOrDebitTags, final JournalEntryType type,
|
||||
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<String> existingTagIds = retrieveExistingTagIds(existingTags);
|
||||
final Set<String> tagsToAdd = new HashSet<String>();
|
||||
final Set<String> tagsToAdd = new HashSet<>();
|
||||
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) {
|
||||
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;
|
||||
}
|
||||
|
||||
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) {
|
||||
existingCreditTagIds.add(accountingTagRule.getTagId().toString());
|
||||
}
|
||||
|
||||
+2
-2
@@ -40,7 +40,7 @@ import org.springframework.stereotype.Component;
|
||||
@Scope("singleton")
|
||||
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",
|
||||
"groupLevelName", "groupName", "clientName", "loanAccountNo", "savingsAccountNo", "clientId", "loanId", "url"));
|
||||
|
||||
@@ -123,7 +123,7 @@ public class AuditsApiResource {
|
||||
|
||||
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"));
|
||||
|
||||
return this.toApiJsonSerializerSearchTemplate.serialize(settings, auditSearchData, RESPONSE_DATA_PARAMETERS_SEARCH_TEMPLATE);
|
||||
|
||||
+2
-2
@@ -42,7 +42,7 @@ import org.springframework.stereotype.Component;
|
||||
@Scope("singleton")
|
||||
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",
|
||||
"groupLevelName", "groupName", "clientName", "loanAccountNo", "savingsAccountNo", "clientId", "loanId"));
|
||||
|
||||
@@ -95,7 +95,7 @@ public class MakercheckersApiResource {
|
||||
|
||||
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"));
|
||||
|
||||
return this.toApiJsonSerializerSearchTemplate.serialize(settings, auditSearchData, RESPONSE_DATA_PARAMETERS_SEARCH_TEMPLATE);
|
||||
|
||||
+7
-7
@@ -62,9 +62,9 @@ import com.google.gson.JsonObject;
|
||||
public class AuditReadPlatformServiceImpl implements AuditReadPlatformService {
|
||||
|
||||
private final static Logger logger = LoggerFactory.getLogger(AuditReadPlatformServiceImpl.class);
|
||||
private final static Set<String> supportedOrderByValues = new HashSet<String>(Arrays.asList("id", "actionName", "entityName",
|
||||
"resourceId", "subresourceId", "madeOnDate", "checkedOnDate", "officeName", "groupName", "clientName", "loanAccountNo",
|
||||
"savingsAccountNo", "clientId", "loanId"));
|
||||
private final static Set<String> supportedOrderByValues = new HashSet<>(Arrays.asList("id", "actionName", "entityName", "resourceId",
|
||||
"subresourceId", "madeOnDate", "checkedOnDate", "officeName", "groupName", "clientName", "loanAccountNo", "savingsAccountNo",
|
||||
"clientId", "loanId"));
|
||||
|
||||
private final JdbcTemplate jdbcTemplate;
|
||||
private final PlatformSecurityContext context;
|
||||
@@ -74,7 +74,7 @@ public class AuditReadPlatformServiceImpl implements AuditReadPlatformService {
|
||||
private final ClientReadPlatformService clientReadPlatformService;
|
||||
private final LoanProductReadPlatformService loanProductReadPlatformService;
|
||||
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 SavingsProductReadPlatformService savingsProductReadPlatformService;
|
||||
private final DepositProductReadPlatformService depositProductReadPlatformService;
|
||||
@@ -377,7 +377,7 @@ public class AuditReadPlatformServiceImpl implements AuditReadPlatformService {
|
||||
private void updateEnumerations(Map<String, Object> commandAsJsonMap, JsonObject auditObject, String entityName) {
|
||||
|
||||
if (entityName.equalsIgnoreCase("LOAN") || entityName.equalsIgnoreCase("LOANPRODUCT")) {
|
||||
|
||||
|
||||
final String[] enumTypes = { "loanTermFrequencyType", "termFrequencyType", "repaymentFrequencyType", "amortizationType",
|
||||
"interestType", "interestCalculationPeriodType", "interestRateFrequencyType", "accountingRule" };
|
||||
|
||||
@@ -394,7 +394,7 @@ public class AuditReadPlatformServiceImpl implements AuditReadPlatformService {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
} else if (entityName.equalsIgnoreCase("SAVINGSPRODUCT") || entityName.equalsIgnoreCase("SAVINGSACCOUNT")
|
||||
|| entityName.equalsIgnoreCase("RECURRINGDEPOSITPRODUCT") || entityName.equalsIgnoreCase("RECURRINGDEPOSITACCOUNT")
|
||||
|| entityName.equalsIgnoreCase("FIXEDDEPOSITPRODUCT") || entityName.equalsIgnoreCase("FIXEDDEPOSITACCOUNT")) {
|
||||
@@ -416,7 +416,7 @@ public class AuditReadPlatformServiceImpl implements AuditReadPlatformService {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Vendored
+1
-1
@@ -8,6 +8,6 @@ public class CacheApiConstants {
|
||||
|
||||
public static final String RESOURCE_NAME = "CACHE";
|
||||
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));
|
||||
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -41,7 +41,7 @@ import org.springframework.stereotype.Component;
|
||||
@Scope("singleton")
|
||||
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 PlatformSecurityContext context;
|
||||
|
||||
+1
-1
@@ -49,7 +49,7 @@ public class UpdateCacheCommandHandler implements NewCommandSourceHandler {
|
||||
final Type typeOfMap = new TypeToken<Map<String, Object>>() {}.getType();
|
||||
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)
|
||||
.resource(CacheApiConstants.RESOURCE_NAME.toLowerCase());
|
||||
|
||||
|
||||
Vendored
+1
-1
@@ -18,7 +18,7 @@ public enum CacheType {
|
||||
private final Integer value;
|
||||
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 {
|
||||
for (final CacheType type : CacheType.values()) {
|
||||
|
||||
+1
-1
@@ -71,7 +71,7 @@ public class RuntimeDelegatingCacheManager implements CacheManager {
|
||||
|
||||
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 distributedCacheEnabled = !ehcacheEnabled;
|
||||
|
||||
+1
-1
@@ -23,7 +23,7 @@ public class CodeConstants {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
private static final Set<String> values = new HashSet<String>();
|
||||
private static final Set<String> values = new HashSet<>();
|
||||
static {
|
||||
for (final CODEVALUE_JSON_INPUT_PARAMS type : CODEVALUE_JSON_INPUT_PARAMS.values()) {
|
||||
values.add(type.value);
|
||||
|
||||
+1
-1
@@ -45,7 +45,7 @@ public class CodeValuesApiResource {
|
||||
/**
|
||||
* 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 PlatformSecurityContext context;
|
||||
|
||||
+1
-1
@@ -44,7 +44,7 @@ public class CodesApiResource {
|
||||
/**
|
||||
* 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 PlatformSecurityContext context;
|
||||
|
||||
+1
-1
@@ -61,7 +61,7 @@ public class Code extends AbstractPersistable<Long> {
|
||||
|
||||
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";
|
||||
if (command.isChangeInStringParameterNamed(firstnameParamName, this.name)) {
|
||||
|
||||
+1
-1
@@ -69,7 +69,7 @@ public class CodeValue extends AbstractPersistable<Long> {
|
||||
|
||||
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();
|
||||
if (command.isChangeInStringParameterNamed(labelParamName, this.label)) {
|
||||
|
||||
+3
-3
@@ -34,7 +34,7 @@ public final class CodeCommandFromApiJsonDeserializer {
|
||||
/**
|
||||
* 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;
|
||||
|
||||
@Autowired
|
||||
@@ -48,7 +48,7 @@ public final class CodeCommandFromApiJsonDeserializer {
|
||||
final Type typeOfMap = new TypeToken<Map<String, Object>>() {}.getType();
|
||||
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 JsonElement element = this.fromApiJsonHelper.parse(json);
|
||||
@@ -65,7 +65,7 @@ public final class CodeCommandFromApiJsonDeserializer {
|
||||
final Type typeOfMap = new TypeToken<Map<String, Object>>() {}.getType();
|
||||
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 JsonElement element = this.fromApiJsonHelper.parse(json);
|
||||
|
||||
+2
-2
@@ -47,7 +47,7 @@ public final class CodeValueCommandFromApiJsonDeserializer {
|
||||
final Type typeOfMap = new TypeToken<Map<String, Object>>() {}.getType();
|
||||
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 JsonElement element = this.fromApiJsonHelper.parse(json);
|
||||
@@ -69,7 +69,7 @@ public final class CodeValueCommandFromApiJsonDeserializer {
|
||||
final Type typeOfMap = new TypeToken<Map<String, Object>>() {}.getType();
|
||||
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 JsonElement element = this.fromApiJsonHelper.parse(json);
|
||||
|
||||
+1
-1
@@ -11,6 +11,6 @@ public class GlobalConfigurationApiConstant {
|
||||
public static final String ID = "id";
|
||||
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));
|
||||
|
||||
}
|
||||
|
||||
+1
-1
@@ -34,7 +34,7 @@ import org.springframework.stereotype.Component;
|
||||
@Scope("singleton")
|
||||
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";
|
||||
|
||||
|
||||
+1
-1
@@ -40,7 +40,7 @@ public class GlobalConfigurationDataValidator {
|
||||
final Type typeOfMap = new TypeToken<Map<String, Object>>() {}.getType();
|
||||
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 JsonElement element = this.fromApiJsonHelper.parse(json);
|
||||
|
||||
|
||||
+1
-1
@@ -56,7 +56,7 @@ public class GlobalConfigurationProperty extends AbstractPersistable<Long> {
|
||||
|
||||
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";
|
||||
if (command.isChangeInBooleanParameterNamed(enabledParamName, this.enabled)) {
|
||||
|
||||
+1
-1
@@ -33,7 +33,7 @@ public final class GlobalConfigurationCommandFromApiJsonDeserializer extends
|
||||
/**
|
||||
* 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;
|
||||
|
||||
@Autowired
|
||||
|
||||
+5
-5
@@ -32,24 +32,24 @@ public class ApiParameterHelper {
|
||||
}
|
||||
|
||||
public static Set<String> extractFieldsForResponseIfProvided(final MultivaluedMap<String, String> queryParams) {
|
||||
Set<String> fields = new HashSet<String>();
|
||||
Set<String> fields = new HashSet<>();
|
||||
String commaSerperatedParameters = "";
|
||||
if (queryParams.getFirst("fields") != null) {
|
||||
commaSerperatedParameters = queryParams.getFirst("fields");
|
||||
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;
|
||||
}
|
||||
|
||||
public static Set<String> extractAssociationsForResponseIfProvided(final MultivaluedMap<String, String> queryParams) {
|
||||
Set<String> fields = new HashSet<String>();
|
||||
Set<String> fields = new HashSet<>();
|
||||
String commaSerperatedParameters = "";
|
||||
if (queryParams.getFirst("associations") != null) {
|
||||
commaSerperatedParameters = queryParams.getFirst("associations");
|
||||
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;
|
||||
@@ -148,7 +148,7 @@ public class ApiParameterHelper {
|
||||
|
||||
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()) {
|
||||
final List<String> values = queryParameters.get(parameterName);
|
||||
|
||||
+7
-7
@@ -44,7 +44,7 @@ public class ApiGlobalErrorResponse {
|
||||
* they be needed. Typically used to express data validation errors with
|
||||
* parameters passed to API.
|
||||
*/
|
||||
private List<ApiParameterError> errors = new ArrayList<ApiParameterError>();
|
||||
private List<ApiParameterError> errors = new ArrayList<>();
|
||||
|
||||
public static ApiGlobalErrorResponse unAuthenticated() {
|
||||
|
||||
@@ -76,7 +76,7 @@ public class ApiGlobalErrorResponse {
|
||||
globalErrorResponse.setUserMessageGlobalisationCode("error.msg.not.authorized");
|
||||
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));
|
||||
globalErrorResponse.setErrors(errors);
|
||||
|
||||
@@ -91,7 +91,7 @@ public class ApiGlobalErrorResponse {
|
||||
globalErrorResponse.setUserMessageGlobalisationCode("validation.msg.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));
|
||||
globalErrorResponse.setErrors(errors);
|
||||
|
||||
@@ -107,7 +107,7 @@ public class ApiGlobalErrorResponse {
|
||||
globalErrorResponse.setUserMessageGlobalisationCode("error.msg.resource.not.found");
|
||||
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));
|
||||
globalErrorResponse.setErrors(errors);
|
||||
|
||||
@@ -123,7 +123,7 @@ public class ApiGlobalErrorResponse {
|
||||
globalErrorResponse.setUserMessageGlobalisationCode(globalisationMessageCode);
|
||||
globalErrorResponse.setDefaultUserMessage(defaultUserMessage);
|
||||
|
||||
final List<ApiParameterError> errors = new ArrayList<ApiParameterError>();
|
||||
final List<ApiParameterError> errors = new ArrayList<>();
|
||||
errors.add(ApiParameterError.parameterError(globalisationMessageCode, defaultUserMessage, parameterName, defaultUserMessageArgs));
|
||||
globalErrorResponse.setErrors(errors);
|
||||
|
||||
@@ -154,7 +154,7 @@ public class ApiGlobalErrorResponse {
|
||||
globalErrorResponse.setUserMessageGlobalisationCode("error.msg.platform.server.side.error");
|
||||
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));
|
||||
globalErrorResponse.setErrors(errors);
|
||||
|
||||
@@ -170,7 +170,7 @@ public class ApiGlobalErrorResponse {
|
||||
globalErrorResponse.setUserMessageGlobalisationCode("error.msg.platform.service.unavailable");
|
||||
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));
|
||||
globalErrorResponse.setErrors(errors);
|
||||
|
||||
|
||||
+2
-2
@@ -42,7 +42,7 @@ public class ApiParameterError {
|
||||
/**
|
||||
* 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,
|
||||
final Object... defaultUserMessageArgs) {
|
||||
@@ -70,7 +70,7 @@ public class ApiParameterError {
|
||||
this.developerMessage = defaultUserMessage;
|
||||
this.defaultUserMessage = defaultUserMessage;
|
||||
|
||||
final List<ApiErrorMessageArg> messageArgs = new ArrayList<ApiErrorMessageArg>();
|
||||
final List<ApiErrorMessageArg> messageArgs = new ArrayList<>();
|
||||
if (defaultUserMessageArgs != null) {
|
||||
for (final Object object : defaultUserMessageArgs) {
|
||||
messageArgs.add(ApiErrorMessageArg.from(object));
|
||||
|
||||
+1
-1
@@ -81,7 +81,7 @@ public class CommandProcessingResult {
|
||||
this.loanId = null;
|
||||
this.savingsId = null;
|
||||
this.transactionId = null;
|
||||
this.changes = new HashMap<String, Object>();
|
||||
this.changes = new HashMap<>();
|
||||
this.productId = null;
|
||||
this.subResourceId = null;
|
||||
}
|
||||
|
||||
+2
-2
@@ -17,11 +17,11 @@ import org.springframework.stereotype.Component;
|
||||
@Component
|
||||
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) {
|
||||
|
||||
final List<ApiParameterError> dataValidationErrors = new ArrayList<ApiParameterError>();
|
||||
final List<ApiParameterError> dataValidationErrors = new ArrayList<>();
|
||||
|
||||
if (parameters.isOrderByRequested() && !supportedOrdeByValues.contains(parameters.getOrderBy())) {
|
||||
final String defaultUserMessage = "The orderBy value '" + parameters.getOrderBy()
|
||||
|
||||
+1
-1
@@ -47,7 +47,7 @@ public class UnrecognizedQueryParamExceptionMapper implements ExceptionMapper<Un
|
||||
final ApiParameterError error = ApiParameterError.parameterError(validationErrorCode.toString(), defaultEnglishMessage.toString(),
|
||||
parameterName, parameterName, parameterValue, exception.getSupportedParams());
|
||||
|
||||
final List<ApiParameterError> errors = new ArrayList<ApiParameterError>();
|
||||
final List<ApiParameterError> errors = new ArrayList<>();
|
||||
errors.add(error);
|
||||
|
||||
final ApiGlobalErrorResponse invalidParameterError = ApiGlobalErrorResponse.badClientRequest(
|
||||
|
||||
+1
-1
@@ -32,7 +32,7 @@ public class UnsupportedCommandExceptionMapper implements ExceptionMapper<Unsupp
|
||||
@Override
|
||||
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 defaultEnglishMessage = new StringBuilder("The command ").append(exception.getUnsupportedCommandName()).append(
|
||||
|
||||
+1
-1
@@ -32,7 +32,7 @@ public class UnsupportedParameterExceptionMapper implements ExceptionMapper<Unsu
|
||||
@Override
|
||||
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()) {
|
||||
final StringBuilder validationErrorCode = new StringBuilder("error.msg.parameter.unsupported");
|
||||
|
||||
+8
-8
@@ -34,17 +34,17 @@ public class DatatableCommandFromApiJsonDeserializer {
|
||||
/**
|
||||
* 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"));
|
||||
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"));
|
||||
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"));
|
||||
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"));
|
||||
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"));
|
||||
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[] supportedApptableNames = { "m_loan", "m_savings_account", "m_client", "m_group", "m_center", "m_office",
|
||||
"m_savings_product", "m_product_loan" };
|
||||
@@ -97,7 +97,7 @@ public class DatatableCommandFromApiJsonDeserializer {
|
||||
final Type typeOfMap = new TypeToken<Map<String, Object>>() {}.getType();
|
||||
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 JsonElement element = this.fromApiJsonHelper.parse(json);
|
||||
@@ -147,7 +147,7 @@ public class DatatableCommandFromApiJsonDeserializer {
|
||||
final Type typeOfMap = new TypeToken<Map<String, Object>>() {}.getType();
|
||||
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 JsonElement element = this.fromApiJsonHelper.parse(json);
|
||||
|
||||
+6
-6
@@ -73,7 +73,7 @@ public class FromJsonHelper {
|
||||
|
||||
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()) {
|
||||
if (!supportedParams.contains(providedParameter)) {
|
||||
unsupportedParameterList.add(providedParameter);
|
||||
@@ -87,7 +87,7 @@ public class FromJsonHelper {
|
||||
if (object == null) { throw new InvalidParameterException(); }
|
||||
|
||||
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) {
|
||||
if (!supportedParams.contains(providedParameter.getKey())) {
|
||||
@@ -227,8 +227,8 @@ public class FromJsonHelper {
|
||||
return this.helperDelegator.extractMonthDayFormatParameter(element);
|
||||
}
|
||||
|
||||
public Gson getGsonConverter() {
|
||||
return this.gsonConverter;
|
||||
}
|
||||
|
||||
public Gson getGsonConverter() {
|
||||
return this.gsonConverter;
|
||||
}
|
||||
|
||||
}
|
||||
+3
-3
@@ -58,16 +58,16 @@ public final class GoogleGsonSerializerHelper {
|
||||
public Gson createGsonBuilderWithParameterExclusionSerializationStrategy(final Set<String> supportedParameters,
|
||||
final boolean prettyPrint, final Set<String> responseParameters) {
|
||||
|
||||
final Set<String> parameterNamesToSkip = new HashSet<String>();
|
||||
final Set<String> parameterNamesToSkip = new HashSet<>();
|
||||
|
||||
if (!responseParameters.isEmpty()) {
|
||||
|
||||
// strip out all known support parameters from expected response to
|
||||
// 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);
|
||||
|
||||
if (!differentParametersDetectedSet.isEmpty()) { throw new UnsupportedParameterException(new ArrayList<String>(
|
||||
if (!differentParametersDetectedSet.isEmpty()) { throw new UnsupportedParameterException(new ArrayList<>(
|
||||
differentParametersDetectedSet)); }
|
||||
|
||||
parameterNamesToSkip.addAll(supportedParameters);
|
||||
|
||||
+10
-10
@@ -298,7 +298,7 @@ public class JsonParserHelper {
|
||||
final DateTimeFormatter formatter = DateTimeFormat.forPattern(dateFormat).withLocale(clientApplicationLocale);
|
||||
value = MonthDay.parse(valueAsString.toLowerCase(clientApplicationLocale), formatter);
|
||||
} 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",
|
||||
"The parameter " + parameterName + " is invalid based on the monthDayFormat: '" + dateFormat
|
||||
+ "' and locale: '" + clientApplicationLocale + "' provided:", parameterName, valueAsString,
|
||||
@@ -356,7 +356,7 @@ public class JsonParserHelper {
|
||||
|
||||
if (StringUtils.isBlank(dateFormat) || clientApplicationLocale == null) {
|
||||
|
||||
final List<ApiParameterError> dataValidationErrors = new ArrayList<ApiParameterError>();
|
||||
final List<ApiParameterError> dataValidationErrors = new ArrayList<>();
|
||||
if (StringUtils.isBlank(dateFormat)) {
|
||||
final String defaultMessage = new StringBuilder("The parameter '" + parameterName
|
||||
+ "' requires a 'dateFormat' parameter to be passed with it.").toString();
|
||||
@@ -382,7 +382,7 @@ public class JsonParserHelper {
|
||||
eventLocalDate = DateTimeFormat.forPattern(dateFormat).withLocale(clientApplicationLocale)
|
||||
.parseLocalDate(dateAsString.toLowerCase(clientApplicationLocale));
|
||||
} 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 "
|
||||
+ parameterName + " is invalid based on the dateFormat: '" + dateFormat + "' and locale: '"
|
||||
+ clientApplicationLocale + "' provided:", parameterName, dateAsString, dateFormat);
|
||||
@@ -400,7 +400,7 @@ public class JsonParserHelper {
|
||||
|
||||
if (clientApplicationLocale == null) {
|
||||
|
||||
final List<ApiParameterError> dataValidationErrors = new ArrayList<ApiParameterError>();
|
||||
final List<ApiParameterError> dataValidationErrors = new ArrayList<>();
|
||||
final String defaultMessage = new StringBuilder("The parameter '" + parameterName
|
||||
+ "' requires a 'locale' parameter to be passed with it.").toString();
|
||||
final ApiParameterError error = ApiParameterError.parameterError("validation.msg.missing.locale.parameter", defaultMessage,
|
||||
@@ -445,7 +445,7 @@ public class JsonParserHelper {
|
||||
return number;
|
||||
} 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 "
|
||||
+ parameterName + " has value: " + numericalValueFormatted + " which is invalid integer value for provided locale of ["
|
||||
+ clientApplicationLocale.toString() + "].", parameterName, numericalValueFormatted, clientApplicationLocale);
|
||||
@@ -469,7 +469,7 @@ public class JsonParserHelper {
|
||||
return number;
|
||||
} 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 "
|
||||
+ parameterName + " has value: " + numericalValueFormatted + " which is invalid integer.", parameterName,
|
||||
numericalValueFormatted);
|
||||
@@ -485,7 +485,7 @@ public class JsonParserHelper {
|
||||
|
||||
if (clientApplicationLocale == null) {
|
||||
|
||||
final List<ApiParameterError> dataValidationErrors = new ArrayList<ApiParameterError>();
|
||||
final List<ApiParameterError> dataValidationErrors = new ArrayList<>();
|
||||
final String defaultMessage = new StringBuilder("The parameter '" + parameterName
|
||||
+ "' requires a 'locale' parameter to be passed with it.").toString();
|
||||
final ApiParameterError error = ApiParameterError.parameterError("validation.msg.missing.locale.parameter", defaultMessage,
|
||||
@@ -524,7 +524,7 @@ public class JsonParserHelper {
|
||||
return number;
|
||||
} 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 "
|
||||
+ parameterName + " has value: " + numericalValueFormatted + " which is invalid decimal value for provided locale of ["
|
||||
+ clientApplicationLocale.toString() + "].", parameterName, numericalValueFormatted, clientApplicationLocale);
|
||||
@@ -540,7 +540,7 @@ public class JsonParserHelper {
|
||||
public static Locale localeFromString(final String 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",
|
||||
"The parameter locale is invalid. It cannot be blank.", "locale");
|
||||
dataValidationErrors.add(error);
|
||||
@@ -575,7 +575,7 @@ public class JsonParserHelper {
|
||||
|
||||
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());
|
||||
if (!allowedLanguages.contains(languageCode.toLowerCase())) {
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user