org.haiku.haikudepotserver.job.model.JobDataWithByteSource.java Source code

Java tutorial

Introduction

Here is the source code for org.haiku.haikudepotserver.job.model.JobDataWithByteSource.java

Source

/*
 * Copyright 2014, Andrew Lindesay
 * Distributed under the terms of the MIT License.
 */

package org.haiku.haikudepotserver.job.model;

import com.google.common.base.Preconditions;
import com.google.common.io.ByteSource;

/**
 * <p>Couples a {@link JobData} with a {@link com.google.common.io.ByteSource}
 * such that data generated by a job can be obtained.</p>
 */

public class JobDataWithByteSource {

    private JobData jobData;
    private ByteSource byteSource;

    public JobDataWithByteSource(JobData jobData, ByteSource byteSource) {
        Preconditions.checkArgument(null != jobData, "job data must be supplied");
        Preconditions.checkArgument(null != byteSource, "byte source must be supplied");
        this.jobData = jobData;
        this.byteSource = byteSource;
    }

    public JobData getJobData() {
        return jobData;
    }

    public ByteSource getByteSource() {
        return byteSource;
    }
}