/*
 * Copyright 2015-2018 OpenEstate.org.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.openestate.io.examples;

import java.io.File;
import java.io.IOException;
import java.io.OutputStream;
import java.io.Writer;
import java.util.ArrayList;
import java.util.Currency;
import java.util.List;
import org.apache.commons.io.output.NullOutputStream;
import org.apache.commons.io.output.NullWriter;
import org.apache.commons.lang3.RandomUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.log4j.PropertyConfigurator;
import org.openestate.io.examples.utils.RandomStringUtils;
import org.openestate.io.is24_csv.Is24CsvPrinter;
import org.openestate.io.is24_csv.Is24CsvRecord;
import org.openestate.io.is24_csv.records.HausKauf;
import org.openestate.io.is24_csv.records.WohnungMiete;
import org.openestate.io.is24_csv.types.Ausstattung;
import org.openestate.io.is24_csv.types.Auswahl;
import org.openestate.io.is24_csv.types.Bauphase;
import org.openestate.io.is24_csv.types.Befeuerungsart;
import org.openestate.io.is24_csv.types.Datei;
import org.openestate.io.is24_csv.types.DateiSuffix;
import org.openestate.io.is24_csv.types.DateiTyp;
import org.openestate.io.is24_csv.types.EnergieausweisTyp;
import org.openestate.io.is24_csv.types.Heizungsart;
import org.openestate.io.is24_csv.types.Importmodus;
import org.openestate.io.is24_csv.types.ObjektkategorieHaus;
import org.openestate.io.is24_csv.types.ObjektkategorieWohnung;
import org.openestate.io.is24_csv.types.Objektzustand;
import org.openestate.io.is24_csv.types.Stellplatz;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * Example for writing IS24-CSV files.
 * <p>
 * This example illustrates the programmatic creation of an IS24-CSV document,
 * and how the document is written into CSV.
 *
 * @author Andreas Rudolph
 * @since 1.0
 */
@SuppressWarnings("WeakerAccess")
public class Is24CsvWritingExample {
    private final static Logger LOGGER = LoggerFactory.getLogger(Is24CsvWritingExample.class);
    private final static String PACKAGE = "/org/openestate/io/examples";

    /**
     * Start the example application.
     *
     * @param args command line arguments
     */
    @SuppressWarnings("Duplicates")
    public static void main(String[] args) {
        // init logging
        PropertyConfigurator.configure(
                Is24CsvWritingExample.class.getResource(PACKAGE + "/log4j.properties"));

        // create some CSV records
        List<Is24CsvRecord> records = new ArrayList<>();
        records.add(createHausKaufRecord());
        records.add(createHausKaufRecord());
        records.add(createWohnungMieteRecord());
        records.add(createWohnungMieteRecord());

        // write CSV records into a java.io.File
        try {
            write(records, File.createTempFile("output-", ".csv"));
        } catch (IOException ex) {
            LOGGER.error("Can't create temporary file!");
            LOGGER.error("> " + ex.getLocalizedMessage(), ex);
            System.exit(1);
        }

        // write CSV records into a java.io.OutputStream
        write(records, new NullOutputStream());

        // write CSV records into a java.io.Writer
        write(records, new NullWriter());

        // write CSV records into a string and send it to the console
        writeToConsole(records);
    }

    /**
     * Create an {@link HausKauf} with some example data.
     *
     * @return created example object
     */
    protected static Is24CsvRecord createHausKaufRecord() {
        // create an example real estate
        HausKauf obj = new HausKauf();
        init(obj);

        obj.setAnzahlBadezimmer(RandomUtils.nextInt(1, 5));
        obj.setAnzahlGarageStellplatz(RandomUtils.nextInt(1, 5));
        obj.setAnzahlSchlafzimmer(RandomUtils.nextInt(1, 5));
        obj.setAusstattung(Ausstattung.GEHOBEN);
        obj.setBarrierefrei(RandomUtils.nextInt(0, 2) == 1);
        obj.setBaujahr(RandomUtils.nextInt(1900, 1990));
        obj.setBauphase(Bauphase.FERTIG_GESTELLT);
        obj.setBefeuerungsart(Befeuerungsart.KOHLE);
        obj.setDenkmalschutz(RandomUtils.nextInt(0, 2) == 1);
        obj.setEinliegerwohnung(RandomUtils.nextInt(0, 2) == 1);
        obj.setEnergieausweisInklWarmwasser(RandomUtils.nextInt(0, 2) == 1);
        obj.setEnergieausweisKennwert(RandomUtils.nextDouble(50, 500));
        obj.setEnergieausweisTyp(EnergieausweisTyp.ENERGIEVERBRAUCHSKENNWERT);
        obj.setFerienhaus(RandomUtils.nextInt(0, 2) == 1);
        obj.setGaesteWc(RandomUtils.nextInt(0, 2) == 1);
        obj.setGrundstuecksflaeche(RandomUtils.nextDouble(200, 2000));
        obj.setHeizungsart(Heizungsart.ZENTRALHEIZUNG);
        obj.setKaufpreis(RandomUtils.nextDouble(100000, 1000000));
        obj.setKeller(RandomUtils.nextInt(0, 2) == 1);
        obj.setMieteinnahmenProMonat(RandomUtils.nextDouble(5000, 50000));
        obj.setNutzflaeche(RandomUtils.nextDouble(200, 1000));
        obj.setObjektkategorie(ObjektkategorieHaus.MEHRFAMILIENHAUS);
        obj.setObjektzustand(Objektzustand.GEPFLEGT);
        obj.setSanierungsjahr(RandomUtils.nextInt(1990, 2010));
        obj.setStellplatz(Stellplatz.CARPORT);
        obj.setStellplatzpreis(RandomUtils.nextDouble(1000, 5000));
        obj.setVerfuegbarAb("notes about availability");
        obj.setVermietet(RandomUtils.nextInt(0, 2) == 1);
        obj.setWohnflaeche(RandomUtils.nextDouble(100, 500));
        obj.setZimmer(RandomUtils.nextInt(1, 10));
        return obj;
    }

    /**
     * Create an {@link WohnungMiete} with some example data.
     *
     * @return created example object
     */
    protected static Is24CsvRecord createWohnungMieteRecord() {
        // create an example real estate
        WohnungMiete obj = new WohnungMiete();
        init(obj);

        obj.setAnzahlBadezimmer(RandomUtils.nextInt(1, 5));
        obj.setAnzahlGarageStellplatz(RandomUtils.nextInt(1, 5));
        obj.setAnzahlSchlafzimmer(RandomUtils.nextInt(1, 5));
        obj.setAufzug(RandomUtils.nextInt(0, 2) == 1);
        obj.setAusstattung(Ausstattung.GEHOBEN);
        obj.setBalkonTerrasse(RandomUtils.nextInt(0, 2) == 1);
        obj.setBarrierefrei(RandomUtils.nextInt(0, 2) == 1);
        obj.setBaujahr(RandomUtils.nextInt(1900, 1990));
        obj.setBefeuerungsart(Befeuerungsart.OEL);
        obj.setEinbaukueche(RandomUtils.nextInt(0, 2) == 1);
        obj.setEnergieausweisInklWarmwasser(RandomUtils.nextInt(0, 2) == 1);
        obj.setEnergieausweisKennwert(RandomUtils.nextDouble(50, 500));
        obj.setEnergieausweisTyp(EnergieausweisTyp.ENERGIEVERBRAUCHSKENNWERT);
        obj.setEtage(RandomUtils.nextInt(0, 10));
        obj.setEtagenzahl(RandomUtils.nextInt(0, 10));
        obj.setFoerderung(RandomUtils.nextInt(0, 2) == 1);
        obj.setGaesteWc(RandomUtils.nextInt(0, 2) == 1);
        obj.setGartennutzung(RandomUtils.nextInt(0, 2) == 1);
        obj.setHaustiere(Auswahl.NACH_VEREINBARUNG);
        obj.setHeizkosten(RandomUtils.nextDouble(100, 500));
        obj.setHeizungsart(Heizungsart.OFENHEIZUNG);
        obj.setKaltmiete(RandomUtils.nextDouble(500, 3000));
        obj.setKaution("notes about deposit");
        obj.setKeller(RandomUtils.nextInt(0, 2) == 1);
        obj.setNebenkosten(RandomUtils.nextDouble(100, 500));
        obj.setNebenkostenInklHeizkosten(RandomUtils.nextInt(0, 2) == 1);
        obj.setNutzflaeche(RandomUtils.nextDouble(50, 500));
        obj.setObjektkategorie(ObjektkategorieWohnung.PENTHOUSE);
        obj.setObjektzustand(Objektzustand.MODERNISIERT);
        obj.setSanierungsjahr(RandomUtils.nextInt(1990, 2010));
        obj.setSeniorengerecht(RandomUtils.nextInt(0, 2) == 1);
        obj.setStellplatz(Stellplatz.TIEFGARAGE);
        obj.setStellplatzmiete(RandomUtils.nextDouble(50, 500));
        obj.setVerfuegbarAb("notes about availability");
        obj.setWarmmiete(RandomUtils.nextDouble(500, 2000));
        obj.setWohnflaeche(RandomUtils.nextDouble(50, 250));
        obj.setZimmer(RandomUtils.nextInt(1, 10));
        return obj;
    }

    /**
     * Init common values of an {@link Is24CsvRecord}.
     *
     * @param obj record to init
     */
    protected static void init(Is24CsvRecord obj) {
        obj.setAdressdruck(RandomUtils.nextInt(0, 2) == 1);
        obj.setAktiv(RandomUtils.nextInt(0, 2) == 1);
        obj.setAnbieterObjektId(RandomStringUtils.random(5));
        obj.setBeschreibungAusstattung("description about features");
        obj.setBeschreibungLage("description about location");
        obj.setBeschreibungObjekt("description about object");
        obj.setBeschreibungSonstiges("further descriptions");
        obj.setGruppierungId(RandomUtils.nextInt(0, 1000));
        obj.setImportmodus(Importmodus.IMPORTIEREN);
        obj.setInternationaleRegion("name of international region");
        obj.setKontaktAnrede("Mr");
        obj.setKontaktEmail("tester@test.org");
        obj.setKontaktHausNr("123");
        obj.setKontaktLand("DEU");
        obj.setKontaktMobiltelefon("030/123456");
        obj.setKontaktNachname("Mustermann");
        obj.setKontaktOrt("Berlin");
        obj.setKontaktPlz("12345");
        obj.setKontaktStrasse("example street");
        obj.setKontaktTelefax("030/123457");
        obj.setKontaktTelefon("030/123458");
        obj.setKontaktVorname("Max");
        obj.setKontaktWebseite("http://www.test.org/");
        obj.setObjektHausNr("124");
        obj.setObjektLand("DEU");
        obj.setObjektOrt("Berlin");
        obj.setObjektPlz("12345");
        obj.setObjektStrasse("example street");
        obj.setProvision("commission");
        obj.setProvisionpflichtig(RandomUtils.nextInt(0, 2) == 1);
        obj.setProvisionshinweis("notes about commission");
        obj.setScoutKundenId(RandomStringUtils.random(5));
        obj.setScoutObjektId(RandomStringUtils.random(5));
        obj.setUeberschrift("a nice title for the object");
        obj.setWaehrung(Currency.getInstance("EUR"));

        obj.setDatei1(new Datei("test1.jpg", DateiTyp.BILD, DateiSuffix.JPG, "a nice image"));
        obj.setDatei2(new Datei("test2.png", DateiTyp.BILD, DateiSuffix.PNG, "another nice image"));
        obj.setDatei3(new Datei("test3.pdf", DateiTyp.GRUNDRISS_PDF, DateiSuffix.PDF, "a document with groundplan"));
        obj.setDatei4(new Datei("http://www.test.org/", DateiTyp.LINK, null, "agency website"));
    }

    /**
     * Write some {@link Is24CsvRecord} objects into a {@link File}.
     *
     * @param records the CSV records to write
     * @param file    the file, where the document is written to
     */
    protected static void write(List<Is24CsvRecord> records, File file) {
        LOGGER.info("writing document");
        try (Is24CsvPrinter printer = Is24CsvPrinter.create(file)) {
            printer.printRecords(records);
            LOGGER.info("> written to: " + file.getAbsolutePath());
        } catch (Exception ex) {
            LOGGER.error("Can't write document into a file!");
            LOGGER.error("> " + ex.getLocalizedMessage(), ex);
            System.exit(1);
        }
    }

    /**
     * Write some {@link Is24CsvRecord} objects into an {@link OutputStream}.
     *
     * @param records the CSV records to write
     * @param output  the stream, where the document is written to
     */
    protected static void write(List<Is24CsvRecord> records, OutputStream output) {
        LOGGER.info("writing document");
        try {
            Is24CsvPrinter printer = Is24CsvPrinter.create(output);
            printer.printRecords(records);
            LOGGER.info("> written to a java.io.OutputStream");
        } catch (Exception ex) {
            LOGGER.error("Can't write document into an OutputStream!");
            LOGGER.error("> " + ex.getLocalizedMessage(), ex);
            System.exit(1);
        }
    }

    /**
     * Write some {@link Is24CsvRecord} objects into a {@link Writer}.
     *
     * @param records the CSV records to write
     * @param output  the writer, where the document is written to
     */
    protected static void write(List<Is24CsvRecord> records, Writer output) {
        LOGGER.info("writing document");
        try {
            Is24CsvPrinter printer = Is24CsvPrinter.create(output);
            printer.printRecords(records);
            LOGGER.info("> written to a java.io.Writer");
        } catch (Exception ex) {
            LOGGER.error("Can't write document into an OutputStream!");
            LOGGER.error("> " + ex.getLocalizedMessage(), ex);
            System.exit(1);
        }
    }

    /**
     * Write some {@link Is24CsvRecord} objects into a {@link String} and print the
     * results to the console.
     *
     * @param records the CSV records to write
     */
    protected static void writeToConsole(List<Is24CsvRecord> records) {
        LOGGER.info("writing document");
        StringBuilder csv = new StringBuilder();
        try (Is24CsvPrinter printer = Is24CsvPrinter.create(csv)) {
            printer.printRecords(records);
            LOGGER.info(StringUtils.repeat("-", 50)
                    + System.lineSeparator() + csv.toString());
        } catch (Exception ex) {
            LOGGER.error("Can't write document into a string!");
            LOGGER.error("> " + ex.getLocalizedMessage(), ex);
            System.exit(1);
        }
    }
}


package org.openestate.io.openimmo.xml;

import java.io.Serializable;
import java.util.Calendar;
import javax.annotation.Generated;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlEnum;
import javax.xml.bind.annotation.XmlEnumValue;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlSchemaType;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import org.jvnet.jaxb2_commons.lang.CopyStrategy2;
import org.jvnet.jaxb2_commons.lang.CopyTo2;
import org.jvnet.jaxb2_commons.lang.Equals2;
import org.jvnet.jaxb2_commons.lang.EqualsStrategy2;
import org.jvnet.jaxb2_commons.lang.JAXBCopyStrategy;
import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy;
import org.jvnet.jaxb2_commons.lang.JAXBToStringStrategy;
import org.jvnet.jaxb2_commons.lang.ToString2;
import org.jvnet.jaxb2_commons.lang.ToStringStrategy2;
import org.jvnet.jaxb2_commons.locator.ObjectLocator;
import org.jvnet.jaxb2_commons.locator.util.LocatorUtils;

/**
 * Java class for <energiepass> element.
 *
 *
 *
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
    "epart",
    "gueltigBis",
    "energieverbrauchkennwert",
    "mitwarmwasser",
    "endenergiebedarf",
    "primaerenergietraeger",
    "stromwert",
    "waermewert",
    "wertklasse",
    "baujahr",
    "ausstelldatum",
    "jahrgang",
    "gebaeudeart",
    "epasstext",
    "geg2018",
    "hwbwert",
    "hwbklasse",
    "fgeewert",
    "fgeeklasse"
})
@XmlRootElement(name = "energiepass")
@Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:54:50+02:00", comments = "JAXB RI v2.2.11")
public class Energiepass implements Serializable, Cloneable, CopyTo2, Equals2, ToString2
{

    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:54:50+02:00", comments = "JAXB RI v2.2.11")
    protected Energiepass.Epart epart;
    @XmlElement(name = "gueltig_bis")
    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:54:50+02:00", comments = "JAXB RI v2.2.11")
    protected String gueltigBis;
    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:54:50+02:00", comments = "JAXB RI v2.2.11")
    protected String energieverbrauchkennwert;
    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:54:50+02:00", comments = "JAXB RI v2.2.11")
    protected Boolean mitwarmwasser;
    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:54:50+02:00", comments = "JAXB RI v2.2.11")
    protected String endenergiebedarf;
    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:54:50+02:00", comments = "JAXB RI v2.2.11")
    protected String primaerenergietraeger;
    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:54:50+02:00", comments = "JAXB RI v2.2.11")
    protected String stromwert;
    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:54:50+02:00", comments = "JAXB RI v2.2.11")
    protected String waermewert;
    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:54:50+02:00", comments = "JAXB RI v2.2.11")
    protected String wertklasse;
    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:54:50+02:00", comments = "JAXB RI v2.2.11")
    protected String baujahr;
    @XmlElement(type = String.class)
    @XmlJavaTypeAdapter(Adapter4 .class)
    @XmlSchemaType(name = "date")
    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:54:50+02:00", comments = "JAXB RI v2.2.11")
    protected Calendar ausstelldatum;
    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:54:50+02:00", comments = "JAXB RI v2.2.11")
    protected Energiepass.Jahrgang jahrgang;
    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:54:50+02:00", comments = "JAXB RI v2.2.11")
    protected Energiepass.Gebaeudeart gebaeudeart;
    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:54:50+02:00", comments = "JAXB RI v2.2.11")
    protected String epasstext;
    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:54:50+02:00", comments = "JAXB RI v2.2.11")
    protected String geg2018;
    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:54:50+02:00", comments = "JAXB RI v2.2.11")
    protected String hwbwert;
    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:54:50+02:00", comments = "JAXB RI v2.2.11")
    protected String hwbklasse;
    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:54:50+02:00", comments = "JAXB RI v2.2.11")
    protected String fgeewert;
    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:54:50+02:00", comments = "JAXB RI v2.2.11")
    protected String fgeeklasse;

    /**
     * Gets the value of the epart property.
     *
     * @return
     *     possible object is
     *     {@link Energiepass.Epart }
     *
     */
    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:54:50+02:00", comments = "JAXB RI v2.2.11")
    public Energiepass.Epart getEpart() {
        return epart;
    }

    /**
     * Sets the value of the epart property.
     *
     * @param value
     *     allowed object is
     *     {@link Energiepass.Epart }
     *
     */
    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:54:50+02:00", comments = "JAXB RI v2.2.11")
    public void setEpart(Energiepass.Epart value) {
        this.epart = value;
    }

    /**
     * Gets the value of the gueltigBis property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:54:50+02:00", comments = "JAXB RI v2.2.11")
    public String getGueltigBis() {
        return gueltigBis;
    }

    /**
     * Sets the value of the gueltigBis property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:54:50+02:00", comments = "JAXB RI v2.2.11")
    public void setGueltigBis(String value) {
        this.gueltigBis = value;
    }

    /**
     * Gets the value of the energieverbrauchkennwert property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:54:50+02:00", comments = "JAXB RI v2.2.11")
    public String getEnergieverbrauchkennwert() {
        return energieverbrauchkennwert;
    }

    /**
     * Sets the value of the energieverbrauchkennwert property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:54:50+02:00", comments = "JAXB RI v2.2.11")
    public void setEnergieverbrauchkennwert(String value) {
        this.energieverbrauchkennwert = value;
    }

    /**
     * Gets the value of the mitwarmwasser property.
     *
     * @return
     *     possible object is
     *     {@link Boolean }
     *
     */
    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:54:50+02:00", comments = "JAXB RI v2.2.11")
    public Boolean getMitwarmwasser() {
        return mitwarmwasser;
    }

    /**
     * Sets the value of the mitwarmwasser property.
     *
     * @param value
     *     allowed object is
     *     {@link Boolean }
     *
     */
    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:54:50+02:00", comments = "JAXB RI v2.2.11")
    public void setMitwarmwasser(Boolean value) {
        this.mitwarmwasser = value;
    }

    /**
     * Gets the value of the endenergiebedarf property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:54:50+02:00", comments = "JAXB RI v2.2.11")
    public String getEndenergiebedarf() {
        return endenergiebedarf;
    }

    /**
     * Sets the value of the endenergiebedarf property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:54:50+02:00", comments = "JAXB RI v2.2.11")
    public void setEndenergiebedarf(String value) {
        this.endenergiebedarf = value;
    }

    /**
     * Gets the value of the primaerenergietraeger property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:54:50+02:00", comments = "JAXB RI v2.2.11")
    public String getPrimaerenergietraeger() {
        return primaerenergietraeger;
    }

    /**
     * Sets the value of the primaerenergietraeger property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:54:50+02:00", comments = "JAXB RI v2.2.11")
    public void setPrimaerenergietraeger(String value) {
        this.primaerenergietraeger = value;
    }

    /**
     * Gets the value of the stromwert property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:54:50+02:00", comments = "JAXB RI v2.2.11")
    public String getStromwert() {
        return stromwert;
    }

    /**
     * Sets the value of the stromwert property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:54:50+02:00", comments = "JAXB RI v2.2.11")
    public void setStromwert(String value) {
        this.stromwert = value;
    }

    /**
     * Gets the value of the waermewert property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:54:50+02:00", comments = "JAXB RI v2.2.11")
    public String getWaermewert() {
        return waermewert;
    }

    /**
     * Sets the value of the waermewert property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:54:50+02:00", comments = "JAXB RI v2.2.11")
    public void setWaermewert(String value) {
        this.waermewert = value;
    }

    /**
     * Gets the value of the wertklasse property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:54:50+02:00", comments = "JAXB RI v2.2.11")
    public String getWertklasse() {
        return wertklasse;
    }

    /**
     * Sets the value of the wertklasse property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:54:50+02:00", comments = "JAXB RI v2.2.11")
    public void setWertklasse(String value) {
        this.wertklasse = value;
    }

    /**
     * Gets the value of the baujahr property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:54:50+02:00", comments = "JAXB RI v2.2.11")
    public String getBaujahr() {
        return baujahr;
    }

    /**
     * Sets the value of the baujahr property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:54:50+02:00", comments = "JAXB RI v2.2.11")
    public void setBaujahr(String value) {
        this.baujahr = value;
    }

    /**
     * Gets the value of the ausstelldatum property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:54:50+02:00", comments = "JAXB RI v2.2.11")
    public Calendar getAusstelldatum() {
        return ausstelldatum;
    }

    /**
     * Sets the value of the ausstelldatum property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:54:50+02:00", comments = "JAXB RI v2.2.11")
    public void setAusstelldatum(Calendar value) {
        this.ausstelldatum = value;
    }

    /**
     * Gets the value of the jahrgang property.
     *
     * @return
     *     possible object is
     *     {@link Energiepass.Jahrgang }
     *
     */
    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:54:50+02:00", comments = "JAXB RI v2.2.11")
    public Energiepass.Jahrgang getJahrgang() {
        return jahrgang;
    }

    /**
     * Sets the value of the jahrgang property.
     *
     * @param value
     *     allowed object is
     *     {@link Energiepass.Jahrgang }
     *
     */
    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:54:50+02:00", comments = "JAXB RI v2.2.11")
    public void setJahrgang(Energiepass.Jahrgang value) {
        this.jahrgang = value;
    }

    /**
     * Gets the value of the gebaeudeart property.
     *
     * @return
     *     possible object is
     *     {@link Energiepass.Gebaeudeart }
     *
     */
    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:54:50+02:00", comments = "JAXB RI v2.2.11")
    public Energiepass.Gebaeudeart getGebaeudeart() {
        return gebaeudeart;
    }

    /**
     * Sets the value of the gebaeudeart property.
     *
     * @param value
     *     allowed object is
     *     {@link Energiepass.Gebaeudeart }
     *
     */
    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:54:50+02:00", comments = "JAXB RI v2.2.11")
    public void setGebaeudeart(Energiepass.Gebaeudeart value) {
        this.gebaeudeart = value;
    }

    /**
     * Gets the value of the epasstext property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:54:50+02:00", comments = "JAXB RI v2.2.11")
    public String getEpasstext() {
        return epasstext;
    }

    /**
     * Sets the value of the epasstext property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:54:50+02:00", comments = "JAXB RI v2.2.11")
    public void setEpasstext(String value) {
        this.epasstext = value;
    }

    /**
     * Gets the value of the geg2018 property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:54:50+02:00", comments = "JAXB RI v2.2.11")
    public String getGeg2018() {
        return geg2018;
    }

    /**
     * Sets the value of the geg2018 property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:54:50+02:00", comments = "JAXB RI v2.2.11")
    public void setGeg2018(String value) {
        this.geg2018 = value;
    }

    /**
     * Gets the value of the hwbwert property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:54:50+02:00", comments = "JAXB RI v2.2.11")
    public String getHwbwert() {
        return hwbwert;
    }

    /**
     * Sets the value of the hwbwert property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:54:50+02:00", comments = "JAXB RI v2.2.11")
    public void setHwbwert(String value) {
        this.hwbwert = value;
    }

    /**
     * Gets the value of the hwbklasse property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:54:50+02:00", comments = "JAXB RI v2.2.11")
    public String getHwbklasse() {
        return hwbklasse;
    }

    /**
     * Sets the value of the hwbklasse property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:54:50+02:00", comments = "JAXB RI v2.2.11")
    public void setHwbklasse(String value) {
        this.hwbklasse = value;
    }

    /**
     * Gets the value of the fgeewert property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:54:50+02:00", comments = "JAXB RI v2.2.11")
    public String getFgeewert() {
        return fgeewert;
    }

    /**
     * Sets the value of the fgeewert property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:54:50+02:00", comments = "JAXB RI v2.2.11")
    public void setFgeewert(String value) {
        this.fgeewert = value;
    }

    /**
     * Gets the value of the fgeeklasse property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:54:50+02:00", comments = "JAXB RI v2.2.11")
    public String getFgeeklasse() {
        return fgeeklasse;
    }

    /**
     * Sets the value of the fgeeklasse property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:54:50+02:00", comments = "JAXB RI v2.2.11")
    public void setFgeeklasse(String value) {
        this.fgeeklasse = value;
    }

    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:54:50+02:00", comments = "JAXB RI v2.2.11")
    public String toString() {
        final ToStringStrategy2 strategy = JAXBToStringStrategy.INSTANCE;
        final StringBuilder buffer = new StringBuilder();
        append(null, buffer, strategy);
        return buffer.toString();
    }

    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:54:50+02:00", comments = "JAXB RI v2.2.11")
    public StringBuilder append(ObjectLocator locator, StringBuilder buffer, ToStringStrategy2 strategy) {
        strategy.appendStart(locator, this, buffer);
        appendFields(locator, buffer, strategy);
        strategy.appendEnd(locator, this, buffer);
        return buffer;
    }

    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:54:50+02:00", comments = "JAXB RI v2.2.11")
    public StringBuilder appendFields(ObjectLocator locator, StringBuilder buffer, ToStringStrategy2 strategy) {
        {
            Energiepass.Epart theEpart;
            theEpart = this.getEpart();
            strategy.appendField(locator, this, "epart", buffer, theEpart, (this.epart!= null));
        }
        {
            String theGueltigBis;
            theGueltigBis = this.getGueltigBis();
            strategy.appendField(locator, this, "gueltigBis", buffer, theGueltigBis, (this.gueltigBis!= null));
        }
        {
            String theEnergieverbrauchkennwert;
            theEnergieverbrauchkennwert = this.getEnergieverbrauchkennwert();
            strategy.appendField(locator, this, "energieverbrauchkennwert", buffer, theEnergieverbrauchkennwert, (this.energieverbrauchkennwert!= null));
        }
        {
            Boolean theMitwarmwasser;
            theMitwarmwasser = this.getMitwarmwasser();
            strategy.appendField(locator, this, "mitwarmwasser", buffer, theMitwarmwasser, (this.mitwarmwasser!= null));
        }
        {
            String theEndenergiebedarf;
            theEndenergiebedarf = this.getEndenergiebedarf();
            strategy.appendField(locator, this, "endenergiebedarf", buffer, theEndenergiebedarf, (this.endenergiebedarf!= null));
        }
        {
            String thePrimaerenergietraeger;
            thePrimaerenergietraeger = this.getPrimaerenergietraeger();
            strategy.appendField(locator, this, "primaerenergietraeger", buffer, thePrimaerenergietraeger, (this.primaerenergietraeger!= null));
        }
        {
            String theStromwert;
            theStromwert = this.getStromwert();
            strategy.appendField(locator, this, "stromwert", buffer, theStromwert, (this.stromwert!= null));
        }
        {
            String theWaermewert;
            theWaermewert = this.getWaermewert();
            strategy.appendField(locator, this, "waermewert", buffer, theWaermewert, (this.waermewert!= null));
        }
        {
            String theWertklasse;
            theWertklasse = this.getWertklasse();
            strategy.appendField(locator, this, "wertklasse", buffer, theWertklasse, (this.wertklasse!= null));
        }
        {
            String theBaujahr;
            theBaujahr = this.getBaujahr();
            strategy.appendField(locator, this, "baujahr", buffer, theBaujahr, (this.baujahr!= null));
        }
        {
            Calendar theAusstelldatum;
            theAusstelldatum = this.getAusstelldatum();
            strategy.appendField(locator, this, "ausstelldatum", buffer, theAusstelldatum, (this.ausstelldatum!= null));
        }
        {
            Energiepass.Jahrgang theJahrgang;
            theJahrgang = this.getJahrgang();
            strategy.appendField(locator, this, "jahrgang", buffer, theJahrgang, (this.jahrgang!= null));
        }
        {
            Energiepass.Gebaeudeart theGebaeudeart;
            theGebaeudeart = this.getGebaeudeart();
            strategy.appendField(locator, this, "gebaeudeart", buffer, theGebaeudeart, (this.gebaeudeart!= null));
        }
        {
            String theEpasstext;
            theEpasstext = this.getEpasstext();
            strategy.appendField(locator, this, "epasstext", buffer, theEpasstext, (this.epasstext!= null));
        }
        {
            String theGeg2018;
            theGeg2018 = this.getGeg2018();
            strategy.appendField(locator, this, "geg2018", buffer, theGeg2018, (this.geg2018 != null));
        }
        {
            String theHwbwert;
            theHwbwert = this.getHwbwert();
            strategy.appendField(locator, this, "hwbwert", buffer, theHwbwert, (this.hwbwert!= null));
        }
        {
            String theHwbklasse;
            theHwbklasse = this.getHwbklasse();
            strategy.appendField(locator, this, "hwbklasse", buffer, theHwbklasse, (this.hwbklasse!= null));
        }
        {
            String theFgeewert;
            theFgeewert = this.getFgeewert();
            strategy.appendField(locator, this, "fgeewert", buffer, theFgeewert, (this.fgeewert!= null));
        }
        {
            String theFgeeklasse;
            theFgeeklasse = this.getFgeeklasse();
            strategy.appendField(locator, this, "fgeeklasse", buffer, theFgeeklasse, (this.fgeeklasse!= null));
        }
        return buffer;
    }

    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:54:50+02:00", comments = "JAXB RI v2.2.11")
    public Object clone() {
        return copyTo(createNewInstance());
    }

    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:54:50+02:00", comments = "JAXB RI v2.2.11")
    public Object copyTo(Object target) {
        final CopyStrategy2 strategy = JAXBCopyStrategy.INSTANCE;
        return copyTo(null, target, strategy);
    }

    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:54:50+02:00", comments = "JAXB RI v2.2.11")
    public Object copyTo(ObjectLocator locator, Object target, CopyStrategy2 strategy) {
        final Object draftCopy = ((target == null)?createNewInstance():target);
        if (draftCopy instanceof Energiepass) {
            final Energiepass copy = ((Energiepass) draftCopy);
            {
                Boolean epartShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, (this.epart!= null));
                if (epartShouldBeCopiedAndSet == Boolean.TRUE) {
                    Energiepass.Epart sourceEpart;
                    sourceEpart = this.getEpart();
                    Energiepass.Epart copyEpart = ((Energiepass.Epart) strategy.copy(LocatorUtils.property(locator, "epart", sourceEpart), sourceEpart, (this.epart!= null)));
                    copy.setEpart(copyEpart);
                } else {
                    if (epartShouldBeCopiedAndSet == Boolean.FALSE) {
                        copy.epart = null;
                    }
                }
            }
            {
                Boolean gueltigBisShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, (this.gueltigBis!= null));
                if (gueltigBisShouldBeCopiedAndSet == Boolean.TRUE) {
                    String sourceGueltigBis;
                    sourceGueltigBis = this.getGueltigBis();
                    String copyGueltigBis = ((String) strategy.copy(LocatorUtils.property(locator, "gueltigBis", sourceGueltigBis), sourceGueltigBis, (this.gueltigBis!= null)));
                    copy.setGueltigBis(copyGueltigBis);
                } else {
                    if (gueltigBisShouldBeCopiedAndSet == Boolean.FALSE) {
                        copy.gueltigBis = null;
                    }
                }
            }
            {
                Boolean energieverbrauchkennwertShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, (this.energieverbrauchkennwert!= null));
                if (energieverbrauchkennwertShouldBeCopiedAndSet == Boolean.TRUE) {
                    String sourceEnergieverbrauchkennwert;
                    sourceEnergieverbrauchkennwert = this.getEnergieverbrauchkennwert();
                    String copyEnergieverbrauchkennwert = ((String) strategy.copy(LocatorUtils.property(locator, "energieverbrauchkennwert", sourceEnergieverbrauchkennwert), sourceEnergieverbrauchkennwert, (this.energieverbrauchkennwert!= null)));
                    copy.setEnergieverbrauchkennwert(copyEnergieverbrauchkennwert);
                } else {
                    if (energieverbrauchkennwertShouldBeCopiedAndSet == Boolean.FALSE) {
                        copy.energieverbrauchkennwert = null;
                    }
                }
            }
            {
                Boolean mitwarmwasserShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, (this.mitwarmwasser!= null));
                if (mitwarmwasserShouldBeCopiedAndSet == Boolean.TRUE) {
                    Boolean sourceMitwarmwasser;
                    sourceMitwarmwasser = this.getMitwarmwasser();
                    Boolean copyMitwarmwasser = ((Boolean) strategy.copy(LocatorUtils.property(locator, "mitwarmwasser", sourceMitwarmwasser), sourceMitwarmwasser, (this.mitwarmwasser!= null)));
                    copy.setMitwarmwasser(copyMitwarmwasser);
                } else {
                    if (mitwarmwasserShouldBeCopiedAndSet == Boolean.FALSE) {
                        copy.mitwarmwasser = null;
                    }
                }
            }
            {
                Boolean endenergiebedarfShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, (this.endenergiebedarf!= null));
                if (endenergiebedarfShouldBeCopiedAndSet == Boolean.TRUE) {
                    String sourceEndenergiebedarf;
                    sourceEndenergiebedarf = this.getEndenergiebedarf();
                    String copyEndenergiebedarf = ((String) strategy.copy(LocatorUtils.property(locator, "endenergiebedarf", sourceEndenergiebedarf), sourceEndenergiebedarf, (this.endenergiebedarf!= null)));
                    copy.setEndenergiebedarf(copyEndenergiebedarf);
                } else {
                    if (endenergiebedarfShouldBeCopiedAndSet == Boolean.FALSE) {
                        copy.endenergiebedarf = null;
                    }
                }
            }
            {
                Boolean primaerenergietraegerShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, (this.primaerenergietraeger!= null));
                if (primaerenergietraegerShouldBeCopiedAndSet == Boolean.TRUE) {
                    String sourcePrimaerenergietraeger;
                    sourcePrimaerenergietraeger = this.getPrimaerenergietraeger();
                    String copyPrimaerenergietraeger = ((String) strategy.copy(LocatorUtils.property(locator, "primaerenergietraeger", sourcePrimaerenergietraeger), sourcePrimaerenergietraeger, (this.primaerenergietraeger!= null)));
                    copy.setPrimaerenergietraeger(copyPrimaerenergietraeger);
                } else {
                    if (primaerenergietraegerShouldBeCopiedAndSet == Boolean.FALSE) {
                        copy.primaerenergietraeger = null;
                    }
                }
            }
            {
                Boolean stromwertShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, (this.stromwert!= null));
                if (stromwertShouldBeCopiedAndSet == Boolean.TRUE) {
                    String sourceStromwert;
                    sourceStromwert = this.getStromwert();
                    String copyStromwert = ((String) strategy.copy(LocatorUtils.property(locator, "stromwert", sourceStromwert), sourceStromwert, (this.stromwert!= null)));
                    copy.setStromwert(copyStromwert);
                } else {
                    if (stromwertShouldBeCopiedAndSet == Boolean.FALSE) {
                        copy.stromwert = null;
                    }
                }
            }
            {
                Boolean waermewertShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, (this.waermewert!= null));
                if (waermewertShouldBeCopiedAndSet == Boolean.TRUE) {
                    String sourceWaermewert;
                    sourceWaermewert = this.getWaermewert();
                    String copyWaermewert = ((String) strategy.copy(LocatorUtils.property(locator, "waermewert", sourceWaermewert), sourceWaermewert, (this.waermewert!= null)));
                    copy.setWaermewert(copyWaermewert);
                } else {
                    if (waermewertShouldBeCopiedAndSet == Boolean.FALSE) {
                        copy.waermewert = null;
                    }
                }
            }
            {
                Boolean wertklasseShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, (this.wertklasse!= null));
                if (wertklasseShouldBeCopiedAndSet == Boolean.TRUE) {
                    String sourceWertklasse;
                    sourceWertklasse = this.getWertklasse();
                    String copyWertklasse = ((String) strategy.copy(LocatorUtils.property(locator, "wertklasse", sourceWertklasse), sourceWertklasse, (this.wertklasse!= null)));
                    copy.setWertklasse(copyWertklasse);
                } else {
                    if (wertklasseShouldBeCopiedAndSet == Boolean.FALSE) {
                        copy.wertklasse = null;
                    }
                }
            }
            {
                Boolean baujahrShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, (this.baujahr!= null));
                if (baujahrShouldBeCopiedAndSet == Boolean.TRUE) {
                    String sourceBaujahr;
                    sourceBaujahr = this.getBaujahr();
                    String copyBaujahr = ((String) strategy.copy(LocatorUtils.property(locator, "baujahr", sourceBaujahr), sourceBaujahr, (this.baujahr!= null)));
                    copy.setBaujahr(copyBaujahr);
                } else {
                    if (baujahrShouldBeCopiedAndSet == Boolean.FALSE) {
                        copy.baujahr = null;
                    }
                }
            }
            {
                Boolean ausstelldatumShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, (this.ausstelldatum!= null));
                if (ausstelldatumShouldBeCopiedAndSet == Boolean.TRUE) {
                    Calendar sourceAusstelldatum;
                    sourceAusstelldatum = this.getAusstelldatum();
                    Calendar copyAusstelldatum = ((Calendar) strategy.copy(LocatorUtils.property(locator, "ausstelldatum", sourceAusstelldatum), sourceAusstelldatum, (this.ausstelldatum!= null)));
                    copy.setAusstelldatum(copyAusstelldatum);
                } else {
                    if (ausstelldatumShouldBeCopiedAndSet == Boolean.FALSE) {
                        copy.ausstelldatum = null;
                    }
                }
            }
            {
                Boolean jahrgangShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, (this.jahrgang!= null));
                if (jahrgangShouldBeCopiedAndSet == Boolean.TRUE) {
                    Energiepass.Jahrgang sourceJahrgang;
                    sourceJahrgang = this.getJahrgang();
                    Energiepass.Jahrgang copyJahrgang = ((Energiepass.Jahrgang) strategy.copy(LocatorUtils.property(locator, "jahrgang", sourceJahrgang), sourceJahrgang, (this.jahrgang!= null)));
                    copy.setJahrgang(copyJahrgang);
                } else {
                    if (jahrgangShouldBeCopiedAndSet == Boolean.FALSE) {
                        copy.jahrgang = null;
                    }
                }
            }
            {
                Boolean gebaeudeartShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, (this.gebaeudeart!= null));
                if (gebaeudeartShouldBeCopiedAndSet == Boolean.TRUE) {
                    Energiepass.Gebaeudeart sourceGebaeudeart;
                    sourceGebaeudeart = this.getGebaeudeart();
                    Energiepass.Gebaeudeart copyGebaeudeart = ((Energiepass.Gebaeudeart) strategy.copy(LocatorUtils.property(locator, "gebaeudeart", sourceGebaeudeart), sourceGebaeudeart, (this.gebaeudeart!= null)));
                    copy.setGebaeudeart(copyGebaeudeart);
                } else {
                    if (gebaeudeartShouldBeCopiedAndSet == Boolean.FALSE) {
                        copy.gebaeudeart = null;
                    }
                }
            }
            {
                Boolean epasstextShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, (this.epasstext!= null));
                if (epasstextShouldBeCopiedAndSet == Boolean.TRUE) {
                    String sourceEpasstext;
                    sourceEpasstext = this.getEpasstext();
                    String copyEpasstext = ((String) strategy.copy(LocatorUtils.property(locator, "epasstext", sourceEpasstext), sourceEpasstext, (this.epasstext!= null)));
                    copy.setEpasstext(copyEpasstext);
                } else {
                    if (epasstextShouldBeCopiedAndSet == Boolean.FALSE) {
                        copy.epasstext = null;
                    }
                }
            }
            {
                Boolean geg2018ShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, (this.geg2018 != null));
                if (geg2018ShouldBeCopiedAndSet == Boolean.TRUE) {
                    String sourceGeg2018;
                    sourceGeg2018 = this.getGeg2018();
                    String copyGeg2018 = ((String) strategy.copy(LocatorUtils.property(locator, "geg2018", sourceGeg2018), sourceGeg2018, (this.geg2018 != null)));
                    copy.setGeg2018(copyGeg2018);
                } else {
                    if (geg2018ShouldBeCopiedAndSet == Boolean.FALSE) {
                        copy.geg2018 = null;
                    }
                }
            }
            {
                Boolean hwbwertShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, (this.hwbwert!= null));
                if (hwbwertShouldBeCopiedAndSet == Boolean.TRUE) {
                    String sourceHwbwert;
                    sourceHwbwert = this.getHwbwert();
                    String copyHwbwert = ((String) strategy.copy(LocatorUtils.property(locator, "hwbwert", sourceHwbwert), sourceHwbwert, (this.hwbwert!= null)));
                    copy.setHwbwert(copyHwbwert);
                } else {
                    if (hwbwertShouldBeCopiedAndSet == Boolean.FALSE) {
                        copy.hwbwert = null;
                    }
                }
            }
            {
                Boolean hwbklasseShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, (this.hwbklasse!= null));
                if (hwbklasseShouldBeCopiedAndSet == Boolean.TRUE) {
                    String sourceHwbklasse;
                    sourceHwbklasse = this.getHwbklasse();
                    String copyHwbklasse = ((String) strategy.copy(LocatorUtils.property(locator, "hwbklasse", sourceHwbklasse), sourceHwbklasse, (this.hwbklasse!= null)));
                    copy.setHwbklasse(copyHwbklasse);
                } else {
                    if (hwbklasseShouldBeCopiedAndSet == Boolean.FALSE) {
                        copy.hwbklasse = null;
                    }
                }
            }
            {
                Boolean fgeewertShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, (this.fgeewert!= null));
                if (fgeewertShouldBeCopiedAndSet == Boolean.TRUE) {
                    String sourceFgeewert;
                    sourceFgeewert = this.getFgeewert();
                    String copyFgeewert = ((String) strategy.copy(LocatorUtils.property(locator, "fgeewert", sourceFgeewert), sourceFgeewert, (this.fgeewert!= null)));
                    copy.setFgeewert(copyFgeewert);
                } else {
                    if (fgeewertShouldBeCopiedAndSet == Boolean.FALSE) {
                        copy.fgeewert = null;
                    }
                }
            }
            {
                Boolean fgeeklasseShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, (this.fgeeklasse!= null));
                if (fgeeklasseShouldBeCopiedAndSet == Boolean.TRUE) {
                    String sourceFgeeklasse;
                    sourceFgeeklasse = this.getFgeeklasse();
                    String copyFgeeklasse = ((String) strategy.copy(LocatorUtils.property(locator, "fgeeklasse", sourceFgeeklasse), sourceFgeeklasse, (this.fgeeklasse!= null)));
                    copy.setFgeeklasse(copyFgeeklasse);
                } else {
                    if (fgeeklasseShouldBeCopiedAndSet == Boolean.FALSE) {
                        copy.fgeeklasse = null;
                    }
                }
            }
        }
        return draftCopy;
    }

    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:54:50+02:00", comments = "JAXB RI v2.2.11")
    public Object createNewInstance() {
        return new Energiepass();
    }

    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:54:50+02:00", comments = "JAXB RI v2.2.11")
    public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy2 strategy) {
        if ((object == null)||(this.getClass()!= object.getClass())) {
            return false;
        }
        if (this == object) {
            return true;
        }
        final Energiepass that = ((Energiepass) object);
        {
            Energiepass.Epart lhsEpart;
            lhsEpart = this.getEpart();
            Energiepass.Epart rhsEpart;
            rhsEpart = that.getEpart();
            if (!strategy.equals(LocatorUtils.property(thisLocator, "epart", lhsEpart), LocatorUtils.property(thatLocator, "epart", rhsEpart), lhsEpart, rhsEpart, (this.epart!= null), (that.epart!= null))) {
                return false;
            }
        }
        {
            String lhsGueltigBis;
            lhsGueltigBis = this.getGueltigBis();
            String rhsGueltigBis;
            rhsGueltigBis = that.getGueltigBis();
            if (!strategy.equals(LocatorUtils.property(thisLocator, "gueltigBis", lhsGueltigBis), LocatorUtils.property(thatLocator, "gueltigBis", rhsGueltigBis), lhsGueltigBis, rhsGueltigBis, (this.gueltigBis!= null), (that.gueltigBis!= null))) {
                return false;
            }
        }
        {
            String lhsEnergieverbrauchkennwert;
            lhsEnergieverbrauchkennwert = this.getEnergieverbrauchkennwert();
            String rhsEnergieverbrauchkennwert;
            rhsEnergieverbrauchkennwert = that.getEnergieverbrauchkennwert();
            if (!strategy.equals(LocatorUtils.property(thisLocator, "energieverbrauchkennwert", lhsEnergieverbrauchkennwert), LocatorUtils.property(thatLocator, "energieverbrauchkennwert", rhsEnergieverbrauchkennwert), lhsEnergieverbrauchkennwert, rhsEnergieverbrauchkennwert, (this.energieverbrauchkennwert!= null), (that.energieverbrauchkennwert!= null))) {
                return false;
            }
        }
        {
            Boolean lhsMitwarmwasser;
            lhsMitwarmwasser = this.getMitwarmwasser();
            Boolean rhsMitwarmwasser;
            rhsMitwarmwasser = that.getMitwarmwasser();
            if (!strategy.equals(LocatorUtils.property(thisLocator, "mitwarmwasser", lhsMitwarmwasser), LocatorUtils.property(thatLocator, "mitwarmwasser", rhsMitwarmwasser), lhsMitwarmwasser, rhsMitwarmwasser, (this.mitwarmwasser!= null), (that.mitwarmwasser!= null))) {
                return false;
            }
        }
        {
            String lhsEndenergiebedarf;
            lhsEndenergiebedarf = this.getEndenergiebedarf();
            String rhsEndenergiebedarf;
            rhsEndenergiebedarf = that.getEndenergiebedarf();
            if (!strategy.equals(LocatorUtils.property(thisLocator, "endenergiebedarf", lhsEndenergiebedarf), LocatorUtils.property(thatLocator, "endenergiebedarf", rhsEndenergiebedarf), lhsEndenergiebedarf, rhsEndenergiebedarf, (this.endenergiebedarf!= null), (that.endenergiebedarf!= null))) {
                return false;
            }
        }
        {
            String lhsPrimaerenergietraeger;
            lhsPrimaerenergietraeger = this.getPrimaerenergietraeger();
            String rhsPrimaerenergietraeger;
            rhsPrimaerenergietraeger = that.getPrimaerenergietraeger();
            if (!strategy.equals(LocatorUtils.property(thisLocator, "primaerenergietraeger", lhsPrimaerenergietraeger), LocatorUtils.property(thatLocator, "primaerenergietraeger", rhsPrimaerenergietraeger), lhsPrimaerenergietraeger, rhsPrimaerenergietraeger, (this.primaerenergietraeger!= null), (that.primaerenergietraeger!= null))) {
                return false;
            }
        }
        {
            String lhsStromwert;
            lhsStromwert = this.getStromwert();
            String rhsStromwert;
            rhsStromwert = that.getStromwert();
            if (!strategy.equals(LocatorUtils.property(thisLocator, "stromwert", lhsStromwert), LocatorUtils.property(thatLocator, "stromwert", rhsStromwert), lhsStromwert, rhsStromwert, (this.stromwert!= null), (that.stromwert!= null))) {
                return false;
            }
        }
        {
            String lhsWaermewert;
            lhsWaermewert = this.getWaermewert();
            String rhsWaermewert;
            rhsWaermewert = that.getWaermewert();
            if (!strategy.equals(LocatorUtils.property(thisLocator, "waermewert", lhsWaermewert), LocatorUtils.property(thatLocator, "waermewert", rhsWaermewert), lhsWaermewert, rhsWaermewert, (this.waermewert!= null), (that.waermewert!= null))) {
                return false;
            }
        }
        {
            String lhsWertklasse;
            lhsWertklasse = this.getWertklasse();
            String rhsWertklasse;
            rhsWertklasse = that.getWertklasse();
            if (!strategy.equals(LocatorUtils.property(thisLocator, "wertklasse", lhsWertklasse), LocatorUtils.property(thatLocator, "wertklasse", rhsWertklasse), lhsWertklasse, rhsWertklasse, (this.wertklasse!= null), (that.wertklasse!= null))) {
                return false;
            }
        }
        {
            String lhsBaujahr;
            lhsBaujahr = this.getBaujahr();
            String rhsBaujahr;
            rhsBaujahr = that.getBaujahr();
            if (!strategy.equals(LocatorUtils.property(thisLocator, "baujahr", lhsBaujahr), LocatorUtils.property(thatLocator, "baujahr", rhsBaujahr), lhsBaujahr, rhsBaujahr, (this.baujahr!= null), (that.baujahr!= null))) {
                return false;
            }
        }
        {
            Calendar lhsAusstelldatum;
            lhsAusstelldatum = this.getAusstelldatum();
            Calendar rhsAusstelldatum;
            rhsAusstelldatum = that.getAusstelldatum();
            if (!strategy.equals(LocatorUtils.property(thisLocator, "ausstelldatum", lhsAusstelldatum), LocatorUtils.property(thatLocator, "ausstelldatum", rhsAusstelldatum), lhsAusstelldatum, rhsAusstelldatum, (this.ausstelldatum!= null), (that.ausstelldatum!= null))) {
                return false;
            }
        }
        {
            Energiepass.Jahrgang lhsJahrgang;
            lhsJahrgang = this.getJahrgang();
            Energiepass.Jahrgang rhsJahrgang;
            rhsJahrgang = that.getJahrgang();
            if (!strategy.equals(LocatorUtils.property(thisLocator, "jahrgang", lhsJahrgang), LocatorUtils.property(thatLocator, "jahrgang", rhsJahrgang), lhsJahrgang, rhsJahrgang, (this.jahrgang!= null), (that.jahrgang!= null))) {
                return false;
            }
        }
        {
            Energiepass.Gebaeudeart lhsGebaeudeart;
            lhsGebaeudeart = this.getGebaeudeart();
            Energiepass.Gebaeudeart rhsGebaeudeart;
            rhsGebaeudeart = that.getGebaeudeart();
            if (!strategy.equals(LocatorUtils.property(thisLocator, "gebaeudeart", lhsGebaeudeart), LocatorUtils.property(thatLocator, "gebaeudeart", rhsGebaeudeart), lhsGebaeudeart, rhsGebaeudeart, (this.gebaeudeart!= null), (that.gebaeudeart!= null))) {
                return false;
            }
        }
        {
            String lhsEpasstext;
            lhsEpasstext = this.getEpasstext();
            String rhsEpasstext;
            rhsEpasstext = that.getEpasstext();
            if (!strategy.equals(LocatorUtils.property(thisLocator, "epasstext", lhsEpasstext), LocatorUtils.property(thatLocator, "epasstext", rhsEpasstext), lhsEpasstext, rhsEpasstext, (this.epasstext!= null), (that.epasstext!= null))) {
                return false;
            }
        }
        {
            String lhsGeg2018;
            lhsGeg2018 = this.getGeg2018();
            String rhsGeg2018;
            rhsGeg2018 = that.getGeg2018();
            if (!strategy.equals(LocatorUtils.property(thisLocator, "geg2018", lhsGeg2018), LocatorUtils.property(thatLocator, "geg2018", rhsGeg2018), lhsGeg2018, rhsGeg2018, (this.geg2018 != null), (that.geg2018 != null))) {
                return false;
            }
        }
        {
            String lhsHwbwert;
            lhsHwbwert = this.getHwbwert();
            String rhsHwbwert;
            rhsHwbwert = that.getHwbwert();
            if (!strategy.equals(LocatorUtils.property(thisLocator, "hwbwert", lhsHwbwert), LocatorUtils.property(thatLocator, "hwbwert", rhsHwbwert), lhsHwbwert, rhsHwbwert, (this.hwbwert!= null), (that.hwbwert!= null))) {
                return false;
            }
        }
        {
            String lhsHwbklasse;
            lhsHwbklasse = this.getHwbklasse();
            String rhsHwbklasse;
            rhsHwbklasse = that.getHwbklasse();
            if (!strategy.equals(LocatorUtils.property(thisLocator, "hwbklasse", lhsHwbklasse), LocatorUtils.property(thatLocator, "hwbklasse", rhsHwbklasse), lhsHwbklasse, rhsHwbklasse, (this.hwbklasse!= null), (that.hwbklasse!= null))) {
                return false;
            }
        }
        {
            String lhsFgeewert;
            lhsFgeewert = this.getFgeewert();
            String rhsFgeewert;
            rhsFgeewert = that.getFgeewert();
            if (!strategy.equals(LocatorUtils.property(thisLocator, "fgeewert", lhsFgeewert), LocatorUtils.property(thatLocator, "fgeewert", rhsFgeewert), lhsFgeewert, rhsFgeewert, (this.fgeewert!= null), (that.fgeewert!= null))) {
                return false;
            }
        }
        {
            String lhsFgeeklasse;
            lhsFgeeklasse = this.getFgeeklasse();
            String rhsFgeeklasse;
            rhsFgeeklasse = that.getFgeeklasse();
            if (!strategy.equals(LocatorUtils.property(thisLocator, "fgeeklasse", lhsFgeeklasse), LocatorUtils.property(thatLocator, "fgeeklasse", rhsFgeeklasse), lhsFgeeklasse, rhsFgeeklasse, (this.fgeeklasse!= null), (that.fgeeklasse!= null))) {
                return false;
            }
        }
        return true;
    }

    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:54:50+02:00", comments = "JAXB RI v2.2.11")
    public boolean equals(Object object) {
        final EqualsStrategy2 strategy = JAXBEqualsStrategy.INSTANCE;
        return equals(null, null, object, strategy);
    }

    /**
     *
     *                     Java enum for <em>epart</em> attribute in <energiepass> elements.
     *
     * <p>Java class for null.
     *
     * <p>The following schema fragment specifies the expected content contained within this class.
     * <p>
     * <pre>
     * <simpleType>
     *   <restriction base="{http://www.w3.org/2001/XMLSchema}string">
     *     <enumeration value="BEDARF"/>
     *     <enumeration value="VERBRAUCH"/>
     *   </restriction>
     * </simpleType>
     * </pre>
     *
     */
    @XmlType(name = "")
    @XmlEnum
    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:54:50+02:00", comments = "JAXB RI v2.2.11")
    public enum Epart {

        BEDARF,
        VERBRAUCH;

        public String value() {
            return name();
        }

        public static Energiepass.Epart fromValue(String v) {
            return valueOf(v);
        }

    }

    /**
     *
     *                     Java enum for <em>gebaeudeart</em> attribute in <energiepass> elements.
     *
     * <p>Java class for null.
     *
     * <p>The following schema fragment specifies the expected content contained within this class.
     * <p>
     * <pre>
     * <simpleType>
     *   <restriction base="{http://www.w3.org/2001/XMLSchema}string">
     *     <enumeration value="wohn"/>
     *     <enumeration value="nichtwohn"/>
     *   </restriction>
     * </simpleType>
     * </pre>
     *
     */
    @XmlType(name = "")
    @XmlEnum
    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:54:50+02:00", comments = "JAXB RI v2.2.11")
    public enum Gebaeudeart {

        @XmlEnumValue("wohn")
        WOHN("wohn"),
        @XmlEnumValue("nichtwohn")
        NICHTWOHN("nichtwohn");
        private final String value;

        Gebaeudeart(String v) {
            value = v;
        }

        public String value() {
            return value;
        }

        public static Energiepass.Gebaeudeart fromValue(String v) {
            for (Energiepass.Gebaeudeart c: Energiepass.Gebaeudeart.values()) {
                if (c.value.equals(v)) {
                    return c;
                }
            }
            throw new IllegalArgumentException(v);
        }

    }

    /**
     *
     *                     Java enum for <em>jahrgang</em> attribute in <energiepass> elements.
     *
     * <p>Java class for null.
     *
     * <p>The following schema fragment specifies the expected content contained within this class.
     * <p>
     * <pre>
     * <simpleType>
     *   <restriction base="{http://www.w3.org/2001/XMLSchema}string">
     *     <enumeration value="2008"/>
     *     <enumeration value="2014"/>
     *     <enumeration value="ohne"/>
     *     <enumeration value="nicht_noetig"/>
     *     <enumeration value="bei_besichtigung"/>
     *   </restriction>
     * </simpleType>
     * </pre>
     *
     */
    @XmlType(name = "")
    @XmlEnum
    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:54:50+02:00", comments = "JAXB RI v2.2.11")
    public enum Jahrgang {

        @XmlEnumValue("2008")
        BIS_APRIL_2014("2008"),
        @XmlEnumValue("2014")
        AB_MAI_2014("2014"),
        @XmlEnumValue("ohne")
        OHNE("ohne"),
        @XmlEnumValue("nicht_noetig")
        NICHT_NOETIG("nicht_noetig"),
        @XmlEnumValue("bei_besichtigung")
        BEI_BESICHTIGUNG("bei_besichtigung");
        private final String value;

        Jahrgang(String v) {
            value = v;
        }

        public String value() {
            return value;
        }

        public static Energiepass.Jahrgang fromValue(String v) {
            for (Energiepass.Jahrgang c: Energiepass.Jahrgang.values()) {
                if (c.value.equals(v)) {
                    return c;
                }
            }
            throw new IllegalArgumentException(v);
        }

    }

}


package org.openestate.io.openimmo.xml;

import java.io.Serializable;
import javax.annotation.Generated;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlEnum;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
import org.jvnet.jaxb2_commons.lang.CopyStrategy2;
import org.jvnet.jaxb2_commons.lang.CopyTo2;
import org.jvnet.jaxb2_commons.lang.Equals2;
import org.jvnet.jaxb2_commons.lang.EqualsStrategy2;
import org.jvnet.jaxb2_commons.lang.JAXBCopyStrategy;
import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy;
import org.jvnet.jaxb2_commons.lang.JAXBToStringStrategy;
import org.jvnet.jaxb2_commons.lang.ToString2;
import org.jvnet.jaxb2_commons.lang.ToStringStrategy2;
import org.jvnet.jaxb2_commons.locator.ObjectLocator;
import org.jvnet.jaxb2_commons.locator.util.LocatorUtils;

/**
 * Java class for <buero_praxen> element.
 *
 *
 *
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "")
@XmlRootElement(name = "buero_praxen")
@Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:54:50+02:00", comments = "JAXB RI v2.2.11")
public class BueroPraxen implements Serializable, Cloneable, CopyTo2, Equals2, ToString2
{

    @XmlAttribute(name = "buero_typ")
    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:54:50+02:00", comments = "JAXB RI v2.2.11")
    protected BueroPraxen.BueroTyp bueroTyp;

    /**
     * Gets the value of the bueroTyp property.
     *
     * @return
     *     possible object is
     *     {@link BueroPraxen.BueroTyp }
     *
     */
    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:54:50+02:00", comments = "JAXB RI v2.2.11")
    public BueroPraxen.BueroTyp getBueroTyp() {
        return bueroTyp;
    }

    /**
     * Sets the value of the bueroTyp property.
     *
     * @param value
     *     allowed object is
     *     {@link BueroPraxen.BueroTyp }
     *
     */
    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:54:50+02:00", comments = "JAXB RI v2.2.11")
    public void setBueroTyp(BueroPraxen.BueroTyp value) {
        this.bueroTyp = value;
    }

    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:54:50+02:00", comments = "JAXB RI v2.2.11")
    public String toString() {
        final ToStringStrategy2 strategy = JAXBToStringStrategy.INSTANCE;
        final StringBuilder buffer = new StringBuilder();
        append(null, buffer, strategy);
        return buffer.toString();
    }

    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:54:50+02:00", comments = "JAXB RI v2.2.11")
    public StringBuilder append(ObjectLocator locator, StringBuilder buffer, ToStringStrategy2 strategy) {
        strategy.appendStart(locator, this, buffer);
        appendFields(locator, buffer, strategy);
        strategy.appendEnd(locator, this, buffer);
        return buffer;
    }

    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:54:50+02:00", comments = "JAXB RI v2.2.11")
    public StringBuilder appendFields(ObjectLocator locator, StringBuilder buffer, ToStringStrategy2 strategy) {
        {
            BueroPraxen.BueroTyp theBueroTyp;
            theBueroTyp = this.getBueroTyp();
            strategy.appendField(locator, this, "bueroTyp", buffer, theBueroTyp, (this.bueroTyp!= null));
        }
        return buffer;
    }

    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:54:50+02:00", comments = "JAXB RI v2.2.11")
    public Object clone() {
        return copyTo(createNewInstance());
    }

    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:54:50+02:00", comments = "JAXB RI v2.2.11")
    public Object copyTo(Object target) {
        final CopyStrategy2 strategy = JAXBCopyStrategy.INSTANCE;
        return copyTo(null, target, strategy);
    }

    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:54:50+02:00", comments = "JAXB RI v2.2.11")
    public Object copyTo(ObjectLocator locator, Object target, CopyStrategy2 strategy) {
        final Object draftCopy = ((target == null)?createNewInstance():target);
        if (draftCopy instanceof BueroPraxen) {
            final BueroPraxen copy = ((BueroPraxen) draftCopy);
            {
                Boolean bueroTypShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, (this.bueroTyp!= null));
                if (bueroTypShouldBeCopiedAndSet == Boolean.TRUE) {
                    BueroPraxen.BueroTyp sourceBueroTyp;
                    sourceBueroTyp = this.getBueroTyp();
                    BueroPraxen.BueroTyp copyBueroTyp = ((BueroPraxen.BueroTyp) strategy.copy(LocatorUtils.property(locator, "bueroTyp", sourceBueroTyp), sourceBueroTyp, (this.bueroTyp!= null)));
                    copy.setBueroTyp(copyBueroTyp);
                } else {
                    if (bueroTypShouldBeCopiedAndSet == Boolean.FALSE) {
                        copy.bueroTyp = null;
                    }
                }
            }
        }
        return draftCopy;
    }

    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:54:50+02:00", comments = "JAXB RI v2.2.11")
    public Object createNewInstance() {
        return new BueroPraxen();
    }

    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:54:50+02:00", comments = "JAXB RI v2.2.11")
    public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy2 strategy) {
        if ((object == null)||(this.getClass()!= object.getClass())) {
            return false;
        }
        if (this == object) {
            return true;
        }
        final BueroPraxen that = ((BueroPraxen) object);
        {
            BueroPraxen.BueroTyp lhsBueroTyp;
            lhsBueroTyp = this.getBueroTyp();
            BueroPraxen.BueroTyp rhsBueroTyp;
            rhsBueroTyp = that.getBueroTyp();
            if (!strategy.equals(LocatorUtils.property(thisLocator, "bueroTyp", lhsBueroTyp), LocatorUtils.property(thatLocator, "bueroTyp", rhsBueroTyp), lhsBueroTyp, rhsBueroTyp, (this.bueroTyp!= null), (that.bueroTyp!= null))) {
                return false;
            }
        }
        return true;
    }

    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:54:50+02:00", comments = "JAXB RI v2.2.11")
    public boolean equals(Object object) {
        final EqualsStrategy2 strategy = JAXBEqualsStrategy.INSTANCE;
        return equals(null, null, object, strategy);
    }

    /**
     *
     *                     Java enum for buero_typ attribute in <buero_praxen> elements.
     *
     *
Java class for null.
     *
     *
The following schema fragment specifies the expected content contained within this class.
     *

     *

     * <simpleType>
     *   <restriction base="{http://www.w3.org/2001/XMLSchema}string">
     *     <enumeration value="BUEROFLAECHE"/>
     *     <enumeration value="BUEROHAUS"/>
     *     <enumeration value="BUEROZENTRUM"/>
     *     <enumeration value="LOFT_ATELIER"/>
     *     <enumeration value="PRAXIS"/>
     *     <enumeration value="PRAXISFLAECHE"/>
     *     <enumeration value="PRAXISHAUS"/>
     *     <enumeration value="AUSSTELLUNGSFLAECHE"/>
     *     <enumeration value="COWORKING"/>
     *     <enumeration value="SHARED_OFFICE"/>
     *   </restriction>
     * </simpleType>
     *

     *
     */
    @XmlType(name = "")
    @XmlEnum
    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:54:50+02:00", comments = "JAXB RI v2.2.11")
    public enum BueroTyp {

        BUEROFLAECHE,
        BUEROHAUS,
        BUEROZENTRUM,
        LOFT_ATELIER,
        PRAXIS,
        PRAXISFLAECHE,
        PRAXISHAUS,
        AUSSTELLUNGSFLAECHE,
        COWORKING,
        SHARED_OFFICE;

        public String value() {
            return name();
        }

        public static BueroPraxen.BueroTyp fromValue(String v) {
            return valueOf(v);
        }

    }

}


/*
 * Copyright 2015-2018 OpenEstate.org.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.openestate.io.core;

import java.text.DecimalFormatSymbols;
import java.text.NumberFormat;
import java.text.ParseException;
import java.util.Locale;
import org.apache.commons.lang3.ArrayUtils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * NumberUtils.
 *
 * @author Andreas Rudolph
 * @since 1.1
 */
public final class NumberUtils {
    private static final Logger LOGGER = LoggerFactory.getLogger(NumberUtils.class);

    /**
     * Test, if a string contains a parsable number.
     *
     * @param value  the value to check
     * @param locale the locale, against which the value is checked
     *               (checks locale specific decimal and grouping separators)
     * @return true, if the provided value contains of numbers
     */
    public static boolean isNumeric(String value, Locale locale) {
        if (value == null) return false;
        int start = 0;

        final DecimalFormatSymbols symbols = (locale != null) ?
                DecimalFormatSymbols.getInstance(locale) :
                DecimalFormatSymbols.getInstance();

        if (value.startsWith("+") || value.startsWith("-")) start++;
        boolean fraction = false;
        for (int i = start; i < value.length(); i++) {
            final char c = value.charAt(i);
            if (c == symbols.getDecimalSeparator() && !fraction) {
                fraction = true;
                continue;
            }
            if (c == symbols.getGroupingSeparator() && !fraction) {
                continue;
            }
            if (!Character.isDigit(c)) {
                return false;
            }
        }
        return true;
    }

