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

org.n52.proxy.connector.constellations.QuantityDatasetConstellation Maven / Gradle / Ivy

There is a newer version: 1.0.0-alpha.9
Show newest version
package org.n52.proxy.connector.constellations;


import java.util.Date;

import org.n52.proxy.connector.utils.EntityBuilder;
import org.n52.proxy.db.beans.ProxyServiceEntity;
import org.n52.series.db.beans.QuantityDatasetEntity;
import org.n52.series.db.beans.UnitEntity;

/**
 * @author Jan Schulte
 */
public class QuantityDatasetConstellation extends DatasetConstellation {

    private UnitEntity unit;

    public QuantityDatasetConstellation(String procedure, String offering, String category, String phenomenon,
            String feature) {
        super(procedure, offering, category, phenomenon, feature);
    }

    public UnitEntity getUnit() {
        return unit;
    }

    public void setUnit(UnitEntity unit) {
        this.unit = unit;
    }

    @Override
    protected QuantityDatasetEntity createDatasetEntity(ProxyServiceEntity service) {
        QuantityDatasetEntity quantityDataset = new QuantityDatasetEntity();
        // add empty unit entity, will be replaced later in the repositories
        if (unit == null) {
            // create empty unit
            unit = EntityBuilder.createUnit("", null, service);
        }
        quantityDataset.setUnit(unit);
        quantityDataset.setFirstValueAt(new Date());
        quantityDataset.setLastValueAt(new Date());
        return quantityDataset;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy