-
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.
Revert recordifisering av IT Grunnlag (#1199)
- Loading branch information
Showing
3 changed files
with
234 additions
and
18 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
38 changes: 37 additions & 1 deletion
38
...c/main/java/no/nav/vedtak/felles/integrasjon/infotrygd/grunnlag/v1/respons/Orgnummer.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,11 +1,47 @@ | ||
package no.nav.vedtak.felles.integrasjon.infotrygd.grunnlag.v1.respons; | ||
|
||
import java.util.Objects; | ||
|
||
import com.fasterxml.jackson.annotation.JsonCreator; | ||
import com.fasterxml.jackson.annotation.JsonValue; | ||
|
||
public class Orgnummer { | ||
|
||
public record Orgnummer(String orgnr) { | ||
private final String orgnr; | ||
|
||
@JsonCreator | ||
public static Orgnummer forValue(String orgnr) { | ||
return new Orgnummer(orgnr); | ||
} | ||
|
||
private Orgnummer(String orgnr) { | ||
this.orgnr = orgnr; | ||
} | ||
|
||
@JsonValue | ||
public String getOrgnr() { | ||
return orgnr; | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return Objects.hash(orgnr); | ||
} | ||
|
||
@Override | ||
public boolean equals(Object obj) { | ||
if (obj == null || !(obj instanceof Orgnummer)) { | ||
return false; | ||
} | ||
if (this == obj) { | ||
return true; | ||
} | ||
Orgnummer that = (Orgnummer) obj; | ||
return Objects.equals(that.orgnr, this.orgnr); | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return getClass().getSimpleName() + "[orgnr=" + orgnr + "]"; | ||
} | ||
} |
38 changes: 37 additions & 1 deletion
38
...src/main/java/no/nav/vedtak/felles/integrasjon/infotrygd/grunnlag/v1/respons/Prosent.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,11 +1,47 @@ | ||
package no.nav.vedtak.felles.integrasjon.infotrygd.grunnlag.v1.respons; | ||
|
||
import java.util.Objects; | ||
|
||
import com.fasterxml.jackson.annotation.JsonCreator; | ||
import com.fasterxml.jackson.annotation.JsonValue; | ||
|
||
public class Prosent { | ||
|
||
public record Prosent(Integer prosent) { | ||
private final Integer prosent; | ||
|
||
@JsonCreator | ||
public static Prosent forValue(Integer value) { | ||
return new Prosent(value); | ||
} | ||
|
||
private Prosent(Integer prosent) { | ||
this.prosent = prosent; | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return Objects.hash(prosent); | ||
} | ||
|
||
@Override | ||
public boolean equals(Object obj) { | ||
if (obj == null || !(obj instanceof Prosent)) { | ||
return false; | ||
} | ||
if (this == obj) { | ||
return true; | ||
} | ||
Prosent that = (Prosent) obj; | ||
return Objects.equals(that.prosent, this.prosent); | ||
} | ||
|
||
@JsonValue | ||
public Integer getProsent() { | ||
return prosent; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return getClass().getSimpleName() + " [prosent=" + prosent + "]"; | ||
} | ||
} |