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

net.intelie.liverig.witsml.query.WellboreGeometryQuery141 Maven / Gradle / Ivy

The newest version!
package net.intelie.liverig.witsml.query;

import net.intelie.liverig.parser.ParseException;
import net.intelie.liverig.witsml.WITSMLResult;
import net.intelie.liverig.witsml.objects.WellboreGeometryData;

import java.util.ArrayList;

class WellboreGeometryQuery141 extends AbstractWellboreGeometryQuery141 implements WellboreGeometryQuery {
    private final boolean wellboreGeometrySection;
    private final boolean raw;

    WellboreGeometryQuery141(String uidWell, String uidWellbore, String uid, boolean wellboreGeometrySection, boolean raw) {
        super(uidWell, uidWellbore, uid, null);
        this.wellboreGeometrySection = wellboreGeometrySection;
        this.raw = raw;
    }

    @Override
    public String options() {
        return wellboreGeometrySection ? RETURN_ELEMENTS_ALL : RETURN_ELEMENTS_REQUESTED;
    }

    @Override
    public WellboreGeometryData parse(WITSMLResult witsmlResult) throws ParseException {
        String xml = witsmlResult.getXml();
        WellboreGeometryData result = new WellboreGeometryData();
        if (wellboreGeometrySection)
            result.setData(new ArrayList<>());
        parse(xml, new Parser(result));
        if (raw)
            result.setRaw(xml);
        result.setRawResult(witsmlResult.getResult());
        return result;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy