-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[backend] add intermediate record to sort as stream
- Loading branch information
1 parent
1828c9e
commit 5fd5f84
Showing
3 changed files
with
31 additions
and
19 deletions.
There are no files selected for viewing
14 changes: 14 additions & 0 deletions
14
openbas-api/src/main/java/io/openbas/rest/scenario/FinishedExerciseWithInjects.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,14 @@ | ||
package io.openbas.rest.scenario; | ||
|
||
import java.time.Instant; | ||
import java.util.Set; | ||
|
||
public record FinishedExerciseWithInjects(Instant endDate, Set<String> injectIds) | ||
implements Comparable<FinishedExerciseWithInjects> { | ||
@Override | ||
public int compareTo(FinishedExerciseWithInjects exercise) { | ||
if (this.endDate.isBefore(exercise.endDate)) return 1; | ||
if (this.endDate.isAfter(exercise.endDate)) return -1; | ||
return 0; | ||
} | ||
} |
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