/* * 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.ows.xml.v110; 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.XmlRootElement; import javax.xml.bind.annotation.XmlSchemaType; import javax.xml.bind.annotation.XmlType; import javax.xml.bind.annotation.XmlValue; /** * Human-readable name of the list of values provided by the referenced document. Can be empty string when this list has no name. * * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * <complexType> * <simpleContent> * <extension base="<http://www.w3.org/2001/XMLSchema>string"> * <attribute ref="{http://www.opengis.net/ows/1.1}reference use="required""/> * </extension> * </simpleContent> * </complexType> * </pre> * * @author Guilhem Legal * @module */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "value" }) @XmlRootElement(name = "ValuesReference") public class ValuesReference { @XmlValue private String value; @XmlAttribute(namespace = "http://www.opengis.net/ows/1.1", required = true) @XmlSchemaType(name = "anyURI") private String reference; /** * Empty constructor used by JAXB. */ ValuesReference(){ } public ValuesReference(final ValuesReference that){ if (that != null) { this.reference = that.reference; this.value = that.value; } } /** * Build a new Values reference. */ public ValuesReference(final String value, final String reference){ this.value = value; this.reference = reference; } /** * Gets the value of the value property. */ public String getValue() { return value; } /** * Gets the value of the reference property. */ public String getReference() { return reference; } /** * Verify that this entry is identical to the specified object. */ @Override public boolean equals(final Object object) { if (object == this) { return true; } if (object instanceof ValuesReference) { final ValuesReference that = ( ValuesReference) object; return Objects.equals(this.reference, that.reference) && Objects.equals(this.value, that.value); } return false; } @Override public int hashCode() { int hash = 3; hash = 17 * hash + (this.value != null ? this.value.hashCode() : 0); hash = 17 * hash + (this.reference != null ? this.reference.hashCode() : 0); return hash; } }