001/* 002 * GeoAPI - Java interfaces for OGC/ISO standards 003 * Copyright © 2005-2023 Open Geospatial Consortium, Inc. 004 * http://www.geoapi.org 005 * 006 * Licensed under the Apache License, Version 2.0 (the "License"); 007 * you may not use this file except in compliance with the License. 008 * You may obtain a copy of the License at 009 * 010 * http://www.apache.org/licenses/LICENSE-2.0 011 * 012 * Unless required by applicable law or agreed to in writing, software 013 * distributed under the License is distributed on an "AS IS" BASIS, 014 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 015 * See the License for the specific language governing permissions and 016 * limitations under the License. 017 */ 018package org.opengis.metadata.citation; 019 020import java.util.Date; 021import java.time.temporal.Temporal; 022import org.opengis.geoapi.internal.Legacy; 023import org.opengis.annotation.UML; 024import org.opengis.annotation.Profile; 025import org.opengis.annotation.Classifier; 026import org.opengis.annotation.Stereotype; 027 028import static org.opengis.annotation.Obligation.*; 029import static org.opengis.annotation.Specification.*; 030import static org.opengis.annotation.ComplianceLevel.*; 031 032 033/** 034 * Reference date and event used to describe it. 035 * 036 * @author Martin Desruisseaux (IRD) 037 * @version 3.1 038 * @since 2.0 039 */ 040@Classifier(Stereotype.DATATYPE) 041@UML(identifier="CI_Date", specification=ISO_19115) 042public interface CitationDate { 043 /** 044 * Reference date for the cited resource. 045 * 046 * @return reference date for the cited resource. 047 * 048 * @deprecated Replaced by {@link #getReferenceDate()}. 049 */ 050 @Deprecated(since="3.1") 051 default Date getDate() { 052 return Legacy.toDate(getReferenceDate()); 053 } 054 055 /** 056 * Reference date for the cited resource. 057 * The returned value should be an instance of {@link java.time.LocalDate}, {@link java.time.LocalDateTime}, 058 * {@link java.time.OffsetDateTime} or {@link java.time.ZonedDateTime}, depending whether hours are defined 059 * and how the timezone (if any) is defined. But other types are also allowed. 060 * For example, a citation date may be merely a {@link java.time.Year}. 061 * 062 * @return reference date for the cited resource. 063 * 064 * @departure historical 065 * Renamed for avoiding a conflict with the {@code getDate()} method defined in GeoAPI 3.0. 066 * 067 * @since 3.1 068 */ 069 @Profile(level=CORE) 070 @UML(identifier="date", obligation=MANDATORY, specification=ISO_19115) 071 Temporal getReferenceDate(); 072 073 /** 074 * Event used for reference date. 075 * 076 * @return event used for reference date. 077 */ 078 @Profile(level=CORE) 079 @UML(identifier="dateType", obligation=MANDATORY, specification=ISO_19115) 080 DateType getDateType(); 081}