/*
* 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.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/2.0}reference use="required""/>
* </extension>
* </simpleContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"value"
})
@XmlRootElement(name = "ValuesReference")
public class ValuesReference implements org.geotoolkit.ows.xml.ValueReference {
@XmlValue
protected String value;
@XmlAttribute(namespace = "http://www.opengis.net/ows/2.0", required = true)
@XmlSchemaType(name = "anyURI")
protected 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.
*
* @return
* possible object is
* {@link String }
*
*/
@Override
public String getValue() {
return value;
}
/**
* Sets the value of the value property.
*
* @param value
* allowed object is
* {@link String }
*
*/
@Override
public void setValue(String value) {
this.value = value;
}
/**
* Gets the value of the reference property.
*
* @return
* possible object is
* {@link String }
*
*/
@Override
public String getReference() {
return reference;
}
/**
* Sets the value of the reference property.
*
* @param value
* allowed object is
* {@link String }
*
*/
@Override
public void setReference(String value) {
this.reference = value;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("[").append(this.getClass().getSimpleName()).append("]\n");
if (reference != null) {
sb.append("reference:").append(reference).append('\n');
}
if (value != null) {
sb.append("value:").append(value).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 ValuesReference) {
final ValuesReference that = (ValuesReference) object;
return Objects.equals(this.reference, that.reference) &&
Objects.equals(this.value, that.value);
}
return false;
}
}