/* * Geotoolkit - An Open Source Java GIS Toolkit * http://www.geotoolkit.org * * (C) 2015, 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.ext; import java.util.Objects; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlType; import javax.xml.bind.annotation.XmlValue; import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; /** * * @author Theo Zozime * * This class create a new xml tag which is the GeoJSON tag */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "GeoJSONType", namespace = "http://geotoolkit.org") @XmlRootElement(name="GeoJSON") public class GeoJSONType { @XmlJavaTypeAdapter(CDATAAdapter.class) @XmlValue private String content; public GeoJSONType(String content) { this.content = content; } public GeoJSONType() { this(""); } public void setContent(String content) { this.content = content; } public String getContent() { return content; } @Override public String toString() { StringBuilder sb = new StringBuilder("[").append(this.getClass().getSimpleName()).append("]\n"); if (content != null) { sb.append("content:").append(content).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 GeoJSONType) { final GeoJSONType that = (GeoJSONType) object; return Objects.equals(this.content, that.content); } return false; } @Override public int hashCode() { int hash = 3; hash = 71 * hash + Objects.hashCode(this.content); return hash; } }