/*
* 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.sos.xml.v100;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
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.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for anonymous complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType>
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="ObservationOfferingList">
* <complexType>
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="ObservationOffering" type="{http://www.opengis.net/sos/1.0}ObservationOfferingType" maxOccurs="unbounded"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </element>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
* @author Guilhem Legal
* @module
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"observationOfferingList"
})
@XmlRootElement(name = "Contents")
public class Contents implements org.geotoolkit.sos.xml.Contents {
@XmlElement(name = "ObservationOfferingList", required = true)
private Contents.ObservationOfferingList observationOfferingList;
/**
* Empty constructor used by JAXB
*/
Contents() {
}
/**
* Build a new Contents
*/
public Contents(final ObservationOfferingList observationOfferingList) {
this.observationOfferingList = observationOfferingList;
}
public Contents(final List<ObservationOfferingType> offerings) {
this.observationOfferingList = new ObservationOfferingList(offerings);
}
/**
* Return the value of the observationOfferingList property.
*/
public ObservationOfferingList getObservationOfferingList() {
return observationOfferingList;
}
@Override
public List<ObservationOfferingType> getOfferings() {
if (observationOfferingList != null) {
return observationOfferingList.getObservationOffering();
}
return new ArrayList<ObservationOfferingType>();
}
/**
* Verify if this entry is identical to�the specified object.
*/
@Override
public boolean equals(final Object object) {
if (object == this) {
return true;
}
if (object instanceof Contents) {
final Contents that = (Contents) object;
return Objects.equals(this.observationOfferingList, that.observationOfferingList);
}
return false;
}
@Override
public int hashCode() {
int hash = 7;
hash = 59 * hash + (this.observationOfferingList != null ? this.observationOfferingList.hashCode() : 0);
return hash;
}
@Override
public String toString() {
StringBuilder s = new StringBuilder();
s.append("class: Contents :").append(observationOfferingList.toString());
return s.toString();
}
/**
* <p>Java class for anonymous complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType>
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="ObservationOffering" type="{http://www.opengis.net/sos/1.0}ObservationOfferingType" maxOccurs="unbounded"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"observationOffering"
})
public static class ObservationOfferingList {
@XmlElement(name = "ObservationOffering", required = true)
private List<ObservationOfferingType> observationOffering;
/**
* Empty constructor used by JAXB
*/
ObservationOfferingList(){
}
/**
* Build a new Observation offering list.
*/
public ObservationOfferingList(final List<ObservationOfferingType> observationOffering){
this.observationOffering = observationOffering;
}
/**
* Return the list of observation Offering.
*/
public List<ObservationOfferingType> getObservationOffering() {
if (observationOffering == null){
observationOffering = new ArrayList<ObservationOfferingType>();
}
return Collections.unmodifiableList(observationOffering);
}
/**
* Verify if this entry is identical to the specified object.
*/
@Override
public boolean equals(final Object object) {
if (object == this) {
return true;
}
if (object instanceof ObservationOfferingList) {
final ObservationOfferingList that = (ObservationOfferingList) object;
return Objects.equals(this.observationOffering, that.observationOffering);
}
return false;
}
@Override
public int hashCode() {
int hash = 5;
hash = 67 * hash + (this.observationOffering != null ? this.observationOffering.hashCode() : 0);
return hash;
}
@Override
public String toString() {
StringBuilder s = new StringBuilder();
for (ObservationOfferingType o:observationOffering) {
s.append(o.toString()).append('\n');
}
return s.toString();
}
}
}