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