-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
24 changed files
with
122 additions
and
497 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
110 changes: 2 additions & 108 deletions
110
...penger/behandlingslager/testutilities/behandling/personopplysning/Oppholdstillatelse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,114 +1,8 @@ | ||
package no.nav.foreldrepenger.behandlingslager.testutilities.behandling.personopplysning; | ||
|
||
import java.time.LocalDate; | ||
import java.util.Objects; | ||
|
||
import no.nav.foreldrepenger.behandlingslager.aktør.OppholdstillatelseType; | ||
import no.nav.foreldrepenger.domene.tid.DatoIntervallEntitet; | ||
import no.nav.foreldrepenger.behandlingslager.aktør.historikk.OppholdstillatelsePeriode; | ||
import no.nav.foreldrepenger.domene.typer.AktørId; | ||
|
||
public class Oppholdstillatelse { | ||
|
||
private AktørId aktørId; | ||
private DatoIntervallEntitet periode; | ||
private OppholdstillatelseType tillatelse = OppholdstillatelseType.UDEFINERT; | ||
|
||
public Oppholdstillatelse() { | ||
} | ||
|
||
Oppholdstillatelse(Oppholdstillatelse personstatus) { | ||
this.aktørId = personstatus.getAktørId(); | ||
this.periode = personstatus.getPeriode(); | ||
this.tillatelse = personstatus.getTillatelse(); | ||
} | ||
|
||
|
||
public OppholdstillatelseType getTillatelse() { | ||
return tillatelse; | ||
} | ||
|
||
public void setTillatelse(OppholdstillatelseType tillatelse) { | ||
this.tillatelse = tillatelse; | ||
} | ||
|
||
public AktørId getAktørId() { | ||
return aktørId; | ||
} | ||
|
||
void setAktørId(AktørId aktørId) { | ||
this.aktørId = aktørId; | ||
} | ||
|
||
|
||
public DatoIntervallEntitet getPeriode() { | ||
return periode; | ||
} | ||
|
||
void setPeriode(DatoIntervallEntitet gyldighetsperiode) { | ||
this.periode = gyldighetsperiode; | ||
} | ||
|
||
|
||
@Override | ||
public boolean equals(Object o) { | ||
if (this == o) { | ||
return true; | ||
} | ||
if (o == null || getClass() != o.getClass()) { | ||
return false; | ||
} | ||
var entitet = (Oppholdstillatelse) o; | ||
return Objects.equals(aktørId, entitet.aktørId) && | ||
Objects.equals(periode, entitet.periode) && | ||
Objects.equals(tillatelse, entitet.tillatelse); | ||
} | ||
|
||
|
||
@Override | ||
public int hashCode() { | ||
return Objects.hash(aktørId, periode, tillatelse); | ||
} | ||
|
||
|
||
@Override | ||
public String toString() { | ||
return "OppholdstillatelseEntitet{" + | ||
"periode=" + periode + | ||
", tillatelse=" + tillatelse + | ||
'}'; | ||
} | ||
|
||
public static Oppholdstillatelse.OppholdstillatelseBuilder builder() { | ||
return new OppholdstillatelseBuilder(new Oppholdstillatelse()); | ||
} | ||
|
||
public static final class OppholdstillatelseBuilder { | ||
|
||
private final Oppholdstillatelse kladd; | ||
|
||
private OppholdstillatelseBuilder(Oppholdstillatelse kladd) { | ||
this.kladd = kladd; | ||
} | ||
|
||
public Oppholdstillatelse.OppholdstillatelseBuilder medAktørId(AktørId aktørId) { | ||
kladd.setAktørId(aktørId); | ||
return this; | ||
} | ||
|
||
public Oppholdstillatelse.OppholdstillatelseBuilder medPeriode(LocalDate fom, LocalDate tom) { | ||
kladd.setPeriode(DatoIntervallEntitet.fraOgMedTilOgMed(fom, tom)); | ||
return this; | ||
} | ||
|
||
public Oppholdstillatelse.OppholdstillatelseBuilder medOppholdstillatelse(OppholdstillatelseType tillatelse) { | ||
kladd.setTillatelse(tillatelse); | ||
return this; | ||
} | ||
|
||
public Oppholdstillatelse build() { | ||
return kladd; | ||
} | ||
|
||
} | ||
public record Oppholdstillatelse(AktørId aktørId, OppholdstillatelsePeriode oppholdstillatelsePeriode) { | ||
|
||
} |
Oops, something went wrong.