2
2
3
3
import java .util .Objects ;
4
4
5
- import no .nav .ung .kodeverk .uttak .UttakArbeidType ;
6
5
import no .nav .ung .sak .domene .typer .tid .DatoIntervallEntitet ;
7
- import no .nav .ung .sak .typer .Arbeidsgiver ;
8
6
import no .nav .ung .sak .typer .InternArbeidsforholdRef ;
9
7
10
8
public class SøktPeriode <T > {
11
9
12
10
private DatoIntervallEntitet periode ;
13
- private UttakArbeidType type ;
14
- private Arbeidsgiver arbeidsgiver ;
15
- private InternArbeidsforholdRef arbeidsforholdRef ;
16
11
private T raw ;
17
12
18
13
/**
@@ -26,38 +21,14 @@ public class SøktPeriode<T> {
26
21
this .raw = raw ;
27
22
}
28
23
29
- public SøktPeriode (DatoIntervallEntitet periode , UttakArbeidType type , Arbeidsgiver arbeidsgiver , InternArbeidsforholdRef arbeidsforholdRef , T raw ) {
30
- this .periode = periode ;
31
- this .type = type ;
32
- this .arbeidsgiver = arbeidsgiver ;
33
- this .arbeidsforholdRef = arbeidsforholdRef ;
34
- this .raw = raw ;
35
- }
36
-
37
24
public DatoIntervallEntitet getPeriode () {
38
25
return periode ;
39
26
}
40
27
41
- public UttakArbeidType getType () {
42
- return type ;
43
- }
44
-
45
- public Arbeidsgiver getArbeidsgiver () {
46
- return arbeidsgiver ;
47
- }
48
-
49
- public InternArbeidsforholdRef getArbeidsforholdRef () {
50
- return arbeidsforholdRef ;
51
- }
52
-
53
28
public T getRaw () {
54
29
return raw ;
55
30
}
56
31
57
- public static <T > SøktPeriode <T > arbeid (DatoIntervallEntitet periode , Arbeidsgiver arbeidsgiver , InternArbeidsforholdRef arbeidsforholdRef , T raw ) {
58
- return new SøktPeriode <>(periode , UttakArbeidType .ARBEIDSTAKER , arbeidsgiver , arbeidsforholdRef , raw );
59
- }
60
-
61
32
@ SuppressWarnings ("rawtypes" )
62
33
@ Override
63
34
public boolean equals (Object o ) {
@@ -66,24 +37,18 @@ public boolean equals(Object o) {
66
37
if (o == null || getClass () != o .getClass ())
67
38
return false ;
68
39
var that = (SøktPeriode ) o ;
69
- return type == that .type &&
70
- Objects .equals (arbeidsgiver , that .arbeidsgiver )
71
- && Objects .equals (arbeidsforholdRef , that .arbeidsforholdRef )
72
- && Objects .equals (raw , that .raw );
40
+ return Objects .equals (raw , that .raw );
73
41
}
74
42
75
43
@ Override
76
44
public int hashCode () {
77
- return Objects .hash (type , arbeidsgiver , arbeidsforholdRef , raw );
45
+ return Objects .hash (raw );
78
46
}
79
47
80
48
@ Override
81
49
public String toString () {
82
50
return "SøktPeriode{" +
83
51
"periode=" + periode +
84
- ", type=" + type +
85
- ", arbeidsgiver=" + arbeidsgiver +
86
- ", arbeidsforholdRef=" + arbeidsforholdRef +
87
52
'}' ;
88
53
}
89
54
}
0 commit comments