[bisq-network/bisq] Sorting order of offers appropriately by min/max range (#4068)

Christoph Atteneder notifications at github.com
Tue Mar 17 15:35:45 UTC 2020


ripcurlx commented on this pull request.



> +            if (newValue==TableColumn.SortType.DESCENDING)
+                amountColumn.setComparator(Comparator.comparing(o -> o.getOffer().getAmount(), Comparator.nullsFirst(Comparator.naturalOrder())));
+            else
+                amountColumn.setComparator(Comparator.comparing(o -> o.getOffer().getMinAmount(), Comparator.nullsFirst(Comparator.naturalOrder())));
+        });
+        volumeColumn.sortTypeProperty().addListener((observable, oldValue, newValue) -> {
+            if (newValue==TableColumn.SortType.DESCENDING)
+                volumeColumn.setComparator(Comparator.comparing(o -> o.getOffer().getVolume(), Comparator.nullsFirst(Comparator.naturalOrder())));
+            else
+                volumeColumn.setComparator(Comparator.comparing(o -> o.getOffer().getMinVolume(), Comparator.nullsFirst(Comparator.naturalOrder())));
+        });

As we had issues in the past concerning using no brackets for one line conditionals we decided to use always `{}`

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/bisq-network/bisq/pull/4068#pullrequestreview-376150295
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bisq.network/pipermail/bisq-github/attachments/20200317/0001aae0/attachment.html>


More information about the bisq-github mailing list