001// Generated from: ../../../../../../../../oscal/src/metaschema/oscal_assessment-common_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.TokenAdapter; 006import dev.metaschema.core.datatype.adapter.UuidAdapter; 007import dev.metaschema.core.datatype.markup.MarkupLine; 008import dev.metaschema.core.datatype.markup.MarkupLineAdapter; 009import dev.metaschema.core.datatype.markup.MarkupMultiline; 010import dev.metaschema.core.datatype.markup.MarkupMultilineAdapter; 011import dev.metaschema.core.model.IBoundObject; 012import dev.metaschema.core.model.IMetaschemaData; 013import dev.metaschema.core.model.JsonGroupAsBehavior; 014import dev.metaschema.core.model.constraint.IConstraint; 015import dev.metaschema.core.util.ObjectUtils; 016import dev.metaschema.databind.model.annotations.AllowedValue; 017import dev.metaschema.databind.model.annotations.AllowedValues; 018import dev.metaschema.databind.model.annotations.BoundAssembly; 019import dev.metaschema.databind.model.annotations.BoundField; 020import dev.metaschema.databind.model.annotations.BoundFlag; 021import dev.metaschema.databind.model.annotations.GroupAs; 022import dev.metaschema.databind.model.annotations.MetaschemaAssembly; 023import dev.metaschema.databind.model.annotations.ValueConstraints; 024import edu.umd.cs.findbugs.annotations.NonNull; 025import edu.umd.cs.findbugs.annotations.Nullable; 026import java.util.LinkedList; 027import java.util.List; 028import java.util.UUID; 029import org.apache.commons.lang3.builder.ReflectionToStringBuilder; 030import org.apache.commons.lang3.builder.ToStringStyle; 031 032/** 033 * Describes either recommended or an actual plan for addressing the risk. 034 */ 035@MetaschemaAssembly( 036 formalName = "Risk Response", 037 description = "Describes either recommended or an actual plan for addressing the risk.", 038 name = "response", 039 moduleClass = OscalAssessmentCommonModule.class, 040 valueConstraints = @ValueConstraints(allowedValues = {@AllowedValues(id = "oscal-response-prop-name", level = IConstraint.Level.ERROR, target = "prop[has-oscal-namespace('http://csrc.nist.gov/ns/oscal')]/@name", values = @AllowedValue(value = "type", description = "Risk Response Type")), @AllowedValues(id = "oscal-response-prop-type-value", level = IConstraint.Level.ERROR, target = "prop[has-oscal-namespace('http://csrc.nist.gov/ns/oscal') and @name='type']/@value", values = {@AllowedValue(value = "avoid", description = "The risk will be eliminated."), @AllowedValue(value = "mitigate", description = "The risk will be reduced."), @AllowedValue(value = "transfer", description = "The risk will be transferred to another organization or entity."), @AllowedValue(value = "accept", description = "The risk will continue to exist without further efforts to address it. (Sometimes referred to as \"Operationally required\")"), @AllowedValue(value = "share", description = "The risk will be partially transferred to another organization or entity."), @AllowedValue(value = "contingency", description = "Plans will be made to address the risk impact if the risk occurs. (This is a form of mitigation.)"), @AllowedValue(value = "none", description = "No response, such as when the identified risk is found to be a false positive.")})}) 041) 042public class Response implements IBoundObject { 043 private final IMetaschemaData __metaschemaData; 044 045 /** 046 * A <a href="https://pages.nist.gov/OSCAL/concepts/identifier-use/#machine-oriented">machine-oriented</a>, <a href="https://pages.nist.gov/OSCAL/concepts/identifier-use/#globally-unique">globally unique</a> identifier with <a href="https://pages.nist.gov/OSCAL/concepts/identifier-use/#cross-instance">cross-instance</a> scope that can be used to reference this remediation elsewhere in <a href="https://pages.nist.gov/OSCAL/concepts/identifier-use/#scope">this or other OSCAL instances</a>. The locally defined <em>UUID</em> of the <code>risk response</code> can be used to reference the data item locally or globally (e.g., in an imported OSCAL instance). This UUID should be assigned <a href="https://pages.nist.gov/OSCAL/concepts/identifier-use/#consistency">per-subject</a>, which means it should be consistently used to identify the same subject across revisions of the document. 047 */ 048 @BoundFlag( 049 formalName = "Remediation Universally Unique Identifier", 050 description = "A [machine-oriented](https://pages.nist.gov/OSCAL/concepts/identifier-use/#machine-oriented), [globally unique](https://pages.nist.gov/OSCAL/concepts/identifier-use/#globally-unique) identifier with [cross-instance](https://pages.nist.gov/OSCAL/concepts/identifier-use/#cross-instance) scope that can be used to reference this remediation elsewhere in [this or other OSCAL instances](https://pages.nist.gov/OSCAL/concepts/identifier-use/#scope). The locally defined *UUID* of the `risk response` can be used to reference the data item locally or globally (e.g., in an imported OSCAL instance). This UUID should be assigned [per-subject](https://pages.nist.gov/OSCAL/concepts/identifier-use/#consistency), which means it should be consistently used to identify the same subject across revisions of the document.", 051 name = "uuid", 052 required = true, 053 typeAdapter = UuidAdapter.class 054 ) 055 private UUID _uuid; 056 057 /** 058 * Identifies whether this is a recommendation, such as from an assessor or tool, or an actual plan accepted by the system owner. 059 */ 060 @BoundFlag( 061 formalName = "Remediation Intent", 062 description = "Identifies whether this is a recommendation, such as from an assessor or tool, or an actual plan accepted by the system owner.", 063 name = "lifecycle", 064 required = true, 065 typeAdapter = TokenAdapter.class, 066 valueConstraints = @ValueConstraints(allowedValues = @AllowedValues(id = "oscal-response-lifecycle-values", level = IConstraint.Level.ERROR, allowOthers = true, values = {@AllowedValue(value = "recommendation", description = "Recommended remediation."), @AllowedValue(value = "planned", description = "The actions intended to resolve the risk."), @AllowedValue(value = "completed", description = "This remediation activities were performed to address the risk.")})) 067 ) 068 private String _lifecycle; 069 070 /** 071 * The title for this response activity. 072 */ 073 @BoundField( 074 formalName = "Response Title", 075 description = "The title for this response activity.", 076 useName = "title", 077 minOccurs = 1, 078 typeAdapter = MarkupLineAdapter.class 079 ) 080 private MarkupLine _title; 081 082 /** 083 * A human-readable description of this response plan. 084 */ 085 @BoundField( 086 formalName = "Response Description", 087 description = "A human-readable description of this response plan.", 088 useName = "description", 089 minOccurs = 1, 090 typeAdapter = MarkupMultilineAdapter.class 091 ) 092 private MarkupMultiline _description; 093 094 /** 095 * An attribute, characteristic, or quality of the containing object expressed as a namespace qualified name/value pair. 096 */ 097 @BoundAssembly( 098 formalName = "Property", 099 description = "An attribute, characteristic, or quality of the containing object expressed as a namespace qualified name/value pair.", 100 useName = "prop", 101 maxOccurs = -1, 102 groupAs = @GroupAs(name = "props", inJson = JsonGroupAsBehavior.LIST) 103 ) 104 private List<Property> _props; 105 106 /** 107 * A reference to a local or remote resource, that has a specific relation to the containing object. 108 */ 109 @BoundAssembly( 110 formalName = "Link", 111 description = "A reference to a local or remote resource, that has a specific relation to the containing object.", 112 useName = "link", 113 maxOccurs = -1, 114 groupAs = @GroupAs(name = "links", inJson = JsonGroupAsBehavior.LIST) 115 ) 116 private List<Link> _links; 117 118 /** 119 * Identifies the source of the finding, such as a tool, interviewed person, or activity. 120 */ 121 @BoundAssembly( 122 formalName = "Origin", 123 description = "Identifies the source of the finding, such as a tool, interviewed person, or activity.", 124 useName = "origin", 125 remarks = "Used to identify the individual and/or tool that generated this recommended or planned response.", 126 maxOccurs = -1, 127 groupAs = @GroupAs(name = "origins", inJson = JsonGroupAsBehavior.LIST) 128 ) 129 private List<Origin> _origins; 130 131 /** 132 * Identifies an asset required to achieve remediation. 133 */ 134 @BoundAssembly( 135 formalName = "Required Asset", 136 description = "Identifies an asset required to achieve remediation.", 137 useName = "required-asset", 138 maxOccurs = -1, 139 groupAs = @GroupAs(name = "required-assets", inJson = JsonGroupAsBehavior.LIST) 140 ) 141 private List<RequiredAsset> _requiredAssets; 142 143 /** 144 * Represents a scheduled event or milestone, which may be associated with a series of assessment actions. 145 */ 146 @BoundAssembly( 147 formalName = "Task", 148 description = "Represents a scheduled event or milestone, which may be associated with a series of assessment actions.", 149 useName = "task", 150 maxOccurs = -1, 151 groupAs = @GroupAs(name = "tasks", inJson = JsonGroupAsBehavior.LIST) 152 ) 153 private List<Task> _tasks; 154 155 /** 156 * Additional commentary about the containing object. 157 */ 158 @BoundField( 159 formalName = "Remarks", 160 description = "Additional commentary about the containing object.", 161 useName = "remarks", 162 typeAdapter = MarkupMultilineAdapter.class 163 ) 164 private MarkupMultiline _remarks; 165 166 /** 167 * Constructs a new {@code dev.metaschema.oscal.lib.model.Response} instance with no metadata. 168 */ 169 public Response() { 170 this(null); 171 } 172 173 /** 174 * Constructs a new {@code dev.metaschema.oscal.lib.model.Response} instance with the specified metadata. 175 * 176 * @param data 177 * the metaschema data, or {@code null} if none 178 */ 179 public Response(IMetaschemaData data) { 180 this.__metaschemaData = data; 181 } 182 183 @Override 184 public IMetaschemaData getMetaschemaData() { 185 return __metaschemaData; 186 } 187 188 /** 189 * Get the "{@literal Remediation Universally Unique Identifier}". 190 * 191 * <p> 192 * A <a href="https://pages.nist.gov/OSCAL/concepts/identifier-use/#machine-oriented">machine-oriented</a>, <a href="https://pages.nist.gov/OSCAL/concepts/identifier-use/#globally-unique">globally unique</a> identifier with <a href="https://pages.nist.gov/OSCAL/concepts/identifier-use/#cross-instance">cross-instance</a> scope that can be used to reference this remediation elsewhere in <a href="https://pages.nist.gov/OSCAL/concepts/identifier-use/#scope">this or other OSCAL instances</a>. The locally defined <em>UUID</em> of the <code>risk response</code> can be used to reference the data item locally or globally (e.g., in an imported OSCAL instance). This UUID should be assigned <a href="https://pages.nist.gov/OSCAL/concepts/identifier-use/#consistency">per-subject</a>, which means it should be consistently used to identify the same subject across revisions of the document. 193 * 194 * @return the uuid value 195 */ 196 @NonNull 197 public UUID getUuid() { 198 return _uuid; 199 } 200 201 /** 202 * Set the "{@literal Remediation Universally Unique Identifier}". 203 * 204 * <p> 205 * A <a href="https://pages.nist.gov/OSCAL/concepts/identifier-use/#machine-oriented">machine-oriented</a>, <a href="https://pages.nist.gov/OSCAL/concepts/identifier-use/#globally-unique">globally unique</a> identifier with <a href="https://pages.nist.gov/OSCAL/concepts/identifier-use/#cross-instance">cross-instance</a> scope that can be used to reference this remediation elsewhere in <a href="https://pages.nist.gov/OSCAL/concepts/identifier-use/#scope">this or other OSCAL instances</a>. The locally defined <em>UUID</em> of the <code>risk response</code> can be used to reference the data item locally or globally (e.g., in an imported OSCAL instance). This UUID should be assigned <a href="https://pages.nist.gov/OSCAL/concepts/identifier-use/#consistency">per-subject</a>, which means it should be consistently used to identify the same subject across revisions of the document. 206 * 207 * @param value 208 * the uuid value to set 209 */ 210 public void setUuid(@NonNull UUID value) { 211 _uuid = value; 212 } 213 214 /** 215 * Get the "{@literal Remediation Intent}". 216 * 217 * <p> 218 * Identifies whether this is a recommendation, such as from an assessor or tool, or an actual plan accepted by the system owner. 219 * 220 * @return the lifecycle value 221 */ 222 @NonNull 223 public String getLifecycle() { 224 return _lifecycle; 225 } 226 227 /** 228 * Set the "{@literal Remediation Intent}". 229 * 230 * <p> 231 * Identifies whether this is a recommendation, such as from an assessor or tool, or an actual plan accepted by the system owner. 232 * 233 * @param value 234 * the lifecycle value to set 235 */ 236 public void setLifecycle(@NonNull String value) { 237 _lifecycle = value; 238 } 239 240 /** 241 * Get the "{@literal Response Title}". 242 * 243 * <p> 244 * The title for this response activity. 245 * 246 * @return the title value 247 */ 248 @NonNull 249 public MarkupLine getTitle() { 250 return _title; 251 } 252 253 /** 254 * Set the "{@literal Response Title}". 255 * 256 * <p> 257 * The title for this response activity. 258 * 259 * @param value 260 * the title value to set 261 */ 262 public void setTitle(@NonNull MarkupLine value) { 263 _title = value; 264 } 265 266 /** 267 * Get the "{@literal Response Description}". 268 * 269 * <p> 270 * A human-readable description of this response plan. 271 * 272 * @return the description value 273 */ 274 @NonNull 275 public MarkupMultiline getDescription() { 276 return _description; 277 } 278 279 /** 280 * Set the "{@literal Response Description}". 281 * 282 * <p> 283 * A human-readable description of this response plan. 284 * 285 * @param value 286 * the description value to set 287 */ 288 public void setDescription(@NonNull MarkupMultiline value) { 289 _description = value; 290 } 291 292 /** 293 * Get the "{@literal Property}". 294 * 295 * <p> 296 * An attribute, characteristic, or quality of the containing object expressed as a namespace qualified name/value pair. 297 * 298 * @return the prop value 299 */ 300 @NonNull 301 public List<Property> getProps() { 302 if (_props == null) { 303 _props = new LinkedList<>(); 304 } 305 return ObjectUtils.notNull(_props); 306 } 307 308 /** 309 * Set the "{@literal Property}". 310 * 311 * <p> 312 * An attribute, characteristic, or quality of the containing object expressed as a namespace qualified name/value pair. 313 * 314 * @param value 315 * the prop value to set 316 */ 317 public void setProps(@NonNull List<Property> value) { 318 _props = value; 319 } 320 321 /** 322 * Add a new {@link Property} item to the underlying collection. 323 * @param item the item to add 324 * @return {@code true} 325 */ 326 public boolean addProp(Property item) { 327 Property value = ObjectUtils.requireNonNull(item,"item cannot be null"); 328 if (_props == null) { 329 _props = new LinkedList<>(); 330 } 331 return _props.add(value); 332 } 333 334 /** 335 * Remove the first matching {@link Property} item from the underlying collection. 336 * @param item the item to remove 337 * @return {@code true} if the item was removed or {@code false} otherwise 338 */ 339 public boolean removeProp(Property item) { 340 Property value = ObjectUtils.requireNonNull(item,"item cannot be null"); 341 return _props != null && _props.remove(value); 342 } 343 344 /** 345 * Get the "{@literal Link}". 346 * 347 * <p> 348 * A reference to a local or remote resource, that has a specific relation to the containing object. 349 * 350 * @return the link value 351 */ 352 @NonNull 353 public List<Link> getLinks() { 354 if (_links == null) { 355 _links = new LinkedList<>(); 356 } 357 return ObjectUtils.notNull(_links); 358 } 359 360 /** 361 * Set the "{@literal Link}". 362 * 363 * <p> 364 * A reference to a local or remote resource, that has a specific relation to the containing object. 365 * 366 * @param value 367 * the link value to set 368 */ 369 public void setLinks(@NonNull List<Link> value) { 370 _links = value; 371 } 372 373 /** 374 * Add a new {@link Link} item to the underlying collection. 375 * @param item the item to add 376 * @return {@code true} 377 */ 378 public boolean addLink(Link item) { 379 Link value = ObjectUtils.requireNonNull(item,"item cannot be null"); 380 if (_links == null) { 381 _links = new LinkedList<>(); 382 } 383 return _links.add(value); 384 } 385 386 /** 387 * Remove the first matching {@link Link} item from the underlying collection. 388 * @param item the item to remove 389 * @return {@code true} if the item was removed or {@code false} otherwise 390 */ 391 public boolean removeLink(Link item) { 392 Link value = ObjectUtils.requireNonNull(item,"item cannot be null"); 393 return _links != null && _links.remove(value); 394 } 395 396 /** 397 * Get the "{@literal Origin}". 398 * 399 * <p> 400 * Identifies the source of the finding, such as a tool, interviewed person, or activity. 401 * 402 * @return the origin value 403 */ 404 @NonNull 405 public List<Origin> getOrigins() { 406 if (_origins == null) { 407 _origins = new LinkedList<>(); 408 } 409 return ObjectUtils.notNull(_origins); 410 } 411 412 /** 413 * Set the "{@literal Origin}". 414 * 415 * <p> 416 * Identifies the source of the finding, such as a tool, interviewed person, or activity. 417 * 418 * @param value 419 * the origin value to set 420 */ 421 public void setOrigins(@NonNull List<Origin> value) { 422 _origins = value; 423 } 424 425 /** 426 * Add a new {@link Origin} item to the underlying collection. 427 * @param item the item to add 428 * @return {@code true} 429 */ 430 public boolean addOrigin(Origin item) { 431 Origin value = ObjectUtils.requireNonNull(item,"item cannot be null"); 432 if (_origins == null) { 433 _origins = new LinkedList<>(); 434 } 435 return _origins.add(value); 436 } 437 438 /** 439 * Remove the first matching {@link Origin} item from the underlying collection. 440 * @param item the item to remove 441 * @return {@code true} if the item was removed or {@code false} otherwise 442 */ 443 public boolean removeOrigin(Origin item) { 444 Origin value = ObjectUtils.requireNonNull(item,"item cannot be null"); 445 return _origins != null && _origins.remove(value); 446 } 447 448 /** 449 * Get the "{@literal Required Asset}". 450 * 451 * <p> 452 * Identifies an asset required to achieve remediation. 453 * 454 * @return the required-asset value 455 */ 456 @NonNull 457 public List<RequiredAsset> getRequiredAssets() { 458 if (_requiredAssets == null) { 459 _requiredAssets = new LinkedList<>(); 460 } 461 return ObjectUtils.notNull(_requiredAssets); 462 } 463 464 /** 465 * Set the "{@literal Required Asset}". 466 * 467 * <p> 468 * Identifies an asset required to achieve remediation. 469 * 470 * @param value 471 * the required-asset value to set 472 */ 473 public void setRequiredAssets(@NonNull List<RequiredAsset> value) { 474 _requiredAssets = value; 475 } 476 477 /** 478 * Add a new {@link RequiredAsset} item to the underlying collection. 479 * @param item the item to add 480 * @return {@code true} 481 */ 482 public boolean addRequiredAsset(RequiredAsset item) { 483 RequiredAsset value = ObjectUtils.requireNonNull(item,"item cannot be null"); 484 if (_requiredAssets == null) { 485 _requiredAssets = new LinkedList<>(); 486 } 487 return _requiredAssets.add(value); 488 } 489 490 /** 491 * Remove the first matching {@link RequiredAsset} item from the underlying collection. 492 * @param item the item to remove 493 * @return {@code true} if the item was removed or {@code false} otherwise 494 */ 495 public boolean removeRequiredAsset(RequiredAsset item) { 496 RequiredAsset value = ObjectUtils.requireNonNull(item,"item cannot be null"); 497 return _requiredAssets != null && _requiredAssets.remove(value); 498 } 499 500 /** 501 * Get the "{@literal Task}". 502 * 503 * <p> 504 * Represents a scheduled event or milestone, which may be associated with a series of assessment actions. 505 * 506 * @return the task value 507 */ 508 @NonNull 509 public List<Task> getTasks() { 510 if (_tasks == null) { 511 _tasks = new LinkedList<>(); 512 } 513 return ObjectUtils.notNull(_tasks); 514 } 515 516 /** 517 * Set the "{@literal Task}". 518 * 519 * <p> 520 * Represents a scheduled event or milestone, which may be associated with a series of assessment actions. 521 * 522 * @param value 523 * the task value to set 524 */ 525 public void setTasks(@NonNull List<Task> value) { 526 _tasks = value; 527 } 528 529 /** 530 * Add a new {@link Task} item to the underlying collection. 531 * @param item the item to add 532 * @return {@code true} 533 */ 534 public boolean addTask(Task item) { 535 Task value = ObjectUtils.requireNonNull(item,"item cannot be null"); 536 if (_tasks == null) { 537 _tasks = new LinkedList<>(); 538 } 539 return _tasks.add(value); 540 } 541 542 /** 543 * Remove the first matching {@link Task} item from the underlying collection. 544 * @param item the item to remove 545 * @return {@code true} if the item was removed or {@code false} otherwise 546 */ 547 public boolean removeTask(Task item) { 548 Task value = ObjectUtils.requireNonNull(item,"item cannot be null"); 549 return _tasks != null && _tasks.remove(value); 550 } 551 552 /** 553 * Get the "{@literal Remarks}". 554 * 555 * <p> 556 * Additional commentary about the containing object. 557 * 558 * @return the remarks value, or {@code null} if not set 559 */ 560 @Nullable 561 public MarkupMultiline getRemarks() { 562 return _remarks; 563 } 564 565 /** 566 * Set the "{@literal Remarks}". 567 * 568 * <p> 569 * Additional commentary about the containing object. 570 * 571 * @param value 572 * the remarks value to set, or {@code null} to clear 573 */ 574 public void setRemarks(@Nullable MarkupMultiline value) { 575 _remarks = value; 576 } 577 578 @Override 579 public String toString() { 580 return ObjectUtils.notNull(new ReflectionToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).toString()); 581 } 582 583 /** 584 * Identifies an asset required to achieve remediation. 585 */ 586 @MetaschemaAssembly( 587 formalName = "Required Asset", 588 description = "Identifies an asset required to achieve remediation.", 589 name = "required-asset", 590 moduleClass = OscalAssessmentCommonModule.class 591 ) 592 public static class RequiredAsset implements IBoundObject { 593 private final IMetaschemaData __metaschemaData; 594 595 /** 596 * A <a href="https://pages.nist.gov/OSCAL/concepts/identifier-use/#machine-oriented">machine-oriented</a>, <a href="https://pages.nist.gov/OSCAL/concepts/identifier-use/#globally-unique">globally unique</a> identifier with <a href="https://pages.nist.gov/OSCAL/concepts/identifier-use/#cross-instance">cross-instance</a> scope that can be used to reference this required asset elsewhere in <a href="https://pages.nist.gov/OSCAL/concepts/identifier-use/#scope">this or other OSCAL instances</a>. The locally defined <em>UUID</em> of the <code>asset</code> can be used to reference the data item locally or globally (e.g., in an imported OSCAL instance). This UUID should be assigned <a href="https://pages.nist.gov/OSCAL/concepts/identifier-use/#consistency">per-subject</a>, which means it should be consistently used to identify the same subject across revisions of the document. 597 */ 598 @BoundFlag( 599 formalName = "Required Universally Unique Identifier", 600 description = "A [machine-oriented](https://pages.nist.gov/OSCAL/concepts/identifier-use/#machine-oriented), [globally unique](https://pages.nist.gov/OSCAL/concepts/identifier-use/#globally-unique) identifier with [cross-instance](https://pages.nist.gov/OSCAL/concepts/identifier-use/#cross-instance) scope that can be used to reference this required asset elsewhere in [this or other OSCAL instances](https://pages.nist.gov/OSCAL/concepts/identifier-use/#scope). The locally defined *UUID* of the `asset` can be used to reference the data item locally or globally (e.g., in an imported OSCAL instance). This UUID should be assigned [per-subject](https://pages.nist.gov/OSCAL/concepts/identifier-use/#consistency), which means it should be consistently used to identify the same subject across revisions of the document.", 601 name = "uuid", 602 required = true, 603 typeAdapter = UuidAdapter.class 604 ) 605 private UUID _uuid; 606 607 /** 608 * A <a href="https://pages.nist.gov/OSCAL/concepts/identifier-use/#human-oriented">human-oriented</a> identifier reference to a resource. Use type to indicate whether the identified resource is a component, inventory item, location, user, or something else. 609 */ 610 @BoundAssembly( 611 formalName = "Identifies the Subject", 612 description = "A [human-oriented](https://pages.nist.gov/OSCAL/concepts/identifier-use/#human-oriented) identifier reference to a resource. Use type to indicate whether the identified resource is a component, inventory item, location, user, or something else.", 613 useName = "subject", 614 remarks = "Identifies an asset associated with this requirement, such as a party, system component, or inventory-item.", 615 maxOccurs = -1, 616 groupAs = @GroupAs(name = "subjects", inJson = JsonGroupAsBehavior.LIST) 617 ) 618 private List<SubjectReference> _subjects; 619 620 /** 621 * The title for this required asset. 622 */ 623 @BoundField( 624 formalName = "Title for Required Asset", 625 description = "The title for this required asset.", 626 useName = "title", 627 typeAdapter = MarkupLineAdapter.class 628 ) 629 private MarkupLine _title; 630 631 /** 632 * A human-readable description of this required asset. 633 */ 634 @BoundField( 635 formalName = "Description of Required Asset", 636 description = "A human-readable description of this required asset.", 637 useName = "description", 638 minOccurs = 1, 639 typeAdapter = MarkupMultilineAdapter.class 640 ) 641 private MarkupMultiline _description; 642 643 /** 644 * An attribute, characteristic, or quality of the containing object expressed as a namespace qualified name/value pair. 645 */ 646 @BoundAssembly( 647 formalName = "Property", 648 description = "An attribute, characteristic, or quality of the containing object expressed as a namespace qualified name/value pair.", 649 useName = "prop", 650 maxOccurs = -1, 651 groupAs = @GroupAs(name = "props", inJson = JsonGroupAsBehavior.LIST) 652 ) 653 private List<Property> _props; 654 655 /** 656 * A reference to a local or remote resource, that has a specific relation to the containing object. 657 */ 658 @BoundAssembly( 659 formalName = "Link", 660 description = "A reference to a local or remote resource, that has a specific relation to the containing object.", 661 useName = "link", 662 maxOccurs = -1, 663 groupAs = @GroupAs(name = "links", inJson = JsonGroupAsBehavior.LIST) 664 ) 665 private List<Link> _links; 666 667 /** 668 * Additional commentary about the containing object. 669 */ 670 @BoundField( 671 formalName = "Remarks", 672 description = "Additional commentary about the containing object.", 673 useName = "remarks", 674 typeAdapter = MarkupMultilineAdapter.class 675 ) 676 private MarkupMultiline _remarks; 677 678 /** 679 * Constructs a new {@code dev.metaschema.oscal.lib.model.Response.RequiredAsset} instance with no metadata. 680 */ 681 public RequiredAsset() { 682 this(null); 683 } 684 685 /** 686 * Constructs a new {@code dev.metaschema.oscal.lib.model.Response.RequiredAsset} instance with the specified metadata. 687 * 688 * @param data 689 * the metaschema data, or {@code null} if none 690 */ 691 public RequiredAsset(IMetaschemaData data) { 692 this.__metaschemaData = data; 693 } 694 695 @Override 696 public IMetaschemaData getMetaschemaData() { 697 return __metaschemaData; 698 } 699 700 /** 701 * Get the "{@literal Required Universally Unique Identifier}". 702 * 703 * <p> 704 * A <a href="https://pages.nist.gov/OSCAL/concepts/identifier-use/#machine-oriented">machine-oriented</a>, <a href="https://pages.nist.gov/OSCAL/concepts/identifier-use/#globally-unique">globally unique</a> identifier with <a href="https://pages.nist.gov/OSCAL/concepts/identifier-use/#cross-instance">cross-instance</a> scope that can be used to reference this required asset elsewhere in <a href="https://pages.nist.gov/OSCAL/concepts/identifier-use/#scope">this or other OSCAL instances</a>. The locally defined <em>UUID</em> of the <code>asset</code> can be used to reference the data item locally or globally (e.g., in an imported OSCAL instance). This UUID should be assigned <a href="https://pages.nist.gov/OSCAL/concepts/identifier-use/#consistency">per-subject</a>, which means it should be consistently used to identify the same subject across revisions of the document. 705 * 706 * @return the uuid value 707 */ 708 @NonNull 709 public UUID getUuid() { 710 return _uuid; 711 } 712 713 /** 714 * Set the "{@literal Required Universally Unique Identifier}". 715 * 716 * <p> 717 * A <a href="https://pages.nist.gov/OSCAL/concepts/identifier-use/#machine-oriented">machine-oriented</a>, <a href="https://pages.nist.gov/OSCAL/concepts/identifier-use/#globally-unique">globally unique</a> identifier with <a href="https://pages.nist.gov/OSCAL/concepts/identifier-use/#cross-instance">cross-instance</a> scope that can be used to reference this required asset elsewhere in <a href="https://pages.nist.gov/OSCAL/concepts/identifier-use/#scope">this or other OSCAL instances</a>. The locally defined <em>UUID</em> of the <code>asset</code> can be used to reference the data item locally or globally (e.g., in an imported OSCAL instance). This UUID should be assigned <a href="https://pages.nist.gov/OSCAL/concepts/identifier-use/#consistency">per-subject</a>, which means it should be consistently used to identify the same subject across revisions of the document. 718 * 719 * @param value 720 * the uuid value to set 721 */ 722 public void setUuid(@NonNull UUID value) { 723 _uuid = value; 724 } 725 726 /** 727 * Get the "{@literal Identifies the Subject}". 728 * 729 * <p> 730 * A <a href="https://pages.nist.gov/OSCAL/concepts/identifier-use/#human-oriented">human-oriented</a> identifier reference to a resource. Use type to indicate whether the identified resource is a component, inventory item, location, user, or something else. 731 * 732 * @return the subject value 733 */ 734 @NonNull 735 public List<SubjectReference> getSubjects() { 736 if (_subjects == null) { 737 _subjects = new LinkedList<>(); 738 } 739 return ObjectUtils.notNull(_subjects); 740 } 741 742 /** 743 * Set the "{@literal Identifies the Subject}". 744 * 745 * <p> 746 * A <a href="https://pages.nist.gov/OSCAL/concepts/identifier-use/#human-oriented">human-oriented</a> identifier reference to a resource. Use type to indicate whether the identified resource is a component, inventory item, location, user, or something else. 747 * 748 * @param value 749 * the subject value to set 750 */ 751 public void setSubjects(@NonNull List<SubjectReference> value) { 752 _subjects = value; 753 } 754 755 /** 756 * Add a new {@link SubjectReference} item to the underlying collection. 757 * @param item the item to add 758 * @return {@code true} 759 */ 760 public boolean addSubject(SubjectReference item) { 761 SubjectReference value = ObjectUtils.requireNonNull(item,"item cannot be null"); 762 if (_subjects == null) { 763 _subjects = new LinkedList<>(); 764 } 765 return _subjects.add(value); 766 } 767 768 /** 769 * Remove the first matching {@link SubjectReference} item from the underlying collection. 770 * @param item the item to remove 771 * @return {@code true} if the item was removed or {@code false} otherwise 772 */ 773 public boolean removeSubject(SubjectReference item) { 774 SubjectReference value = ObjectUtils.requireNonNull(item,"item cannot be null"); 775 return _subjects != null && _subjects.remove(value); 776 } 777 778 /** 779 * Get the "{@literal Title for Required Asset}". 780 * 781 * <p> 782 * The title for this required asset. 783 * 784 * @return the title value, or {@code null} if not set 785 */ 786 @Nullable 787 public MarkupLine getTitle() { 788 return _title; 789 } 790 791 /** 792 * Set the "{@literal Title for Required Asset}". 793 * 794 * <p> 795 * The title for this required asset. 796 * 797 * @param value 798 * the title value to set, or {@code null} to clear 799 */ 800 public void setTitle(@Nullable MarkupLine value) { 801 _title = value; 802 } 803 804 /** 805 * Get the "{@literal Description of Required Asset}". 806 * 807 * <p> 808 * A human-readable description of this required asset. 809 * 810 * @return the description value 811 */ 812 @NonNull 813 public MarkupMultiline getDescription() { 814 return _description; 815 } 816 817 /** 818 * Set the "{@literal Description of Required Asset}". 819 * 820 * <p> 821 * A human-readable description of this required asset. 822 * 823 * @param value 824 * the description value to set 825 */ 826 public void setDescription(@NonNull MarkupMultiline value) { 827 _description = value; 828 } 829 830 /** 831 * Get the "{@literal Property}". 832 * 833 * <p> 834 * An attribute, characteristic, or quality of the containing object expressed as a namespace qualified name/value pair. 835 * 836 * @return the prop value 837 */ 838 @NonNull 839 public List<Property> getProps() { 840 if (_props == null) { 841 _props = new LinkedList<>(); 842 } 843 return ObjectUtils.notNull(_props); 844 } 845 846 /** 847 * Set the "{@literal Property}". 848 * 849 * <p> 850 * An attribute, characteristic, or quality of the containing object expressed as a namespace qualified name/value pair. 851 * 852 * @param value 853 * the prop value to set 854 */ 855 public void setProps(@NonNull List<Property> value) { 856 _props = value; 857 } 858 859 /** 860 * Add a new {@link Property} item to the underlying collection. 861 * @param item the item to add 862 * @return {@code true} 863 */ 864 public boolean addProp(Property item) { 865 Property value = ObjectUtils.requireNonNull(item,"item cannot be null"); 866 if (_props == null) { 867 _props = new LinkedList<>(); 868 } 869 return _props.add(value); 870 } 871 872 /** 873 * Remove the first matching {@link Property} item from the underlying collection. 874 * @param item the item to remove 875 * @return {@code true} if the item was removed or {@code false} otherwise 876 */ 877 public boolean removeProp(Property item) { 878 Property value = ObjectUtils.requireNonNull(item,"item cannot be null"); 879 return _props != null && _props.remove(value); 880 } 881 882 /** 883 * Get the "{@literal Link}". 884 * 885 * <p> 886 * A reference to a local or remote resource, that has a specific relation to the containing object. 887 * 888 * @return the link value 889 */ 890 @NonNull 891 public List<Link> getLinks() { 892 if (_links == null) { 893 _links = new LinkedList<>(); 894 } 895 return ObjectUtils.notNull(_links); 896 } 897 898 /** 899 * Set the "{@literal Link}". 900 * 901 * <p> 902 * A reference to a local or remote resource, that has a specific relation to the containing object. 903 * 904 * @param value 905 * the link value to set 906 */ 907 public void setLinks(@NonNull List<Link> value) { 908 _links = value; 909 } 910 911 /** 912 * Add a new {@link Link} item to the underlying collection. 913 * @param item the item to add 914 * @return {@code true} 915 */ 916 public boolean addLink(Link item) { 917 Link value = ObjectUtils.requireNonNull(item,"item cannot be null"); 918 if (_links == null) { 919 _links = new LinkedList<>(); 920 } 921 return _links.add(value); 922 } 923 924 /** 925 * Remove the first matching {@link Link} item from the underlying collection. 926 * @param item the item to remove 927 * @return {@code true} if the item was removed or {@code false} otherwise 928 */ 929 public boolean removeLink(Link item) { 930 Link value = ObjectUtils.requireNonNull(item,"item cannot be null"); 931 return _links != null && _links.remove(value); 932 } 933 934 /** 935 * Get the "{@literal Remarks}". 936 * 937 * <p> 938 * Additional commentary about the containing object. 939 * 940 * @return the remarks value, or {@code null} if not set 941 */ 942 @Nullable 943 public MarkupMultiline getRemarks() { 944 return _remarks; 945 } 946 947 /** 948 * Set the "{@literal Remarks}". 949 * 950 * <p> 951 * Additional commentary about the containing object. 952 * 953 * @param value 954 * the remarks value to set, or {@code null} to clear 955 */ 956 public void setRemarks(@Nullable MarkupMultiline value) { 957 _remarks = value; 958 } 959 960 @Override 961 public String toString() { 962 return ObjectUtils.notNull(new ReflectionToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).toString()); 963 } 964 } 965}