+ private final WeakReference<MobileLedgerProfile> profileWeakReference;
+
+ public LedgerAccount(MobileLedgerProfile profile, String name, @Nullable LedgerAccount parent) {
+ this.profileWeakReference = new WeakReference<>(profile);
+ this.parent = parent;
+ if (parent != null && !name.startsWith(parent.getName() + ":"))
+ throw new IllegalStateException(
+ String.format("Account name '%s' doesn't match parent account '%s'", name,
+ parent.getName()));