/* * 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.ows.xml.v200; import java.util.Objects; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlType; import javax.xml.bind.annotation.XmlValue; import org.geotoolkit.ows.xml.Value; /** * A single value, encoded as a string. This type can be * used for one value, for a spacing between allowed values, or for the * default value of a parameter. * * <p>Java class for ValueType complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * <complexType name="ValueType"> * <simpleContent> * <extension base="<http://www.w3.org/2001/XMLSchema>string"> * </extension> * </simpleContent> * </complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "ValueType", propOrder = { "value" }) public class ValueType implements Value { @XmlValue private String value; protected ValueType(){ } public ValueType(final Value that){ if (that != null) { this.value = that.getValue(); } } /** * Build a new Value. */ public ValueType(final String value){ this.value = value; } /** * Gets the value of the value property. * * @return * possible object is * {@link String } * */ public String getValue() { return value; } /** * Sets the value of the value property. * * @param value * allowed object is * {@link String } * */ public void setValue(String value) { this.value = value; } /** * 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 ValueType) { final ValueType that = (ValueType) object; return Objects.equals(this.value, that.value); } return false; } @Override public int hashCode() { int hash = 7; hash = 67 * hash + (this.value != null ? this.value.hashCode() : 0); return hash; } @Override public String toString() { return value; } }