001/*
002 * #%L
003 * HAPI FHIR - Core Library
004 * %%
005 * Copyright (C) 2014 - 2024 Smile CDR, Inc.
006 * %%
007 * Licensed under the Apache License, Version 2.0 (the "License");
008 * you may not use this file except in compliance with the License.
009 * You may obtain a copy of the License at
010 *
011 *      http://www.apache.org/licenses/LICENSE-2.0
012 *
013 * Unless required by applicable law or agreed to in writing, software
014 * distributed under the License is distributed on an "AS IS" BASIS,
015 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
016 * See the License for the specific language governing permissions and
017 * limitations under the License.
018 * #L%
019 */
020package ca.uhn.fhir.model.primitive;
021
022import ca.uhn.fhir.model.api.IQueryParameterType;
023import ca.uhn.fhir.model.api.annotation.DatatypeDef;
024import ca.uhn.fhir.model.api.annotation.SimpleSetter;
025
026/**
027 * Represents a Time datatype, per the FHIR specification. A time is a specification of hours and minutes (and optionally milliseconds), with NO date and NO timezone information attached. It is
028 * expressed as a string in the form <code>HH:mm:ss[.SSSS]</code>
029 *
030 * <p>
031 * This datatype is not valid in FHIR DSTU1
032 * </p>
033 *
034 * @since FHIR DSTU 2 / HAPI 0.8
035 *
036 *        TODO: have a way of preventing this from being used in DSTU1 resources
037 *        TODO: validate time?
038 */
039@DatatypeDef(name = "time")
040public class TimeDt extends StringDt implements IQueryParameterType {
041
042        /**
043         * Create a new String
044         */
045        public TimeDt() {
046                super();
047        }
048
049        /**
050         * Create a new String
051         */
052        @SimpleSetter
053        public TimeDt(@SimpleSetter.Parameter(name = "theString") String theValue) {
054                this();
055                setValue(theValue);
056        }
057}