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) {
        if (job == null){
            return stripJobReferences(tasks);
        } else {
            return tasks.stream().map(t -> job.equals(t.getIngestionJob()) ? t : t.cloneWithJob(job)).collect(Collectors.toList());
        }
    }

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy