forked from quince-science/QuinCe
-
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.
(quince-science#2962) Correctly process missing run types
When an instrument has multiple file definitions, and at least one has no run type column, uploading new files with missing run types would fail.
- Loading branch information
1 parent
b6bae08
commit c06f1c5
Showing
3 changed files
with
16 additions
and
9 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
12 changes: 9 additions & 3 deletions
12
WebApp/src/uk/ac/exeter/QuinCe/web/files/MissingRunType.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,15 +1,21 @@ | ||
package uk.ac.exeter.QuinCe.web.files; | ||
|
||
import java.util.List; | ||
import java.util.Set; | ||
|
||
import uk.ac.exeter.QuinCe.data.Instrument.FileDefinition; | ||
import uk.ac.exeter.QuinCe.data.Instrument.RunTypes.RunTypeAssignment; | ||
|
||
public record MissingRunType(FileDefinition fileDefinition, | ||
RunTypeAssignment runType) { | ||
protected static boolean contains(List<MissingRunType> list, | ||
RunTypeAssignment runType) implements Comparable<MissingRunType> { | ||
|
||
protected static boolean contains(Set<MissingRunType> list, | ||
FileDefinition fileDefinition, String runName) { | ||
return list.stream().anyMatch(r -> r.fileDefinition.equals(fileDefinition) | ||
&& r.runType.getRunName().equals(runName)); | ||
} | ||
|
||
@Override | ||
public int compareTo(MissingRunType o) { | ||
return runType.getRunName().compareTo(o.runType.getRunName()); | ||
} | ||
} |
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