001package org.hl7.fhir.r4.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 Sun, May 6, 2018 17:51-0400 for FHIR v3.4.0 033 034import java.util.*; 035 036import org.hl7.fhir.utilities.Utilities; 037import ca.uhn.fhir.model.api.annotation.ResourceDef; 038import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; 039import ca.uhn.fhir.model.api.annotation.Child; 040import ca.uhn.fhir.model.api.annotation.ChildOrder; 041import ca.uhn.fhir.model.api.annotation.Description; 042import ca.uhn.fhir.model.api.annotation.Block; 043import org.hl7.fhir.instance.model.api.*; 044import org.hl7.fhir.exceptions.FHIRException; 045/** 046 * This special resource type is used to represent an operation request and response (operations.html). It has no other use, and there is no RESTful endpoint associated with it. 047 */ 048@ResourceDef(name="Parameters", profile="http://hl7.org/fhir/Profile/Parameters") 049public class Parameters extends Resource implements IBaseParameters { 050 051 @Block() 052 public static class ParametersParameterComponent extends BackboneElement implements IBaseBackboneElement { 053 /** 054 * The name of the parameter (reference to the operation definition). 055 */ 056 @Child(name = "name", type = {StringType.class}, order=1, min=1, max=1, modifier=false, summary=true) 057 @Description(shortDefinition="Name from the definition", formalDefinition="The name of the parameter (reference to the operation definition)." ) 058 protected StringType name; 059 060 /** 061 * If the parameter is a data type. 062 */ 063 @Child(name = "value", type = {}, order=2, min=0, max=1, modifier=false, summary=true) 064 @Description(shortDefinition="If parameter is a data type", formalDefinition="If the parameter is a data type." ) 065 protected org.hl7.fhir.r4.model.Type value; 066 067 /** 068 * If the parameter is a whole resource. 069 */ 070 @Child(name = "resource", type = {Resource.class}, order=3, min=0, max=1, modifier=false, summary=true) 071 @Description(shortDefinition="If parameter is a whole resource", formalDefinition="If the parameter is a whole resource." ) 072 protected Resource resource; 073 074 /** 075 * A named part of a multi-part parameter. 076 */ 077 @Child(name = "part", type = {ParametersParameterComponent.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) 078 @Description(shortDefinition="Named part of a multi-part parameter", formalDefinition="A named part of a multi-part parameter." ) 079 protected List<ParametersParameterComponent> part; 080 081 private static final long serialVersionUID = -1265707999L; 082 083 /** 084 * Constructor 085 */ 086 public ParametersParameterComponent() { 087 super(); 088 } 089 090 /** 091 * Constructor 092 */ 093 public ParametersParameterComponent(StringType name) { 094 super(); 095 this.name = name; 096 } 097 098 /** 099 * @return {@link #name} (The name of the parameter (reference to the operation definition).). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value 100 */ 101 public StringType getNameElement() { 102 if (this.name == null) 103 if (Configuration.errorOnAutoCreate()) 104 throw new Error("Attempt to auto-create ParametersParameterComponent.name"); 105 else if (Configuration.doAutoCreate()) 106 this.name = new StringType(); // bb 107 return this.name; 108 } 109 110 public boolean hasNameElement() { 111 return this.name != null && !this.name.isEmpty(); 112 } 113 114 public boolean hasName() { 115 return this.name != null && !this.name.isEmpty(); 116 } 117 118 /** 119 * @param value {@link #name} (The name of the parameter (reference to the operation definition).). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value 120 */ 121 public ParametersParameterComponent setNameElement(StringType value) { 122 this.name = value; 123 return this; 124 } 125 126 /** 127 * @return The name of the parameter (reference to the operation definition). 128 */ 129 public String getName() { 130 return this.name == null ? null : this.name.getValue(); 131 } 132 133 /** 134 * @param value The name of the parameter (reference to the operation definition). 135 */ 136 public ParametersParameterComponent setName(String value) { 137 if (this.name == null) 138 this.name = new StringType(); 139 this.name.setValue(value); 140 return this; 141 } 142 143 /** 144 * @return {@link #value} (If the parameter is a data type.) 145 */ 146 public org.hl7.fhir.r4.model.Type getValue() { 147 return this.value; 148 } 149 150 public boolean hasValue() { 151 return this.value != null && !this.value.isEmpty(); 152 } 153 154 /** 155 * @param value {@link #value} (If the parameter is a data type.) 156 */ 157 public ParametersParameterComponent setValue(org.hl7.fhir.r4.model.Type value) { 158 this.value = value; 159 return this; 160 } 161 162 /** 163 * @return {@link #resource} (If the parameter is a whole resource.) 164 */ 165 public Resource getResource() { 166 return this.resource; 167 } 168 169 public boolean hasResource() { 170 return this.resource != null && !this.resource.isEmpty(); 171 } 172 173 /** 174 * @param value {@link #resource} (If the parameter is a whole resource.) 175 */ 176 public ParametersParameterComponent setResource(Resource value) { 177 this.resource = value; 178 return this; 179 } 180 181 /** 182 * @return {@link #part} (A named part of a multi-part parameter.) 183 */ 184 public List<ParametersParameterComponent> getPart() { 185 if (this.part == null) 186 this.part = new ArrayList<ParametersParameterComponent>(); 187 return this.part; 188 } 189 190 /** 191 * @return Returns a reference to <code>this</code> for easy method chaining 192 */ 193 public ParametersParameterComponent setPart(List<ParametersParameterComponent> thePart) { 194 this.part = thePart; 195 return this; 196 } 197 198 public boolean hasPart() { 199 if (this.part == null) 200 return false; 201 for (ParametersParameterComponent item : this.part) 202 if (!item.isEmpty()) 203 return true; 204 return false; 205 } 206 207 public ParametersParameterComponent addPart() { //3 208 ParametersParameterComponent t = new ParametersParameterComponent(); 209 if (this.part == null) 210 this.part = new ArrayList<ParametersParameterComponent>(); 211 this.part.add(t); 212 return t; 213 } 214 215 public ParametersParameterComponent addPart(ParametersParameterComponent t) { //3 216 if (t == null) 217 return this; 218 if (this.part == null) 219 this.part = new ArrayList<ParametersParameterComponent>(); 220 this.part.add(t); 221 return this; 222 } 223 224 /** 225 * @return The first repetition of repeating field {@link #part}, creating it if it does not already exist 226 */ 227 public ParametersParameterComponent getPartFirstRep() { 228 if (getPart().isEmpty()) { 229 addPart(); 230 } 231 return getPart().get(0); 232 } 233 234 protected void listChildren(List<Property> children) { 235 super.listChildren(children); 236 children.add(new Property("name", "string", "The name of the parameter (reference to the operation definition).", 0, 1, name)); 237 children.add(new Property("value[x]", "*", "If the parameter is a data type.", 0, 1, value)); 238 children.add(new Property("resource", "Resource", "If the parameter is a whole resource.", 0, 1, resource)); 239 children.add(new Property("part", "@Parameters.parameter", "A named part of a multi-part parameter.", 0, java.lang.Integer.MAX_VALUE, part)); 240 } 241 242 @Override 243 public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException { 244 switch (_hash) { 245 case 3373707: /*name*/ return new Property("name", "string", "The name of the parameter (reference to the operation definition).", 0, 1, name); 246 case -1410166417: /*value[x]*/ return new Property("value[x]", "*", "If the parameter is a data type.", 0, 1, value); 247 case 111972721: /*value*/ return new Property("value[x]", "*", "If the parameter is a data type.", 0, 1, value); 248 case -1535024575: /*valueBase64Binary*/ return new Property("value[x]", "*", "If the parameter is a data type.", 0, 1, value); 249 case 733421943: /*valueBoolean*/ return new Property("value[x]", "*", "If the parameter is a data type.", 0, 1, value); 250 case -786218365: /*valueCanonical*/ return new Property("value[x]", "*", "If the parameter is a data type.", 0, 1, value); 251 case -766209282: /*valueCode*/ return new Property("value[x]", "*", "If the parameter is a data type.", 0, 1, value); 252 case -766192449: /*valueDate*/ return new Property("value[x]", "*", "If the parameter is a data type.", 0, 1, value); 253 case 1047929900: /*valueDateTime*/ return new Property("value[x]", "*", "If the parameter is a data type.", 0, 1, value); 254 case -2083993440: /*valueDecimal*/ return new Property("value[x]", "*", "If the parameter is a data type.", 0, 1, value); 255 case 231604844: /*valueId*/ return new Property("value[x]", "*", "If the parameter is a data type.", 0, 1, value); 256 case -1668687056: /*valueInstant*/ return new Property("value[x]", "*", "If the parameter is a data type.", 0, 1, value); 257 case -1668204915: /*valueInteger*/ return new Property("value[x]", "*", "If the parameter is a data type.", 0, 1, value); 258 case -497880704: /*valueMarkdown*/ return new Property("value[x]", "*", "If the parameter is a data type.", 0, 1, value); 259 case -1410178407: /*valueOid*/ return new Property("value[x]", "*", "If the parameter is a data type.", 0, 1, value); 260 case -1249932027: /*valuePositiveInt*/ return new Property("value[x]", "*", "If the parameter is a data type.", 0, 1, value); 261 case -1424603934: /*valueString*/ return new Property("value[x]", "*", "If the parameter is a data type.", 0, 1, value); 262 case -765708322: /*valueTime*/ return new Property("value[x]", "*", "If the parameter is a data type.", 0, 1, value); 263 case 26529417: /*valueUnsignedInt*/ return new Property("value[x]", "*", "If the parameter is a data type.", 0, 1, value); 264 case -1410172357: /*valueUri*/ return new Property("value[x]", "*", "If the parameter is a data type.", 0, 1, value); 265 case -1410172354: /*valueUrl*/ return new Property("value[x]", "*", "If the parameter is a data type.", 0, 1, value); 266 case -765667124: /*valueUuid*/ return new Property("value[x]", "*", "If the parameter is a data type.", 0, 1, value); 267 case -478981821: /*valueAddress*/ return new Property("value[x]", "*", "If the parameter is a data type.", 0, 1, value); 268 case -67108992: /*valueAnnotation*/ return new Property("value[x]", "*", "If the parameter is a data type.", 0, 1, value); 269 case -475566732: /*valueAttachment*/ return new Property("value[x]", "*", "If the parameter is a data type.", 0, 1, value); 270 case 924902896: /*valueCodeableConcept*/ return new Property("value[x]", "*", "If the parameter is a data type.", 0, 1, value); 271 case -1887705029: /*valueCoding*/ return new Property("value[x]", "*", "If the parameter is a data type.", 0, 1, value); 272 case 944904545: /*valueContactPoint*/ return new Property("value[x]", "*", "If the parameter is a data type.", 0, 1, value); 273 case -2026205465: /*valueHumanName*/ return new Property("value[x]", "*", "If the parameter is a data type.", 0, 1, value); 274 case -130498310: /*valueIdentifier*/ return new Property("value[x]", "*", "If the parameter is a data type.", 0, 1, value); 275 case -1524344174: /*valuePeriod*/ return new Property("value[x]", "*", "If the parameter is a data type.", 0, 1, value); 276 case -2029823716: /*valueQuantity*/ return new Property("value[x]", "*", "If the parameter is a data type.", 0, 1, value); 277 case 2030761548: /*valueRange*/ return new Property("value[x]", "*", "If the parameter is a data type.", 0, 1, value); 278 case 2030767386: /*valueRatio*/ return new Property("value[x]", "*", "If the parameter is a data type.", 0, 1, value); 279 case 1755241690: /*valueReference*/ return new Property("value[x]", "*", "If the parameter is a data type.", 0, 1, value); 280 case -962229101: /*valueSampledData*/ return new Property("value[x]", "*", "If the parameter is a data type.", 0, 1, value); 281 case -540985785: /*valueSignature*/ return new Property("value[x]", "*", "If the parameter is a data type.", 0, 1, value); 282 case -1406282469: /*valueTiming*/ return new Property("value[x]", "*", "If the parameter is a data type.", 0, 1, value); 283 case -1858636920: /*valueDosage*/ return new Property("value[x]", "*", "If the parameter is a data type.", 0, 1, value); 284 case -341064690: /*resource*/ return new Property("resource", "Resource", "If the parameter is a whole resource.", 0, 1, resource); 285 case 3433459: /*part*/ return new Property("part", "@Parameters.parameter", "A named part of a multi-part parameter.", 0, java.lang.Integer.MAX_VALUE, part); 286 default: return super.getNamedProperty(_hash, _name, _checkValid); 287 } 288 289 } 290 291 @Override 292 public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { 293 switch (hash) { 294 case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType 295 case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // org.hl7.fhir.r4.model.Type 296 case -341064690: /*resource*/ return this.resource == null ? new Base[0] : new Base[] {this.resource}; // Resource 297 case 3433459: /*part*/ return this.part == null ? new Base[0] : this.part.toArray(new Base[this.part.size()]); // ParametersParameterComponent 298 default: return super.getProperty(hash, name, checkValid); 299 } 300 301 } 302 303 @Override 304 public Base setProperty(int hash, String name, Base value) throws FHIRException { 305 switch (hash) { 306 case 3373707: // name 307 this.name = castToString(value); // StringType 308 return value; 309 case 111972721: // value 310 this.value = castToType(value); // org.hl7.fhir.r4.model.Type 311 return value; 312 case -341064690: // resource 313 this.resource = castToResource(value); // Resource 314 return value; 315 case 3433459: // part 316 this.getPart().add((ParametersParameterComponent) value); // ParametersParameterComponent 317 return value; 318 default: return super.setProperty(hash, name, value); 319 } 320 321 } 322 323 @Override 324 public Base setProperty(String name, Base value) throws FHIRException { 325 if (name.equals("name")) { 326 this.name = castToString(value); // StringType 327 } else if (name.equals("value[x]")) { 328 this.value = castToType(value); // org.hl7.fhir.r4.model.Type 329 } else if (name.equals("resource")) { 330 this.resource = castToResource(value); // Resource 331 } else if (name.equals("part")) { 332 this.getPart().add((ParametersParameterComponent) value); 333 } else 334 return super.setProperty(name, value); 335 return value; 336 } 337 338 @Override 339 public Base makeProperty(int hash, String name) throws FHIRException { 340 switch (hash) { 341 case 3373707: return getNameElement(); 342 case -1410166417: return getValue(); 343 case 111972721: return getValue(); 344 case -341064690: throw new FHIRException("Cannot make property resource as it is not a complex type"); // Resource 345 case 3433459: return addPart(); 346 default: return super.makeProperty(hash, name); 347 } 348 349 } 350 351 @Override 352 public String[] getTypesForProperty(int hash, String name) throws FHIRException { 353 switch (hash) { 354 case 3373707: /*name*/ return new String[] {"string"}; 355 case 111972721: /*value*/ return new String[] {"*"}; 356 case -341064690: /*resource*/ return new String[] {"Resource"}; 357 case 3433459: /*part*/ return new String[] {"@Parameters.parameter"}; 358 default: return super.getTypesForProperty(hash, name); 359 } 360 361 } 362 363 @Override 364 public Base addChild(String name) throws FHIRException { 365 if (name.equals("name")) { 366 throw new FHIRException("Cannot call addChild on a primitive type Parameters.name"); 367 } 368 else if (name.equals("valueBase64Binary")) { 369 this.value = new Base64BinaryType(); 370 return this.value; 371 } 372 else if (name.equals("valueBoolean")) { 373 this.value = new BooleanType(); 374 return this.value; 375 } 376 else if (name.equals("valueCanonical")) { 377 this.value = new CanonicalType(); 378 return this.value; 379 } 380 else if (name.equals("valueCode")) { 381 this.value = new CodeType(); 382 return this.value; 383 } 384 else if (name.equals("valueDate")) { 385 this.value = new DateType(); 386 return this.value; 387 } 388 else if (name.equals("valueDateTime")) { 389 this.value = new DateTimeType(); 390 return this.value; 391 } 392 else if (name.equals("valueDecimal")) { 393 this.value = new DecimalType(); 394 return this.value; 395 } 396 else if (name.equals("valueId")) { 397 this.value = new IdType(); 398 return this.value; 399 } 400 else if (name.equals("valueInstant")) { 401 this.value = new InstantType(); 402 return this.value; 403 } 404 else if (name.equals("valueInteger")) { 405 this.value = new IntegerType(); 406 return this.value; 407 } 408 else if (name.equals("valueMarkdown")) { 409 this.value = new MarkdownType(); 410 return this.value; 411 } 412 else if (name.equals("valueOid")) { 413 this.value = new OidType(); 414 return this.value; 415 } 416 else if (name.equals("valuePositiveInt")) { 417 this.value = new PositiveIntType(); 418 return this.value; 419 } 420 else if (name.equals("valueString")) { 421 this.value = new StringType(); 422 return this.value; 423 } 424 else if (name.equals("valueTime")) { 425 this.value = new TimeType(); 426 return this.value; 427 } 428 else if (name.equals("valueUnsignedInt")) { 429 this.value = new UnsignedIntType(); 430 return this.value; 431 } 432 else if (name.equals("valueUri")) { 433 this.value = new UriType(); 434 return this.value; 435 } 436 else if (name.equals("valueUrl")) { 437 this.value = new UrlType(); 438 return this.value; 439 } 440 else if (name.equals("valueUuid")) { 441 this.value = new UuidType(); 442 return this.value; 443 } 444 else if (name.equals("valueAddress")) { 445 this.value = new Address(); 446 return this.value; 447 } 448 else if (name.equals("valueAge")) { 449 this.value = new Age(); 450 return this.value; 451 } 452 else if (name.equals("valueAnnotation")) { 453 this.value = new Annotation(); 454 return this.value; 455 } 456 else if (name.equals("valueAttachment")) { 457 this.value = new Attachment(); 458 return this.value; 459 } 460 else if (name.equals("valueCodeableConcept")) { 461 this.value = new CodeableConcept(); 462 return this.value; 463 } 464 else if (name.equals("valueCoding")) { 465 this.value = new Coding(); 466 return this.value; 467 } 468 else if (name.equals("valueContactPoint")) { 469 this.value = new ContactPoint(); 470 return this.value; 471 } 472 else if (name.equals("valueCount")) { 473 this.value = new Count(); 474 return this.value; 475 } 476 else if (name.equals("valueDistance")) { 477 this.value = new Distance(); 478 return this.value; 479 } 480 else if (name.equals("valueDuration")) { 481 this.value = new Duration(); 482 return this.value; 483 } 484 else if (name.equals("valueHumanName")) { 485 this.value = new HumanName(); 486 return this.value; 487 } 488 else if (name.equals("valueIdentifier")) { 489 this.value = new Identifier(); 490 return this.value; 491 } 492 else if (name.equals("valueMoney")) { 493 this.value = new Money(); 494 return this.value; 495 } 496 else if (name.equals("valuePeriod")) { 497 this.value = new Period(); 498 return this.value; 499 } 500 else if (name.equals("valueQuantity")) { 501 this.value = new Quantity(); 502 return this.value; 503 } 504 else if (name.equals("valueRange")) { 505 this.value = new Range(); 506 return this.value; 507 } 508 else if (name.equals("valueRatio")) { 509 this.value = new Ratio(); 510 return this.value; 511 } 512 else if (name.equals("valueReference")) { 513 this.value = new Reference(); 514 return this.value; 515 } 516 else if (name.equals("valueSampledData")) { 517 this.value = new SampledData(); 518 return this.value; 519 } 520 else if (name.equals("valueSignature")) { 521 this.value = new Signature(); 522 return this.value; 523 } 524 else if (name.equals("valueTiming")) { 525 this.value = new Timing(); 526 return this.value; 527 } 528 else if (name.equals("valueParameterDefinition")) { 529 this.value = new ParameterDefinition(); 530 return this.value; 531 } 532 else if (name.equals("valueDataRequirement")) { 533 this.value = new DataRequirement(); 534 return this.value; 535 } 536 else if (name.equals("valueRelatedArtifact")) { 537 this.value = new RelatedArtifact(); 538 return this.value; 539 } 540 else if (name.equals("valueContactDetail")) { 541 this.value = new ContactDetail(); 542 return this.value; 543 } 544 else if (name.equals("valueContributor")) { 545 this.value = new Contributor(); 546 return this.value; 547 } 548 else if (name.equals("valueTriggerDefinition")) { 549 this.value = new TriggerDefinition(); 550 return this.value; 551 } 552 else if (name.equals("valueUsageContext")) { 553 this.value = new UsageContext(); 554 return this.value; 555 } 556 else if (name.equals("valueDosage")) { 557 this.value = new Dosage(); 558 return this.value; 559 } 560 else if (name.equals("resource")) { 561 throw new FHIRException("Cannot call addChild on an abstract type Parameters.resource"); 562 } 563 else if (name.equals("part")) { 564 return addPart(); 565 } 566 else 567 return super.addChild(name); 568 } 569 570 public ParametersParameterComponent copy() { 571 ParametersParameterComponent dst = new ParametersParameterComponent(); 572 copyValues(dst); 573 dst.name = name == null ? null : name.copy(); 574 dst.value = value == null ? null : value.copy(); 575 dst.resource = resource == null ? null : resource.copy(); 576 if (part != null) { 577 dst.part = new ArrayList<ParametersParameterComponent>(); 578 for (ParametersParameterComponent i : part) 579 dst.part.add(i.copy()); 580 }; 581 return dst; 582 } 583 584 @Override 585 public boolean equalsDeep(Base other_) { 586 if (!super.equalsDeep(other_)) 587 return false; 588 if (!(other_ instanceof ParametersParameterComponent)) 589 return false; 590 ParametersParameterComponent o = (ParametersParameterComponent) other_; 591 return compareDeep(name, o.name, true) && compareDeep(value, o.value, true) && compareDeep(resource, o.resource, true) 592 && compareDeep(part, o.part, true); 593 } 594 595 @Override 596 public boolean equalsShallow(Base other_) { 597 if (!super.equalsShallow(other_)) 598 return false; 599 if (!(other_ instanceof ParametersParameterComponent)) 600 return false; 601 ParametersParameterComponent o = (ParametersParameterComponent) other_; 602 return compareValues(name, o.name, true); 603 } 604 605 public boolean isEmpty() { 606 return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(name, value, resource, part 607 ); 608 } 609 610 public String fhirType() { 611 return "Parameters.parameter"; 612 613 } 614 615 } 616 617 /** 618 * A parameter passed to or received from the operation. 619 */ 620 @Child(name = "parameter", type = {}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) 621 @Description(shortDefinition="Operation Parameter", formalDefinition="A parameter passed to or received from the operation." ) 622 protected List<ParametersParameterComponent> parameter; 623 624 private static final long serialVersionUID = -1495940293L; 625 626 /** 627 * Constructor 628 */ 629 public Parameters() { 630 super(); 631 } 632 633 /** 634 * @return {@link #parameter} (A parameter passed to or received from the operation.) 635 */ 636 public List<ParametersParameterComponent> getParameter() { 637 if (this.parameter == null) 638 this.parameter = new ArrayList<ParametersParameterComponent>(); 639 return this.parameter; 640 } 641 642 /** 643 * @return Returns a reference to <code>this</code> for easy method chaining 644 */ 645 public Parameters setParameter(List<ParametersParameterComponent> theParameter) { 646 this.parameter = theParameter; 647 return this; 648 } 649 650 public boolean hasParameter() { 651 if (this.parameter == null) 652 return false; 653 for (ParametersParameterComponent item : this.parameter) 654 if (!item.isEmpty()) 655 return true; 656 return false; 657 } 658 659 public ParametersParameterComponent addParameter() { //3 660 ParametersParameterComponent t = new ParametersParameterComponent(); 661 if (this.parameter == null) 662 this.parameter = new ArrayList<ParametersParameterComponent>(); 663 this.parameter.add(t); 664 return t; 665 } 666 667 public Parameters addParameter(ParametersParameterComponent t) { //3 668 if (t == null) 669 return this; 670 if (this.parameter == null) 671 this.parameter = new ArrayList<ParametersParameterComponent>(); 672 this.parameter.add(t); 673 return this; 674 } 675 676 /** 677 * @return The first repetition of repeating field {@link #parameter}, creating it if it does not already exist 678 */ 679 public ParametersParameterComponent getParameterFirstRep() { 680 if (getParameter().isEmpty()) { 681 addParameter(); 682 } 683 return getParameter().get(0); 684 } 685 686 protected void listChildren(List<Property> children) { 687 super.listChildren(children); 688 children.add(new Property("parameter", "", "A parameter passed to or received from the operation.", 0, java.lang.Integer.MAX_VALUE, parameter)); 689 } 690 691 @Override 692 public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException { 693 switch (_hash) { 694 case 1954460585: /*parameter*/ return new Property("parameter", "", "A parameter passed to or received from the operation.", 0, java.lang.Integer.MAX_VALUE, parameter); 695 default: return super.getNamedProperty(_hash, _name, _checkValid); 696 } 697 698 } 699 700 @Override 701 public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { 702 switch (hash) { 703 case 1954460585: /*parameter*/ return this.parameter == null ? new Base[0] : this.parameter.toArray(new Base[this.parameter.size()]); // ParametersParameterComponent 704 default: return super.getProperty(hash, name, checkValid); 705 } 706 707 } 708 709 @Override 710 public Base setProperty(int hash, String name, Base value) throws FHIRException { 711 switch (hash) { 712 case 1954460585: // parameter 713 this.getParameter().add((ParametersParameterComponent) value); // ParametersParameterComponent 714 return value; 715 default: return super.setProperty(hash, name, value); 716 } 717 718 } 719 720 @Override 721 public Base setProperty(String name, Base value) throws FHIRException { 722 if (name.equals("parameter")) { 723 this.getParameter().add((ParametersParameterComponent) value); 724 } else 725 return super.setProperty(name, value); 726 return value; 727 } 728 729 @Override 730 public Base makeProperty(int hash, String name) throws FHIRException { 731 switch (hash) { 732 case 1954460585: return addParameter(); 733 default: return super.makeProperty(hash, name); 734 } 735 736 } 737 738 @Override 739 public String[] getTypesForProperty(int hash, String name) throws FHIRException { 740 switch (hash) { 741 case 1954460585: /*parameter*/ return new String[] {}; 742 default: return super.getTypesForProperty(hash, name); 743 } 744 745 } 746 747 @Override 748 public Base addChild(String name) throws FHIRException { 749 if (name.equals("parameter")) { 750 return addParameter(); 751 } 752 else 753 return super.addChild(name); 754 } 755 756 public String fhirType() { 757 return "Parameters"; 758 759 } 760 761 public Parameters copy() { 762 Parameters dst = new Parameters(); 763 copyValues(dst); 764 if (parameter != null) { 765 dst.parameter = new ArrayList<ParametersParameterComponent>(); 766 for (ParametersParameterComponent i : parameter) 767 dst.parameter.add(i.copy()); 768 }; 769 return dst; 770 } 771 772 protected Parameters typedCopy() { 773 return copy(); 774 } 775 776 @Override 777 public boolean equalsDeep(Base other_) { 778 if (!super.equalsDeep(other_)) 779 return false; 780 if (!(other_ instanceof Parameters)) 781 return false; 782 Parameters o = (Parameters) other_; 783 return compareDeep(parameter, o.parameter, true); 784 } 785 786 @Override 787 public boolean equalsShallow(Base other_) { 788 if (!super.equalsShallow(other_)) 789 return false; 790 if (!(other_ instanceof Parameters)) 791 return false; 792 Parameters o = (Parameters) other_; 793 return true; 794 } 795 796 public boolean isEmpty() { 797 return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(parameter); 798 } 799 800 @Override 801 public ResourceType getResourceType() { 802 return ResourceType.Parameters; 803 } 804 805 806} 807