Skip to content

Commit

Permalink
Fiks: Fikser equals av lister i tilkjent ytelse (#2452)
Browse files Browse the repository at this point in the history
  • Loading branch information
pekern authored Nov 1, 2023
1 parent 60477b5 commit 58e9003
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ public boolean equals(Object o) {
if (o == null || getClass() != o.getClass())
return false;
TilkjentYtelseForeldrepenger that = (TilkjentYtelseForeldrepenger) o;
if (perioder != null && that.perioder != null) {
return perioder.size() == that.perioder.size()
&& perioder.containsAll(that.perioder);
}
return Objects.equals(perioder, that.perioder);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,14 @@ public boolean equals(Object o) {
return false;
TilkjentYtelsePeriode that = (TilkjentYtelsePeriode) o;
return Objects.equals(dagsats, that.dagsats) && Objects.equals(periode, that.periode) && Objects.equals(utbetaltTilSøker,
that.utbetaltTilSøker) && Objects.equals(andeler, that.andeler);
that.utbetaltTilSøker) && likeAndeler(andeler, that.andeler);
}

private boolean likeAndeler(List<TilkjentYtelseAndel> liste1, List<TilkjentYtelseAndel> liste2) {
if (liste1 != null && liste2 != null) {
return liste1.size() == liste2.size() && liste1.containsAll(liste2);
}
return Objects.equals(liste1, liste2);
}

@Override
Expand Down

0 comments on commit 58e9003

Please sign in to comment.