/* * Geotoolkit - An Open Source Java GIS Toolkit * http://www.geotoolkit.org * * (C) 2013, Geomatys * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. */ package org.geotoolkit.wcs.xml.v200; import java.util.Objects; 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.XmlSeeAlso; import javax.xml.bind.annotation.XmlType; import org.apache.sis.util.Version; import org.geotoolkit.ows.xml.RequestBase; /** * XML encoded WCS operation request base, for all operations except GetCapabilities. In this XML encoding, no "request" parameter is included, since the element name specifies the specific operation. 'Extension' elements allow WCS extension standards to define their individual extra request parameters. * * <p>Java class for RequestBaseType complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * <complexType name="RequestBaseType"> * <complexContent> * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * <sequence> * <element ref="{http://www.opengis.net/wcs/2.0}Extension" minOccurs="0"/> * </sequence> * <attribute name="service" use="required" type="{http://www.w3.org/2001/XMLSchema}string" fixed="WCS" /> * <attribute name="version" use="required" type="{http://www.opengis.net/wcs/2.0}VersionStringType" /> * </restriction> * </complexContent> * </complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "RequestBaseType", propOrder = { "extension" }) @XmlSeeAlso({ GetCoverageType.class, DescribeCoverageType.class }) public abstract class RequestBaseType implements RequestBase { @XmlElement(name = "Extension") private ExtensionType extension; @XmlAttribute(required = true) protected String service; @XmlAttribute(required = true) protected String version; /** * Gets the value of the extension property. * * @return * possible object is * {@link ExtensionType } * */ public ExtensionType getExtension() { return extension; } /** * Sets the value of the extension property. * * @param value * allowed object is * {@link ExtensionType } * */ public void setExtension(ExtensionType value) { this.extension = value; } /** * Gets the value of the service property. * * @return * possible object is * {@link String } * */ @Override public String getService() { if (service == null) { return "WCS"; } else { return service; } } /** * Sets the value of the service property. * * @param value * allowed object is * {@link String } * */ @Override public void setService(String value) { this.service = value; } /** * Gets the value of the version property. * * @return * possible object is * {@link String } * */ @Override public Version getVersion() { if (version != null) { return new Version(version); } return null; } @Override public void setVersion(final String value) { this.version = value; } @Override public boolean equals(Object o) { if (this == o) { return true; } if (o instanceof RequestBaseType) { final RequestBaseType that = (RequestBaseType) o; return Objects.equals(this.extension, that.extension) && Objects.equals(this.service, that.service) && Objects.equals(this.version, that.version); } return false; } @Override public int hashCode() { int hash = 3; hash = 47 * hash + Objects.hashCode(this.extension); hash = 47 * hash + Objects.hashCode(this.service); hash = 47 * hash + Objects.hashCode(this.version); return hash; } }