private Long getCurrentId(Map<String, Long> taskReferences) { Long max = Lambda.max(taskReferences); return max + NUMBER_OF_TASK_EXECUTION_STEPS; }
/** * Finds the maximum item in this iterable defined by the given argument. * @param argument An argument defined using the {@link Lambda#on(Class)} method * @return The maximum of all the Object in the given iterable */ public <A> A max(A argument) { return Lambda.max(getInner(), argument); }
protected static String resolveDotNetVersion() { File dotNetHome = new File(DOTNET_PATH); if(dotNetHome.isDirectory()) { File[] versionFolders = dotNetHome.listFiles(new FileFilter() { @Override public boolean accept(File file) { return file.isDirectory() && file.getName().startsWith("v"); } }); if(!ArrayUtils.isEmpty(versionFolders)) { String maxVersion = max(versionFolders, on(File.class).getName()).substring(1); return maxVersion.substring(0, 1) + ".x"; } } return "N/A"; }
protected static String resolveDotNetVersion() { File dotNetHome = new File(DOTNET_PATH); if(dotNetHome.isDirectory()) { File[] versionFolders = dotNetHome.listFiles(new FileFilter() { @Override public boolean accept(File file) { return file.isDirectory() && file.getName().startsWith("v"); } }); if(!ArrayUtils.isEmpty(versionFolders)) { String maxVersion = max(versionFolders, on(File.class).getName()).substring(1); return maxVersion.substring(0, 1) + ".x"; } } return "N/A"; }
private long getCurrentId(Map<String, Long> stepReferences, Deque<Step> steps) { Long currentId; long max = Lambda.max(stepReferences); Map.Entry maxEntry = selectFirst(stepReferences.entrySet(), having(on(Map.Entry.class).getValue(), equalTo(max))); String referenceKey = (String) (maxEntry).getKey(); Step step = null; for (Step stepItem : steps) { if (stepItem.getName().equals(referenceKey)) { step = stepItem; break; } } if (step == null || !step.isParallelLoop()) { // the reference is not a step or is not a parallel loop step currentId = max + NUMBER_OF_STEP_EXECUTION_STEPS; } else { //async step currentId = max + NUMBER_OF_STEP_EXECUTION_STEPS + NUMBER_OF_PARALLEL_LOOP_EXECUTION_STEPS; } return currentId; }
private long getCurrentId(Map<String, Long> stepReferences, Deque<Step> steps) { Long currentId; long max = Lambda.max(stepReferences); Map.Entry maxEntry = selectFirst(stepReferences.entrySet(), having(on(Map.Entry.class).getValue(), equalTo(max))); String referenceKey = (String) (maxEntry).getKey(); Step step = null; for (Step stepItem : steps) { if (stepItem.getName().equals(referenceKey)) { step = stepItem; break; } } if (step == null || !step.isParallelLoop()) { // the reference is not a step or is not a parallel loop step currentId = max + NUMBER_OF_STEP_EXECUTION_STEPS; } else { //async step currentId = max + NUMBER_OF_STEP_EXECUTION_STEPS + NUMBER_OF_PARALLEL_LOOP_EXECUTION_STEPS; } return currentId; }