001// Generated from: ../../../../../../../../oscal/src/metaschema/oscal_profile_metaschema.xml 002// Do not edit - changes will be lost when regenerated. 003package dev.metaschema.oscal.lib.model; 004 005import dev.metaschema.core.datatype.adapter.StringAdapter; 006import dev.metaschema.core.datatype.adapter.TokenAdapter; 007import dev.metaschema.core.datatype.adapter.UriAdapter; 008import dev.metaschema.core.datatype.markup.MarkupLine; 009import dev.metaschema.core.datatype.markup.MarkupLineAdapter; 010import dev.metaschema.core.datatype.markup.MarkupMultiline; 011import dev.metaschema.core.datatype.markup.MarkupMultilineAdapter; 012import dev.metaschema.core.model.IBoundObject; 013import dev.metaschema.core.model.IMetaschemaData; 014import dev.metaschema.core.model.JsonGroupAsBehavior; 015import dev.metaschema.core.model.constraint.IConstraint; 016import dev.metaschema.core.util.ObjectUtils; 017import dev.metaschema.databind.model.annotations.AllowedValue; 018import dev.metaschema.databind.model.annotations.AllowedValues; 019import dev.metaschema.databind.model.annotations.AssemblyConstraints; 020import dev.metaschema.databind.model.annotations.BoundAssembly; 021import dev.metaschema.databind.model.annotations.BoundChoice; 022import dev.metaschema.databind.model.annotations.BoundField; 023import dev.metaschema.databind.model.annotations.BoundFlag; 024import dev.metaschema.databind.model.annotations.GroupAs; 025import dev.metaschema.databind.model.annotations.IsUnique; 026import dev.metaschema.databind.model.annotations.KeyField; 027import dev.metaschema.databind.model.annotations.MetaschemaAssembly; 028import dev.metaschema.databind.model.annotations.ValueConstraints; 029import edu.umd.cs.findbugs.annotations.NonNull; 030import edu.umd.cs.findbugs.annotations.Nullable; 031import java.net.URI; 032import java.util.LinkedList; 033import java.util.List; 034import org.apache.commons.lang3.builder.ReflectionToStringBuilder; 035import org.apache.commons.lang3.builder.ToStringStyle; 036 037/** 038 * Set parameters or amend controls in resolution. 039 */ 040@MetaschemaAssembly( 041 formalName = "Modify Controls", 042 description = "Set parameters or amend controls in resolution.", 043 name = "modify", 044 moduleClass = OscalProfileModule.class, 045 modelConstraints = @AssemblyConstraints(unique = @IsUnique(id = "oscal-unique-profile-modify-set-parameter", level = IConstraint.Level.ERROR, target = "set-parameter", keyFields = @KeyField(target = "@param-id"), remarks = "Since multiple `set-parameter` entries can be provided, each parameter must be set only once.")) 046) 047public class Modify implements IBoundObject { 048 private final IMetaschemaData __metaschemaData; 049 050 /** 051 * A parameter setting, to be propagated to points of insertion. 052 */ 053 @BoundAssembly( 054 formalName = "Parameter Setting", 055 description = "A parameter setting, to be propagated to points of insertion.", 056 useName = "set-parameter", 057 maxOccurs = -1, 058 groupAs = @GroupAs(name = "set-parameters", inJson = JsonGroupAsBehavior.LIST) 059 ) 060 private List<ProfileSetParameter> _setParameters; 061 062 /** 063 * Specifies changes to be made to an included control when a profile is resolved. 064 */ 065 @BoundAssembly( 066 formalName = "Alteration", 067 description = "Specifies changes to be made to an included control when a profile is resolved.", 068 useName = "alter", 069 remarks = "Use `@control-id` to indicate the scope of alteration.\n" 070 + "\n" 071 + "It is an error for two `alter` elements to apply to the same control. In practice, multiple alterations can be applied (together), but it creates confusion.\n" 072 + "\n" 073 + "At present, no provision is made for altering many controls at once (for example, to systematically remove properties or add global properties); extending this element to match multiple control IDs could provide for this.", 074 maxOccurs = -1, 075 groupAs = @GroupAs(name = "alters", inJson = JsonGroupAsBehavior.LIST) 076 ) 077 private List<Alter> _alters; 078 079 /** 080 * Constructs a new {@code dev.metaschema.oscal.lib.model.Modify} instance with no metadata. 081 */ 082 public Modify() { 083 this(null); 084 } 085 086 /** 087 * Constructs a new {@code dev.metaschema.oscal.lib.model.Modify} instance with the specified metadata. 088 * 089 * @param data 090 * the metaschema data, or {@code null} if none 091 */ 092 public Modify(IMetaschemaData data) { 093 this.__metaschemaData = data; 094 } 095 096 @Override 097 public IMetaschemaData getMetaschemaData() { 098 return __metaschemaData; 099 } 100 101 /** 102 * Get the "{@literal Parameter Setting}". 103 * 104 * <p> 105 * A parameter setting, to be propagated to points of insertion. 106 * 107 * @return the set-parameter value 108 */ 109 @NonNull 110 public List<ProfileSetParameter> getSetParameters() { 111 if (_setParameters == null) { 112 _setParameters = new LinkedList<>(); 113 } 114 return ObjectUtils.notNull(_setParameters); 115 } 116 117 /** 118 * Set the "{@literal Parameter Setting}". 119 * 120 * <p> 121 * A parameter setting, to be propagated to points of insertion. 122 * 123 * @param value 124 * the set-parameter value to set 125 */ 126 public void setSetParameters(@NonNull List<ProfileSetParameter> value) { 127 _setParameters = value; 128 } 129 130 /** 131 * Add a new {@link ProfileSetParameter} item to the underlying collection. 132 * @param item the item to add 133 * @return {@code true} 134 */ 135 public boolean addSetParameter(ProfileSetParameter item) { 136 ProfileSetParameter value = ObjectUtils.requireNonNull(item,"item cannot be null"); 137 if (_setParameters == null) { 138 _setParameters = new LinkedList<>(); 139 } 140 return _setParameters.add(value); 141 } 142 143 /** 144 * Remove the first matching {@link ProfileSetParameter} item from the underlying collection. 145 * @param item the item to remove 146 * @return {@code true} if the item was removed or {@code false} otherwise 147 */ 148 public boolean removeSetParameter(ProfileSetParameter item) { 149 ProfileSetParameter value = ObjectUtils.requireNonNull(item,"item cannot be null"); 150 return _setParameters != null && _setParameters.remove(value); 151 } 152 153 /** 154 * Get the "{@literal Alteration}". 155 * 156 * <p> 157 * Specifies changes to be made to an included control when a profile is resolved. 158 * 159 * @return the alter value 160 */ 161 @NonNull 162 public List<Alter> getAlters() { 163 if (_alters == null) { 164 _alters = new LinkedList<>(); 165 } 166 return ObjectUtils.notNull(_alters); 167 } 168 169 /** 170 * Set the "{@literal Alteration}". 171 * 172 * <p> 173 * Specifies changes to be made to an included control when a profile is resolved. 174 * 175 * @param value 176 * the alter value to set 177 */ 178 public void setAlters(@NonNull List<Alter> value) { 179 _alters = value; 180 } 181 182 /** 183 * Add a new {@link Alter} item to the underlying collection. 184 * @param item the item to add 185 * @return {@code true} 186 */ 187 public boolean addAlter(Alter item) { 188 Alter value = ObjectUtils.requireNonNull(item,"item cannot be null"); 189 if (_alters == null) { 190 _alters = new LinkedList<>(); 191 } 192 return _alters.add(value); 193 } 194 195 /** 196 * Remove the first matching {@link Alter} item from the underlying collection. 197 * @param item the item to remove 198 * @return {@code true} if the item was removed or {@code false} otherwise 199 */ 200 public boolean removeAlter(Alter item) { 201 Alter value = ObjectUtils.requireNonNull(item,"item cannot be null"); 202 return _alters != null && _alters.remove(value); 203 } 204 205 @Override 206 public String toString() { 207 return ObjectUtils.notNull(new ReflectionToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).toString()); 208 } 209 210 /** 211 * A parameter setting, to be propagated to points of insertion. 212 */ 213 @MetaschemaAssembly( 214 formalName = "Parameter Setting", 215 description = "A parameter setting, to be propagated to points of insertion.", 216 name = "set-parameter", 217 moduleClass = OscalProfileModule.class 218 ) 219 public static class ProfileSetParameter implements IBoundObject { 220 private final IMetaschemaData __metaschemaData; 221 222 /** 223 * An identifier for the parameter. 224 */ 225 @BoundFlag( 226 formalName = "Parameter ID", 227 description = "An identifier for the parameter.", 228 name = "param-id", 229 required = true, 230 typeAdapter = TokenAdapter.class 231 ) 232 private String _paramId; 233 234 /** 235 * A textual label that provides a characterization of the parameter. 236 */ 237 @BoundFlag( 238 formalName = "Parameter Class", 239 description = "A textual label that provides a characterization of the parameter.", 240 name = "class", 241 typeAdapter = TokenAdapter.class, 242 remarks = "A `class` can be used in validation rules to express extra constraints over named items of a specific `class` value." 243 ) 244 private String _clazz; 245 246 /** 247 * **(deprecated)** Another parameter invoking this one. This construct has been deprecated and should not be used. 248 */ 249 @BoundFlag( 250 formalName = "Depends On", 251 description = "\\*\\*(deprecated)\\*\\* Another parameter invoking this one. This construct has been deprecated and should not be used.", 252 name = "depends-on", 253 typeAdapter = TokenAdapter.class 254 ) 255 private String _dependsOn; 256 257 /** 258 * An attribute, characteristic, or quality of the containing object expressed as a namespace qualified name/value pair. 259 */ 260 @BoundAssembly( 261 formalName = "Property", 262 description = "An attribute, characteristic, or quality of the containing object expressed as a namespace qualified name/value pair.", 263 useName = "prop", 264 maxOccurs = -1, 265 groupAs = @GroupAs(name = "props", inJson = JsonGroupAsBehavior.LIST) 266 ) 267 private List<Property> _props; 268 269 /** 270 * A reference to a local or remote resource, that has a specific relation to the containing object. 271 */ 272 @BoundAssembly( 273 formalName = "Link", 274 description = "A reference to a local or remote resource, that has a specific relation to the containing object.", 275 useName = "link", 276 maxOccurs = -1, 277 groupAs = @GroupAs(name = "links", inJson = JsonGroupAsBehavior.LIST) 278 ) 279 private List<Link> _links; 280 281 /** 282 * A short, placeholder name for the parameter, which can be used as a substitute for a <code>value</code> if no value is assigned. 283 */ 284 @BoundField( 285 formalName = "Parameter Label", 286 description = "A short, placeholder name for the parameter, which can be used as a substitute for a `value` if no value is assigned.", 287 useName = "label", 288 remarks = "The label value should be suitable for inline display in a rendered catalog.", 289 typeAdapter = MarkupLineAdapter.class 290 ) 291 private MarkupLine _label; 292 293 /** 294 * Describes the purpose and use of a parameter. 295 */ 296 @BoundField( 297 formalName = "Parameter Usage Description", 298 description = "Describes the purpose and use of a parameter.", 299 useName = "usage", 300 typeAdapter = MarkupMultilineAdapter.class 301 ) 302 private MarkupMultiline _usage; 303 304 /** 305 * A formal or informal expression of a constraint or test. 306 */ 307 @BoundAssembly( 308 formalName = "Constraint", 309 description = "A formal or informal expression of a constraint or test.", 310 useName = "constraint", 311 maxOccurs = -1, 312 groupAs = @GroupAs(name = "constraints", inJson = JsonGroupAsBehavior.LIST) 313 ) 314 private List<ParameterConstraint> _constraints; 315 316 /** 317 * A prose statement that provides a recommendation for the use of a parameter. 318 */ 319 @BoundAssembly( 320 formalName = "Guideline", 321 description = "A prose statement that provides a recommendation for the use of a parameter.", 322 useName = "guideline", 323 maxOccurs = -1, 324 groupAs = @GroupAs(name = "guidelines", inJson = JsonGroupAsBehavior.LIST) 325 ) 326 private List<ParameterGuideline> _guidelines; 327 328 /** 329 * A parameter value or set of values. 330 */ 331 @BoundField( 332 formalName = "Parameter Value", 333 description = "A parameter value or set of values.", 334 useName = "value", 335 remarks = "Used to (re)define a parameter value.", 336 maxOccurs = -1, 337 groupAs = @GroupAs(name = "values", inJson = JsonGroupAsBehavior.LIST), 338 typeAdapter = StringAdapter.class 339 ) 340 @BoundChoice( 341 choiceId = "choice-1" 342 ) 343 private List<String> _values; 344 345 /** 346 * Presenting a choice among alternatives. 347 */ 348 @BoundAssembly( 349 formalName = "Selection", 350 description = "Presenting a choice among alternatives.", 351 useName = "select" 352 ) 353 @BoundChoice( 354 choiceId = "choice-1" 355 ) 356 private ParameterSelection _select; 357 358 /** 359 * Constructs a new {@code dev.metaschema.oscal.lib.model.Modify.ProfileSetParameter} instance with no metadata. 360 */ 361 public ProfileSetParameter() { 362 this(null); 363 } 364 365 /** 366 * Constructs a new {@code dev.metaschema.oscal.lib.model.Modify.ProfileSetParameter} instance with the specified metadata. 367 * 368 * @param data 369 * the metaschema data, or {@code null} if none 370 */ 371 public ProfileSetParameter(IMetaschemaData data) { 372 this.__metaschemaData = data; 373 } 374 375 @Override 376 public IMetaschemaData getMetaschemaData() { 377 return __metaschemaData; 378 } 379 380 /** 381 * Get the "{@literal Parameter ID}". 382 * 383 * <p> 384 * An identifier for the parameter. 385 * 386 * @return the param-id value 387 */ 388 @NonNull 389 public String getParamId() { 390 return _paramId; 391 } 392 393 /** 394 * Set the "{@literal Parameter ID}". 395 * 396 * <p> 397 * An identifier for the parameter. 398 * 399 * @param value 400 * the param-id value to set 401 */ 402 public void setParamId(@NonNull String value) { 403 _paramId = value; 404 } 405 406 /** 407 * Get the "{@literal Parameter Class}". 408 * 409 * <p> 410 * A textual label that provides a characterization of the parameter. 411 * 412 * @return the class value, or {@code null} if not set 413 */ 414 @Nullable 415 public String getClazz() { 416 return _clazz; 417 } 418 419 /** 420 * Set the "{@literal Parameter Class}". 421 * 422 * <p> 423 * A textual label that provides a characterization of the parameter. 424 * 425 * @param value 426 * the class value to set, or {@code null} to clear 427 */ 428 public void setClazz(@Nullable String value) { 429 _clazz = value; 430 } 431 432 /** 433 * Get the "{@literal Depends On}". 434 * 435 * <p> 436 * **(deprecated)** Another parameter invoking this one. This construct has been deprecated and should not be used. 437 * 438 * @return the depends-on value, or {@code null} if not set 439 */ 440 @Nullable 441 public String getDependsOn() { 442 return _dependsOn; 443 } 444 445 /** 446 * Set the "{@literal Depends On}". 447 * 448 * <p> 449 * **(deprecated)** Another parameter invoking this one. This construct has been deprecated and should not be used. 450 * 451 * @param value 452 * the depends-on value to set, or {@code null} to clear 453 */ 454 public void setDependsOn(@Nullable String value) { 455 _dependsOn = value; 456 } 457 458 /** 459 * Get the "{@literal Property}". 460 * 461 * <p> 462 * An attribute, characteristic, or quality of the containing object expressed as a namespace qualified name/value pair. 463 * 464 * @return the prop value 465 */ 466 @NonNull 467 public List<Property> getProps() { 468 if (_props == null) { 469 _props = new LinkedList<>(); 470 } 471 return ObjectUtils.notNull(_props); 472 } 473 474 /** 475 * Set the "{@literal Property}". 476 * 477 * <p> 478 * An attribute, characteristic, or quality of the containing object expressed as a namespace qualified name/value pair. 479 * 480 * @param value 481 * the prop value to set 482 */ 483 public void setProps(@NonNull List<Property> value) { 484 _props = value; 485 } 486 487 /** 488 * Add a new {@link Property} item to the underlying collection. 489 * @param item the item to add 490 * @return {@code true} 491 */ 492 public boolean addProp(Property item) { 493 Property value = ObjectUtils.requireNonNull(item,"item cannot be null"); 494 if (_props == null) { 495 _props = new LinkedList<>(); 496 } 497 return _props.add(value); 498 } 499 500 /** 501 * Remove the first matching {@link Property} item from the underlying collection. 502 * @param item the item to remove 503 * @return {@code true} if the item was removed or {@code false} otherwise 504 */ 505 public boolean removeProp(Property item) { 506 Property value = ObjectUtils.requireNonNull(item,"item cannot be null"); 507 return _props != null && _props.remove(value); 508 } 509 510 /** 511 * Get the "{@literal Link}". 512 * 513 * <p> 514 * A reference to a local or remote resource, that has a specific relation to the containing object. 515 * 516 * @return the link value 517 */ 518 @NonNull 519 public List<Link> getLinks() { 520 if (_links == null) { 521 _links = new LinkedList<>(); 522 } 523 return ObjectUtils.notNull(_links); 524 } 525 526 /** 527 * Set the "{@literal Link}". 528 * 529 * <p> 530 * A reference to a local or remote resource, that has a specific relation to the containing object. 531 * 532 * @param value 533 * the link value to set 534 */ 535 public void setLinks(@NonNull List<Link> value) { 536 _links = value; 537 } 538 539 /** 540 * Add a new {@link Link} item to the underlying collection. 541 * @param item the item to add 542 * @return {@code true} 543 */ 544 public boolean addLink(Link item) { 545 Link value = ObjectUtils.requireNonNull(item,"item cannot be null"); 546 if (_links == null) { 547 _links = new LinkedList<>(); 548 } 549 return _links.add(value); 550 } 551 552 /** 553 * Remove the first matching {@link Link} item from the underlying collection. 554 * @param item the item to remove 555 * @return {@code true} if the item was removed or {@code false} otherwise 556 */ 557 public boolean removeLink(Link item) { 558 Link value = ObjectUtils.requireNonNull(item,"item cannot be null"); 559 return _links != null && _links.remove(value); 560 } 561 562 /** 563 * Get the "{@literal Parameter Label}". 564 * 565 * <p> 566 * A short, placeholder name for the parameter, which can be used as a substitute for a <code>value</code> if no value is assigned. 567 * 568 * @return the label value, or {@code null} if not set 569 */ 570 @Nullable 571 public MarkupLine getLabel() { 572 return _label; 573 } 574 575 /** 576 * Set the "{@literal Parameter Label}". 577 * 578 * <p> 579 * A short, placeholder name for the parameter, which can be used as a substitute for a <code>value</code> if no value is assigned. 580 * 581 * @param value 582 * the label value to set, or {@code null} to clear 583 */ 584 public void setLabel(@Nullable MarkupLine value) { 585 _label = value; 586 } 587 588 /** 589 * Get the "{@literal Parameter Usage Description}". 590 * 591 * <p> 592 * Describes the purpose and use of a parameter. 593 * 594 * @return the usage value, or {@code null} if not set 595 */ 596 @Nullable 597 public MarkupMultiline getUsage() { 598 return _usage; 599 } 600 601 /** 602 * Set the "{@literal Parameter Usage Description}". 603 * 604 * <p> 605 * Describes the purpose and use of a parameter. 606 * 607 * @param value 608 * the usage value to set, or {@code null} to clear 609 */ 610 public void setUsage(@Nullable MarkupMultiline value) { 611 _usage = value; 612 } 613 614 /** 615 * Get the "{@literal Constraint}". 616 * 617 * <p> 618 * A formal or informal expression of a constraint or test. 619 * 620 * @return the constraint value 621 */ 622 @NonNull 623 public List<ParameterConstraint> getConstraints() { 624 if (_constraints == null) { 625 _constraints = new LinkedList<>(); 626 } 627 return ObjectUtils.notNull(_constraints); 628 } 629 630 /** 631 * Set the "{@literal Constraint}". 632 * 633 * <p> 634 * A formal or informal expression of a constraint or test. 635 * 636 * @param value 637 * the constraint value to set 638 */ 639 public void setConstraints(@NonNull List<ParameterConstraint> value) { 640 _constraints = value; 641 } 642 643 /** 644 * Add a new {@link ParameterConstraint} item to the underlying collection. 645 * @param item the item to add 646 * @return {@code true} 647 */ 648 public boolean addConstraint(ParameterConstraint item) { 649 ParameterConstraint value = ObjectUtils.requireNonNull(item,"item cannot be null"); 650 if (_constraints == null) { 651 _constraints = new LinkedList<>(); 652 } 653 return _constraints.add(value); 654 } 655 656 /** 657 * Remove the first matching {@link ParameterConstraint} item from the underlying collection. 658 * @param item the item to remove 659 * @return {@code true} if the item was removed or {@code false} otherwise 660 */ 661 public boolean removeConstraint(ParameterConstraint item) { 662 ParameterConstraint value = ObjectUtils.requireNonNull(item,"item cannot be null"); 663 return _constraints != null && _constraints.remove(value); 664 } 665 666 /** 667 * Get the "{@literal Guideline}". 668 * 669 * <p> 670 * A prose statement that provides a recommendation for the use of a parameter. 671 * 672 * @return the guideline value 673 */ 674 @NonNull 675 public List<ParameterGuideline> getGuidelines() { 676 if (_guidelines == null) { 677 _guidelines = new LinkedList<>(); 678 } 679 return ObjectUtils.notNull(_guidelines); 680 } 681 682 /** 683 * Set the "{@literal Guideline}". 684 * 685 * <p> 686 * A prose statement that provides a recommendation for the use of a parameter. 687 * 688 * @param value 689 * the guideline value to set 690 */ 691 public void setGuidelines(@NonNull List<ParameterGuideline> value) { 692 _guidelines = value; 693 } 694 695 /** 696 * Add a new {@link ParameterGuideline} item to the underlying collection. 697 * @param item the item to add 698 * @return {@code true} 699 */ 700 public boolean addGuideline(ParameterGuideline item) { 701 ParameterGuideline value = ObjectUtils.requireNonNull(item,"item cannot be null"); 702 if (_guidelines == null) { 703 _guidelines = new LinkedList<>(); 704 } 705 return _guidelines.add(value); 706 } 707 708 /** 709 * Remove the first matching {@link ParameterGuideline} item from the underlying collection. 710 * @param item the item to remove 711 * @return {@code true} if the item was removed or {@code false} otherwise 712 */ 713 public boolean removeGuideline(ParameterGuideline item) { 714 ParameterGuideline value = ObjectUtils.requireNonNull(item,"item cannot be null"); 715 return _guidelines != null && _guidelines.remove(value); 716 } 717 718 /** 719 * Get the "{@literal Parameter Value}". 720 * 721 * <p> 722 * A parameter value or set of values. 723 * 724 * @return the value value 725 */ 726 @NonNull 727 public List<String> getValues() { 728 if (_values == null) { 729 _values = new LinkedList<>(); 730 } 731 return ObjectUtils.notNull(_values); 732 } 733 734 /** 735 * Set the "{@literal Parameter Value}". 736 * 737 * <p> 738 * A parameter value or set of values. 739 * 740 * @param value 741 * the value value to set 742 */ 743 public void setValues(@NonNull List<String> value) { 744 _values = value; 745 } 746 747 /** 748 * Add a new {@link String} item to the underlying collection. 749 * @param item the item to add 750 * @return {@code true} 751 */ 752 public boolean addValue(String item) { 753 String value = ObjectUtils.requireNonNull(item,"item cannot be null"); 754 if (_values == null) { 755 _values = new LinkedList<>(); 756 } 757 return _values.add(value); 758 } 759 760 /** 761 * Remove the first matching {@link String} item from the underlying collection. 762 * @param item the item to remove 763 * @return {@code true} if the item was removed or {@code false} otherwise 764 */ 765 public boolean removeValue(String item) { 766 String value = ObjectUtils.requireNonNull(item,"item cannot be null"); 767 return _values != null && _values.remove(value); 768 } 769 770 /** 771 * Get the "{@literal Selection}". 772 * 773 * <p> 774 * Presenting a choice among alternatives. 775 * 776 * @return the select value, or {@code null} if not set 777 */ 778 @Nullable 779 public ParameterSelection getSelect() { 780 return _select; 781 } 782 783 /** 784 * Set the "{@literal Selection}". 785 * 786 * <p> 787 * Presenting a choice among alternatives. 788 * 789 * @param value 790 * the select value to set, or {@code null} to clear 791 */ 792 public void setSelect(@Nullable ParameterSelection value) { 793 _select = value; 794 } 795 796 @Override 797 public String toString() { 798 return ObjectUtils.notNull(new ReflectionToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).toString()); 799 } 800 } 801 802 /** 803 * Specifies changes to be made to an included control when a profile is resolved. 804 */ 805 @MetaschemaAssembly( 806 formalName = "Alteration", 807 description = "Specifies changes to be made to an included control when a profile is resolved.", 808 name = "alter", 809 moduleClass = OscalProfileModule.class, 810 remarks = "Use `@control-id` to indicate the scope of alteration.\n" 811 + "\n" 812 + "It is an error for two `alter` elements to apply to the same control. In practice, multiple alterations can be applied (together), but it creates confusion.\n" 813 + "\n" 814 + "At present, no provision is made for altering many controls at once (for example, to systematically remove properties or add global properties); extending this element to match multiple control IDs could provide for this." 815 ) 816 public static class Alter implements IBoundObject { 817 private final IMetaschemaData __metaschemaData; 818 819 /** 820 * A reference to a control with a corresponding <code>id</code> value. When referencing an externally defined <code>control</code>, the <code>Control Identifier Reference</code> must be used in the context of the external / imported OSCAL instance (e.g., uri-reference). 821 */ 822 @BoundFlag( 823 formalName = "Control Identifier Reference", 824 description = "A reference to a control with a corresponding `id` value. When referencing an externally defined `control`, the `Control Identifier Reference` must be used in the context of the external / imported OSCAL instance (e.g., uri-reference).", 825 name = "control-id", 826 required = true, 827 typeAdapter = TokenAdapter.class 828 ) 829 private String _controlId; 830 831 /** 832 * Specifies objects to be removed from a control based on specific aspects of the object that must all match. 833 */ 834 @BoundAssembly( 835 formalName = "Removal", 836 description = "Specifies objects to be removed from a control based on specific aspects of the object that must all match.", 837 useName = "remove", 838 remarks = "Use `by-name`, `by-class`, `by-id` or `by-item-name` to indicate class tokens or ID reference, or the formal name, of the component to be removed or erased from a control, when a catalog is resolved. The control affected is indicated by the pointer on the removal's parent (containing) `alter` element.\n" 839 + "\n" 840 + "To change an element, use `remove` to remove the element, then `add` to add it back again with changes.", 841 maxOccurs = -1, 842 groupAs = @GroupAs(name = "removes", inJson = JsonGroupAsBehavior.LIST) 843 ) 844 private List<Remove> _removes; 845 846 /** 847 * Specifies contents to be added into controls, in resolution. 848 */ 849 @BoundAssembly( 850 formalName = "Addition", 851 description = "Specifies contents to be added into controls, in resolution.", 852 useName = "add", 853 remarks = "When no `by-id` is given, the addition is inserted into the control targeted by the alteration at the start or end as indicated by `position`. Only `position` values of \"starting\" or \"ending\" are permitted when there is no `by-id`.\n" 854 + "\n" 855 + "`by-id`, when given, should indicate, by its ID, an element inside the control to serve as the anchor point for the addition. In this case, `position` value may be any of the permitted values.", 856 maxOccurs = -1, 857 groupAs = @GroupAs(name = "adds", inJson = JsonGroupAsBehavior.LIST) 858 ) 859 private List<Add> _adds; 860 861 /** 862 * Constructs a new {@code dev.metaschema.oscal.lib.model.Modify.Alter} instance with no metadata. 863 */ 864 public Alter() { 865 this(null); 866 } 867 868 /** 869 * Constructs a new {@code dev.metaschema.oscal.lib.model.Modify.Alter} instance with the specified metadata. 870 * 871 * @param data 872 * the metaschema data, or {@code null} if none 873 */ 874 public Alter(IMetaschemaData data) { 875 this.__metaschemaData = data; 876 } 877 878 @Override 879 public IMetaschemaData getMetaschemaData() { 880 return __metaschemaData; 881 } 882 883 /** 884 * Get the "{@literal Control Identifier Reference}". 885 * 886 * <p> 887 * A reference to a control with a corresponding <code>id</code> value. When referencing an externally defined <code>control</code>, the <code>Control Identifier Reference</code> must be used in the context of the external / imported OSCAL instance (e.g., uri-reference). 888 * 889 * @return the control-id value 890 */ 891 @NonNull 892 public String getControlId() { 893 return _controlId; 894 } 895 896 /** 897 * Set the "{@literal Control Identifier Reference}". 898 * 899 * <p> 900 * A reference to a control with a corresponding <code>id</code> value. When referencing an externally defined <code>control</code>, the <code>Control Identifier Reference</code> must be used in the context of the external / imported OSCAL instance (e.g., uri-reference). 901 * 902 * @param value 903 * the control-id value to set 904 */ 905 public void setControlId(@NonNull String value) { 906 _controlId = value; 907 } 908 909 /** 910 * Get the "{@literal Removal}". 911 * 912 * <p> 913 * Specifies objects to be removed from a control based on specific aspects of the object that must all match. 914 * 915 * @return the remove value 916 */ 917 @NonNull 918 public List<Remove> getRemoves() { 919 if (_removes == null) { 920 _removes = new LinkedList<>(); 921 } 922 return ObjectUtils.notNull(_removes); 923 } 924 925 /** 926 * Set the "{@literal Removal}". 927 * 928 * <p> 929 * Specifies objects to be removed from a control based on specific aspects of the object that must all match. 930 * 931 * @param value 932 * the remove value to set 933 */ 934 public void setRemoves(@NonNull List<Remove> value) { 935 _removes = value; 936 } 937 938 /** 939 * Add a new {@link Remove} item to the underlying collection. 940 * @param item the item to add 941 * @return {@code true} 942 */ 943 public boolean addRemove(Remove item) { 944 Remove value = ObjectUtils.requireNonNull(item,"item cannot be null"); 945 if (_removes == null) { 946 _removes = new LinkedList<>(); 947 } 948 return _removes.add(value); 949 } 950 951 /** 952 * Remove the first matching {@link Remove} item from the underlying collection. 953 * @param item the item to remove 954 * @return {@code true} if the item was removed or {@code false} otherwise 955 */ 956 public boolean removeRemove(Remove item) { 957 Remove value = ObjectUtils.requireNonNull(item,"item cannot be null"); 958 return _removes != null && _removes.remove(value); 959 } 960 961 /** 962 * Get the "{@literal Addition}". 963 * 964 * <p> 965 * Specifies contents to be added into controls, in resolution. 966 * 967 * @return the add value 968 */ 969 @NonNull 970 public List<Add> getAdds() { 971 if (_adds == null) { 972 _adds = new LinkedList<>(); 973 } 974 return ObjectUtils.notNull(_adds); 975 } 976 977 /** 978 * Set the "{@literal Addition}". 979 * 980 * <p> 981 * Specifies contents to be added into controls, in resolution. 982 * 983 * @param value 984 * the add value to set 985 */ 986 public void setAdds(@NonNull List<Add> value) { 987 _adds = value; 988 } 989 990 /** 991 * Add a new {@link Add} item to the underlying collection. 992 * @param item the item to add 993 * @return {@code true} 994 */ 995 public boolean addAdd(Add item) { 996 Add value = ObjectUtils.requireNonNull(item,"item cannot be null"); 997 if (_adds == null) { 998 _adds = new LinkedList<>(); 999 } 1000 return _adds.add(value); 1001 } 1002 1003 /** 1004 * Remove the first matching {@link Add} item from the underlying collection. 1005 * @param item the item to remove 1006 * @return {@code true} if the item was removed or {@code false} otherwise 1007 */ 1008 public boolean removeAdd(Add item) { 1009 Add value = ObjectUtils.requireNonNull(item,"item cannot be null"); 1010 return _adds != null && _adds.remove(value); 1011 } 1012 1013 @Override 1014 public String toString() { 1015 return ObjectUtils.notNull(new ReflectionToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).toString()); 1016 } 1017 1018 /** 1019 * Specifies objects to be removed from a control based on specific aspects of the object that must all match. 1020 */ 1021 @MetaschemaAssembly( 1022 formalName = "Removal", 1023 description = "Specifies objects to be removed from a control based on specific aspects of the object that must all match.", 1024 name = "remove", 1025 moduleClass = OscalProfileModule.class, 1026 remarks = "Use `by-name`, `by-class`, `by-id` or `by-item-name` to indicate class tokens or ID reference, or the formal name, of the component to be removed or erased from a control, when a catalog is resolved. The control affected is indicated by the pointer on the removal's parent (containing) `alter` element.\n" 1027 + "\n" 1028 + "To change an element, use `remove` to remove the element, then `add` to add it back again with changes." 1029 ) 1030 public static class Remove implements IBoundObject { 1031 private final IMetaschemaData __metaschemaData; 1032 1033 /** 1034 * Identify items remove by matching their assigned name. 1035 */ 1036 @BoundFlag( 1037 formalName = "Reference by (assigned) name", 1038 description = "Identify items remove by matching their assigned name.", 1039 name = "by-name", 1040 typeAdapter = TokenAdapter.class 1041 ) 1042 private String _byName; 1043 1044 /** 1045 * Identify items to remove by matching their <code>class</code>. 1046 */ 1047 @BoundFlag( 1048 formalName = "Reference by class", 1049 description = "Identify items to remove by matching their `class`.", 1050 name = "by-class", 1051 typeAdapter = TokenAdapter.class 1052 ) 1053 private String _byClass; 1054 1055 /** 1056 * Identify items to remove indicated by their <code>id</code>. 1057 */ 1058 @BoundFlag( 1059 formalName = "Reference by ID", 1060 description = "Identify items to remove indicated by their `id`.", 1061 name = "by-id", 1062 typeAdapter = TokenAdapter.class 1063 ) 1064 private String _byId; 1065 1066 /** 1067 * Identify items to remove by the name of the item's information object name, e.g. <code>title</code> or <code>prop</code>. 1068 */ 1069 @BoundFlag( 1070 formalName = "Item Name Reference", 1071 description = "Identify items to remove by the name of the item's information object name, e.g. `title` or `prop`.", 1072 name = "by-item-name", 1073 typeAdapter = TokenAdapter.class, 1074 valueConstraints = @ValueConstraints(allowedValues = @AllowedValues(id = "oscal-profile-alter-by-item-name-values", level = IConstraint.Level.ERROR, values = {@AllowedValue(value = "param", description = "A descendant parameter and all of its descendants."), @AllowedValue(value = "prop", description = "A descendant property and all of its descendants."), @AllowedValue(value = "link", description = "A descendant link and all of its descendants."), @AllowedValue(value = "part", description = "A descendant parameter and all of its descendants."), @AllowedValue(value = "mapping", description = "A descendant mapping and all of its descendants."), @AllowedValue(value = "map", description = "A descendant mapping entry (map) and all of its descendants.")})) 1075 ) 1076 private String _byItemName; 1077 1078 /** 1079 * Identify items to remove by the item's <code>ns</code>, which is the namespace associated with a <code>part</code>, or <code>prop</code>. 1080 */ 1081 @BoundFlag( 1082 formalName = "Item Namespace Reference", 1083 description = "Identify items to remove by the item's `ns`, which is the namespace associated with a `part`, or `prop`.", 1084 name = "by-ns", 1085 typeAdapter = UriAdapter.class 1086 ) 1087 private URI _byNs; 1088 1089 /** 1090 * Additional commentary about the containing object. 1091 */ 1092 @BoundField( 1093 formalName = "Remarks", 1094 description = "Additional commentary about the containing object.", 1095 useName = "remarks", 1096 typeAdapter = MarkupMultilineAdapter.class 1097 ) 1098 private MarkupMultiline _remarks; 1099 1100 /** 1101 * Constructs a new {@code dev.metaschema.oscal.lib.model.Modify.Alter.Remove} instance with no metadata. 1102 */ 1103 public Remove() { 1104 this(null); 1105 } 1106 1107 /** 1108 * Constructs a new {@code dev.metaschema.oscal.lib.model.Modify.Alter.Remove} instance with the specified metadata. 1109 * 1110 * @param data 1111 * the metaschema data, or {@code null} if none 1112 */ 1113 public Remove(IMetaschemaData data) { 1114 this.__metaschemaData = data; 1115 } 1116 1117 @Override 1118 public IMetaschemaData getMetaschemaData() { 1119 return __metaschemaData; 1120 } 1121 1122 /** 1123 * Get the "{@literal Reference by (assigned) name}". 1124 * 1125 * <p> 1126 * Identify items remove by matching their assigned name. 1127 * 1128 * @return the by-name value, or {@code null} if not set 1129 */ 1130 @Nullable 1131 public String getByName() { 1132 return _byName; 1133 } 1134 1135 /** 1136 * Set the "{@literal Reference by (assigned) name}". 1137 * 1138 * <p> 1139 * Identify items remove by matching their assigned name. 1140 * 1141 * @param value 1142 * the by-name value to set, or {@code null} to clear 1143 */ 1144 public void setByName(@Nullable String value) { 1145 _byName = value; 1146 } 1147 1148 /** 1149 * Get the "{@literal Reference by class}". 1150 * 1151 * <p> 1152 * Identify items to remove by matching their <code>class</code>. 1153 * 1154 * @return the by-class value, or {@code null} if not set 1155 */ 1156 @Nullable 1157 public String getByClass() { 1158 return _byClass; 1159 } 1160 1161 /** 1162 * Set the "{@literal Reference by class}". 1163 * 1164 * <p> 1165 * Identify items to remove by matching their <code>class</code>. 1166 * 1167 * @param value 1168 * the by-class value to set, or {@code null} to clear 1169 */ 1170 public void setByClass(@Nullable String value) { 1171 _byClass = value; 1172 } 1173 1174 /** 1175 * Get the "{@literal Reference by ID}". 1176 * 1177 * <p> 1178 * Identify items to remove indicated by their <code>id</code>. 1179 * 1180 * @return the by-id value, or {@code null} if not set 1181 */ 1182 @Nullable 1183 public String getById() { 1184 return _byId; 1185 } 1186 1187 /** 1188 * Set the "{@literal Reference by ID}". 1189 * 1190 * <p> 1191 * Identify items to remove indicated by their <code>id</code>. 1192 * 1193 * @param value 1194 * the by-id value to set, or {@code null} to clear 1195 */ 1196 public void setById(@Nullable String value) { 1197 _byId = value; 1198 } 1199 1200 /** 1201 * Get the "{@literal Item Name Reference}". 1202 * 1203 * <p> 1204 * Identify items to remove by the name of the item's information object name, e.g. <code>title</code> or <code>prop</code>. 1205 * 1206 * @return the by-item-name value, or {@code null} if not set 1207 */ 1208 @Nullable 1209 public String getByItemName() { 1210 return _byItemName; 1211 } 1212 1213 /** 1214 * Set the "{@literal Item Name Reference}". 1215 * 1216 * <p> 1217 * Identify items to remove by the name of the item's information object name, e.g. <code>title</code> or <code>prop</code>. 1218 * 1219 * @param value 1220 * the by-item-name value to set, or {@code null} to clear 1221 */ 1222 public void setByItemName(@Nullable String value) { 1223 _byItemName = value; 1224 } 1225 1226 /** 1227 * Get the "{@literal Item Namespace Reference}". 1228 * 1229 * <p> 1230 * Identify items to remove by the item's <code>ns</code>, which is the namespace associated with a <code>part</code>, or <code>prop</code>. 1231 * 1232 * @return the by-ns value, or {@code null} if not set 1233 */ 1234 @Nullable 1235 public URI getByNs() { 1236 return _byNs; 1237 } 1238 1239 /** 1240 * Set the "{@literal Item Namespace Reference}". 1241 * 1242 * <p> 1243 * Identify items to remove by the item's <code>ns</code>, which is the namespace associated with a <code>part</code>, or <code>prop</code>. 1244 * 1245 * @param value 1246 * the by-ns value to set, or {@code null} to clear 1247 */ 1248 public void setByNs(@Nullable URI value) { 1249 _byNs = value; 1250 } 1251 1252 /** 1253 * Get the "{@literal Remarks}". 1254 * 1255 * <p> 1256 * Additional commentary about the containing object. 1257 * 1258 * @return the remarks value, or {@code null} if not set 1259 */ 1260 @Nullable 1261 public MarkupMultiline getRemarks() { 1262 return _remarks; 1263 } 1264 1265 /** 1266 * Set the "{@literal Remarks}". 1267 * 1268 * <p> 1269 * Additional commentary about the containing object. 1270 * 1271 * @param value 1272 * the remarks value to set, or {@code null} to clear 1273 */ 1274 public void setRemarks(@Nullable MarkupMultiline value) { 1275 _remarks = value; 1276 } 1277 1278 @Override 1279 public String toString() { 1280 return ObjectUtils.notNull(new ReflectionToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).toString()); 1281 } 1282 } 1283 1284 /** 1285 * Specifies contents to be added into controls, in resolution. 1286 */ 1287 @MetaschemaAssembly( 1288 formalName = "Addition", 1289 description = "Specifies contents to be added into controls, in resolution.", 1290 name = "add", 1291 moduleClass = OscalProfileModule.class, 1292 remarks = "When no `by-id` is given, the addition is inserted into the control targeted by the alteration at the start or end as indicated by `position`. Only `position` values of \"starting\" or \"ending\" are permitted when there is no `by-id`.\n" 1293 + "\n" 1294 + "`by-id`, when given, should indicate, by its ID, an element inside the control to serve as the anchor point for the addition. In this case, `position` value may be any of the permitted values.", 1295 valueConstraints = @ValueConstraints(allowedValues = @AllowedValues(id = "oscal-profile-modify-alter-prop-name-values", level = IConstraint.Level.ERROR, target = "prop[has-oscal-namespace('http://csrc.nist.gov/ns/oscal')]/@name", values = {@AllowedValue(value = "label", description = "A human-readable label for the parent context, which may be rendered in place of the actual identifier for some use cases."), @AllowedValue(value = "sort-id", description = "An alternative identifier, whose value is easily sortable among other such values in the document."), @AllowedValue(value = "alt-identifier", description = "An alternate or aliased identifier for the parent context.")})) 1296 ) 1297 public static class Add implements IBoundObject { 1298 private final IMetaschemaData __metaschemaData; 1299 1300 /** 1301 * Where to add the new content with respect to the targeted element (beside it or inside it). 1302 */ 1303 @BoundFlag( 1304 formalName = "Position", 1305 description = "Where to add the new content with respect to the targeted element (beside it or inside it).", 1306 name = "position", 1307 defaultValue = "ending", 1308 typeAdapter = TokenAdapter.class, 1309 valueConstraints = @ValueConstraints(allowedValues = @AllowedValues(id = "oscal-alter-position-values", level = IConstraint.Level.ERROR, values = {@AllowedValue(value = "before", description = "Preceding the by-id target"), @AllowedValue(value = "after", description = "Following the by-id target"), @AllowedValue(value = "starting", description = "Inside the control or by-id target, at the start"), @AllowedValue(value = "ending", description = "Inside the control or by-id target, at the end")})) 1310 ) 1311 private String _position; 1312 1313 /** 1314 * Target location of the addition. 1315 */ 1316 @BoundFlag( 1317 formalName = "Reference by ID", 1318 description = "Target location of the addition.", 1319 name = "by-id", 1320 typeAdapter = TokenAdapter.class 1321 ) 1322 private String _byId; 1323 1324 /** 1325 * A name given to the control, which may be used by a tool for display and navigation. 1326 */ 1327 @BoundField( 1328 formalName = "Title Change", 1329 description = "A name given to the control, which may be used by a tool for display and navigation.", 1330 useName = "title", 1331 typeAdapter = MarkupLineAdapter.class 1332 ) 1333 private MarkupLine _title; 1334 1335 /** 1336 * Parameters provide a mechanism for the dynamic assignment of value(s) in a control. 1337 */ 1338 @BoundAssembly( 1339 formalName = "Parameter", 1340 description = "Parameters provide a mechanism for the dynamic assignment of value(s) in a control.", 1341 useName = "param", 1342 maxOccurs = -1, 1343 groupAs = @GroupAs(name = "params", inJson = JsonGroupAsBehavior.LIST) 1344 ) 1345 private List<Parameter> _params; 1346 1347 /** 1348 * An attribute, characteristic, or quality of the containing object expressed as a namespace qualified name/value pair. 1349 */ 1350 @BoundAssembly( 1351 formalName = "Property", 1352 description = "An attribute, characteristic, or quality of the containing object expressed as a namespace qualified name/value pair.", 1353 useName = "prop", 1354 maxOccurs = -1, 1355 groupAs = @GroupAs(name = "props", inJson = JsonGroupAsBehavior.LIST) 1356 ) 1357 private List<Property> _props; 1358 1359 /** 1360 * A reference to a local or remote resource, that has a specific relation to the containing object. 1361 */ 1362 @BoundAssembly( 1363 formalName = "Link", 1364 description = "A reference to a local or remote resource, that has a specific relation to the containing object.", 1365 useName = "link", 1366 maxOccurs = -1, 1367 groupAs = @GroupAs(name = "links", inJson = JsonGroupAsBehavior.LIST) 1368 ) 1369 private List<Link> _links; 1370 1371 /** 1372 * An annotated, markup-based textual element of a control's or catalog group's definition, or a child of another part. 1373 */ 1374 @BoundAssembly( 1375 formalName = "Part", 1376 description = "An annotated, markup-based textual element of a control's or catalog group's definition, or a child of another part.", 1377 useName = "part", 1378 maxOccurs = -1, 1379 groupAs = @GroupAs(name = "parts", inJson = JsonGroupAsBehavior.LIST) 1380 ) 1381 private List<ControlPart> _parts; 1382 1383 /** 1384 * Constructs a new {@code dev.metaschema.oscal.lib.model.Modify.Alter.Add} instance with no metadata. 1385 */ 1386 public Add() { 1387 this(null); 1388 } 1389 1390 /** 1391 * Constructs a new {@code dev.metaschema.oscal.lib.model.Modify.Alter.Add} instance with the specified metadata. 1392 * 1393 * @param data 1394 * the metaschema data, or {@code null} if none 1395 */ 1396 public Add(IMetaschemaData data) { 1397 this.__metaschemaData = data; 1398 } 1399 1400 @Override 1401 public IMetaschemaData getMetaschemaData() { 1402 return __metaschemaData; 1403 } 1404 1405 /** 1406 * Get the "{@literal Position}". 1407 * 1408 * <p> 1409 * Where to add the new content with respect to the targeted element (beside it or inside it). 1410 * 1411 * @return the position value, or {@code null} if not set 1412 */ 1413 @Nullable 1414 public String getPosition() { 1415 return _position; 1416 } 1417 1418 /** 1419 * Set the "{@literal Position}". 1420 * 1421 * <p> 1422 * Where to add the new content with respect to the targeted element (beside it or inside it). 1423 * 1424 * @param value 1425 * the position value to set, or {@code null} to clear 1426 */ 1427 public void setPosition(@Nullable String value) { 1428 _position = value; 1429 } 1430 1431 /** 1432 * Get the "{@literal Reference by ID}". 1433 * 1434 * <p> 1435 * Target location of the addition. 1436 * 1437 * @return the by-id value, or {@code null} if not set 1438 */ 1439 @Nullable 1440 public String getById() { 1441 return _byId; 1442 } 1443 1444 /** 1445 * Set the "{@literal Reference by ID}". 1446 * 1447 * <p> 1448 * Target location of the addition. 1449 * 1450 * @param value 1451 * the by-id value to set, or {@code null} to clear 1452 */ 1453 public void setById(@Nullable String value) { 1454 _byId = value; 1455 } 1456 1457 /** 1458 * Get the "{@literal Title Change}". 1459 * 1460 * <p> 1461 * A name given to the control, which may be used by a tool for display and navigation. 1462 * 1463 * @return the title value, or {@code null} if not set 1464 */ 1465 @Nullable 1466 public MarkupLine getTitle() { 1467 return _title; 1468 } 1469 1470 /** 1471 * Set the "{@literal Title Change}". 1472 * 1473 * <p> 1474 * A name given to the control, which may be used by a tool for display and navigation. 1475 * 1476 * @param value 1477 * the title value to set, or {@code null} to clear 1478 */ 1479 public void setTitle(@Nullable MarkupLine value) { 1480 _title = value; 1481 } 1482 1483 /** 1484 * Get the "{@literal Parameter}". 1485 * 1486 * <p> 1487 * Parameters provide a mechanism for the dynamic assignment of value(s) in a control. 1488 * 1489 * @return the param value 1490 */ 1491 @NonNull 1492 public List<Parameter> getParams() { 1493 if (_params == null) { 1494 _params = new LinkedList<>(); 1495 } 1496 return ObjectUtils.notNull(_params); 1497 } 1498 1499 /** 1500 * Set the "{@literal Parameter}". 1501 * 1502 * <p> 1503 * Parameters provide a mechanism for the dynamic assignment of value(s) in a control. 1504 * 1505 * @param value 1506 * the param value to set 1507 */ 1508 public void setParams(@NonNull List<Parameter> value) { 1509 _params = value; 1510 } 1511 1512 /** 1513 * Add a new {@link Parameter} item to the underlying collection. 1514 * @param item the item to add 1515 * @return {@code true} 1516 */ 1517 public boolean addParam(Parameter item) { 1518 Parameter value = ObjectUtils.requireNonNull(item,"item cannot be null"); 1519 if (_params == null) { 1520 _params = new LinkedList<>(); 1521 } 1522 return _params.add(value); 1523 } 1524 1525 /** 1526 * Remove the first matching {@link Parameter} item from the underlying collection. 1527 * @param item the item to remove 1528 * @return {@code true} if the item was removed or {@code false} otherwise 1529 */ 1530 public boolean removeParam(Parameter item) { 1531 Parameter value = ObjectUtils.requireNonNull(item,"item cannot be null"); 1532 return _params != null && _params.remove(value); 1533 } 1534 1535 /** 1536 * Get the "{@literal Property}". 1537 * 1538 * <p> 1539 * An attribute, characteristic, or quality of the containing object expressed as a namespace qualified name/value pair. 1540 * 1541 * @return the prop value 1542 */ 1543 @NonNull 1544 public List<Property> getProps() { 1545 if (_props == null) { 1546 _props = new LinkedList<>(); 1547 } 1548 return ObjectUtils.notNull(_props); 1549 } 1550 1551 /** 1552 * Set the "{@literal Property}". 1553 * 1554 * <p> 1555 * An attribute, characteristic, or quality of the containing object expressed as a namespace qualified name/value pair. 1556 * 1557 * @param value 1558 * the prop value to set 1559 */ 1560 public void setProps(@NonNull List<Property> value) { 1561 _props = value; 1562 } 1563 1564 /** 1565 * Add a new {@link Property} item to the underlying collection. 1566 * @param item the item to add 1567 * @return {@code true} 1568 */ 1569 public boolean addProp(Property item) { 1570 Property value = ObjectUtils.requireNonNull(item,"item cannot be null"); 1571 if (_props == null) { 1572 _props = new LinkedList<>(); 1573 } 1574 return _props.add(value); 1575 } 1576 1577 /** 1578 * Remove the first matching {@link Property} item from the underlying collection. 1579 * @param item the item to remove 1580 * @return {@code true} if the item was removed or {@code false} otherwise 1581 */ 1582 public boolean removeProp(Property item) { 1583 Property value = ObjectUtils.requireNonNull(item,"item cannot be null"); 1584 return _props != null && _props.remove(value); 1585 } 1586 1587 /** 1588 * Get the "{@literal Link}". 1589 * 1590 * <p> 1591 * A reference to a local or remote resource, that has a specific relation to the containing object. 1592 * 1593 * @return the link value 1594 */ 1595 @NonNull 1596 public List<Link> getLinks() { 1597 if (_links == null) { 1598 _links = new LinkedList<>(); 1599 } 1600 return ObjectUtils.notNull(_links); 1601 } 1602 1603 /** 1604 * Set the "{@literal Link}". 1605 * 1606 * <p> 1607 * A reference to a local or remote resource, that has a specific relation to the containing object. 1608 * 1609 * @param value 1610 * the link value to set 1611 */ 1612 public void setLinks(@NonNull List<Link> value) { 1613 _links = value; 1614 } 1615 1616 /** 1617 * Add a new {@link Link} item to the underlying collection. 1618 * @param item the item to add 1619 * @return {@code true} 1620 */ 1621 public boolean addLink(Link item) { 1622 Link value = ObjectUtils.requireNonNull(item,"item cannot be null"); 1623 if (_links == null) { 1624 _links = new LinkedList<>(); 1625 } 1626 return _links.add(value); 1627 } 1628 1629 /** 1630 * Remove the first matching {@link Link} item from the underlying collection. 1631 * @param item the item to remove 1632 * @return {@code true} if the item was removed or {@code false} otherwise 1633 */ 1634 public boolean removeLink(Link item) { 1635 Link value = ObjectUtils.requireNonNull(item,"item cannot be null"); 1636 return _links != null && _links.remove(value); 1637 } 1638 1639 /** 1640 * Get the "{@literal Part}". 1641 * 1642 * <p> 1643 * An annotated, markup-based textual element of a control's or catalog group's definition, or a child of another part. 1644 * 1645 * @return the part value 1646 */ 1647 @NonNull 1648 public List<ControlPart> getParts() { 1649 if (_parts == null) { 1650 _parts = new LinkedList<>(); 1651 } 1652 return ObjectUtils.notNull(_parts); 1653 } 1654 1655 /** 1656 * Set the "{@literal Part}". 1657 * 1658 * <p> 1659 * An annotated, markup-based textual element of a control's or catalog group's definition, or a child of another part. 1660 * 1661 * @param value 1662 * the part value to set 1663 */ 1664 public void setParts(@NonNull List<ControlPart> value) { 1665 _parts = value; 1666 } 1667 1668 /** 1669 * Add a new {@link ControlPart} item to the underlying collection. 1670 * @param item the item to add 1671 * @return {@code true} 1672 */ 1673 public boolean addPart(ControlPart item) { 1674 ControlPart value = ObjectUtils.requireNonNull(item,"item cannot be null"); 1675 if (_parts == null) { 1676 _parts = new LinkedList<>(); 1677 } 1678 return _parts.add(value); 1679 } 1680 1681 /** 1682 * Remove the first matching {@link ControlPart} item from the underlying collection. 1683 * @param item the item to remove 1684 * @return {@code true} if the item was removed or {@code false} otherwise 1685 */ 1686 public boolean removePart(ControlPart item) { 1687 ControlPart value = ObjectUtils.requireNonNull(item,"item cannot be null"); 1688 return _parts != null && _parts.remove(value); 1689 } 1690 1691 @Override 1692 public String toString() { 1693 return ObjectUtils.notNull(new ReflectionToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).toString()); 1694 } 1695 } 1696 } 1697}