/* * 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.gml.xml.v311; 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.XmlSchemaType; import javax.xml.bind.annotation.XmlType; import javax.xml.datatype.XMLGregorianCalendar; import org.apache.sis.util.ComparisonMode; /** * Defines the origin of a temporal coordinate reference system. * This type extends the TemporalDatumRestrictionType to add the "origin" element with the dateTime type. * * <p>Java class for TemporalDatumType complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * <complexType name="TemporalDatumType"> * <complexContent> * <extension base="{http://www.opengis.net/gml}TemporalDatumBaseType"> * <sequence> * <element ref="{http://www.opengis.net/gml}origin"/> * </sequence> * </extension> * </complexContent> * </complexType> * </pre> * * * @module */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "TemporalDatumType", propOrder = { "origin" }) public class TemporalDatumType extends TemporalDatumBaseType { @XmlElement(required = true) @XmlSchemaType(name = "dateTime") private XMLGregorianCalendar origin; /** * Gets the value of the origin property. * */ public XMLGregorianCalendar getOrigin() { return origin; } /** * Sets the value of the origin property. * */ public void setOrigin(final XMLGregorianCalendar value) { this.origin = value; } @Override public String toString() { StringBuilder sb = new StringBuilder(super.toString()).append("\n"); if (origin != null) { sb.append("origin: ").append(origin).append('\n'); } return sb.toString(); } /** * Verify if this entry is identical to specified object. */ @Override public boolean equals(final Object object, final ComparisonMode mode) { if (object == this) { return true; } if (object instanceof TemporalDatumType && super.equals(object, mode)) { final TemporalDatumType that = (TemporalDatumType) object; return Objects.equals(this.origin, that.origin); } return false; } @Override public int hashCode() { int hash = 5; hash = 59 * hash + (this.origin != null ? this.origin.hashCode() : 0); return hash; } }