make gson use treesets

This commit is contained in:
Craig Raw 2020-08-20 11:44:12 +02:00
parent b9ef670e61
commit b1299f6abf
2 changed files with 5 additions and 5 deletions

View file

@ -26,7 +26,7 @@ public class Wallet {
private ScriptType scriptType;
private Policy defaultPolicy;
private List<Keystore> keystores = new ArrayList<>();
private final Set<WalletNode> purposeNodes = new TreeSet<>();
private final TreeSet<WalletNode> purposeNodes = new TreeSet<>();
private final Map<Sha256Hash, BlockTransaction> transactions = new HashMap<>();
private Integer storedBlockHeight;

View file

@ -10,8 +10,8 @@ import java.util.stream.Collectors;
public class WalletNode implements Comparable<WalletNode> {
private final String derivationPath;
private String label;
private Set<WalletNode> children = new TreeSet<>();
private Set<BlockTransactionHashIndex> transactionOutputs = new TreeSet<>();
private TreeSet<WalletNode> children = new TreeSet<>();
private TreeSet<BlockTransactionHashIndex> transactionOutputs = new TreeSet<>();
private transient KeyPurpose keyPurpose;
private transient int index = -1;
@ -90,7 +90,7 @@ public class WalletNode implements Comparable<WalletNode> {
return children == null ? null : Collections.unmodifiableSet(children);
}
public void setChildren(Set<WalletNode> children) {
public void setChildren(TreeSet<WalletNode> children) {
this.children = children;
}
@ -98,7 +98,7 @@ public class WalletNode implements Comparable<WalletNode> {
return transactionOutputs == null ? null : Collections.unmodifiableSet(transactionOutputs);
}
public void setTransactionOutputs(Set<BlockTransactionHashIndex> transactionOutputs) {
public void setTransactionOutputs(TreeSet<BlockTransactionHashIndex> transactionOutputs) {
this.transactionOutputs = transactionOutputs;
}