001/*
002 *    GeoAPI - Java interfaces for OGC/ISO standards
003 *    Copyright © 2014-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.identification;
019
020import org.opengis.annotation.UML;
021import org.opengis.metadata.citation.Citation;
022
023import static org.opengis.annotation.Obligation.*;
024import static org.opengis.annotation.Specification.ISO_19115;
025
026
027/**
028 * Associated resource information.
029 *
030 * <p><b>Conditional properties:</b></p>
031 * Following property has default method but shall nevertheless be implemented if the corresponding condition is met:
032 * <ul>
033 *   <li>{@linkplain #getMetadataReference() Metadata reference} is mandatory if the resource
034 *       {@linkplain #getName() name} is not provided.</li>
035 * </ul>
036 *
037 * @author  Rémi Maréchal (Geomatys)
038 * @version 3.1
039 * @since   3.1
040 */
041@UML(identifier="MD_AssociatedResource", specification=ISO_19115)
042public interface AssociatedResource {
043    /**
044     * Citation information about the associated resource.
045     *
046     * @return citation information about the associated resource, or {@code null} if none.
047     *
048     * @condition Mandatory if the {@linkplain #getMetadataReference() metadata reference} is not documented.
049     */
050    @UML(identifier="name", obligation=CONDITIONAL, specification=ISO_19115)
051    Citation getName();
052
053    /**
054     * Type of relation between the resources.
055     *
056     * @return the type of relation between the resources.
057     */
058    @UML(identifier="associationType", obligation=MANDATORY, specification=ISO_19115)
059    AssociationType getAssociationType();
060
061    /**
062     * Type of initiative under which the associated resource was produced.
063     *
064     * @return the type of initiative under which the associated resource was produced, or {@code null} if none.
065     */
066    @UML(identifier="initiativeType", obligation=OPTIONAL, specification=ISO_19115)
067    default InitiativeType getInitiativeType() {
068        return null;
069    }
070
071    /**
072     * Reference to the metadata of the associated resource.
073     *
074     * @return reference to the metadata of the associated resource, or {@code null} if none.
075     *
076     * @condition Mandatory if the {@linkplain #getName() name} is not documented.
077     */
078    @UML(identifier="metadataReference", obligation=CONDITIONAL, specification=ISO_19115)
079    default Citation getMetadataReference() {
080        return null;
081    }
082}