001package org.hl7.fhir.r5.model; 002 003 004/* 005 * #%L 006 * org.hl7.fhir.r5 007 * %% 008 * Copyright (C) 2014 - 2019 Health Level 7 009 * %% 010 * Licensed under the Apache License, Version 2.0 (the \"License\"); 011 * you may not use this file except in compliance with the License. 012 * You may obtain a copy of the License at 013 * 014 * http://www.apache.org/licenses/LICENSE-2.0 015 * 016 * Unless required by applicable law or agreed to in writing, software 017 * distributed under the License is distributed on an \"AS IS\" BASIS, 018 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 019 * See the License for the specific language governing permissions and 020 * limitations under the License. 021 * #L% 022 */ 023 024/* 025 Copyright (c) 2011+, HL7, Inc. 026 All rights reserved. 027 028 Redistribution and use in source and binary forms, with or without modification, \ 029 are permitted provided that the following conditions are met: 030 031 * Redistributions of source code must retain the above copyright notice, this \ 032 list of conditions and the following disclaimer. 033 * Redistributions in binary form must reproduce the above copyright notice, \ 034 this list of conditions and the following disclaimer in the documentation \ 035 and/or other materials provided with the distribution. 036 * Neither the name of HL7 nor the names of its contributors may be used to 037 endorse or promote products derived from this software without specific 038 prior written permission. 039 040 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \ 041 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \ 042 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \ 043 IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \ 044 INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \ 045 NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \ 046 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \ 047 WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \ 048 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \ 049 POSSIBILITY OF SUCH DAMAGE. 050 */ 051 052// Generated on Tue, Dec 31, 2019 12:12+1100 for FHIR vcurrent 053 054import java.util.ArrayList; 055import java.util.Date; 056import java.util.List; 057import org.hl7.fhir.r5.model.Enumerations.*; 058import org.hl7.fhir.instance.model.api.IBaseBackboneElement; 059import org.hl7.fhir.exceptions.FHIRException; 060import org.hl7.fhir.instance.model.api.ICompositeType; 061import ca.uhn.fhir.model.api.annotation.ResourceDef; 062import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; 063import org.hl7.fhir.instance.model.api.IBaseBackboneElement; 064import ca.uhn.fhir.model.api.annotation.Child; 065import ca.uhn.fhir.model.api.annotation.ChildOrder; 066import ca.uhn.fhir.model.api.annotation.Description; 067import ca.uhn.fhir.model.api.annotation.Block; 068 069import java.util.Collections; 070import org.hl7.fhir.instance.model.api.IDomainResource; 071import org.hl7.fhir.instance.model.api.IBaseDatatypeElement; 072import org.hl7.fhir.instance.model.api.IBaseHasExtensions; 073import org.hl7.fhir.instance.model.api.IBaseHasModifierExtensions; 074import org.hl7.fhir.instance.model.api.IBaseBackboneElement; 075/** 076 * A resource that includes narrative, extensions, and contained resources. 077 */ 078public abstract class DomainResource extends Resource implements IBaseHasExtensions, IBaseHasModifierExtensions, IDomainResource { 079 080 /** 081 * A human-readable narrative that contains a summary of the resource and can be used to represent the content of the resource to a human. The narrative need not encode all the structured data, but is required to contain sufficient detail to make it "clinically safe" for a human to just read the narrative. Resource definitions may define what content should be represented in the narrative to ensure clinical safety. 082 */ 083 @Child(name = "text", type = {Narrative.class}, order=0, min=0, max=1, modifier=false, summary=false) 084 @Description(shortDefinition="Text summary of the resource, for human interpretation", formalDefinition="A human-readable narrative that contains a summary of the resource and can be used to represent the content of the resource to a human. The narrative need not encode all the structured data, but is required to contain sufficient detail to make it \"clinically safe\" for a human to just read the narrative. Resource definitions may define what content should be represented in the narrative to ensure clinical safety." ) 085 protected Narrative text; 086 087 /** 088 * These resources do not have an independent existence apart from the resource that contains them - they cannot be identified independently, and nor can they have their own independent transaction scope. 089 */ 090 @Child(name = "contained", type = {Resource.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) 091 @Description(shortDefinition="Contained, inline Resources", formalDefinition="These resources do not have an independent existence apart from the resource that contains them - they cannot be identified independently, and nor can they have their own independent transaction scope." ) 092 protected List<Resource> contained; 093 094 /** 095 * May be used to represent additional information that is not part of the basic definition of the resource. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. 096 */ 097 @Child(name = "extension", type = {Extension.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) 098 @Description(shortDefinition="Additional content defined by implementations", formalDefinition="May be used to represent additional information that is not part of the basic definition of the resource. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension." ) 099 protected List<Extension> extension; 100 101 /** 102 * May be used to represent additional information that is not part of the basic definition of the resource and that modifies the understanding of the element that contains it and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions. 103 104Modifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself). 105 */ 106 @Child(name = "modifierExtension", type = {Extension.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=true, summary=false) 107 @Description(shortDefinition="Extensions that cannot be ignored", formalDefinition="May be used to represent additional information that is not part of the basic definition of the resource and that modifies the understanding of the element that contains it and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself)." ) 108 protected List<Extension> modifierExtension; 109 110 private static final long serialVersionUID = -970285559L; 111 112 /** 113 * Constructor 114 */ 115 public DomainResource() { 116 super(); 117 } 118 119 /** 120 * @return {@link #text} (A human-readable narrative that contains a summary of the resource and can be used to represent the content of the resource to a human. The narrative need not encode all the structured data, but is required to contain sufficient detail to make it "clinically safe" for a human to just read the narrative. Resource definitions may define what content should be represented in the narrative to ensure clinical safety.) 121 */ 122 public Narrative getText() { 123 if (this.text == null) 124 if (Configuration.errorOnAutoCreate()) 125 throw new Error("Attempt to auto-create DomainResource.text"); 126 else if (Configuration.doAutoCreate()) 127 this.text = new Narrative(); // cc 128 return this.text; 129 } 130 131 public boolean hasText() { 132 return this.text != null && !this.text.isEmpty(); 133 } 134 135 /** 136 * @param value {@link #text} (A human-readable narrative that contains a summary of the resource and can be used to represent the content of the resource to a human. The narrative need not encode all the structured data, but is required to contain sufficient detail to make it "clinically safe" for a human to just read the narrative. Resource definitions may define what content should be represented in the narrative to ensure clinical safety.) 137 */ 138 public DomainResource setText(Narrative value) { 139 this.text = value; 140 return this; 141 } 142 143 /** 144 * @return {@link #contained} (These resources do not have an independent existence apart from the resource that contains them - they cannot be identified independently, and nor can they have their own independent transaction scope.) 145 */ 146 public List<Resource> getContained() { 147 if (this.contained == null) 148 this.contained = new ArrayList<Resource>(); 149 return this.contained; 150 } 151 152 /** 153 * @return Returns a reference to <code>this</code> for easy method chaining 154 */ 155 public DomainResource setContained(List<Resource> theContained) { 156 this.contained = theContained; 157 return this; 158 } 159 160 public boolean hasContained() { 161 if (this.contained == null) 162 return false; 163 for (Resource item : this.contained) 164 if (!item.isEmpty()) 165 return true; 166 return false; 167 } 168 169 public DomainResource addContained(Resource t) { //3 170 if (t == null) 171 return this; 172 if (this.contained == null) 173 this.contained = new ArrayList<Resource>(); 174 this.contained.add(t); 175 return this; 176 } 177 178 /** 179 * @return {@link #extension} (May be used to represent additional information that is not part of the basic definition of the resource. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.) 180 */ 181 public List<Extension> getExtension() { 182 if (this.extension == null) 183 this.extension = new ArrayList<Extension>(); 184 return this.extension; 185 } 186 187 /** 188 * @return Returns a reference to <code>this</code> for easy method chaining 189 */ 190 public DomainResource setExtension(List<Extension> theExtension) { 191 this.extension = theExtension; 192 return this; 193 } 194 195 public boolean hasExtension() { 196 if (this.extension == null) 197 return false; 198 for (Extension item : this.extension) 199 if (!item.isEmpty()) 200 return true; 201 return false; 202 } 203 204 public Extension addExtension() { //3 205 Extension t = new Extension(); 206 if (this.extension == null) 207 this.extension = new ArrayList<Extension>(); 208 this.extension.add(t); 209 return t; 210 } 211 212 public DomainResource addExtension(Extension t) { //3 213 if (t == null) 214 return this; 215 if (this.extension == null) 216 this.extension = new ArrayList<Extension>(); 217 this.extension.add(t); 218 return this; 219 } 220 221 /** 222 * @return {@link #modifierExtension} (May be used to represent additional information that is not part of the basic definition of the resource and that modifies the understanding of the element that contains it and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions. 223 224Modifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).) 225 */ 226 public List<Extension> getModifierExtension() { 227 if (this.modifierExtension == null) 228 this.modifierExtension = new ArrayList<Extension>(); 229 return this.modifierExtension; 230 } 231 232 /** 233 * @return Returns a reference to <code>this</code> for easy method chaining 234 */ 235 public DomainResource setModifierExtension(List<Extension> theModifierExtension) { 236 this.modifierExtension = theModifierExtension; 237 return this; 238 } 239 240 public boolean hasModifierExtension() { 241 if (this.modifierExtension == null) 242 return false; 243 for (Extension item : this.modifierExtension) 244 if (!item.isEmpty()) 245 return true; 246 return false; 247 } 248 249 public Extension addModifierExtension() { //3 250 Extension t = new Extension(); 251 if (this.modifierExtension == null) 252 this.modifierExtension = new ArrayList<Extension>(); 253 this.modifierExtension.add(t); 254 return t; 255 } 256 257 public DomainResource addModifierExtension(Extension t) { //3 258 if (t == null) 259 return this; 260 if (this.modifierExtension == null) 261 this.modifierExtension = new ArrayList<Extension>(); 262 this.modifierExtension.add(t); 263 return this; 264 } 265 266 protected void listChildren(List<Property> children) { 267 super.listChildren(children); 268 children.add(new Property("text", "Narrative", "A human-readable narrative that contains a summary of the resource and can be used to represent the content of the resource to a human. The narrative need not encode all the structured data, but is required to contain sufficient detail to make it \"clinically safe\" for a human to just read the narrative. Resource definitions may define what content should be represented in the narrative to ensure clinical safety.", 0, 1, text)); 269 children.add(new Property("contained", "Resource", "These resources do not have an independent existence apart from the resource that contains them - they cannot be identified independently, and nor can they have their own independent transaction scope.", 0, java.lang.Integer.MAX_VALUE, contained)); 270 children.add(new Property("extension", "Extension", "May be used to represent additional information that is not part of the basic definition of the resource. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.", 0, java.lang.Integer.MAX_VALUE, extension)); 271 children.add(new Property("modifierExtension", "Extension", "May be used to represent additional information that is not part of the basic definition of the resource and that modifies the understanding of the element that contains it and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).", 0, java.lang.Integer.MAX_VALUE, modifierExtension)); 272 } 273 274 @Override 275 public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException { 276 switch (_hash) { 277 case 3556653: /*text*/ return new Property("text", "Narrative", "A human-readable narrative that contains a summary of the resource and can be used to represent the content of the resource to a human. The narrative need not encode all the structured data, but is required to contain sufficient detail to make it \"clinically safe\" for a human to just read the narrative. Resource definitions may define what content should be represented in the narrative to ensure clinical safety.", 0, 1, text); 278 case -410956685: /*contained*/ return new Property("contained", "Resource", "These resources do not have an independent existence apart from the resource that contains them - they cannot be identified independently, and nor can they have their own independent transaction scope.", 0, java.lang.Integer.MAX_VALUE, contained); 279 case -612557761: /*extension*/ return new Property("extension", "Extension", "May be used to represent additional information that is not part of the basic definition of the resource. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.", 0, java.lang.Integer.MAX_VALUE, extension); 280 case -298878168: /*modifierExtension*/ return new Property("modifierExtension", "Extension", "May be used to represent additional information that is not part of the basic definition of the resource and that modifies the understanding of the element that contains it and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).", 0, java.lang.Integer.MAX_VALUE, modifierExtension); 281 default: return super.getNamedProperty(_hash, _name, _checkValid); 282 } 283 284 } 285 286 @Override 287 public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { 288 switch (hash) { 289 case 3556653: /*text*/ return this.text == null ? new Base[0] : new Base[] {this.text}; // Narrative 290 case -410956685: /*contained*/ return this.contained == null ? new Base[0] : this.contained.toArray(new Base[this.contained.size()]); // Resource 291 case -612557761: /*extension*/ return this.extension == null ? new Base[0] : this.extension.toArray(new Base[this.extension.size()]); // Extension 292 case -298878168: /*modifierExtension*/ return this.modifierExtension == null ? new Base[0] : this.modifierExtension.toArray(new Base[this.modifierExtension.size()]); // Extension 293 default: return super.getProperty(hash, name, checkValid); 294 } 295 296 } 297 298 @Override 299 public Base setProperty(int hash, String name, Base value) throws FHIRException { 300 switch (hash) { 301 case 3556653: // text 302 this.text = TypeConvertor.castToNarrative(value); // Narrative 303 return value; 304 case -410956685: // contained 305 this.getContained().add(TypeConvertor.castToResource(value)); // Resource 306 return value; 307 case -612557761: // extension 308 this.getExtension().add(TypeConvertor.castToExtension(value)); // Extension 309 return value; 310 case -298878168: // modifierExtension 311 this.getModifierExtension().add(TypeConvertor.castToExtension(value)); // Extension 312 return value; 313 default: return super.setProperty(hash, name, value); 314 } 315 316 } 317 318 @Override 319 public Base setProperty(String name, Base value) throws FHIRException { 320 if (name.equals("text")) { 321 this.text = TypeConvertor.castToNarrative(value); // Narrative 322 } else if (name.equals("contained")) { 323 this.getContained().add(TypeConvertor.castToResource(value)); 324 } else if (name.equals("extension")) { 325 this.getExtension().add(TypeConvertor.castToExtension(value)); 326 } else if (name.equals("modifierExtension")) { 327 this.getModifierExtension().add(TypeConvertor.castToExtension(value)); 328 } else 329 return super.setProperty(name, value); 330 return value; 331 } 332 333 @Override 334 public Base makeProperty(int hash, String name) throws FHIRException { 335 switch (hash) { 336 case 3556653: return getText(); 337 case -410956685: throw new FHIRException("Cannot make property contained as it is not a complex type"); // Resource 338 case -612557761: return addExtension(); 339 case -298878168: return addModifierExtension(); 340 default: return super.makeProperty(hash, name); 341 } 342 343 } 344 345 @Override 346 public String[] getTypesForProperty(int hash, String name) throws FHIRException { 347 switch (hash) { 348 case 3556653: /*text*/ return new String[] {"Narrative"}; 349 case -410956685: /*contained*/ return new String[] {"Resource"}; 350 case -612557761: /*extension*/ return new String[] {"Extension"}; 351 case -298878168: /*modifierExtension*/ return new String[] {"Extension"}; 352 default: return super.getTypesForProperty(hash, name); 353 } 354 355 } 356 357 @Override 358 public Base addChild(String name) throws FHIRException { 359 if (name.equals("text")) { 360 this.text = new Narrative(); 361 return this.text; 362 } 363 else if (name.equals("contained")) { 364 throw new FHIRException("Cannot call addChild on an abstract type DomainResource.contained"); 365 } 366 else if (name.equals("extension")) { 367 return addExtension(); 368 } 369 else if (name.equals("modifierExtension")) { 370 return addModifierExtension(); 371 } 372 else 373 return super.addChild(name); 374 } 375 376 public String fhirType() { 377 return "DomainResource"; 378 379 } 380 381 public abstract DomainResource copy(); 382 383 public void copyValues(DomainResource dst) { 384 super.copyValues(dst); 385 dst.text = text == null ? null : text.copy(); 386 if (contained != null) { 387 dst.contained = new ArrayList<Resource>(); 388 for (Resource i : contained) 389 dst.contained.add(i.copy()); 390 }; 391 if (extension != null) { 392 dst.extension = new ArrayList<Extension>(); 393 for (Extension i : extension) 394 dst.extension.add(i.copy()); 395 }; 396 if (modifierExtension != null) { 397 dst.modifierExtension = new ArrayList<Extension>(); 398 for (Extension i : modifierExtension) 399 dst.modifierExtension.add(i.copy()); 400 }; 401 } 402 403 @Override 404 public boolean equalsDeep(Base other_) { 405 if (!super.equalsDeep(other_)) 406 return false; 407 if (!(other_ instanceof DomainResource)) 408 return false; 409 DomainResource o = (DomainResource) other_; 410 return compareDeep(text, o.text, true) && compareDeep(contained, o.contained, true) && compareDeep(extension, o.extension, true) 411 && compareDeep(modifierExtension, o.modifierExtension, true); 412 } 413 414 @Override 415 public boolean equalsShallow(Base other_) { 416 if (!super.equalsShallow(other_)) 417 return false; 418 if (!(other_ instanceof DomainResource)) 419 return false; 420 DomainResource o = (DomainResource) other_; 421 return true; 422 } 423 424 public boolean isEmpty() { 425 return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(text, contained, extension 426 , modifierExtension); 427 } 428 429 /** 430 * Search parameter: <b>_text</b> 431 * <p> 432 * Description: <b>Search on the narrative of the resource</b><br> 433 * Type: <b>string</b><br> 434 * Path: <b>null</b><br> 435 * </p> 436 */ 437 @SearchParamDefinition(name="_text", path="", description="Search on the narrative of the resource", type="string" ) 438 public static final String SP_TEXT = "_text"; 439 /** 440 * <b>Fluent Client</b> search parameter constant for <b>_text</b> 441 * <p> 442 * Description: <b>Search on the narrative of the resource</b><br> 443 * Type: <b>string</b><br> 444 * Path: <b>null</b><br> 445 * </p> 446 */ 447 public static final ca.uhn.fhir.rest.gclient.StringClientParam TEXT = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_TEXT); 448 449// Manual code (from Configuration.txt)t: 450 451 public void checkNoModifiers(String noun, String verb) throws FHIRException { 452 if (hasModifierExtension()) { 453 throw new FHIRException("Found unknown Modifier Exceptions on "+noun+" doing "+verb); 454 } 455 456 } 457 458 public void addExtension(String url, DataType value) { 459 Extension ex = new Extension(); 460 ex.setUrl(url); 461 ex.setValue(value); 462 getExtension().add(ex); 463 } 464 465 466 467 468 public boolean hasExtension(String url) { 469 for (Extension e : getExtension()) 470 if (url.equals(e.getUrl())) 471 return true; 472 return false; 473 } 474 475 public Extension getExtensionByUrl(String theUrl) { 476 org.apache.commons.lang3.Validate.notBlank(theUrl, "theUrl must not be blank or null"); 477 ArrayList<Extension> retVal = new ArrayList<Extension>(); 478 for (Extension next : getExtension()) { 479 if (theUrl.equals(next.getUrl())) { 480 retVal.add(next); 481 } 482 } 483 if (retVal.size() == 0) 484 return null; 485 else { 486 org.apache.commons.lang3.Validate.isTrue(retVal.size() == 1, "Url "+theUrl+" must have only one match"); 487 return retVal.get(0); 488 } 489 } 490 491 public Resource getContained(String ref) { 492 if (ref == null) 493 return null; 494 495 if (ref.startsWith("#")) 496 ref = ref.substring(1); 497 for (Resource r : getContained()) { 498 if (r.getId().equals(ref)) 499 return r; 500 } 501 return null; 502 } 503 504 /** 505 * Returns a list of extensions from this element which have the given URL. Note that 506 * this list may not be modified (you can not add or remove elements from it) 507 */ 508 public List<Extension> getExtensionsByUrl(String theUrl) { 509 org.apache.commons.lang3.Validate.notBlank(theUrl, "theUrl must be provided with a value"); 510 ArrayList<Extension> retVal = new ArrayList<Extension>(); 511 for (Extension next : getExtension()) { 512 if (theUrl.equals(next.getUrl())) { 513 retVal.add(next); 514 } 515 } 516 return Collections.unmodifiableList(retVal); 517 } 518 519 /** 520 * Returns a list of modifier extensions from this element which have the given URL. Note that 521 * this list may not be modified (you can not add or remove elements from it) 522 */ 523 public List<Extension> getModifierExtensionsByUrl(String theUrl) { 524 org.apache.commons.lang3.Validate.notBlank(theUrl, "theUrl must be provided with a value"); 525 ArrayList<Extension> retVal = new ArrayList<Extension>(); 526 for (Extension next : getModifierExtension()) { 527 if (theUrl.equals(next.getUrl())) { 528 retVal.add(next); 529 } 530 } 531 return Collections.unmodifiableList(retVal); 532 } 533 534 535// end addition 536 537} 538