mirror of
https://github.com/sparrowwallet/drongo.git
synced 2024-12-26 01:56:44 +00:00
add wallet hierarchy-aware convenience naming methods
This commit is contained in:
parent
46e4413cf6
commit
debafd42e8
1 changed files with 17 additions and 1 deletions
|
@ -61,6 +61,22 @@ public class Wallet extends Persistable {
|
|||
return name;
|
||||
}
|
||||
|
||||
public String getFullName() {
|
||||
if(isMasterWallet()) {
|
||||
return name;
|
||||
}
|
||||
|
||||
return getMasterWallet().getName() + "-" + name;
|
||||
}
|
||||
|
||||
public String getMasterName() {
|
||||
if(isMasterWallet()) {
|
||||
return name;
|
||||
}
|
||||
|
||||
return getMasterWallet().getName();
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
@ -1233,6 +1249,6 @@ public class Wallet extends Persistable {
|
|||
|
||||
@Override
|
||||
public String toString() {
|
||||
return getName();
|
||||
return getFullName();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue