/*
* Geotoolkit - An Open Source Java GIS Toolkit
* http://www.geotoolkit.org
*
* (C) 2008 - 2009, 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.wps.xml.v100;
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.XmlSchemaType;
import javax.xml.bind.annotation.XmlType;
import org.geotoolkit.wps.xml.Reference;
/**
* Reference to an output value that is a web accessible resource.
*
* <p>Java class for OutputReferenceType complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType name="OutputReferenceType">
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <attGroup ref="{http://www.opengis.net/wps/1.0.0}ComplexDataEncoding"/>
* <attribute name="href" use="required" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
* @module
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "OutputReferenceType")
public class OutputReferenceType implements Reference {
@XmlAttribute(required = true)
@XmlSchemaType(name = "anyURI")
protected String href;
@XmlAttribute
protected String mimeType;
@XmlAttribute
@XmlSchemaType(name = "anyURI")
protected String encoding;
@XmlAttribute
@XmlSchemaType(name = "anyURI")
protected String schema;
public OutputReferenceType() {
}
public OutputReferenceType(String href, String mimeType, String encoding) {
this.href = href;
this.mimeType = mimeType;
this.encoding = encoding;
}
/**
* Gets the value of the href property.
*
* @return
* possible object is
* {@link String }
*
*/
@Override
public String getHref() {
return href;
}
/**
* Sets the value of the href property.
*
* @param value
* allowed object is
* {@link String }
*
*/
@Override
public void setHref(final String value) {
this.href = value;
}
/**
* Gets the value of the mimeType property.
*
* @return
* possible object is
* {@link String }
*
*/
@Override
public String getMimeType() {
return mimeType;
}
/**
* Sets the value of the mimeType property.
*
* @param value
* allowed object is
* {@link String }
*
*/
@Override
public void setMimeType(final String value) {
this.mimeType = value;
}
/**
* Gets the value of the encoding property.
*
* @return
* possible object is
* {@link String }
*
*/
@Override
public String getEncoding() {
return encoding;
}
/**
* Sets the value of the encoding property.
*
* @param value
* allowed object is
* {@link String }
*
*/
@Override
public void setEncoding(final String value) {
this.encoding = value;
}
/**
* Gets the value of the schema property.
*
* @return
* possible object is
* {@link String }
*
*/
@Override
public String getSchema() {
return schema;
}
/**
* Sets the value of the schema property.
*
* @param value
* allowed object is
* {@link String }
*
*/
@Override
public void setSchema(final String value) {
this.schema = value;
}
@Override
public Object getBody() {
return null; // no body for output reference
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("[").append(this.getClass().getSimpleName()).append("]\n");
if (encoding != null) {
sb.append("encoding:").append(encoding).append('\n');
}
if (href != null) {
sb.append("href:").append(href).append('\n');
}
if (mimeType != null) {
sb.append("mimeType:").append(mimeType).append('\n');
}
if (schema != null) {
sb.append("schema:").append(schema).append('\n');
}
return sb.toString();
}
/**
* Verify that this entry is identical to the specified object.
* @param object Object to compare
*/
@Override
public boolean equals(final Object object) {
if (object == this) {
return true;
}
if (object instanceof OutputReferenceType) {
final OutputReferenceType that = (OutputReferenceType) object;
return Objects.equals(this.encoding, that.encoding) &&
Objects.equals(this.href, that.href) &&
Objects.equals(this.schema, that.schema) &&
Objects.equals(this.mimeType, that.mimeType);
}
return false;
}
@Override
public int hashCode() {
int hash = 5;
hash = 29 * hash + Objects.hashCode(this.href);
hash = 29 * hash + Objects.hashCode(this.mimeType);
hash = 29 * hash + Objects.hashCode(this.encoding);
hash = 29 * hash + Objects.hashCode(this.schema);
return hash;
}
}