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

org.sourcelab.github.client.response.RerunMultipleJobsResponse Maven / Gradle / Ivy

The newest version!
package org.sourcelab.github.client.response;

import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class RerunMultipleJobsResponse {
    /**
     * Maps from JobId => the result.
     */
    private final Map resultMap;

    /**
     * Constructor.
     */
    public RerunMultipleJobsResponse(final Map resultMap) {
        this.resultMap = Collections.unmodifiableMap(new HashMap<>(resultMap));
    }

    /**
     * Given a jobId get the result of the re-run operation.
     */
    public boolean getResultForJobId(final long jobId) {
        if (!resultMap.containsKey(jobId)) {
            throw new IllegalArgumentException("JobId " + jobId + " is not defined!");
        }
        return resultMap.get(jobId);
    }

    public List getJobIds() {
        return new ArrayList<>(resultMap.keySet());
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy