/*
 * 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.is24_xml;

import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.net.URI;
import java.net.URISyntaxException;
import java.nio.charset.Charset;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import javax.xml.bind.DatatypeConverter;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Marshaller;
import javax.xml.bind.Unmarshaller;
import javax.xml.parsers.ParserConfigurationException;
import org.apache.commons.lang3.StringUtils;
import org.openestate.io.core.XmlUtils;
import org.openestate.io.core.XmlValidationHandler;
import org.openestate.io.is24_xml.xml.ObjectFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.w3c.dom.Document;
import org.xml.sax.SAXException;

/**
 * Some helper functions for the IS24-XML format.
 *
 * @author Andreas Rudolph
 * @since 1.0
 */
@SuppressWarnings("WeakerAccess")
public class Is24XmlUtils {
    @SuppressWarnings("unused")
    private final static Logger LOGGER = LoggerFactory.getLogger(Is24XmlUtils.class);
    private static JAXBContext JAXB = null;

    /**
     * the latest implemented version of this format
     */
    @SuppressWarnings("unused")
    public final static String VERSION = "rev189438";

    /**
     * the XML target namespace of this format
     */
    @SuppressWarnings("unused")
    public final static String NAMESPACE = "http://www.immobilienscout24.de/immobilientransfer";

    /**
     * the package, where generated JAXB classes are located
     */
    @SuppressWarnings("unused")
    public final static String PACKAGE = "org.openestate.io.is24_xml.xml";

    /**
     * the factory for creation of JAXB objects
     */
    @SuppressWarnings("unused")
    public final static ObjectFactory FACTORY = new ObjectFactory();

    private Is24XmlUtils() {
    }

    /**
     * Creates a {@link Is24XmlDocument} from an {@link InputStream}.
     *
     * @param input XML input
     * @return created document or null, of the document is not supported by this format
     * @throws SAXException                 if XML is invalid
     * @throws IOException                  if reading failed
     * @throws ParserConfigurationException if the parser is not properly configured
     */
    public static Is24XmlDocument createDocument(InputStream input) throws SAXException, IOException, ParserConfigurationException {
        return createDocument(XmlUtils.newDocument(input, true));
    }

    /**
     * Creates a {@link Is24XmlDocument} from a {@link File}.
     *
     * @param xmlFile XML file
     * @return created document or null, of the document is not supported by this format
     * @throws SAXException                 if XML is invalid
     * @throws IOException                  if reading failed
     * @throws ParserConfigurationException if the parser is not properly configured
     */
    public static Is24XmlDocument createDocument(File xmlFile) throws SAXException, IOException, ParserConfigurationException {
        return createDocument(XmlUtils.newDocument(xmlFile, true));
    }

    /**
     * Creates a {@link Is24XmlDocument} from a {@link String}.
     *
     * @param xmlString XML string
     * @return created document or null, of the document is not supported by this format
     * @throws SAXException                 if XML is invalid
     * @throws IOException                  if reading failed
     * @throws ParserConfigurationException if the parser is not properly configured
     */
    public static Is24XmlDocument createDocument(String xmlString) throws SAXException, IOException, ParserConfigurationException {
        return createDocument(XmlUtils.newDocument(xmlString, true));
    }

    /**
     * Creates a {@link Is24XmlDocument} from a {@link Document}.
     *
     * @param doc XML document
     * @return created document or null, of the document is not supported by this format
     */
    public static Is24XmlDocument createDocument(Document doc) {
        if (Is24XmlDocument.isReadable(doc))
            return new Is24XmlDocument(doc);
        else
            return null;
    }

    /**
     * Creates a {@link Marshaller} to write JAXB objects into XML.
     *
     * @return created marshaller
     * @throws JAXBException if a problem with JAXB occurred
     */
    @SuppressWarnings("unused")
    public static Marshaller createMarshaller() throws JAXBException {
        return createMarshaller(Charset.defaultCharset().name(), true);
    }

    /**
     * Creates a {@link Marshaller} to write JAXB objects into XML.
     *
     * @param encoding  encoding of written XML
     * @param formatted if written XML is pretty printed
     * @return created marshaller
     * @throws JAXBException if a problem with JAXB occurred
     */
    @SuppressWarnings("Duplicates")
    public static Marshaller createMarshaller(String encoding, boolean formatted) throws JAXBException {
        Marshaller m = getContext().createMarshaller();
        m.setProperty(Marshaller.JAXB_ENCODING, encoding);
        m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, formatted);
        m.setEventHandler(new XmlValidationHandler());
        return m;
    }

    /**
     * Creates a {@link Unmarshaller} to read JAXB objects from XML.
     *
     * @return created unmarshaller
     * @throws JAXBException if a problem with JAXB occurred
     */
    public static Unmarshaller createUnmarshaller() throws JAXBException {
        Unmarshaller m = getContext().createUnmarshaller();
        m.setEventHandler(new XmlValidationHandler());
        return m;
    }

    /**
     * Returns the {@link JAXBContext} for this format.
     *
     * @return context
     * @throws JAXBException if a problem with JAXB occurred
     */
    public synchronized static JAXBContext getContext() throws JAXBException {
        if (JAXB == null) initContext(Thread.currentThread().getContextClassLoader());
        return JAXB;
    }

    /**
     * Returns the preferred date format for this format.
     *
     * @return date format
     */
    public static DateFormat getDateFormat() {
        return new SimpleDateFormat("yyyy-MM-dd");
    }

    /**
     * Returns the {@link ObjectFactory} for this format.
     *
     * @return object factory
     */
    public synchronized static ObjectFactory getFactory() {
        return FACTORY;
    }

    /**
     * Initializes the {@link JAXBContext} for this format.
     *
     * @param classloader the classloader to load the generated JAXB classes with
     * @throws JAXBException if a problem with JAXB occurred
     */
    public synchronized static void initContext(ClassLoader classloader) throws JAXBException {
        JAXB = JAXBContext.newInstance(PACKAGE, classloader);
    }

    public static Calendar parseDate(String value) {
        return XmlUtils.parseDate(value);
    }

    public static BigDecimal parsePreisAufAnfrage(String value) {
        value = StringUtils.trimToNull(value);
        return (value != null) ? DatatypeConverter.parseDecimal(value) : null;
    }

    public static String parseEmail(String value) {
        //value = StringUtils.trimToNull( value );
        //if (value==null)
        //  return null;
        //else if (value.matches( ".*@.*\\..*" ))
        //  return value;
        //else
        //  throw new IllegalArgumentException( "Can't parse e-mail value '" + value + "'!" );
        return StringUtils.trimToNull(value);
    }

    @SuppressWarnings("unused")
    private static String parseText(String value, int length) {
        return StringUtils.trimToNull(value);
    }

    public static String parseText4(String value) {
        return parseText(value, 4);
    }

    public static String parseText15(String value) {
        return parseText(value, 15);
    }

    public static String parseText20(String value) {
        return parseText(value, 20);
    }

    public static String parseText30(String value) {
        return parseText(value, 30);
    }

    public static String parseText40(String value) {
        return parseText(value, 40);
    }

    public static String parseText50(String value) {
        return parseText(value, 50);
    }

    public static String parseText80(String value) {
        return parseText(value, 80);
    }

    public static String parseText100(String value) {
        return parseText(value, 100);
    }

    public static String parseText150(String value) {
        return parseText(value, 150);
    }

    public static String parseText200(String value) {
        return parseText(value, 200);
    }

    public static String parseText255(String value) {
        return parseText(value, 255);
    }

    public static String parseText300(String value) {
        return parseText(value, 300);
    }

    public static String parseText500(String value) {
        return parseText(value, 500);
    }

    public static String parseText2000(String value) {
        return parseText(value, 2000);
    }

    @SuppressWarnings("Duplicates")
    public static URI parseWebUrl(String value) {
        value = StringUtils.trimToNull(value);
        if (value == null) return null;
        try {
            if (StringUtils.startsWithIgnoreCase(value, "http://"))
                return new URI(value);
            else if (StringUtils.startsWithIgnoreCase(value, "https://"))
                return new URI(value);
            else
                return new URI("http://" + value);
        } catch (URISyntaxException ex) {
            throw new IllegalArgumentException("Can't parse URI value '" + value + "'!", ex);
        }
    }

    public static Long parseZahl2(String value) {
        value = StringUtils.trimToNull(value);
        return (value != null) ? DatatypeConverter.parseLong(value) : null;
    }

    public static Long parseZahl3(String value) {
        value = StringUtils.trimToNull(value);
        return (value != null) ? DatatypeConverter.parseLong(value) : null;
    }

    public static Long parseZahl4(String value) {
        value = StringUtils.trimToNull(value);
        return (value != null) ? DatatypeConverter.parseLong(value) : null;
    }

    public static Long parseZahl5(String value) {
        value = StringUtils.trimToNull(value);
        return (value != null) ? DatatypeConverter.parseLong(value) : null;
    }

    public static Long parseZahl8(String value) {
        value = StringUtils.trimToNull(value);
        return (value != null) ? DatatypeConverter.parseLong(value) : null;
    }

    public static Long parseZahl10(String value) {
        value = StringUtils.trimToNull(value);
        return (value != null) ? DatatypeConverter.parseLong(value) : null;
    }

    public static BigInteger parseZahl20(String value) {
        value = StringUtils.trimToNull(value);
        return (value != null) ? DatatypeConverter.parseInteger(value) : null;
    }

    public static BigDecimal parseZahl31(String value) {
        value = StringUtils.trimToNull(value);
        return (value != null) ? DatatypeConverter.parseDecimal(value) : null;
    }

    public static BigDecimal parseZahl32(String value) {
        value = StringUtils.trimToNull(value);
        return (value != null) ? DatatypeConverter.parseDecimal(value) : null;
    }

    public static BigDecimal parseZahl42(String value) {
        value = StringUtils.trimToNull(value);
        return (value != null) ? DatatypeConverter.parseDecimal(value) : null;
    }

    public static BigDecimal parseZahl52(String value) {
        value = StringUtils.trimToNull(value);
        return (value != null) ? DatatypeConverter.parseDecimal(value) : null;
    }

    public static BigDecimal parseZahl62(String value) {
        value = StringUtils.trimToNull(value);
        return (value != null) ? DatatypeConverter.parseDecimal(value) : null;
    }

    public static BigDecimal parseZahl72(String value) {
        value = StringUtils.trimToNull(value);
        return (value != null) ? DatatypeConverter.parseDecimal(value) : null;
    }

    public static BigDecimal parseZahl102(String value) {
        value = StringUtils.trimToNull(value);
        return (value != null) ? DatatypeConverter.parseDecimal(value) : null;
    }

    public static BigDecimal parseZahl152(String value) {
        value = StringUtils.trimToNull(value);
        return (value != null) ? DatatypeConverter.parseDecimal(value) : null;
    }

    public static BigDecimal parseZimmeranzahl(String value) {
        value = StringUtils.trimToNull(value);
        return (value != null) ? DatatypeConverter.parseDecimal(value) : null;
    }

    public static String printDate(Calendar value) {
        if (value == null)
            throw new IllegalArgumentException("Can't print date value!");
        else
            return getDateFormat().format(value.getTime());
    }

    public static String printEmail(String value) {
        value = StringUtils.trimToNull(value);
        if (value == null || value.length() > 150 || !value.matches(".*@.*\\..*"))
            throw new IllegalArgumentException("Can't print email value '" + value + "'!");
        else
            return value;
    }

    public static String printPreisAufAnfrage(BigDecimal value) {
        if (value == null || value.compareTo(BigDecimal.ZERO) < 0 || value.compareTo(BigDecimal.TEN.pow(13)) >= 0)
            throw new IllegalArgumentException("Can't print decimal value '" + value + "'!");
        else if (value.compareTo(BigDecimal.ZERO) == 0)
            return "0";
        else
            return DatatypeConverter.printDecimal(value.setScale(2, BigDecimal.ROUND_HALF_UP));
    }

    @SuppressWarnings("Duplicates")
    private static String printText(String value, int maxLength) {
        value = StringUtils.trimToEmpty(value);
        int length = value.length();
        if (length <= 0)
            return StringUtils.EMPTY;
        else if (length <= maxLength)
            return value;
        else if (maxLength > 3)
            return StringUtils.abbreviate(value, maxLength);
        else
            return value.substring(0, maxLength);
    }

    public static String printText4(String value) {
        return printText(value, 4);
    }

    public static String printText15(String value) {
        return printText(value, 15);
    }

    public static String printText20(String value) {
        return printText(value, 20);
    }

    public static String printText30(String value) {
        return printText(value, 30);
    }

    public static String printText40(String value) {
        return printText(value, 40);
    }

    public static String printText50(String value) {
        return printText(value, 50);
    }

    public static String printText80(String value) {
        return printText(value, 80);
    }

    public static String printText100(String value) {
        return printText(value, 100);
    }

    public static String printText150(String value) {
        return printText(value, 150);
    }

    public static String printText200(String value) {
        return printText(value, 200);
    }

    public static String printText255(String value) {
        return printText(value, 255);
    }

    public static String printText300(String value) {
        return printText(value, 300);
    }

    public static String printText500(String value) {
        return printText(value, 500);
    }

    public static String printText2000(String value) {
        return printText(value, 2000);
    }

    public static String printWebUrl(URI value) {
        if (value == null || StringUtils.isBlank(value.getHost()))
            throw new IllegalArgumentException("Can't print URI value '" + value + "'!");
        else
            return value.toString();
    }

    public static String printZahl2(Long value) {
        if (value == null || value <= 0)
            throw new IllegalArgumentException("Can't print integer value '" + value + "'!");
        String val = DatatypeConverter.printLong(value);
        if (val.length() > 2)
            throw new IllegalArgumentException("Can't print integer value '" + value + "'! The value exceeds maximal length of 2 digits.");
        return val;
    }

    public static String printZahl2Including0(Long value) {
        if (value == null || value < 0)
            throw new IllegalArgumentException("Can't print integer value '" + value + "'!");
        String val = DatatypeConverter.printLong(value);
        if (val.length() > 2)
            throw new IllegalArgumentException("Can't print integer value '" + value + "'! The value exceeds maximal length of 2 digits.");
        return val;
    }

    public static String printZahl3(Long value) {
        if (value == null || value <= 0)
            throw new IllegalArgumentException("Can't print integer value '" + value + "'!");
        String val = DatatypeConverter.printLong(value);
        if (val.length() > 3)
            throw new IllegalArgumentException("Can't print integer value '" + value + "'! The value exceeds maximal length of 3 digits.");
        return val;
    }

    public static String printZahl3Including0(Long value) {
        if (value == null || value < 0)
            throw new IllegalArgumentException("Can't print integer value '" + value + "'!");
        String val = DatatypeConverter.printLong(value);
        if (val.length() > 3)
            throw new IllegalArgumentException("Can't print integer value '" + value + "'! The value exceeds maximal length of 3 digits.");
        return val;
    }

    public static String printZahl4(Long value) {
        if (value == null || value <= 0)
            throw new IllegalArgumentException("Can't print integer value '" + value + "'!");
        String val = DatatypeConverter.printLong(value);
        if (val.length() > 4)
            throw new IllegalArgumentException("Can't print integer value '" + value + "'! The value exceeds maximal length of 4 digits.");
        return val;
    }

    public static String printZahl5(Long value) {
        if (value == null || value <= 0)
            throw new IllegalArgumentException("Can't print integer value '" + value + "'!");
        String val = DatatypeConverter.printLong(value);
        if (val.length() > 5)
            throw new IllegalArgumentException("Can't print integer value '" + value + "'! The value exceeds maximal length of 5 digits.");
        return val;
    }

    public static String printZahl8(Long value) {
        if (value == null || value <= 0)
            throw new IllegalArgumentException("Can't print integer value '" + value + "'!");
        String val = DatatypeConverter.printLong(value);
        if (val.length() > 8)
            throw new IllegalArgumentException("Can't print integer value '" + value + "'! The value exceeds maximal length of 8 digits.");
        return val;
    }

    public static String printZahl10(Long value) {
        if (value == null || value <= 0)
            throw new IllegalArgumentException("Can't print integer value '" + value + "'!");
        String val = DatatypeConverter.printLong(value);
        if (val.length() > 10)
            throw new IllegalArgumentException("Can't print integer value '" + value + "'! The value exceeds maximal length of 10 digits.");
        return val;
    }

    public static String printZahl20(BigInteger value) {
        if (value == null || value.compareTo(BigInteger.ZERO) < 1)
            throw new IllegalArgumentException("Can't print integer value '" + value + "'!");
        String val = DatatypeConverter.printInteger(value);
        if (val.length() > 20)
            throw new IllegalArgumentException("Can't print integer value '" + value + "'! The value exceeds maximal length of 20 digits.");
        return val;
    }

    public static String printZahl31(BigDecimal value) {
        if (value == null || value.compareTo(BigDecimal.ZERO) < 1 || value.compareTo(BigDecimal.TEN.pow(2)) >= 0)
            throw new IllegalArgumentException("Can't print decimal value '" + value + "'!");
        else
            return DatatypeConverter.printDecimal(value.setScale(1, BigDecimal.ROUND_HALF_UP));
    }

    public static String printZahl32(BigDecimal value) {
        if (value == null || value.compareTo(BigDecimal.ZERO) < 1 || value.compareTo(BigDecimal.TEN.pow(1)) >= 0)
            throw new IllegalArgumentException("Can't print decimal value '" + value + "'!");
        else
            return DatatypeConverter.printDecimal(value.setScale(2, BigDecimal.ROUND_HALF_UP));
    }

    public static String printZahl42(BigDecimal value) {
        if (value == null || value.compareTo(BigDecimal.ZERO) < 1 || value.compareTo(BigDecimal.TEN.pow(2)) >= 0)
            throw new IllegalArgumentException("Can't print decimal value '" + value + "'!");
        else
            return DatatypeConverter.printDecimal(value.setScale(2, BigDecimal.ROUND_HALF_UP));
    }

    public static String printZahl52(BigDecimal value) {
        if (value == null || value.compareTo(BigDecimal.ZERO) < 1 || value.compareTo(BigDecimal.TEN.pow(3)) >= 0)
            throw new IllegalArgumentException("Can't print decimal value '" + value + "'!");
        else
            return DatatypeConverter.printDecimal(value.setScale(2, BigDecimal.ROUND_HALF_UP));
    }

    public static String printZahl62(BigDecimal value) {
        if (value == null || value.compareTo(BigDecimal.ZERO) < 1 || value.compareTo(BigDecimal.TEN.pow(4)) >= 0)
            throw new IllegalArgumentException("Can't print decimal value '" + value + "'!");
        else
            return DatatypeConverter.printDecimal(value.setScale(2, BigDecimal.ROUND_HALF_UP));
    }

    public static String printZahl72(BigDecimal value) {
        if (value == null || value.compareTo(BigDecimal.ZERO) < 1 || value.compareTo(BigDecimal.TEN.pow(5)) >= 0)
            throw new IllegalArgumentException("Can't print decimal value '" + value + "'!");
        else
            return DatatypeConverter.printDecimal(value.setScale(2, BigDecimal.ROUND_HALF_UP));
    }

    public static String printZahl102(BigDecimal value) {
        if (value == null || value.compareTo(BigDecimal.ZERO) < 1 || value.compareTo(BigDecimal.TEN.pow(8)) >= 0)
            throw new IllegalArgumentException("Can't print decimal value '" + value + "'!");
        else
            return DatatypeConverter.printDecimal(value.setScale(2, BigDecimal.ROUND_HALF_UP));
    }

    public static String printZahl152(BigDecimal value) {
        if (value == null || value.compareTo(BigDecimal.ZERO) < 1 || value.compareTo(BigDecimal.TEN.pow(13)) >= 0)
            throw new IllegalArgumentException("Can't print decimal value '" + value + "'!");
        else
            return DatatypeConverter.printDecimal(value.setScale(2, BigDecimal.ROUND_HALF_UP));
    }

    public static String printZimmeranzahl(BigDecimal value) {
        BigDecimal min = new BigDecimal("0.5");
        BigDecimal max = new BigDecimal("9999");
        if (value == null || value.compareTo(min) < 0 || value.compareTo(max) > 0)
            throw new IllegalArgumentException("Can't print decimal value '" + value + "'!");
        else
            return printZahl62(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.XmlElement;
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 <anhang> element.
 *
 *
 *
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
    "anhangtitel",
    "format",
    "daten"
})
@XmlRootElement(name = "anhang")
@Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:50:55+02:00", comments = "JAXB RI v2.2.11")
public class Anhang implements Serializable, Cloneable, CopyTo2, Equals2, ToString2
{

    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:50:55+02:00", comments = "JAXB RI v2.2.11")
    protected String anhangtitel;
    @XmlElement(required = true)
    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:50:55+02:00", comments = "JAXB RI v2.2.11")
    protected String format;
    @XmlElement(required = true)
    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:50:55+02:00", comments = "JAXB RI v2.2.11")
    protected Daten daten;
    @XmlAttribute(name = "location", required = true)
    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:50:55+02:00", comments = "JAXB RI v2.2.11")
    protected Anhang.Location location;
    @XmlAttribute(name = "gruppe")
    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:50:55+02:00", comments = "JAXB RI v2.2.11")
    protected Anhang.Gruppe gruppe;

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

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

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

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

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

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

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

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

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

    /**
     * Sets the value of the gruppe property.
     *
     * @param value
     *     allowed object is
     *     {@link Anhang.Gruppe }
     *
     */
    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:50:55+02:00", comments = "JAXB RI v2.2.11")
    public void setGruppe(Anhang.Gruppe value) {
        this.gruppe = 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) {
        {
            String theAnhangtitel;
            theAnhangtitel = this.getAnhangtitel();
            strategy.appendField(locator, this, "anhangtitel", buffer, theAnhangtitel, (this.anhangtitel!= null));
        }
        {
            String theFormat;
            theFormat = this.getFormat();
            strategy.appendField(locator, this, "format", buffer, theFormat, (this.format!= null));
        }
        {
            Daten theDaten;
            theDaten = this.getDaten();
            strategy.appendField(locator, this, "daten", buffer, theDaten, (this.daten!= null));
        }
        {
            Anhang.Location theLocation;
            theLocation = this.getLocation();
            strategy.appendField(locator, this, "location", buffer, theLocation, (this.location!= null));
        }
        {
            Anhang.Gruppe theGruppe;
            theGruppe = this.getGruppe();
            strategy.appendField(locator, this, "gruppe", buffer, theGruppe, (this.gruppe!= 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 Anhang) {
            final Anhang copy = ((Anhang) draftCopy);
            {
                Boolean anhangtitelShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, (this.anhangtitel!= null));
                if (anhangtitelShouldBeCopiedAndSet == Boolean.TRUE) {
                    String sourceAnhangtitel;
                    sourceAnhangtitel = this.getAnhangtitel();
                    String copyAnhangtitel = ((String) strategy.copy(LocatorUtils.property(locator, "anhangtitel", sourceAnhangtitel), sourceAnhangtitel, (this.anhangtitel!= null)));
                    copy.setAnhangtitel(copyAnhangtitel);
                } else {
                    if (anhangtitelShouldBeCopiedAndSet == Boolean.FALSE) {
                        copy.anhangtitel = null;
                    }
                }
            }
            {
                Boolean formatShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, (this.format!= null));
                if (formatShouldBeCopiedAndSet == Boolean.TRUE) {
                    String sourceFormat;
                    sourceFormat = this.getFormat();
                    String copyFormat = ((String) strategy.copy(LocatorUtils.property(locator, "format", sourceFormat), sourceFormat, (this.format!= null)));
                    copy.setFormat(copyFormat);
                } else {
                    if (formatShouldBeCopiedAndSet == Boolean.FALSE) {
                        copy.format = null;
                    }
                }
            }
            {
                Boolean datenShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, (this.daten!= null));
                if (datenShouldBeCopiedAndSet == Boolean.TRUE) {
                    Daten sourceDaten;
                    sourceDaten = this.getDaten();
                    Daten copyDaten = ((Daten) strategy.copy(LocatorUtils.property(locator, "daten", sourceDaten), sourceDaten, (this.daten!= null)));
                    copy.setDaten(copyDaten);
                } else {
                    if (datenShouldBeCopiedAndSet == Boolean.FALSE) {
                        copy.daten = null;
                    }
                }
            }
            {
                Boolean locationShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, (this.location!= null));
                if (locationShouldBeCopiedAndSet == Boolean.TRUE) {
                    Anhang.Location sourceLocation;
                    sourceLocation = this.getLocation();
                    Anhang.Location copyLocation = ((Anhang.Location) strategy.copy(LocatorUtils.property(locator, "location", sourceLocation), sourceLocation, (this.location!= null)));
                    copy.setLocation(copyLocation);
                } else {
                    if (locationShouldBeCopiedAndSet == Boolean.FALSE) {
                        copy.location = null;
                    }
                }
            }
            {
                Boolean gruppeShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, (this.gruppe!= null));
                if (gruppeShouldBeCopiedAndSet == Boolean.TRUE) {
                    Anhang.Gruppe sourceGruppe;
                    sourceGruppe = this.getGruppe();
                    Anhang.Gruppe copyGruppe = ((Anhang.Gruppe) strategy.copy(LocatorUtils.property(locator, "gruppe", sourceGruppe), sourceGruppe, (this.gruppe!= null)));
                    copy.setGruppe(copyGruppe);
                } else {
                    if (gruppeShouldBeCopiedAndSet == Boolean.FALSE) {
                        copy.gruppe = 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 Anhang();
    }

    @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 Anhang that = ((Anhang) object);
        {
            String lhsAnhangtitel;
            lhsAnhangtitel = this.getAnhangtitel();
            String rhsAnhangtitel;
            rhsAnhangtitel = that.getAnhangtitel();
            if (!strategy.equals(LocatorUtils.property(thisLocator, "anhangtitel", lhsAnhangtitel), LocatorUtils.property(thatLocator, "anhangtitel", rhsAnhangtitel), lhsAnhangtitel, rhsAnhangtitel, (this.anhangtitel!= null), (that.anhangtitel!= null))) {
                return false;
            }
        }
        {
            String lhsFormat;
            lhsFormat = this.getFormat();
            String rhsFormat;
            rhsFormat = that.getFormat();
            if (!strategy.equals(LocatorUtils.property(thisLocator, "format", lhsFormat), LocatorUtils.property(thatLocator, "format", rhsFormat), lhsFormat, rhsFormat, (this.format!= null), (that.format!= null))) {
                return false;
            }
        }
        {
            Daten lhsDaten;
            lhsDaten = this.getDaten();
            Daten rhsDaten;
            rhsDaten = that.getDaten();
            if (!strategy.equals(LocatorUtils.property(thisLocator, "daten", lhsDaten), LocatorUtils.property(thatLocator, "daten", rhsDaten), lhsDaten, rhsDaten, (this.daten!= null), (that.daten!= null))) {
                return false;
            }
        }
        {
            Anhang.Location lhsLocation;
            lhsLocation = this.getLocation();
            Anhang.Location rhsLocation;
            rhsLocation = that.getLocation();
            if (!strategy.equals(LocatorUtils.property(thisLocator, "location", lhsLocation), LocatorUtils.property(thatLocator, "location", rhsLocation), lhsLocation, rhsLocation, (this.location!= null), (that.location!= null))) {
                return false;
            }
        }
        {
            Anhang.Gruppe lhsGruppe;
            lhsGruppe = this.getGruppe();
            Anhang.Gruppe rhsGruppe;
            rhsGruppe = that.getGruppe();
            if (!strategy.equals(LocatorUtils.property(thisLocator, "gruppe", lhsGruppe), LocatorUtils.property(thatLocator, "gruppe", rhsGruppe), lhsGruppe, rhsGruppe, (this.gruppe!= null), (that.gruppe!= 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 gruppe attribute in <anhang> 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="TITELBILD"/>
     *     <enumeration value="INNENANSICHTEN"/>
     *     <enumeration value="AUSSENANSICHTEN"/>
     *     <enumeration value="GRUNDRISS"/>
     *     <enumeration value="KARTEN_LAGEPLAN"/>
     *     <enumeration value="ANBIETERLOGO"/>
     *     <enumeration value="BILD"/>
     *     <enumeration value="DOKUMENTE"/>
     *     <enumeration value="LINKS"/>
     *     <enumeration value="PANORAMA"/>
     *   </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 Gruppe {

        TITELBILD,
        INNENANSICHTEN,
        AUSSENANSICHTEN,
        GRUNDRISS,
        KARTEN_LAGEPLAN,
        ANBIETERLOGO,
        BILD,
        DOKUMENTE,
        LINKS,
        PANORAMA;

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

        public static Anhang.Gruppe fromValue(String v) {
            return valueOf(v);
        }

    }

    /**
     *
     *                     Java enum for location attribute in <anhang> 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="INTERN"/>
     *     <enumeration value="EXTERN"/>
     *   </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 Location {

        INTERN,
        EXTERN;

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

        public static Anhang.Location fromValue(String v) {
            return valueOf(v);
        }

    }

}


package org.openestate.io.immobiliare_it.xml;

import java.io.Serializable;
import java.math.BigInteger;
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.XmlSchemaType;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.XmlValue;
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 floor complex type.
 *
 *
The following schema fragment specifies the expected content contained within this class.
 *
 *

 * <complexType name="floor">
 *   <simpleContent>
 *     <extension base="<http://www.w3.org/2001/XMLSchema>integer">
 *       <attribute name="type">
 *         <simpleType>
 *           <restriction base="{http://www.w3.org/2001/XMLSchema}string">
 *             <enumeration value="Intermedio"/>
 *             <enumeration value="Interrato"/>
 *             <enumeration value="Controterra"/>
 *             <enumeration value="Seminterrato"/>
 *             <enumeration value="PianoTerra"/>
 *             <enumeration value="Rialzato"/>
 *             <enumeration value="PianoNobile"/>
 *             <enumeration value="Multipiano"/>
 *             <enumeration value="Ultimo"/>
 *             <enumeration value="Attico"/>
 *             <enumeration value="Edificio"/>
 *           </restriction>
 *         </simpleType>
 *       </attribute>
 *     </extension>
 *   </simpleContent>
 * </complexType>
 *

 *
 *
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "floor", propOrder = {
    "value"
})
@Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:48:12+02:00", comments = "JAXB RI v2.2.11")
public class Floor implements Serializable, Cloneable, CopyTo2, Equals2, ToString2
{

    @XmlValue
    @XmlJavaTypeAdapter(Adapter2 .class)
    @XmlSchemaType(name = "integer")
    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:48:12+02:00", comments = "JAXB RI v2.2.11")
    protected BigInteger value;
    @XmlAttribute(name = "type")
    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:48:12+02:00", comments = "JAXB RI v2.2.11")
    protected Floor.FloorType type;

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

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

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

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

    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:48:12+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:48:12+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:48:12+02:00", comments = "JAXB RI v2.2.11")
    public StringBuilder appendFields(ObjectLocator locator, StringBuilder buffer, ToStringStrategy2 strategy) {
        {
            BigInteger theValue;
            theValue = this.getValue();
            strategy.appendField(locator, this, "value", buffer, theValue, (this.value!= null));
        }
        {
            Floor.FloorType theType;
            theType = this.getType();
            strategy.appendField(locator, this, "type", buffer, theType, (this.type!= null));
        }
        return buffer;
    }

    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:48:12+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:48:12+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:48:12+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 Floor) {
            final Floor copy = ((Floor) draftCopy);
            {
                Boolean valueShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, (this.value!= null));
                if (valueShouldBeCopiedAndSet == Boolean.TRUE) {
                    BigInteger sourceValue;
                    sourceValue = this.getValue();
                    BigInteger copyValue = ((BigInteger) strategy.copy(LocatorUtils.property(locator, "value", sourceValue), sourceValue, (this.value!= null)));
                    copy.setValue(copyValue);
                } else {
                    if (valueShouldBeCopiedAndSet == Boolean.FALSE) {
                        copy.value = null;
                    }
                }
            }
            {
                Boolean typeShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, (this.type!= null));
                if (typeShouldBeCopiedAndSet == Boolean.TRUE) {
                    Floor.FloorType sourceType;
                    sourceType = this.getType();
                    Floor.FloorType copyType = ((Floor.FloorType) strategy.copy(LocatorUtils.property(locator, "type", sourceType), sourceType, (this.type!= null)));
                    copy.setType(copyType);
                } else {
                    if (typeShouldBeCopiedAndSet == Boolean.FALSE) {
                        copy.type = null;
                    }
                }
            }
        }
        return draftCopy;
    }

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

    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:48:12+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 Floor that = ((Floor) object);
        {
            BigInteger lhsValue;
            lhsValue = this.getValue();
            BigInteger rhsValue;
            rhsValue = that.getValue();
            if (!strategy.equals(LocatorUtils.property(thisLocator, "value", lhsValue), LocatorUtils.property(thatLocator, "value", rhsValue), lhsValue, rhsValue, (this.value!= null), (that.value!= null))) {
                return false;
            }
        }
        {
            Floor.FloorType lhsType;
            lhsType = this.getType();
            Floor.FloorType rhsType;
            rhsType = that.getType();
            if (!strategy.equals(LocatorUtils.property(thisLocator, "type", lhsType), LocatorUtils.property(thatLocator, "type", rhsType), lhsType, rhsType, (this.type!= null), (that.type!= null))) {
                return false;
            }
        }
        return true;
    }

    @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:48:12+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 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="Intermedio"/>
     *     <enumeration value="Interrato"/>
     *     <enumeration value="Controterra"/>
     *     <enumeration value="Seminterrato"/>
     *     <enumeration value="PianoTerra"/>
     *     <enumeration value="Rialzato"/>
     *     <enumeration value="PianoNobile"/>
     *     <enumeration value="Multipiano"/>
     *     <enumeration value="Ultimo"/>
     *     <enumeration value="Attico"/>
     *     <enumeration value="Edificio"/>
     *   </restriction>
     * </simpleType>
     *

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

        @XmlEnumValue("Intermedio")
        INTERMEDIO("Intermedio"),
        @XmlEnumValue("Interrato")
        INTERRATO("Interrato"),
        @XmlEnumValue("Controterra")
        CONTROTERRA("Controterra"),
        @XmlEnumValue("Seminterrato")
        SEMINTERRATO("Seminterrato"),
        @XmlEnumValue("PianoTerra")
        PIANO_TERRA("PianoTerra"),
        @XmlEnumValue("Rialzato")
        RIALZATO("Rialzato"),
        @XmlEnumValue("PianoNobile")
        PIANO_NOBILE("PianoNobile"),
        @XmlEnumValue("Multipiano")
        MULTIPIANO("Multipiano"),
        @XmlEnumValue("Ultimo")
        ULTIMO("Ultimo"),
        @XmlEnumValue("Attico")
        ATTICO("Attico"),
        @XmlEnumValue("Edificio")
        EDIFICIO("Edificio");
        private final String value;

        FloorType(String v) {
            value = v;
        }

        public String value() {
            return value;
        }

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

    }

}