    /**
     * Convert a string value into a number.
     *
     * @param value the string value to convert
     * @return numeric value for the string
     * @throws NumberFormatException if the string is not a valid number
     */
    public static Number parseNumber(String value) throws NumberFormatException {
        return parseNumber(value, false);
    }

    /**
     * Convert a string value into a number.
     *
     * @param value   the string value to convert
     * @param locales locales, against which the value is parsed
     * @return numeric value for the string
     * @throws NumberFormatException if the string is not a valid number
     */
    public static Number parseNumber(String value, Locale... locales) throws NumberFormatException {
        return parseNumber(value, false, locales);
    }

    /**
     * Convert a string value into a number.
     *
     * @param value       the string value to convert
     * @param integerOnly wether only the integer part of the value is parsed
     * @param locales     locales, against which the value is parsed
     * @return numeric value for the string
     * @throws NumberFormatException if the string is not a valid number
     */
    public static Number parseNumber(String value, boolean integerOnly, Locale... locales) throws NumberFormatException {
        value = StringUtils.trimToNull(value);
        if (value == null) return null;

        // ignore leading plus sign
        if (value.startsWith("+"))
            value = StringUtils.trimToNull(value.substring(1));

        // remove any spaces
        value = StringUtils.replace(value, StringUtils.SPACE, StringUtils.EMPTY);

        if (ArrayUtils.isEmpty(locales))
            locales = new Locale[]{Locale.getDefault()};

        for (Locale locale : locales) {
            // check, if the value is completely numeric for the locale
            if (!isNumeric(value, locale)) continue;
            NumberFormat format = NumberFormat.getNumberInstance(locale);
            try {
                format.setMinimumFractionDigits(0);
                format.setParseIntegerOnly(integerOnly);
                format.setGroupingUsed(value.indexOf(DecimalFormatSymbols.getInstance(locale).getGroupingSeparator()) > -1);
                return format.parse(value);
            } catch (ParseException ex) {
            }
        }
        throw new NumberFormatException("The provided value '" + value + "' is not numeric!");
    }

