-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Konverter til validert type så tidleg som mogleg og rydd i/forenkle k…
…oden
- Loading branch information
Showing
15 changed files
with
371 additions
and
445 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
30 changes: 30 additions & 0 deletions
30
src/main/java/no/nav/pto/veilarbportefolje/domene/Sorteringsrekkefolge.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,30 @@ | ||
package no.nav.pto.veilarbportefolje.domene; | ||
|
||
public enum Sorteringsrekkefolge { | ||
IKKE_SATT("ikke_satt"), | ||
STIGENDE("ascending"), | ||
SYNKENDE("descending"); | ||
|
||
/** | ||
* Verdien som blir sendt mellom frontend og backend | ||
*/ | ||
public final String sorteringsverdi; | ||
|
||
Sorteringsrekkefolge(String sorteringsverdi) { | ||
this.sorteringsverdi = sorteringsverdi; | ||
} | ||
|
||
public static Sorteringsrekkefolge toSorteringsrekkefolge(String sorteringsverdi) { | ||
for (Sorteringsrekkefolge sorteringsrekkefolge : values()) { | ||
if (sorteringsrekkefolge.sorteringsverdi.equals(sorteringsverdi)) { | ||
return sorteringsrekkefolge; | ||
} | ||
} | ||
throw new IllegalArgumentException("Ugyldig verdi for enum: " + sorteringsverdi); | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return this.name() + " (" + this.sorteringsverdi + ")"; | ||
} | ||
} |
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.