-
Notifications
You must be signed in to change notification settings - Fork 0
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
43 changed files
with
239 additions
and
203 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
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
49 changes: 49 additions & 0 deletions
49
apps/backend/polly-app/src/main/java/no/nav/data/polly/codelist/CodelistStaticService.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 |
---|---|---|
@@ -0,0 +1,49 @@ | ||
package no.nav.data.polly.codelist; | ||
|
||
import no.nav.data.polly.codelist.domain.Codelist; | ||
import no.nav.data.polly.codelist.domain.ListName; | ||
import no.nav.data.polly.codelist.dto.CodelistResponse; | ||
|
||
import java.util.Collection; | ||
import java.util.List; | ||
|
||
import static no.nav.data.common.utils.StreamUtils.convert; | ||
|
||
@Deprecated // TODO: Skal fjernes (midlertidig hjem for alt som var static i CodelistService) | ||
public final class CodelistStaticService { | ||
|
||
private CodelistStaticService() {} | ||
|
||
public static Codelist getCodelist(ListName listName, String code) { | ||
return CodelistCache.getCodelist(listName, code); | ||
} | ||
|
||
public static CodelistResponse getCodelistResponse(ListName listName, String code) { | ||
if (code == null) { | ||
return null; | ||
} | ||
Codelist codelist = getCodelist(listName, code); | ||
if (codelist == null) { | ||
return new CodelistResponse(listName, code, null, null); | ||
} | ||
return CodelistResponse.buildFrom(codelist); | ||
} | ||
|
||
public static List<Codelist> getCodelists(ListName listName) { | ||
return CodelistCache.getCodelist(listName); | ||
} | ||
|
||
// TODO: Snu avhengigheten innover | ||
public static List<CodelistResponse> getCodelistResponseList(ListName listName, Collection<String> codes) { | ||
return convert(codes, code -> getCodelistResponse(listName, code)); | ||
} | ||
|
||
public static List<Codelist> getCodelist(ListName name) { | ||
return CodelistCache.getCodelist(name); | ||
} | ||
|
||
public static List<Codelist> getAll() { | ||
return CodelistCache.getAll(); | ||
} | ||
|
||
} |
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
1 change: 0 additions & 1 deletion
1
...kend/polly-app/src/main/java/no/nav/data/polly/codelist/dto/CodelistRequestValidator.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
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
Oops, something went wrong.