    /**
     * Write a number into a string value.
     *
     * @param value          the number to write
     * @param integerDigits  maximal number of integer digits
     * @param fractionDigits maximal number of fraction digits
     * @return the formatted number
     */
    public static String printNumber(Number value, int integerDigits, int fractionDigits) {
        return printNumber(value, integerDigits, fractionDigits, null);
    }

    /**
     * Write a number into a string value.
     *
     * @param value          the number to write
     * @param integerDigits  maximal number of integer digits
     * @param fractionDigits maximal number of fraction digits
     * @param locale         locale for decimal separator (using {@link Locale#ENGLISH} if null)
     * @return the formatted number
     */
    public static String printNumber(Number value, int integerDigits, int fractionDigits, Locale locale) {
        if (value == null) return null;
        NumberFormat format = NumberFormat.getNumberInstance((locale != null) ? locale : Locale.ENGLISH);
        format.setMaximumIntegerDigits(integerDigits);
        format.setMaximumFractionDigits(fractionDigits);
        format.setMinimumFractionDigits(0);
        format.setGroupingUsed(false);
        return format.format(value);
    }
}


package org.openestate.io.immoxml.xml;

import java.io.Serializable;
import javax.annotation.Generated;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlEnum;
import javax.xml.bind.annotation.XmlEnumValue;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
import org.jvnet.jaxb2_commons.lang.CopyStrategy2;
import org.jvnet.jaxb2_commons.lang.CopyTo2;
import org.jvnet.jaxb2_commons.lang.Equals2;
import org.jvnet.jaxb2_commons.lang.EqualsStrategy2;
import org.jvnet.jaxb2_commons.lang.JAXBCopyStrategy;
import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy;
import org.jvnet.jaxb2_commons.lang.JAXBToStringStrategy;
import org.jvnet.jaxb2_commons.lang.ToString2;
import org.jvnet.jaxb2_commons.lang.ToStringStrategy2;
import org.jvnet.jaxb2_commons.locator.ObjectLocator;
import org.jvnet.jaxb2_commons.locator.util.LocatorUtils;

