+ @Nullable
+ public static String extractParentName(@NonNull String accName) {
+ int colonPos = accName.lastIndexOf(':');
+ if (colonPos < 0)
+ return null; // no parent account -- this is a top-level account
+ else
+ return accName.substring(0, colonPos);
+ }
+ @NonNull
+ static public LedgerAccount fromDBO(AccountWithAmounts in, LedgerAccount parent) {
+ LedgerAccount res = new LedgerAccount(in.account.getName(), parent);
+ res.dbId = in.account.getId();
+ res.profileId = in.account.getProfileId();
+ res.setName(in.account.getName());
+ res.setExpanded(in.account.isExpanded());
+ res.setAmountsExpanded(in.account.isAmountsExpanded());