All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.harrys.hyppo.source.api.model.TaskAssociations Maven / Gradle / Ivy

There is a newer version: 0.6.4
Show newest version
package com.harrys.hyppo.source.api.model;

import java.util.List;
import java.util.stream.Collectors;

/**
 * Created by jpetty on 11/9/15.
 */
public final class TaskAssociations {

    public static final List resetJobReferences(final DataIngestionJob job, final List tasks) {
        return tasks.stream().
                map(t -> (job.equals(t.getIngestionJob())) ? t : new DataIngestionTask(job, t.getTaskNumber(), t.getTaskArguments())).
                collect(Collectors.toList());
    }

    public static final List stripJobReferences(final List tasks) {
        return tasks.stream().
                map(t -> (t.getIngestionJob() == null) ? t : new DataIngestionTask(null, t.getTaskNumber(), t.getTaskArguments())).
                collect(Collectors.toList());
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy