Package com.socrata.builders

Source Code of com.socrata.builders.NonDataFileDatasetBuilder

package com.socrata.builders;

import com.socrata.model.importer.DatasetInfo;
import com.socrata.model.importer.NonDataFileDataset;

/**
* Builds a NonDataFileDataset.This should be mainly used for modifying existing NonDataFileDataset,
* while using hte methods in SodaImporter for creating the initial NonDataFileDataset.
*/
public class NonDataFileDatasetBuilder extends AbstractDatasetInfoBuilder<NonDataFileDatasetBuilder, NonDataFileDataset>
{
    private String blobFilename;
    private long blobFileSize;
    private String blobId;
    private String blobMimeType;

    public NonDataFileDatasetBuilder()
    {
    }

    public NonDataFileDatasetBuilder(NonDataFileDataset datasetInfo)
    {
        super(datasetInfo);
        this.blobFilename = datasetInfo.getBlobFilename();
        this.blobFileSize = datasetInfo.getBlobFileSize();
        this.blobId = datasetInfo.getBlobId();
        this.blobMimeType = datasetInfo.getBlobMimeType();
    }


    public NonDataFileDatasetBuilder setBlobFilename(String blobFilename)
    {
        this.blobFilename = blobFilename;
        return this;
    }

    public NonDataFileDatasetBuilder setBlobFileSize(long blobFileSize)
    {
        this.blobFileSize = blobFileSize;
        return this;
    }

    public NonDataFileDatasetBuilder setBlobId(String blobId)
    {
        this.blobId = blobId;
        return this;
    }

    public NonDataFileDatasetBuilder setBlobMimeType(String blobMimeType)
    {
        this.blobMimeType = blobMimeType;
        return this;
    }

    @Override
    public NonDataFileDataset build()
    {
        final NonDataFileDataset retVal = new NonDataFileDataset();
        populate(retVal);
        return retVal;
    }
}
TOP

Related Classes of com.socrata.builders.NonDataFileDatasetBuilder

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.