001package org.hl7.fhir.instance.model.api;
002
003import java.io.Serializable;
004import java.util.List;
005
006/*
007 * #%L
008 * HAPI FHIR - Core Library
009 * %%
010 * Copyright (C) 2014 - 2021 Smile CDR, Inc.
011 * %%
012 * Licensed under the Apache License, Version 2.0 (the "License");
013 * you may not use this file except in compliance with the License.
014 * You may obtain a copy of the License at
015 *
016 *      http://www.apache.org/licenses/LICENSE-2.0
017 *
018 * Unless required by applicable law or agreed to in writing, software
019 * distributed under the License is distributed on an "AS IS" BASIS,
020 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
021 * See the License for the specific language governing permissions and
022 * limitations under the License.
023 * #L%
024 */
025
026/**
027 * This interface is a simple marker for anything which is an HL7
028 * structure of some kind. It is provided mostly to simplify convergence
029 * between the HL7.org structures and the HAPI ones. 
030 */
031public interface IBase extends Serializable {
032
033        boolean isEmpty();
034
035        /**
036         * Returns <code>true</code> if any comments would be returned by {@link #getFormatCommentsPre()}
037         * or {@link #getFormatCommentsPost()}
038         * 
039         * @since 1.5
040         */
041        boolean hasFormatComment();
042
043        /**
044         * Returns a list of comments appearing immediately before this element within the serialized
045         * form of the resource. Creates the list if it does not exist, so this method will not return <code>null</code>
046         * 
047         * @since 1.5
048         */
049        List<String> getFormatCommentsPre();
050
051        /**
052         * Returns a list of comments appearing immediately after this element within the serialized
053         * form of the resource. Creates the list if it does not exist, so this method will not return <code>null</code>
054         * 
055         * @since 1.5
056         */
057        List<String> getFormatCommentsPost();
058
059        /**
060         * Returns the FHIR type name for the given element, e.g. "Patient" or "unsignedInt"
061         */
062        default String fhirType() { return null; }
063
064        /**
065         * Retrieves any user suplied data in this element
066         */
067        Object getUserData(String theName);
068
069        /**
070         * Sets a user supplied data value in this element
071         */
072        void setUserData(String theName, Object theValue);
073
074}