mirror of
https://github.com/bisq-network/bisq.git
synced 2025-03-13 11:09:10 +01:00
Slight code cleanup: BurningManView & BalanceEntryItem
1) Replace statement lambda with expression lambda; 2) Use '.iterator().next()' instead of 'new ArrayList<>(_).get(0)'.
This commit is contained in:
parent
c353a95cd9
commit
01de88b163
2 changed files with 2 additions and 5 deletions
|
@ -36,7 +36,6 @@ import com.google.common.base.Joiner;
|
||||||
|
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
|
@ -90,7 +89,7 @@ class BalanceEntryItem {
|
||||||
receivedBtc = Optional.of(monthlyBalanceEntry.getReceivedBtc());
|
receivedBtc = Optional.of(monthlyBalanceEntry.getReceivedBtc());
|
||||||
burnedBsq = Optional.of(-monthlyBalanceEntry.getBurnedBsq());
|
burnedBsq = Optional.of(-monthlyBalanceEntry.getBurnedBsq());
|
||||||
type = monthlyBalanceEntry.getTypes().size() == 1 ?
|
type = monthlyBalanceEntry.getTypes().size() == 1 ?
|
||||||
Optional.of(new ArrayList<>(monthlyBalanceEntry.getTypes()).get(0)) :
|
Optional.of(monthlyBalanceEntry.getTypes().iterator().next()) :
|
||||||
Optional.empty();
|
Optional.empty();
|
||||||
} else if (balanceEntry instanceof BurnedBsqBalanceEntry) {
|
} else if (balanceEntry instanceof BurnedBsqBalanceEntry) {
|
||||||
BurnedBsqBalanceEntry burnedBsqBalanceEntry = (BurnedBsqBalanceEntry) balanceEntry;
|
BurnedBsqBalanceEntry burnedBsqBalanceEntry = (BurnedBsqBalanceEntry) balanceEntry;
|
||||||
|
|
|
@ -211,9 +211,7 @@ public class BurningManView extends ActivatableView<ScrollPane, Void> implements
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
amountInputTextFieldListener = (observable, oldValue, newValue) -> {
|
amountInputTextFieldListener = (observable, oldValue, newValue) -> updateButtonState();
|
||||||
updateButtonState();
|
|
||||||
};
|
|
||||||
|
|
||||||
burningmenSelectionListener = (observable, oldValue, newValue) -> {
|
burningmenSelectionListener = (observable, oldValue, newValue) -> {
|
||||||
boolean isValueSet = newValue != null;
|
boolean isValueSet = newValue != null;
|
||||||
|
|
Loading…
Add table
Reference in a new issue