/*
* Geotoolkit - An Open Source Java GIS Toolkit
* http://www.geotoolkit.org
*
* (C) 2012, 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.observation.xml.v200;
import java.util.Objects;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
import org.geotoolkit.gml.xml.v321.ReferenceType;
/**
* Some observations depend on other observations to provide context which
* is important, sometimes essential, in understanding the result. These dependencies
* are stronger than mere spatiotemporal coincidences, requiring explicit
* representation. If present, the association class ObservationContext (Figure 2)
* shall link a OM_Observation to another OM_Observation, with the role name
* relatedObservation for the target.
*
* <p>Java class for ObservationContextType complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType name="ObservationContextType">
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="role" type="{http://www.opengis.net/gml/3.2}ReferenceType"/>
* <element name="relatedObservation" type="{http://www.opengis.net/gml/3.2}ReferenceType"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "ObservationContextType", propOrder = {
"role",
"relatedObservation"
})
public class ObservationContextType {
@XmlElement(required = true)
private ReferenceType role;
@XmlElement(required = true)
private ReferenceType relatedObservation;
/**
* Gets the value of the role property.
*
* @return
* possible object is
* {@link ReferenceType }
*
*/
public ReferenceType getRole() {
return role;
}
/**
* Sets the value of the role property.
*
* @param value
* allowed object is
* {@link ReferenceType }
*
*/
public void setRole(ReferenceType value) {
this.role = value;
}
/**
* Gets the value of the relatedObservation property.
*
* @return
* possible object is
* {@link ReferenceType }
*
*/
public ReferenceType getRelatedObservation() {
return relatedObservation;
}
/**
* Sets the value of the relatedObservation property.
*
* @param value
* allowed object is
* {@link ReferenceType }
*
*/
public void setRelatedObservation(ReferenceType value) {
this.relatedObservation = value;
}
/**
* Vérifie que cette station est identique à l'objet spécifié
*/
@Override
public boolean equals(final Object object) {
if (object == this) {
return true;
}
if (object instanceof ObservationContextType && super.equals(object)) {
final ObservationContextType that = (ObservationContextType) object;
return Objects.equals(this.relatedObservation, that.relatedObservation) &&
Objects.equals(this.role, that.role);
}
return false;
}
@Override
public int hashCode() {
int hash = 7;
hash = 37 * hash + (this.relatedObservation != null ? this.relatedObservation.hashCode() : 0);
hash = 37 * hash + (this.role != null ? this.role.hashCode() : 0);
return hash;
}
}