001package org.hl7.fhir.r5.model;
002
003/*-
004 * #%L
005 * org.hl7.fhir.r5
006 * %%
007 * Copyright (C) 2014 - 2019 Health Level 7
008 * %%
009 * Licensed under the Apache License, Version 2.0 (the "License");
010 * you may not use this file except in compliance with the License.
011 * You may obtain a copy of the License at
012 * 
013 *      http://www.apache.org/licenses/LICENSE-2.0
014 * 
015 * Unless required by applicable law or agreed to in writing, software
016 * distributed under the License is distributed on an "AS IS" BASIS,
017 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
018 * See the License for the specific language governing permissions and
019 * limitations under the License.
020 * #L%
021 */
022
023/*
024  Copyright (c) 2011+, HL7, Inc.
025  All rights reserved.
026  
027  Redistribution and use in source and binary forms, with or without modification, 
028  are permitted provided that the following conditions are met:
029  
030   * Redistributions of source code must retain the above copyright notice, this 
031     list of conditions and the following disclaimer.
032   * Redistributions in binary form must reproduce the above copyright notice, 
033     this list of conditions and the following disclaimer in the documentation 
034     and/or other materials provided with the distribution.
035   * Neither the name of HL7 nor the names of its contributors may be used to 
036     endorse or promote products derived from this software without specific 
037     prior written permission.
038  
039  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
040  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
041  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
042  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
043  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
044  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
045  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
046  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
047  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
048  POSSIBILITY OF SUCH DAMAGE.
049  
050*/
051
052// Generated on Thu, Dec 13, 2018 14:07+1100 for FHIR v4.0.0
053import java.util.ArrayList;
054import java.util.Date;
055import java.util.List;
056
057import org.hl7.fhir.exceptions.FHIRException;
058import org.hl7.fhir.instance.model.api.ICompositeType;
059
060import org.hl7.fhir.instance.model.api.IBaseDatatypeElement;
061import ca.uhn.fhir.model.api.annotation.Child;
062import ca.uhn.fhir.model.api.annotation.ChildOrder;
063import ca.uhn.fhir.model.api.annotation.DatatypeDef;
064import ca.uhn.fhir.model.api.annotation.Description;
065import ca.uhn.fhir.model.api.annotation.Block;
066/**
067 * A length of time.
068 */
069@DatatypeDef(name="Duration")
070public class Duration extends Quantity implements ICompositeType {
071
072    private static final long serialVersionUID = 0L;
073
074  /**
075   * Constructor
076   */
077    public Duration() {
078      super();
079    }
080
081      protected void listChildren(List<Property> children) {
082        super.listChildren(children);
083      }
084
085      @Override
086      public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
087        switch (_hash) {
088        default: return super.getNamedProperty(_hash, _name, _checkValid);
089        }
090
091      }
092
093      @Override
094      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
095        switch (hash) {
096        default: return super.getProperty(hash, name, checkValid);
097        }
098
099      }
100
101      @Override
102      public Base setProperty(int hash, String name, Base value) throws FHIRException {
103        switch (hash) {
104        default: return super.setProperty(hash, name, value);
105        }
106
107      }
108
109      @Override
110      public Base setProperty(String name, Base value) throws FHIRException {
111          return super.setProperty(name, value);
112      }
113
114      @Override
115      public Base makeProperty(int hash, String name) throws FHIRException {
116        switch (hash) {
117        default: return super.makeProperty(hash, name);
118        }
119
120      }
121
122      @Override
123      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
124        switch (hash) {
125        default: return super.getTypesForProperty(hash, name);
126        }
127
128      }
129
130      @Override
131      public Base addChild(String name) throws FHIRException {
132          return super.addChild(name);
133      }
134
135  public String fhirType() {
136    return "Duration";
137
138  }
139
140      public Duration copy() {
141        Duration dst = new Duration();
142        copyValues(dst);
143        return dst;
144      }
145
146      public void copyValues(Duration dst) {
147        super.copyValues(dst);
148      }
149
150      protected Duration typedCopy() {
151        return copy();
152      }
153
154      @Override
155      public boolean equalsDeep(Base other_) {
156        if (!super.equalsDeep(other_))
157          return false;
158        if (!(other_ instanceof Duration))
159          return false;
160        Duration o = (Duration) other_;
161        return true;
162      }
163
164      @Override
165      public boolean equalsShallow(Base other_) {
166        if (!super.equalsShallow(other_))
167          return false;
168        if (!(other_ instanceof Duration))
169          return false;
170        Duration o = (Duration) other_;
171        return true;
172      }
173
174      public boolean isEmpty() {
175        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty();
176      }
177
178
179}
180