-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extract DocumentType and document name and type utility methods in
independent classes
- Loading branch information
zxBCN Farre_Basurte,Juan_Antonio (IT EDS) EXTERNAL
committed
Aug 5, 2021
1 parent
8f68190
commit d729d02
Showing
7 changed files
with
5,702 additions
and
5,649 deletions.
There are no files selected for viewing
227 changes: 114 additions & 113 deletions
227
src/org/ods/orchestration/scheduler/LeVADocumentScheduler.groovy
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package org.ods.orchestration.util | ||
|
||
enum LeVADocumentType { | ||
CSD, | ||
DIL, | ||
DTP, | ||
DTR, | ||
RA, | ||
CFTP, | ||
CFTR, | ||
IVP, | ||
IVR, | ||
SSDS, | ||
TCP, | ||
TCR, | ||
TIP, | ||
TIR, | ||
TRC, | ||
OVERALL_DTR, | ||
OVERALL_IVR, | ||
OVERALL_TIR | ||
} |
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,29 @@ | ||
package org.ods.orchestration.util | ||
|
||
class LeVADocumentUtil { | ||
private LeVADocumentUtil() { | ||
} | ||
|
||
static List splitName(String name) { | ||
def components = name.split('-') as List | ||
def type = LeVADocumentType.valueOf(components[0]) | ||
components[0] = type | ||
return components | ||
} | ||
|
||
static LeVADocumentType getTypeFromName(String name) { | ||
return splitName(name)[0] | ||
} | ||
|
||
static String getRepoFromName(String name) { | ||
return splitName(name)[1] | ||
} | ||
|
||
static boolean isFullDocument(String name) { | ||
return !getRepoFromName(name) | ||
} | ||
|
||
static boolean isPartialDocument(String name) { | ||
return !isFullDocument(name) | ||
} | ||
} |
Oops, something went wrong.