here’s a link to the gist <https://gist.github.com...
# codereview
s
k
So many nullability going on in there. I believe you can slim fit a couple of them For example, if carts were indeed loaded, then
onKartLoaded
shouldn’t take a nullable parameter. If you are sure an item will be in a map, you can consider
map.getValue(key)
, which returns a non-null result, instead of using
map[key]
Indeed, I would move most of this logic to the presenter, and only callback the view with an already processed
List<X>
You could consider the no-arg plugin to avoid unnecessary defaults in class declaration I suppose you could replace
amount = amount.plus(someValue)
with
amount += someValue
onKartLoaded
definitely should be broken into smaller independent functions if possible And finally, you just might be able to take more advantage of functional operations on those collections to make everything look much cleaner
d
s
alright, will do so now