/**
 * Java class for <lage_gebiet> element.
 *
 *
 *
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "")
@XmlRootElement(name = "lage_gebiet")
@Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:50:55+02:00", comments = "JAXB RI v2.2.11")
public class LageGebiet implements Serializable, Cloneable, CopyTo2, Equals2, ToString2
{

    @XmlAttribute(name = "gebiete")
    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:50:55+02:00", comments = "JAXB RI v2.2.11")
    protected LageGebiet.Gebiete gebiete;

    /**
     * Gets the value of the gebiete property.
     *
     * @return
     *     possible object is
     *     {@link LageGebiet.Gebiete }
     *
     */
    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:50:55+02:00", comments = "JAXB RI v2.2.11")
    public LageGebiet.Gebiete getGebiete() {
        return gebiete;
    }

    /**
     * Sets the value of the gebiete property.
     *
     * @param value
     *     allowed object is
     *     {@link LageGebiet.Gebiete }
     *
     */
    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:50:55+02:00", comments = "JAXB RI v2.2.11")
    public void setGebiete(LageGebiet.Gebiete value) {
        this.gebiete = value;
    }

    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:50:55+02:00", comments = "JAXB RI v2.2.11")
    public String toString() {
        final ToStringStrategy2 strategy = JAXBToStringStrategy.INSTANCE;
        final StringBuilder buffer = new StringBuilder();
        append(null, buffer, strategy);
        return buffer.toString();
    }

    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:50:55+02:00", comments = "JAXB RI v2.2.11")
    public StringBuilder append(ObjectLocator locator, StringBuilder buffer, ToStringStrategy2 strategy) {
        strategy.appendStart(locator, this, buffer);
        appendFields(locator, buffer, strategy);
        strategy.appendEnd(locator, this, buffer);
        return buffer;
    }

    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:50:55+02:00", comments = "JAXB RI v2.2.11")
    public StringBuilder appendFields(ObjectLocator locator, StringBuilder buffer, ToStringStrategy2 strategy) {
        {
            LageGebiet.Gebiete theGebiete;
            theGebiete = this.getGebiete();
            strategy.appendField(locator, this, "gebiete", buffer, theGebiete, (this.gebiete!= null));
        }
        return buffer;
    }

    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:50:55+02:00", comments = "JAXB RI v2.2.11")
    public Object clone() {
        return copyTo(createNewInstance());
    }

    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:50:55+02:00", comments = "JAXB RI v2.2.11")
    public Object copyTo(Object target) {
        final CopyStrategy2 strategy = JAXBCopyStrategy.INSTANCE;
        return copyTo(null, target, strategy);
    }

    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:50:55+02:00", comments = "JAXB RI v2.2.11")
    public Object copyTo(ObjectLocator locator, Object target, CopyStrategy2 strategy) {
        final Object draftCopy = ((target == null)?createNewInstance():target);
        if (draftCopy instanceof LageGebiet) {
            final LageGebiet copy = ((LageGebiet) draftCopy);
            {
                Boolean gebieteShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, (this.gebiete!= null));
                if (gebieteShouldBeCopiedAndSet == Boolean.TRUE) {
                    LageGebiet.Gebiete sourceGebiete;
                    sourceGebiete = this.getGebiete();
                    LageGebiet.Gebiete copyGebiete = ((LageGebiet.Gebiete) strategy.copy(LocatorUtils.property(locator, "gebiete", sourceGebiete), sourceGebiete, (this.gebiete!= null)));
                    copy.setGebiete(copyGebiete);
                } else {
                    if (gebieteShouldBeCopiedAndSet == Boolean.FALSE) {
                        copy.gebiete = null;
                    }
                }
            }
        }
        return draftCopy;
    }

    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:50:55+02:00", comments = "JAXB RI v2.2.11")
    public Object createNewInstance() {
        return new LageGebiet();
    }

    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:50:55+02:00", comments = "JAXB RI v2.2.11")
    public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy2 strategy) {
        if ((object == null)||(this.getClass()!= object.getClass())) {
            return false;
        }
        if (this == object) {
            return true;
        }
        final LageGebiet that = ((LageGebiet) object);
        {
            LageGebiet.Gebiete lhsGebiete;
            lhsGebiete = this.getGebiete();
            LageGebiet.Gebiete rhsGebiete;
            rhsGebiete = that.getGebiete();
            if (!strategy.equals(LocatorUtils.property(thisLocator, "gebiete", lhsGebiete), LocatorUtils.property(thatLocator, "gebiete", rhsGebiete), lhsGebiete, rhsGebiete, (this.gebiete!= null), (that.gebiete!= null))) {
                return false;
            }
        }
        return true;
    }

    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:50:55+02:00", comments = "JAXB RI v2.2.11")
    public boolean equals(Object object) {
        final EqualsStrategy2 strategy = JAXBEqualsStrategy.INSTANCE;
        return equals(null, null, object, strategy);
    }

    /**
     *
     *                     Java enum for gebiete attribute in <lage_gebiet> elements.
     *
     *
Java class for null.
     *
     *
The following schema fragment specifies the expected content contained within this class.
     *

     *

     * <simpleType>
     *   <restriction base="{http://www.w3.org/2001/XMLSchema}string">
     *     <enumeration value="WOHN"/>
     *     <enumeration value="GEWERBE"/>
     *     <enumeration value="INDUSTRIE"/>
     *     <enumeration value="MISCH"/>
     *     <enumeration value="NEUBAU"/>
     *     <enumeration value="ORTSLAGE"/>
     *     <enumeration value="SIEDLUNG"/>
     *     <enumeration value="STADTRAND"/>
     *     <enumeration value="STADTTEIL"/>
     *     <enumeration value="STADTZENTRUM"/>
     *     <enumeration value="NEBENZENTRUM"/>
     *     <enumeration value="1A"/>
     *     <enumeration value="1B"/>
     *   </restriction>
     * </simpleType>
     *

     *
     */
    @XmlType(name = "")
    @XmlEnum
    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:50:55+02:00", comments = "JAXB RI v2.2.11")
    public enum Gebiete {

        WOHN("WOHN"),
        GEWERBE("GEWERBE"),
        INDUSTRIE("INDUSTRIE"),
        MISCH("MISCH"),
        NEUBAU("NEUBAU"),
        ORTSLAGE("ORTSLAGE"),
        SIEDLUNG("SIEDLUNG"),
        STADTRAND("STADTRAND"),
        STADTTEIL("STADTTEIL"),
        STADTZENTRUM("STADTZENTRUM"),
        NEBENZENTRUM("NEBENZENTRUM"),
        @XmlEnumValue("1A")
        A_LAGE("1A"),
        @XmlEnumValue("1B")
        B_LAGE("1B");
        private final String value;

        Gebiete(String v) {
            value = v;
        }

        public String value() {
            return value;
        }

        public static LageGebiet.Gebiete fromValue(String v) {
            for (LageGebiet.Gebiete c: LageGebiet.Gebiete.values()) {
                if (c.value.equals(v)) {
                    return c;
                }
            }
            throw new IllegalArgumentException(v);
        }

    }

}


/*
 * Copyright 2015-2018 OpenEstate.org.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.openestate.io.filemaker;

import javax.xml.bind.JAXBException;
import javax.xml.parsers.ParserConfigurationException;
import org.openestate.io.core.XmlUtils;
import org.openestate.io.filemaker.xml.result.FMPXMLRESULT;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.w3c.dom.Document;
import org.w3c.dom.Element;

/**
 * XML document from Filemaker with a
 * <FMPXMLRESULT> root element.
 *
 * @author Andreas Rudolph
 * @since 1.0
 */
@SuppressWarnings("WeakerAccess")
public class FilemakerResultDocument extends FilemakerDocument<FMPXMLRESULT> {
    @SuppressWarnings("unused")
    private final static Logger LOGGER = LoggerFactory.getLogger(FilemakerResultDocument.class);

    /**
     * Create from a {@link Document}.
     *
     * @param document the document to create from
     */
    public FilemakerResultDocument(Document document) {
        super(document);
        if (!isReadable(document))
            throw new IllegalArgumentException("The provided document is invalid!");
    }

    /**
     * Checks, if a {@link Document} is readable as a {@link FilemakerResultDocument}.
     *
     * @param doc document to check
     * @return true, if the document is usable, otherwise false
     */
    public static boolean isReadable(Document doc) {
        Element root = XmlUtils.getRootElement(doc);
        return "FMPXMLRESULT".equals(root.getLocalName());
    }

    /**
     * Creates an empty {@link FilemakerResultDocument}.
     *
     * @return created document
     * @throws ParserConfigurationException if the parser is not properly configured
     * @throws JAXBException                if a problem with JAXB occurred
     */
    public static FilemakerResultDocument newDocument() throws ParserConfigurationException, JAXBException {
        return newDocument(FilemakerUtils.getFactoryForResult().createFMPXMLRESULT());
    }

    /**
     * Creates a {@link FilemakerResultDocument} from a {@link FMPXMLRESULT} object.
     *
     * @param xmlResult Java object, that represents the <FMPXMLRESULT> root element
     * @return created document
     * @throws ParserConfigurationException if the parser is not properly configured
     * @throws JAXBException                if a problem with JAXB occurred
     */
    public static FilemakerResultDocument newDocument(FMPXMLRESULT xmlResult) throws ParserConfigurationException, JAXBException {
        Document document = XmlUtils.newDocument();
        FilemakerUtils.createMarshaller("UTF-8", true).marshal(xmlResult, document);
        return new FilemakerResultDocument(document);
    }

    /**
     * Creates a {@link FilemakerResultMapping} object from the contained {@link Document}.
     *
     * @return created mapping, that contains the values from the {@link FMPXMLRESULT}
     * @throws JAXBException if a problem with JAXB occurred
     */
    public FilemakerResultMapping toMapping() throws JAXBException {
        return new FilemakerResultMapping(this.toObject());
    }

    /**
     * Creates a {@link FMPXMLRESULT} object from the contained {@link Document}.
     *
     * @return created object, that represents the <FMPXMLRESULT> root element
     * @throws JAXBException if a problem with JAXB occurred
     */
    @Override
    public FMPXMLRESULT toObject() throws JAXBException {
        return (FMPXMLRESULT) FilemakerUtils.createUnmarshaller().unmarshal(this.getDocument());
    }
}