Merge categories into one file, add some new ones
This commit is contained in:
@@ -3,7 +3,7 @@ package entities;
|
|||||||
public class Categories {
|
public class Categories {
|
||||||
|
|
||||||
public enum ExpenseCategory {
|
public enum ExpenseCategory {
|
||||||
MISC;
|
CREDIT, BUY, BUSINESS, ENTERTAINMENT, RESTAURANTS_AND_CAFE, COMMUNAL_PAYMENTS, SUPERMARKET, MISC;
|
||||||
|
|
||||||
public String getEffectiveName() {
|
public String getEffectiveName() {
|
||||||
return Categories.getEffectiveName(this.name());
|
return Categories.getEffectiveName(this.name());
|
||||||
@@ -11,7 +11,7 @@ public class Categories {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public enum IncomeCategory {
|
public enum IncomeCategory {
|
||||||
MISC;
|
P2P, SALARY, GIFT, CREDIT, MISC;
|
||||||
|
|
||||||
public String getEffectiveName() {
|
public String getEffectiveName() {
|
||||||
return Categories.getEffectiveName(this.name());
|
return Categories.getEffectiveName(this.name());
|
||||||
@@ -19,9 +19,14 @@ public class Categories {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static String getEffectiveName(String name) {
|
private static String getEffectiveName(String name) {
|
||||||
String[] arr = name.split("");
|
String[] arr = name.split("_");
|
||||||
StringBuilder result = new StringBuilder(arr[0].toLowerCase());
|
StringBuilder result = new StringBuilder();
|
||||||
for(int i = 1; i < name.length(); i++) result.append(arr[i]);
|
for(String entry : arr) {
|
||||||
|
String[] entryArr = entry.split("");
|
||||||
|
StringBuilder builder = new StringBuilder(entryArr[0]);
|
||||||
|
for(int i = 1; i < entry.length(); i++) builder.append(entryArr[i].toLowerCase());
|
||||||
|
result.append(builder).append(" ");
|
||||||
|
}
|
||||||
return result.toString();
|
return result.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user