enums
DexterHK 2022-12-12 23:31:15 +01:00
parent 94a9feba9f
commit 95033b45a1
1 changed files with 4 additions and 2 deletions

View File

@ -57,7 +57,8 @@ public class Bank implements Serializable {
case 2: return temp.get(Kontoart.Girokonto); case 2: return temp.get(Kontoart.Girokonto);
case 3: return temp.get(Kontoart.Tagesgeldkonto); case 3: return temp.get(Kontoart.Tagesgeldkonto);
default: default:
List<Konto> output = temp.values().stream().flatMap(y -> y.stream()) List<Konto> output = temp.values().stream()
.flatMap(y -> y.stream())
.collect(Collectors.toList()); .collect(Collectors.toList());
return output; return output;
} }
@ -66,7 +67,8 @@ public class Bank implements Serializable {
public long findMax() public long findMax()
{ {
Collection<Konto> kontenTemp = konten.values(); Collection<Konto> kontenTemp = konten.values();
long max = kontenTemp.stream().map(n -> n.getKontostand()).max((a,b) -> long max = kontenTemp.stream().map(n -> n.getKontostand())
.max((a,b) ->
a.compareTo(b)).get(); a.compareTo(b)).get();
return max; return max;