-
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.
Merge pull request #1843 from navikt/sorteringsverdiar
Opprydding/forbetring av logikk/validering/typing relatert til sorteringsfelt og -rekkefølge
- Loading branch information
Showing
15 changed files
with
516 additions
and
479 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 + ")"; | ||
} | ||
} |
267 changes: 190 additions & 77 deletions
267
src/main/java/no/nav/pto/veilarbportefolje/opensearch/OpensearchQueryBuilder.java
Large diffs are not rendered by default.
Oops, something went wrong.
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
Oops, something went wrong.