001package org.hl7.fhir.dstu2016may.model; 002 003 004 005 006/* 007 Copyright (c) 2011+, HL7, Inc. 008 All rights reserved. 009 010 Redistribution and use in source and binary forms, with or without modification, 011 are permitted provided that the following conditions are met: 012 013 * Redistributions of source code must retain the above copyright notice, this 014 list of conditions and the following disclaimer. 015 * Redistributions in binary form must reproduce the above copyright notice, 016 this list of conditions and the following disclaimer in the documentation 017 and/or other materials provided with the distribution. 018 * Neither the name of HL7 nor the names of its contributors may be used to 019 endorse or promote products derived from this software without specific 020 prior written permission. 021 022 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 023 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 024 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 025 IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 026 INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 027 NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 028 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 029 WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 030 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 031 POSSIBILITY OF SUCH DAMAGE. 032 033*/ 034 035// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 036import java.util.Date; 037import java.util.List; 038 039import org.hl7.fhir.exceptions.FHIRException; 040import org.hl7.fhir.instance.model.api.ICompositeType; 041import org.hl7.fhir.utilities.Utilities; 042 043import ca.uhn.fhir.model.api.annotation.Child; 044import ca.uhn.fhir.model.api.annotation.DatatypeDef; 045import ca.uhn.fhir.model.api.annotation.Description; 046/** 047 * For referring to data content defined in other formats. 048 */ 049@DatatypeDef(name="Attachment") 050public class Attachment extends Type implements ICompositeType { 051 052 /** 053 * Identifies the type of the data in the attachment and allows a method to be chosen to interpret or render the data. Includes mime type parameters such as charset where appropriate. 054 */ 055 @Child(name = "contentType", type = {CodeType.class}, order=0, min=0, max=1, modifier=false, summary=true) 056 @Description(shortDefinition="Mime type of the content, with charset etc.", formalDefinition="Identifies the type of the data in the attachment and allows a method to be chosen to interpret or render the data. Includes mime type parameters such as charset where appropriate." ) 057 protected CodeType contentType; 058 059 /** 060 * The human language of the content. The value can be any valid value according to BCP 47. 061 */ 062 @Child(name = "language", type = {CodeType.class}, order=1, min=0, max=1, modifier=false, summary=true) 063 @Description(shortDefinition="Human language of the content (BCP-47)", formalDefinition="The human language of the content. The value can be any valid value according to BCP 47." ) 064 protected CodeType language; 065 066 /** 067 * The actual data of the attachment - a sequence of bytes. In XML, represented using base64. 068 */ 069 @Child(name = "data", type = {Base64BinaryType.class}, order=2, min=0, max=1, modifier=false, summary=false) 070 @Description(shortDefinition="Data inline, base64ed", formalDefinition="The actual data of the attachment - a sequence of bytes. In XML, represented using base64." ) 071 protected Base64BinaryType data; 072 073 /** 074 * An alternative location where the data can be accessed. 075 */ 076 @Child(name = "url", type = {UriType.class}, order=3, min=0, max=1, modifier=false, summary=true) 077 @Description(shortDefinition="Uri where the data can be found", formalDefinition="An alternative location where the data can be accessed." ) 078 protected UriType url; 079 080 /** 081 * The number of bytes of data that make up this attachment. 082 */ 083 @Child(name = "size", type = {UnsignedIntType.class}, order=4, min=0, max=1, modifier=false, summary=true) 084 @Description(shortDefinition="Number of bytes of content (if url provided)", formalDefinition="The number of bytes of data that make up this attachment." ) 085 protected UnsignedIntType size; 086 087 /** 088 * The calculated hash of the data using SHA-1. Represented using base64. 089 */ 090 @Child(name = "hash", type = {Base64BinaryType.class}, order=5, min=0, max=1, modifier=false, summary=true) 091 @Description(shortDefinition="Hash of the data (sha-1, base64ed)", formalDefinition="The calculated hash of the data using SHA-1. Represented using base64." ) 092 protected Base64BinaryType hash; 093 094 /** 095 * A label or set of text to display in place of the data. 096 */ 097 @Child(name = "title", type = {StringType.class}, order=6, min=0, max=1, modifier=false, summary=true) 098 @Description(shortDefinition="Label to display in place of the data", formalDefinition="A label or set of text to display in place of the data." ) 099 protected StringType title; 100 101 /** 102 * The date that the attachment was first created. 103 */ 104 @Child(name = "creation", type = {DateTimeType.class}, order=7, min=0, max=1, modifier=false, summary=true) 105 @Description(shortDefinition="Date attachment was first created", formalDefinition="The date that the attachment was first created." ) 106 protected DateTimeType creation; 107 108 private static final long serialVersionUID = 581007080L; 109 110 /** 111 * Constructor 112 */ 113 public Attachment() { 114 super(); 115 } 116 117 /** 118 * @return {@link #contentType} (Identifies the type of the data in the attachment and allows a method to be chosen to interpret or render the data. Includes mime type parameters such as charset where appropriate.). This is the underlying object with id, value and extensions. The accessor "getContentType" gives direct access to the value 119 */ 120 public CodeType getContentTypeElement() { 121 if (this.contentType == null) 122 if (Configuration.errorOnAutoCreate()) 123 throw new Error("Attempt to auto-create Attachment.contentType"); 124 else if (Configuration.doAutoCreate()) 125 this.contentType = new CodeType(); // bb 126 return this.contentType; 127 } 128 129 public boolean hasContentTypeElement() { 130 return this.contentType != null && !this.contentType.isEmpty(); 131 } 132 133 public boolean hasContentType() { 134 return this.contentType != null && !this.contentType.isEmpty(); 135 } 136 137 /** 138 * @param value {@link #contentType} (Identifies the type of the data in the attachment and allows a method to be chosen to interpret or render the data. Includes mime type parameters such as charset where appropriate.). This is the underlying object with id, value and extensions. The accessor "getContentType" gives direct access to the value 139 */ 140 public Attachment setContentTypeElement(CodeType value) { 141 this.contentType = value; 142 return this; 143 } 144 145 /** 146 * @return Identifies the type of the data in the attachment and allows a method to be chosen to interpret or render the data. Includes mime type parameters such as charset where appropriate. 147 */ 148 public String getContentType() { 149 return this.contentType == null ? null : this.contentType.getValue(); 150 } 151 152 /** 153 * @param value Identifies the type of the data in the attachment and allows a method to be chosen to interpret or render the data. Includes mime type parameters such as charset where appropriate. 154 */ 155 public Attachment setContentType(String value) { 156 if (Utilities.noString(value)) 157 this.contentType = null; 158 else { 159 if (this.contentType == null) 160 this.contentType = new CodeType(); 161 this.contentType.setValue(value); 162 } 163 return this; 164 } 165 166 /** 167 * @return {@link #language} (The human language of the content. The value can be any valid value according to BCP 47.). This is the underlying object with id, value and extensions. The accessor "getLanguage" gives direct access to the value 168 */ 169 public CodeType getLanguageElement() { 170 if (this.language == null) 171 if (Configuration.errorOnAutoCreate()) 172 throw new Error("Attempt to auto-create Attachment.language"); 173 else if (Configuration.doAutoCreate()) 174 this.language = new CodeType(); // bb 175 return this.language; 176 } 177 178 public boolean hasLanguageElement() { 179 return this.language != null && !this.language.isEmpty(); 180 } 181 182 public boolean hasLanguage() { 183 return this.language != null && !this.language.isEmpty(); 184 } 185 186 /** 187 * @param value {@link #language} (The human language of the content. The value can be any valid value according to BCP 47.). This is the underlying object with id, value and extensions. The accessor "getLanguage" gives direct access to the value 188 */ 189 public Attachment setLanguageElement(CodeType value) { 190 this.language = value; 191 return this; 192 } 193 194 /** 195 * @return The human language of the content. The value can be any valid value according to BCP 47. 196 */ 197 public String getLanguage() { 198 return this.language == null ? null : this.language.getValue(); 199 } 200 201 /** 202 * @param value The human language of the content. The value can be any valid value according to BCP 47. 203 */ 204 public Attachment setLanguage(String value) { 205 if (Utilities.noString(value)) 206 this.language = null; 207 else { 208 if (this.language == null) 209 this.language = new CodeType(); 210 this.language.setValue(value); 211 } 212 return this; 213 } 214 215 /** 216 * @return {@link #data} (The actual data of the attachment - a sequence of bytes. In XML, represented using base64.). This is the underlying object with id, value and extensions. The accessor "getData" gives direct access to the value 217 */ 218 public Base64BinaryType getDataElement() { 219 if (this.data == null) 220 if (Configuration.errorOnAutoCreate()) 221 throw new Error("Attempt to auto-create Attachment.data"); 222 else if (Configuration.doAutoCreate()) 223 this.data = new Base64BinaryType(); // bb 224 return this.data; 225 } 226 227 public boolean hasDataElement() { 228 return this.data != null && !this.data.isEmpty(); 229 } 230 231 public boolean hasData() { 232 return this.data != null && !this.data.isEmpty(); 233 } 234 235 /** 236 * @param value {@link #data} (The actual data of the attachment - a sequence of bytes. In XML, represented using base64.). This is the underlying object with id, value and extensions. The accessor "getData" gives direct access to the value 237 */ 238 public Attachment setDataElement(Base64BinaryType value) { 239 this.data = value; 240 return this; 241 } 242 243 /** 244 * @return The actual data of the attachment - a sequence of bytes. In XML, represented using base64. 245 */ 246 public byte[] getData() { 247 return this.data == null ? null : this.data.getValue(); 248 } 249 250 /** 251 * @param value The actual data of the attachment - a sequence of bytes. In XML, represented using base64. 252 */ 253 public Attachment setData(byte[] value) { 254 if (value == null) 255 this.data = null; 256 else { 257 if (this.data == null) 258 this.data = new Base64BinaryType(); 259 this.data.setValue(value); 260 } 261 return this; 262 } 263 264 /** 265 * @return {@link #url} (An alternative location where the data can be accessed.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value 266 */ 267 public UriType getUrlElement() { 268 if (this.url == null) 269 if (Configuration.errorOnAutoCreate()) 270 throw new Error("Attempt to auto-create Attachment.url"); 271 else if (Configuration.doAutoCreate()) 272 this.url = new UriType(); // bb 273 return this.url; 274 } 275 276 public boolean hasUrlElement() { 277 return this.url != null && !this.url.isEmpty(); 278 } 279 280 public boolean hasUrl() { 281 return this.url != null && !this.url.isEmpty(); 282 } 283 284 /** 285 * @param value {@link #url} (An alternative location where the data can be accessed.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value 286 */ 287 public Attachment setUrlElement(UriType value) { 288 this.url = value; 289 return this; 290 } 291 292 /** 293 * @return An alternative location where the data can be accessed. 294 */ 295 public String getUrl() { 296 return this.url == null ? null : this.url.getValue(); 297 } 298 299 /** 300 * @param value An alternative location where the data can be accessed. 301 */ 302 public Attachment setUrl(String value) { 303 if (Utilities.noString(value)) 304 this.url = null; 305 else { 306 if (this.url == null) 307 this.url = new UriType(); 308 this.url.setValue(value); 309 } 310 return this; 311 } 312 313 /** 314 * @return {@link #size} (The number of bytes of data that make up this attachment.). This is the underlying object with id, value and extensions. The accessor "getSize" gives direct access to the value 315 */ 316 public UnsignedIntType getSizeElement() { 317 if (this.size == null) 318 if (Configuration.errorOnAutoCreate()) 319 throw new Error("Attempt to auto-create Attachment.size"); 320 else if (Configuration.doAutoCreate()) 321 this.size = new UnsignedIntType(); // bb 322 return this.size; 323 } 324 325 public boolean hasSizeElement() { 326 return this.size != null && !this.size.isEmpty(); 327 } 328 329 public boolean hasSize() { 330 return this.size != null && !this.size.isEmpty(); 331 } 332 333 /** 334 * @param value {@link #size} (The number of bytes of data that make up this attachment.). This is the underlying object with id, value and extensions. The accessor "getSize" gives direct access to the value 335 */ 336 public Attachment setSizeElement(UnsignedIntType value) { 337 this.size = value; 338 return this; 339 } 340 341 /** 342 * @return The number of bytes of data that make up this attachment. 343 */ 344 public int getSize() { 345 return this.size == null || this.size.isEmpty() ? 0 : this.size.getValue(); 346 } 347 348 /** 349 * @param value The number of bytes of data that make up this attachment. 350 */ 351 public Attachment setSize(int value) { 352 if (this.size == null) 353 this.size = new UnsignedIntType(); 354 this.size.setValue(value); 355 return this; 356 } 357 358 /** 359 * @return {@link #hash} (The calculated hash of the data using SHA-1. Represented using base64.). This is the underlying object with id, value and extensions. The accessor "getHash" gives direct access to the value 360 */ 361 public Base64BinaryType getHashElement() { 362 if (this.hash == null) 363 if (Configuration.errorOnAutoCreate()) 364 throw new Error("Attempt to auto-create Attachment.hash"); 365 else if (Configuration.doAutoCreate()) 366 this.hash = new Base64BinaryType(); // bb 367 return this.hash; 368 } 369 370 public boolean hasHashElement() { 371 return this.hash != null && !this.hash.isEmpty(); 372 } 373 374 public boolean hasHash() { 375 return this.hash != null && !this.hash.isEmpty(); 376 } 377 378 /** 379 * @param value {@link #hash} (The calculated hash of the data using SHA-1. Represented using base64.). This is the underlying object with id, value and extensions. The accessor "getHash" gives direct access to the value 380 */ 381 public Attachment setHashElement(Base64BinaryType value) { 382 this.hash = value; 383 return this; 384 } 385 386 /** 387 * @return The calculated hash of the data using SHA-1. Represented using base64. 388 */ 389 public byte[] getHash() { 390 return this.hash == null ? null : this.hash.getValue(); 391 } 392 393 /** 394 * @param value The calculated hash of the data using SHA-1. Represented using base64. 395 */ 396 public Attachment setHash(byte[] value) { 397 if (value == null) 398 this.hash = null; 399 else { 400 if (this.hash == null) 401 this.hash = new Base64BinaryType(); 402 this.hash.setValue(value); 403 } 404 return this; 405 } 406 407 /** 408 * @return {@link #title} (A label or set of text to display in place of the data.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value 409 */ 410 public StringType getTitleElement() { 411 if (this.title == null) 412 if (Configuration.errorOnAutoCreate()) 413 throw new Error("Attempt to auto-create Attachment.title"); 414 else if (Configuration.doAutoCreate()) 415 this.title = new StringType(); // bb 416 return this.title; 417 } 418 419 public boolean hasTitleElement() { 420 return this.title != null && !this.title.isEmpty(); 421 } 422 423 public boolean hasTitle() { 424 return this.title != null && !this.title.isEmpty(); 425 } 426 427 /** 428 * @param value {@link #title} (A label or set of text to display in place of the data.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value 429 */ 430 public Attachment setTitleElement(StringType value) { 431 this.title = value; 432 return this; 433 } 434 435 /** 436 * @return A label or set of text to display in place of the data. 437 */ 438 public String getTitle() { 439 return this.title == null ? null : this.title.getValue(); 440 } 441 442 /** 443 * @param value A label or set of text to display in place of the data. 444 */ 445 public Attachment setTitle(String value) { 446 if (Utilities.noString(value)) 447 this.title = null; 448 else { 449 if (this.title == null) 450 this.title = new StringType(); 451 this.title.setValue(value); 452 } 453 return this; 454 } 455 456 /** 457 * @return {@link #creation} (The date that the attachment was first created.). This is the underlying object with id, value and extensions. The accessor "getCreation" gives direct access to the value 458 */ 459 public DateTimeType getCreationElement() { 460 if (this.creation == null) 461 if (Configuration.errorOnAutoCreate()) 462 throw new Error("Attempt to auto-create Attachment.creation"); 463 else if (Configuration.doAutoCreate()) 464 this.creation = new DateTimeType(); // bb 465 return this.creation; 466 } 467 468 public boolean hasCreationElement() { 469 return this.creation != null && !this.creation.isEmpty(); 470 } 471 472 public boolean hasCreation() { 473 return this.creation != null && !this.creation.isEmpty(); 474 } 475 476 /** 477 * @param value {@link #creation} (The date that the attachment was first created.). This is the underlying object with id, value and extensions. The accessor "getCreation" gives direct access to the value 478 */ 479 public Attachment setCreationElement(DateTimeType value) { 480 this.creation = value; 481 return this; 482 } 483 484 /** 485 * @return The date that the attachment was first created. 486 */ 487 public Date getCreation() { 488 return this.creation == null ? null : this.creation.getValue(); 489 } 490 491 /** 492 * @param value The date that the attachment was first created. 493 */ 494 public Attachment setCreation(Date value) { 495 if (value == null) 496 this.creation = null; 497 else { 498 if (this.creation == null) 499 this.creation = new DateTimeType(); 500 this.creation.setValue(value); 501 } 502 return this; 503 } 504 505 protected void listChildren(List<Property> childrenList) { 506 super.listChildren(childrenList); 507 childrenList.add(new Property("contentType", "code", "Identifies the type of the data in the attachment and allows a method to be chosen to interpret or render the data. Includes mime type parameters such as charset where appropriate.", 0, java.lang.Integer.MAX_VALUE, contentType)); 508 childrenList.add(new Property("language", "code", "The human language of the content. The value can be any valid value according to BCP 47.", 0, java.lang.Integer.MAX_VALUE, language)); 509 childrenList.add(new Property("data", "base64Binary", "The actual data of the attachment - a sequence of bytes. In XML, represented using base64.", 0, java.lang.Integer.MAX_VALUE, data)); 510 childrenList.add(new Property("url", "uri", "An alternative location where the data can be accessed.", 0, java.lang.Integer.MAX_VALUE, url)); 511 childrenList.add(new Property("size", "unsignedInt", "The number of bytes of data that make up this attachment.", 0, java.lang.Integer.MAX_VALUE, size)); 512 childrenList.add(new Property("hash", "base64Binary", "The calculated hash of the data using SHA-1. Represented using base64.", 0, java.lang.Integer.MAX_VALUE, hash)); 513 childrenList.add(new Property("title", "string", "A label or set of text to display in place of the data.", 0, java.lang.Integer.MAX_VALUE, title)); 514 childrenList.add(new Property("creation", "dateTime", "The date that the attachment was first created.", 0, java.lang.Integer.MAX_VALUE, creation)); 515 } 516 517 @Override 518 public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { 519 switch (hash) { 520 case -389131437: /*contentType*/ return this.contentType == null ? new Base[0] : new Base[] {this.contentType}; // CodeType 521 case -1613589672: /*language*/ return this.language == null ? new Base[0] : new Base[] {this.language}; // CodeType 522 case 3076010: /*data*/ return this.data == null ? new Base[0] : new Base[] {this.data}; // Base64BinaryType 523 case 116079: /*url*/ return this.url == null ? new Base[0] : new Base[] {this.url}; // UriType 524 case 3530753: /*size*/ return this.size == null ? new Base[0] : new Base[] {this.size}; // UnsignedIntType 525 case 3195150: /*hash*/ return this.hash == null ? new Base[0] : new Base[] {this.hash}; // Base64BinaryType 526 case 110371416: /*title*/ return this.title == null ? new Base[0] : new Base[] {this.title}; // StringType 527 case 1820421855: /*creation*/ return this.creation == null ? new Base[0] : new Base[] {this.creation}; // DateTimeType 528 default: return super.getProperty(hash, name, checkValid); 529 } 530 531 } 532 533 @Override 534 public void setProperty(int hash, String name, Base value) throws FHIRException { 535 switch (hash) { 536 case -389131437: // contentType 537 this.contentType = castToCode(value); // CodeType 538 break; 539 case -1613589672: // language 540 this.language = castToCode(value); // CodeType 541 break; 542 case 3076010: // data 543 this.data = castToBase64Binary(value); // Base64BinaryType 544 break; 545 case 116079: // url 546 this.url = castToUri(value); // UriType 547 break; 548 case 3530753: // size 549 this.size = castToUnsignedInt(value); // UnsignedIntType 550 break; 551 case 3195150: // hash 552 this.hash = castToBase64Binary(value); // Base64BinaryType 553 break; 554 case 110371416: // title 555 this.title = castToString(value); // StringType 556 break; 557 case 1820421855: // creation 558 this.creation = castToDateTime(value); // DateTimeType 559 break; 560 default: super.setProperty(hash, name, value); 561 } 562 563 } 564 565 @Override 566 public void setProperty(String name, Base value) throws FHIRException { 567 if (name.equals("contentType")) 568 this.contentType = castToCode(value); // CodeType 569 else if (name.equals("language")) 570 this.language = castToCode(value); // CodeType 571 else if (name.equals("data")) 572 this.data = castToBase64Binary(value); // Base64BinaryType 573 else if (name.equals("url")) 574 this.url = castToUri(value); // UriType 575 else if (name.equals("size")) 576 this.size = castToUnsignedInt(value); // UnsignedIntType 577 else if (name.equals("hash")) 578 this.hash = castToBase64Binary(value); // Base64BinaryType 579 else if (name.equals("title")) 580 this.title = castToString(value); // StringType 581 else if (name.equals("creation")) 582 this.creation = castToDateTime(value); // DateTimeType 583 else 584 super.setProperty(name, value); 585 } 586 587 @Override 588 public Base makeProperty(int hash, String name) throws FHIRException { 589 switch (hash) { 590 case -389131437: throw new FHIRException("Cannot make property contentType as it is not a complex type"); // CodeType 591 case -1613589672: throw new FHIRException("Cannot make property language as it is not a complex type"); // CodeType 592 case 3076010: throw new FHIRException("Cannot make property data as it is not a complex type"); // Base64BinaryType 593 case 116079: throw new FHIRException("Cannot make property url as it is not a complex type"); // UriType 594 case 3530753: throw new FHIRException("Cannot make property size as it is not a complex type"); // UnsignedIntType 595 case 3195150: throw new FHIRException("Cannot make property hash as it is not a complex type"); // Base64BinaryType 596 case 110371416: throw new FHIRException("Cannot make property title as it is not a complex type"); // StringType 597 case 1820421855: throw new FHIRException("Cannot make property creation as it is not a complex type"); // DateTimeType 598 default: return super.makeProperty(hash, name); 599 } 600 601 } 602 603 @Override 604 public Base addChild(String name) throws FHIRException { 605 if (name.equals("contentType")) { 606 throw new FHIRException("Cannot call addChild on a primitive type Attachment.contentType"); 607 } 608 else if (name.equals("language")) { 609 throw new FHIRException("Cannot call addChild on a primitive type Attachment.language"); 610 } 611 else if (name.equals("data")) { 612 throw new FHIRException("Cannot call addChild on a primitive type Attachment.data"); 613 } 614 else if (name.equals("url")) { 615 throw new FHIRException("Cannot call addChild on a primitive type Attachment.url"); 616 } 617 else if (name.equals("size")) { 618 throw new FHIRException("Cannot call addChild on a primitive type Attachment.size"); 619 } 620 else if (name.equals("hash")) { 621 throw new FHIRException("Cannot call addChild on a primitive type Attachment.hash"); 622 } 623 else if (name.equals("title")) { 624 throw new FHIRException("Cannot call addChild on a primitive type Attachment.title"); 625 } 626 else if (name.equals("creation")) { 627 throw new FHIRException("Cannot call addChild on a primitive type Attachment.creation"); 628 } 629 else 630 return super.addChild(name); 631 } 632 633 public String fhirType() { 634 return "Attachment"; 635 636 } 637 638 public Attachment copy() { 639 Attachment dst = new Attachment(); 640 copyValues(dst); 641 dst.contentType = contentType == null ? null : contentType.copy(); 642 dst.language = language == null ? null : language.copy(); 643 dst.data = data == null ? null : data.copy(); 644 dst.url = url == null ? null : url.copy(); 645 dst.size = size == null ? null : size.copy(); 646 dst.hash = hash == null ? null : hash.copy(); 647 dst.title = title == null ? null : title.copy(); 648 dst.creation = creation == null ? null : creation.copy(); 649 return dst; 650 } 651 652 protected Attachment typedCopy() { 653 return copy(); 654 } 655 656 @Override 657 public boolean equalsDeep(Base other) { 658 if (!super.equalsDeep(other)) 659 return false; 660 if (!(other instanceof Attachment)) 661 return false; 662 Attachment o = (Attachment) other; 663 return compareDeep(contentType, o.contentType, true) && compareDeep(language, o.language, true) 664 && compareDeep(data, o.data, true) && compareDeep(url, o.url, true) && compareDeep(size, o.size, true) 665 && compareDeep(hash, o.hash, true) && compareDeep(title, o.title, true) && compareDeep(creation, o.creation, true) 666 ; 667 } 668 669 @Override 670 public boolean equalsShallow(Base other) { 671 if (!super.equalsShallow(other)) 672 return false; 673 if (!(other instanceof Attachment)) 674 return false; 675 Attachment o = (Attachment) other; 676 return compareValues(contentType, o.contentType, true) && compareValues(language, o.language, true) 677 && compareValues(data, o.data, true) && compareValues(url, o.url, true) && compareValues(size, o.size, true) 678 && compareValues(hash, o.hash, true) && compareValues(title, o.title, true) && compareValues(creation, o.creation, true) 679 ; 680 } 681 682 public boolean isEmpty() { 683 return super.isEmpty() && (contentType == null || contentType.isEmpty()) && (language == null || language.isEmpty()) 684 && (data == null || data.isEmpty()) && (url == null || url.isEmpty()) && (size == null || size.isEmpty()) 685 && (hash == null || hash.isEmpty()) && (title == null || title.isEmpty()) && (creation == null || creation.isEmpty()) 686 ; 687 } 688 689 690}