001package gov.nist.secauto.oscal.lib.model; 002 003import gov.nist.secauto.metaschema.binding.model.annotations.AllowedValue; 004import gov.nist.secauto.metaschema.binding.model.annotations.AllowedValues; 005import gov.nist.secauto.metaschema.binding.model.annotations.AssemblyConstraints; 006import gov.nist.secauto.metaschema.binding.model.annotations.BoundAssembly; 007import gov.nist.secauto.metaschema.binding.model.annotations.BoundField; 008import gov.nist.secauto.metaschema.binding.model.annotations.BoundFieldValue; 009import gov.nist.secauto.metaschema.binding.model.annotations.BoundFlag; 010import gov.nist.secauto.metaschema.binding.model.annotations.GroupAs; 011import gov.nist.secauto.metaschema.binding.model.annotations.IsUnique; 012import gov.nist.secauto.metaschema.binding.model.annotations.KeyField; 013import gov.nist.secauto.metaschema.binding.model.annotations.MetaschemaAssembly; 014import gov.nist.secauto.metaschema.binding.model.annotations.ValueConstraints; 015import gov.nist.secauto.metaschema.model.common.JsonGroupAsBehavior; 016import gov.nist.secauto.metaschema.model.common.constraint.IConstraint; 017import gov.nist.secauto.metaschema.model.common.datatype.adapter.TokenAdapter; 018import gov.nist.secauto.metaschema.model.common.datatype.markup.MarkupLine; 019import gov.nist.secauto.metaschema.model.common.datatype.markup.MarkupLineAdapter; 020import gov.nist.secauto.metaschema.model.common.datatype.markup.MarkupMultiline; 021import gov.nist.secauto.metaschema.model.common.datatype.markup.MarkupMultilineAdapter; 022import gov.nist.secauto.metaschema.model.common.util.ObjectUtils; 023import java.lang.Override; 024import java.lang.String; 025import java.util.LinkedList; 026import java.util.List; 027import org.apache.commons.lang3.builder.MultilineRecursiveToStringStyle; 028import org.apache.commons.lang3.builder.ReflectionToStringBuilder; 029 030/** 031 * Set parameters or amend controls in resolution. 032 */ 033@MetaschemaAssembly( 034 formalName = "Modify Controls", 035 description = "Set parameters or amend controls in resolution.", 036 name = "modify", 037 metaschema = OscalProfileMetaschema.class 038) 039@AssemblyConstraints( 040 isUnique = @IsUnique(id = "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.") 041) 042public class Modify { 043 /** 044 * "A parameter setting, to be propagated to points of insertion." 045 */ 046 @BoundAssembly( 047 formalName = "Parameter Setting", 048 description = "A parameter setting, to be propagated to points of insertion.", 049 useName = "set-parameter", 050 maxOccurs = -1 051 ) 052 @GroupAs( 053 name = "set-parameters", 054 inJson = JsonGroupAsBehavior.LIST 055 ) 056 private List<ProfileSetParameter> _setParameters; 057 058 /** 059 * "Specifies changes to be made to an included control when a profile is resolved." 060 */ 061 @BoundAssembly( 062 formalName = "Alteration", 063 description = "Specifies changes to be made to an included control when a profile is resolved.", 064 useName = "alter", 065 maxOccurs = -1, 066 remarks = "Use `@control-id` to indicate the scope of alteration.\n" 067 + "\n" 068 + "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" 069 + "\n" 070 + "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." 071 ) 072 @GroupAs( 073 name = "alters", 074 inJson = JsonGroupAsBehavior.LIST 075 ) 076 private List<Alter> _alters; 077 078 public Modify() { 079 } 080 081 public List<ProfileSetParameter> getSetParameters() { 082 return _setParameters; 083 } 084 085 public void setSetParameters(List<ProfileSetParameter> value) { 086 _setParameters = value; 087 } 088 089 /** 090 * Add a new {@link ProfileSetParameter} item to the underlying collection. 091 * @param item the item to add 092 * @return {@code true} 093 */ 094 public boolean addSetParameter(ProfileSetParameter item) { 095 ProfileSetParameter value = ObjectUtils.requireNonNull(item,"item cannot be null"); 096 if (_setParameters == null) { 097 _setParameters = new LinkedList<>(); 098 } 099 return _setParameters.add(value); 100 } 101 102 /** 103 * Remove the first matching {@link ProfileSetParameter} item from the underlying collection. 104 * @param item the item to remove 105 * @return {@code true} if the item was removed or {@code false} otherwise 106 */ 107 public boolean removeSetParameter(ProfileSetParameter item) { 108 ProfileSetParameter value = ObjectUtils.requireNonNull(item,"item cannot be null"); 109 return _setParameters == null ? false : _setParameters.remove(value); 110 } 111 112 public List<Alter> getAlters() { 113 return _alters; 114 } 115 116 public void setAlters(List<Alter> value) { 117 _alters = value; 118 } 119 120 /** 121 * Add a new {@link Alter} item to the underlying collection. 122 * @param item the item to add 123 * @return {@code true} 124 */ 125 public boolean addAlter(Alter item) { 126 Alter value = ObjectUtils.requireNonNull(item,"item cannot be null"); 127 if (_alters == null) { 128 _alters = new LinkedList<>(); 129 } 130 return _alters.add(value); 131 } 132 133 /** 134 * Remove the first matching {@link Alter} item from the underlying collection. 135 * @param item the item to remove 136 * @return {@code true} if the item was removed or {@code false} otherwise 137 */ 138 public boolean removeAlter(Alter item) { 139 Alter value = ObjectUtils.requireNonNull(item,"item cannot be null"); 140 return _alters == null ? false : _alters.remove(value); 141 } 142 143 @Override 144 public String toString() { 145 return new ReflectionToStringBuilder(this, MultilineRecursiveToStringStyle.MULTI_LINE_STYLE).toString(); 146 } 147 148 /** 149 * Specifies changes to be made to an included control when a profile is resolved. 150 */ 151 @MetaschemaAssembly( 152 formalName = "Alteration", 153 description = "Specifies changes to be made to an included control when a profile is resolved.", 154 name = "alter", 155 metaschema = OscalProfileMetaschema.class, 156 remarks = "Use `@control-id` to indicate the scope of alteration.\n" 157 + "\n" 158 + "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" 159 + "\n" 160 + "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." 161 ) 162 public static class Alter { 163 @BoundFlag( 164 formalName = "Control Identifier Reference", 165 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).", 166 useName = "control-id", 167 required = true, 168 typeAdapter = TokenAdapter.class 169 ) 170 private String _controlId; 171 172 /** 173 * "Specifies objects to be removed from a control based on specific aspects of the object that must all match." 174 */ 175 @BoundAssembly( 176 formalName = "Removal", 177 description = "Specifies objects to be removed from a control based on specific aspects of the object that must all match.", 178 useName = "remove", 179 maxOccurs = -1, 180 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" 181 + "\n" 182 + "To change an element, use `remove` to remove the element, then `add` to add it back again with changes." 183 ) 184 @GroupAs( 185 name = "removes", 186 inJson = JsonGroupAsBehavior.LIST 187 ) 188 private List<Remove> _removes; 189 190 /** 191 * "Specifies contents to be added into controls, in resolution." 192 */ 193 @BoundAssembly( 194 formalName = "Addition", 195 description = "Specifies contents to be added into controls, in resolution.", 196 useName = "add", 197 maxOccurs = -1, 198 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" 199 + "\n" 200 + "`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." 201 ) 202 @GroupAs( 203 name = "adds", 204 inJson = JsonGroupAsBehavior.LIST 205 ) 206 private List<Add> _adds; 207 208 public Alter() { 209 } 210 211 public String getControlId() { 212 return _controlId; 213 } 214 215 public void setControlId(String value) { 216 _controlId = value; 217 } 218 219 public List<Remove> getRemoves() { 220 return _removes; 221 } 222 223 public void setRemoves(List<Remove> value) { 224 _removes = value; 225 } 226 227 /** 228 * Add a new {@link Remove} item to the underlying collection. 229 * @param item the item to add 230 * @return {@code true} 231 */ 232 public boolean addRemove(Remove item) { 233 Remove value = ObjectUtils.requireNonNull(item,"item cannot be null"); 234 if (_removes == null) { 235 _removes = new LinkedList<>(); 236 } 237 return _removes.add(value); 238 } 239 240 /** 241 * Remove the first matching {@link Remove} item from the underlying collection. 242 * @param item the item to remove 243 * @return {@code true} if the item was removed or {@code false} otherwise 244 */ 245 public boolean removeRemove(Remove item) { 246 Remove value = ObjectUtils.requireNonNull(item,"item cannot be null"); 247 return _removes == null ? false : _removes.remove(value); 248 } 249 250 public List<Add> getAdds() { 251 return _adds; 252 } 253 254 public void setAdds(List<Add> value) { 255 _adds = value; 256 } 257 258 /** 259 * Add a new {@link Add} item to the underlying collection. 260 * @param item the item to add 261 * @return {@code true} 262 */ 263 public boolean addAdd(Add item) { 264 Add value = ObjectUtils.requireNonNull(item,"item cannot be null"); 265 if (_adds == null) { 266 _adds = new LinkedList<>(); 267 } 268 return _adds.add(value); 269 } 270 271 /** 272 * Remove the first matching {@link Add} item from the underlying collection. 273 * @param item the item to remove 274 * @return {@code true} if the item was removed or {@code false} otherwise 275 */ 276 public boolean removeAdd(Add item) { 277 Add value = ObjectUtils.requireNonNull(item,"item cannot be null"); 278 return _adds == null ? false : _adds.remove(value); 279 } 280 281 @Override 282 public String toString() { 283 return new ReflectionToStringBuilder(this, MultilineRecursiveToStringStyle.MULTI_LINE_STYLE).toString(); 284 } 285 286 /** 287 * Specifies contents to be added into controls, in resolution. 288 */ 289 @MetaschemaAssembly( 290 formalName = "Addition", 291 description = "Specifies contents to be added into controls, in resolution.", 292 name = "add", 293 metaschema = OscalProfileMetaschema.class, 294 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" 295 + "\n" 296 + "`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." 297 ) 298 @ValueConstraints( 299 allowedValues = @AllowedValues(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.")}) 300 ) 301 public static class Add { 302 @BoundFlag( 303 formalName = "Position", 304 description = "Where to add the new content with respect to the targeted element (beside it or inside it).", 305 useName = "position", 306 typeAdapter = TokenAdapter.class 307 ) 308 @ValueConstraints( 309 allowedValues = @AllowedValues(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")}) 310 ) 311 private String _position; 312 313 @BoundFlag( 314 formalName = "Reference by ID", 315 description = "Target location of the addition.", 316 useName = "by-id", 317 typeAdapter = TokenAdapter.class 318 ) 319 private String _byId; 320 321 /** 322 * "A name given to the control, which may be used by a tool for display and navigation." 323 */ 324 @BoundField( 325 formalName = "Title Change", 326 description = "A name given to the control, which may be used by a tool for display and navigation.", 327 useName = "title" 328 ) 329 @BoundFieldValue( 330 typeAdapter = MarkupLineAdapter.class 331 ) 332 private MarkupLine _title; 333 334 @BoundAssembly( 335 formalName = "Parameter", 336 description = "Parameters provide a mechanism for the dynamic assignment of value(s) in a control.", 337 useName = "param", 338 maxOccurs = -1 339 ) 340 @GroupAs( 341 name = "params", 342 inJson = JsonGroupAsBehavior.LIST 343 ) 344 private List<Parameter> _params; 345 346 @BoundAssembly( 347 formalName = "Property", 348 description = "An attribute, characteristic, or quality of the containing object expressed as a namespace qualified name/value pair.", 349 useName = "prop", 350 maxOccurs = -1 351 ) 352 @GroupAs( 353 name = "props", 354 inJson = JsonGroupAsBehavior.LIST 355 ) 356 private List<Property> _props; 357 358 @BoundAssembly( 359 formalName = "Link", 360 description = "A reference to a local or remote resource, that has a specific relation to the containing object.", 361 useName = "link", 362 maxOccurs = -1 363 ) 364 @GroupAs( 365 name = "links", 366 inJson = JsonGroupAsBehavior.LIST 367 ) 368 private List<Link> _links; 369 370 @BoundAssembly( 371 formalName = "Part", 372 description = "An annotated, markup-based textual element of a control's or catalog group's definition, or a child of another part.", 373 useName = "part", 374 maxOccurs = -1 375 ) 376 @GroupAs( 377 name = "parts", 378 inJson = JsonGroupAsBehavior.LIST 379 ) 380 private List<ControlPart> _parts; 381 382 public Add() { 383 } 384 385 public String getPosition() { 386 return _position; 387 } 388 389 public void setPosition(String value) { 390 _position = value; 391 } 392 393 public String getById() { 394 return _byId; 395 } 396 397 public void setById(String value) { 398 _byId = value; 399 } 400 401 public MarkupLine getTitle() { 402 return _title; 403 } 404 405 public void setTitle(MarkupLine value) { 406 _title = value; 407 } 408 409 public List<Parameter> getParams() { 410 return _params; 411 } 412 413 public void setParams(List<Parameter> value) { 414 _params = value; 415 } 416 417 /** 418 * Add a new {@link Parameter} item to the underlying collection. 419 * @param item the item to add 420 * @return {@code true} 421 */ 422 public boolean addParam(Parameter item) { 423 Parameter value = ObjectUtils.requireNonNull(item,"item cannot be null"); 424 if (_params == null) { 425 _params = new LinkedList<>(); 426 } 427 return _params.add(value); 428 } 429 430 /** 431 * Remove the first matching {@link Parameter} item from the underlying collection. 432 * @param item the item to remove 433 * @return {@code true} if the item was removed or {@code false} otherwise 434 */ 435 public boolean removeParam(Parameter item) { 436 Parameter value = ObjectUtils.requireNonNull(item,"item cannot be null"); 437 return _params == null ? false : _params.remove(value); 438 } 439 440 public List<Property> getProps() { 441 return _props; 442 } 443 444 public void setProps(List<Property> value) { 445 _props = value; 446 } 447 448 /** 449 * Add a new {@link Property} item to the underlying collection. 450 * @param item the item to add 451 * @return {@code true} 452 */ 453 public boolean addProp(Property item) { 454 Property value = ObjectUtils.requireNonNull(item,"item cannot be null"); 455 if (_props == null) { 456 _props = new LinkedList<>(); 457 } 458 return _props.add(value); 459 } 460 461 /** 462 * Remove the first matching {@link Property} item from the underlying collection. 463 * @param item the item to remove 464 * @return {@code true} if the item was removed or {@code false} otherwise 465 */ 466 public boolean removeProp(Property item) { 467 Property value = ObjectUtils.requireNonNull(item,"item cannot be null"); 468 return _props == null ? false : _props.remove(value); 469 } 470 471 public List<Link> getLinks() { 472 return _links; 473 } 474 475 public void setLinks(List<Link> value) { 476 _links = value; 477 } 478 479 /** 480 * Add a new {@link Link} item to the underlying collection. 481 * @param item the item to add 482 * @return {@code true} 483 */ 484 public boolean addLink(Link item) { 485 Link value = ObjectUtils.requireNonNull(item,"item cannot be null"); 486 if (_links == null) { 487 _links = new LinkedList<>(); 488 } 489 return _links.add(value); 490 } 491 492 /** 493 * Remove the first matching {@link Link} item from the underlying collection. 494 * @param item the item to remove 495 * @return {@code true} if the item was removed or {@code false} otherwise 496 */ 497 public boolean removeLink(Link item) { 498 Link value = ObjectUtils.requireNonNull(item,"item cannot be null"); 499 return _links == null ? false : _links.remove(value); 500 } 501 502 public List<ControlPart> getParts() { 503 return _parts; 504 } 505 506 public void setParts(List<ControlPart> value) { 507 _parts = value; 508 } 509 510 /** 511 * Add a new {@link ControlPart} item to the underlying collection. 512 * @param item the item to add 513 * @return {@code true} 514 */ 515 public boolean addPart(ControlPart item) { 516 ControlPart value = ObjectUtils.requireNonNull(item,"item cannot be null"); 517 if (_parts == null) { 518 _parts = new LinkedList<>(); 519 } 520 return _parts.add(value); 521 } 522 523 /** 524 * Remove the first matching {@link ControlPart} item from the underlying collection. 525 * @param item the item to remove 526 * @return {@code true} if the item was removed or {@code false} otherwise 527 */ 528 public boolean removePart(ControlPart item) { 529 ControlPart value = ObjectUtils.requireNonNull(item,"item cannot be null"); 530 return _parts == null ? false : _parts.remove(value); 531 } 532 533 @Override 534 public String toString() { 535 return new ReflectionToStringBuilder(this, MultilineRecursiveToStringStyle.MULTI_LINE_STYLE).toString(); 536 } 537 } 538 539 /** 540 * Specifies objects to be removed from a control based on specific aspects of the object that must all match. 541 */ 542 @MetaschemaAssembly( 543 formalName = "Removal", 544 description = "Specifies objects to be removed from a control based on specific aspects of the object that must all match.", 545 name = "remove", 546 metaschema = OscalProfileMetaschema.class, 547 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" 548 + "\n" 549 + "To change an element, use `remove` to remove the element, then `add` to add it back again with changes." 550 ) 551 public static class Remove { 552 @BoundFlag( 553 formalName = "Reference by (assigned) name", 554 description = "Identify items remove by matching their assigned name.", 555 useName = "by-name", 556 typeAdapter = TokenAdapter.class 557 ) 558 private String _byName; 559 560 @BoundFlag( 561 formalName = "Reference by class", 562 description = "Identify items to remove by matching their `class`.", 563 useName = "by-class", 564 typeAdapter = TokenAdapter.class 565 ) 566 private String _byClass; 567 568 @BoundFlag( 569 formalName = "Reference by ID", 570 description = "Identify items to remove indicated by their `id`.", 571 useName = "by-id", 572 typeAdapter = TokenAdapter.class 573 ) 574 private String _byId; 575 576 @BoundFlag( 577 formalName = "Item Name Reference", 578 description = "Identify items to remove by the name of the item's information object name, e.g. `title` or `prop`.", 579 useName = "by-item-name", 580 typeAdapter = TokenAdapter.class 581 ) 582 @ValueConstraints( 583 allowedValues = @AllowedValues(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.")}) 584 ) 585 private String _byItemName; 586 587 @BoundFlag( 588 formalName = "Item Namespace Reference", 589 description = "Identify items to remove by the item's `ns`, which is the namespace associated with a `part`, or `prop`.", 590 useName = "by-ns", 591 typeAdapter = TokenAdapter.class 592 ) 593 private String _byNs; 594 595 public Remove() { 596 } 597 598 public String getByName() { 599 return _byName; 600 } 601 602 public void setByName(String value) { 603 _byName = value; 604 } 605 606 public String getByClass() { 607 return _byClass; 608 } 609 610 public void setByClass(String value) { 611 _byClass = value; 612 } 613 614 public String getById() { 615 return _byId; 616 } 617 618 public void setById(String value) { 619 _byId = value; 620 } 621 622 public String getByItemName() { 623 return _byItemName; 624 } 625 626 public void setByItemName(String value) { 627 _byItemName = value; 628 } 629 630 public String getByNs() { 631 return _byNs; 632 } 633 634 public void setByNs(String value) { 635 _byNs = value; 636 } 637 638 @Override 639 public String toString() { 640 return new ReflectionToStringBuilder(this, MultilineRecursiveToStringStyle.MULTI_LINE_STYLE).toString(); 641 } 642 } 643 } 644 645 /** 646 * A parameter setting, to be propagated to points of insertion. 647 */ 648 @MetaschemaAssembly( 649 formalName = "Parameter Setting", 650 description = "A parameter setting, to be propagated to points of insertion.", 651 name = "set-parameter", 652 metaschema = OscalProfileMetaschema.class 653 ) 654 public static class ProfileSetParameter { 655 @BoundFlag( 656 formalName = "Parameter ID", 657 description = "An identifier for the parameter.", 658 useName = "param-id", 659 required = true, 660 typeAdapter = TokenAdapter.class 661 ) 662 private String _paramId; 663 664 @BoundFlag( 665 formalName = "Parameter Class", 666 description = "A textual label that provides a characterization of the parameter.", 667 useName = "class", 668 typeAdapter = TokenAdapter.class, 669 remarks = "A `class` can be used in validation rules to express extra constraints over named items of a specific `class` value." 670 ) 671 private String _clazz; 672 673 @BoundFlag( 674 formalName = "Depends On", 675 description = "\\*\\*(deprecated)\\*\\* Another parameter invoking this one. This construct has been deprecated and should not be used.", 676 useName = "depends-on", 677 typeAdapter = TokenAdapter.class 678 ) 679 private String _dependsOn; 680 681 @BoundAssembly( 682 formalName = "Property", 683 description = "An attribute, characteristic, or quality of the containing object expressed as a namespace qualified name/value pair.", 684 useName = "prop", 685 maxOccurs = -1 686 ) 687 @GroupAs( 688 name = "props", 689 inJson = JsonGroupAsBehavior.LIST 690 ) 691 private List<Property> _props; 692 693 @BoundAssembly( 694 formalName = "Link", 695 description = "A reference to a local or remote resource, that has a specific relation to the containing object.", 696 useName = "link", 697 maxOccurs = -1 698 ) 699 @GroupAs( 700 name = "links", 701 inJson = JsonGroupAsBehavior.LIST 702 ) 703 private List<Link> _links; 704 705 /** 706 * "A short, placeholder name for the parameter, which can be used as a substitute for a <code>value</code> if no value is assigned." 707 */ 708 @BoundField( 709 formalName = "Parameter Label", 710 description = "A short, placeholder name for the parameter, which can be used as a substitute for a `value` if no value is assigned.", 711 useName = "label", 712 remarks = "The label value should be suitable for inline display in a rendered catalog." 713 ) 714 @BoundFieldValue( 715 typeAdapter = MarkupLineAdapter.class 716 ) 717 private MarkupLine _label; 718 719 /** 720 * "Describes the purpose and use of a parameter." 721 */ 722 @BoundField( 723 formalName = "Parameter Usage Description", 724 description = "Describes the purpose and use of a parameter.", 725 useName = "usage" 726 ) 727 @BoundFieldValue( 728 typeAdapter = MarkupMultilineAdapter.class 729 ) 730 private MarkupMultiline _usage; 731 732 @BoundAssembly( 733 formalName = "Constraint", 734 description = "A formal or informal expression of a constraint or test.", 735 useName = "constraint", 736 maxOccurs = -1 737 ) 738 @GroupAs( 739 name = "constraints", 740 inJson = JsonGroupAsBehavior.LIST 741 ) 742 private List<ParameterConstraint> _constraints; 743 744 @BoundAssembly( 745 formalName = "Guideline", 746 description = "A prose statement that provides a recommendation for the use of a parameter.", 747 useName = "guideline", 748 maxOccurs = -1 749 ) 750 @GroupAs( 751 name = "guidelines", 752 inJson = JsonGroupAsBehavior.LIST 753 ) 754 private List<ParameterGuideline> _guidelines; 755 756 @BoundField( 757 formalName = "Parameter Value", 758 description = "A parameter value or set of values.", 759 useName = "value", 760 maxOccurs = -1, 761 remarks = "Used to (re)define a parameter value." 762 ) 763 @GroupAs( 764 name = "values", 765 inJson = JsonGroupAsBehavior.LIST 766 ) 767 private List<String> _values; 768 769 @BoundAssembly( 770 formalName = "Selection", 771 description = "Presenting a choice among alternatives.", 772 useName = "select" 773 ) 774 private ParameterSelection _select; 775 776 public ProfileSetParameter() { 777 } 778 779 public String getParamId() { 780 return _paramId; 781 } 782 783 public void setParamId(String value) { 784 _paramId = value; 785 } 786 787 public String getClazz() { 788 return _clazz; 789 } 790 791 public void setClazz(String value) { 792 _clazz = value; 793 } 794 795 public String getDependsOn() { 796 return _dependsOn; 797 } 798 799 public void setDependsOn(String value) { 800 _dependsOn = value; 801 } 802 803 public List<Property> getProps() { 804 return _props; 805 } 806 807 public void setProps(List<Property> value) { 808 _props = value; 809 } 810 811 /** 812 * Add a new {@link Property} item to the underlying collection. 813 * @param item the item to add 814 * @return {@code true} 815 */ 816 public boolean addProp(Property item) { 817 Property value = ObjectUtils.requireNonNull(item,"item cannot be null"); 818 if (_props == null) { 819 _props = new LinkedList<>(); 820 } 821 return _props.add(value); 822 } 823 824 /** 825 * Remove the first matching {@link Property} item from the underlying collection. 826 * @param item the item to remove 827 * @return {@code true} if the item was removed or {@code false} otherwise 828 */ 829 public boolean removeProp(Property item) { 830 Property value = ObjectUtils.requireNonNull(item,"item cannot be null"); 831 return _props == null ? false : _props.remove(value); 832 } 833 834 public List<Link> getLinks() { 835 return _links; 836 } 837 838 public void setLinks(List<Link> value) { 839 _links = value; 840 } 841 842 /** 843 * Add a new {@link Link} item to the underlying collection. 844 * @param item the item to add 845 * @return {@code true} 846 */ 847 public boolean addLink(Link item) { 848 Link value = ObjectUtils.requireNonNull(item,"item cannot be null"); 849 if (_links == null) { 850 _links = new LinkedList<>(); 851 } 852 return _links.add(value); 853 } 854 855 /** 856 * Remove the first matching {@link Link} item from the underlying collection. 857 * @param item the item to remove 858 * @return {@code true} if the item was removed or {@code false} otherwise 859 */ 860 public boolean removeLink(Link item) { 861 Link value = ObjectUtils.requireNonNull(item,"item cannot be null"); 862 return _links == null ? false : _links.remove(value); 863 } 864 865 public MarkupLine getLabel() { 866 return _label; 867 } 868 869 public void setLabel(MarkupLine value) { 870 _label = value; 871 } 872 873 public MarkupMultiline getUsage() { 874 return _usage; 875 } 876 877 public void setUsage(MarkupMultiline value) { 878 _usage = value; 879 } 880 881 public List<ParameterConstraint> getConstraints() { 882 return _constraints; 883 } 884 885 public void setConstraints(List<ParameterConstraint> value) { 886 _constraints = value; 887 } 888 889 /** 890 * Add a new {@link ParameterConstraint} item to the underlying collection. 891 * @param item the item to add 892 * @return {@code true} 893 */ 894 public boolean addConstraint(ParameterConstraint item) { 895 ParameterConstraint value = ObjectUtils.requireNonNull(item,"item cannot be null"); 896 if (_constraints == null) { 897 _constraints = new LinkedList<>(); 898 } 899 return _constraints.add(value); 900 } 901 902 /** 903 * Remove the first matching {@link ParameterConstraint} item from the underlying collection. 904 * @param item the item to remove 905 * @return {@code true} if the item was removed or {@code false} otherwise 906 */ 907 public boolean removeConstraint(ParameterConstraint item) { 908 ParameterConstraint value = ObjectUtils.requireNonNull(item,"item cannot be null"); 909 return _constraints == null ? false : _constraints.remove(value); 910 } 911 912 public List<ParameterGuideline> getGuidelines() { 913 return _guidelines; 914 } 915 916 public void setGuidelines(List<ParameterGuideline> value) { 917 _guidelines = value; 918 } 919 920 /** 921 * Add a new {@link ParameterGuideline} item to the underlying collection. 922 * @param item the item to add 923 * @return {@code true} 924 */ 925 public boolean addGuideline(ParameterGuideline item) { 926 ParameterGuideline value = ObjectUtils.requireNonNull(item,"item cannot be null"); 927 if (_guidelines == null) { 928 _guidelines = new LinkedList<>(); 929 } 930 return _guidelines.add(value); 931 } 932 933 /** 934 * Remove the first matching {@link ParameterGuideline} item from the underlying collection. 935 * @param item the item to remove 936 * @return {@code true} if the item was removed or {@code false} otherwise 937 */ 938 public boolean removeGuideline(ParameterGuideline item) { 939 ParameterGuideline value = ObjectUtils.requireNonNull(item,"item cannot be null"); 940 return _guidelines == null ? false : _guidelines.remove(value); 941 } 942 943 public List<String> getValues() { 944 return _values; 945 } 946 947 public void setValues(List<String> value) { 948 _values = value; 949 } 950 951 /** 952 * Add a new {@link String} item to the underlying collection. 953 * @param item the item to add 954 * @return {@code true} 955 */ 956 public boolean addValue(String item) { 957 String value = ObjectUtils.requireNonNull(item,"item cannot be null"); 958 if (_values == null) { 959 _values = new LinkedList<>(); 960 } 961 return _values.add(value); 962 } 963 964 /** 965 * Remove the first matching {@link String} item from the underlying collection. 966 * @param item the item to remove 967 * @return {@code true} if the item was removed or {@code false} otherwise 968 */ 969 public boolean removeValue(String item) { 970 String value = ObjectUtils.requireNonNull(item,"item cannot be null"); 971 return _values == null ? false : _values.remove(value); 972 } 973 974 public ParameterSelection getSelect() { 975 return _select; 976 } 977 978 public void setSelect(ParameterSelection value) { 979 _select = value; 980 } 981 982 @Override 983 public String toString() { 984 return new ReflectionToStringBuilder(this, MultilineRecursiveToStringStyle.MULTI_LINE_STYLE).toString(); 985 } 986 } 987}