001package gov.nist.secauto.oscal.lib.model; 002 003import gov.nist.secauto.metaschema.core.datatype.adapter.DateTimeWithTZAdapter; 004import gov.nist.secauto.metaschema.core.datatype.adapter.IntegerAdapter; 005import gov.nist.secauto.metaschema.core.datatype.adapter.TokenAdapter; 006import gov.nist.secauto.metaschema.core.datatype.adapter.UuidAdapter; 007import gov.nist.secauto.metaschema.core.datatype.markup.MarkupLine; 008import gov.nist.secauto.metaschema.core.datatype.markup.MarkupLineAdapter; 009import gov.nist.secauto.metaschema.core.datatype.markup.MarkupMultiline; 010import gov.nist.secauto.metaschema.core.datatype.markup.MarkupMultilineAdapter; 011import gov.nist.secauto.metaschema.core.model.IBoundObject; 012import gov.nist.secauto.metaschema.core.model.IMetaschemaData; 013import gov.nist.secauto.metaschema.core.model.JsonGroupAsBehavior; 014import gov.nist.secauto.metaschema.core.model.constraint.IConstraint; 015import gov.nist.secauto.metaschema.core.util.ObjectUtils; 016import gov.nist.secauto.metaschema.databind.model.annotations.AllowedValue; 017import gov.nist.secauto.metaschema.databind.model.annotations.AllowedValues; 018import gov.nist.secauto.metaschema.databind.model.annotations.BoundAssembly; 019import gov.nist.secauto.metaschema.databind.model.annotations.BoundField; 020import gov.nist.secauto.metaschema.databind.model.annotations.BoundFlag; 021import gov.nist.secauto.metaschema.databind.model.annotations.GroupAs; 022import gov.nist.secauto.metaschema.databind.model.annotations.Matches; 023import gov.nist.secauto.metaschema.databind.model.annotations.MetaschemaAssembly; 024import gov.nist.secauto.metaschema.databind.model.annotations.ValueConstraints; 025import java.lang.Override; 026import java.lang.String; 027import java.time.ZonedDateTime; 028import java.util.LinkedList; 029import java.util.List; 030import java.util.UUID; 031import org.apache.commons.lang3.builder.ReflectionToStringBuilder; 032import org.apache.commons.lang3.builder.ToStringStyle; 033 034/** 035 * An identified risk. 036 */ 037@MetaschemaAssembly( 038 formalName = "Identified Risk", 039 description = "An identified risk.", 040 name = "risk", 041 moduleClass = OscalAssessmentCommonModule.class, 042 valueConstraints = @ValueConstraints(allowedValues = @AllowedValues(level = IConstraint.Level.ERROR, target = "prop[has-oscal-namespace('http://csrc.nist.gov/ns/oscal')]/@name", values = {@AllowedValue(value = "false-positive", description = "The risk has been confirmed to be a false positive."), @AllowedValue(value = "accepted", description = "The risk has been accepted. No further action will be taken."), @AllowedValue(value = "risk-adjusted", description = "The risk has been adjusted."), @AllowedValue(value = "priority", description = "A numeric value indicating the sequence in which risks should be addressed. (Lower numbers are higher priority)")}), matches = @Matches(level = IConstraint.Level.ERROR, target = "prop[has-oscal-namespace('http://csrc.nist.gov/ns/oscal') and @name='priority']/@value", typeAdapter = IntegerAdapter.class)) 043) 044public class Risk implements IBoundObject { 045 private final IMetaschemaData __metaschemaData; 046 047 /** 048 * "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 risk 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</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." 049 */ 050 @BoundFlag( 051 formalName = "Risk Universally Unique Identifier", 052 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 risk elsewhere in [this or other OSCAL instances](https://pages.nist.gov/OSCAL/concepts/identifier-use/#scope). The locally defined *UUID* of the `risk` 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.", 053 name = "uuid", 054 required = true, 055 typeAdapter = UuidAdapter.class 056 ) 057 private UUID _uuid; 058 059 @BoundField( 060 formalName = "Risk Title", 061 description = "The title for this risk.", 062 useName = "title", 063 minOccurs = 1, 064 typeAdapter = MarkupLineAdapter.class 065 ) 066 private MarkupLine _title; 067 068 @BoundField( 069 formalName = "Risk Description", 070 description = "A human-readable summary of the identified risk, to include a statement of how the risk impacts the system.", 071 useName = "description", 072 minOccurs = 1, 073 typeAdapter = MarkupMultilineAdapter.class 074 ) 075 private MarkupMultiline _description; 076 077 @BoundField( 078 formalName = "Risk Statement", 079 description = "An summary of impact for how the risk affects the system.", 080 useName = "statement", 081 minOccurs = 1, 082 typeAdapter = MarkupMultilineAdapter.class 083 ) 084 private MarkupMultiline _statement; 085 086 @BoundAssembly( 087 formalName = "Property", 088 description = "An attribute, characteristic, or quality of the containing object expressed as a namespace qualified name/value pair.", 089 useName = "prop", 090 maxOccurs = -1, 091 groupAs = @GroupAs(name = "props", inJson = JsonGroupAsBehavior.LIST) 092 ) 093 private List<Property> _props; 094 095 @BoundAssembly( 096 formalName = "Link", 097 description = "A reference to a local or remote resource, that has a specific relation to the containing object.", 098 useName = "link", 099 maxOccurs = -1, 100 groupAs = @GroupAs(name = "links", inJson = JsonGroupAsBehavior.LIST) 101 ) 102 private List<Link> _links; 103 104 @BoundField( 105 formalName = "Risk Status", 106 description = "Describes the status of the associated risk.", 107 useName = "status", 108 minOccurs = 1, 109 typeAdapter = TokenAdapter.class, 110 valueConstraints = @ValueConstraints(allowedValues = @AllowedValues(level = IConstraint.Level.ERROR, allowOthers = true, values = {@AllowedValue(value = "open", description = "The risk has been identified."), @AllowedValue(value = "investigating", description = "The identified risk is being investigated. (Open risk)"), @AllowedValue(value = "remediating", description = "Remediation activities are underway, but are not yet complete. (Open risk)"), @AllowedValue(value = "deviation-requested", description = "A risk deviation, such as false positive, risk reduction, or operational requirement has been submitted for approval. (Open risk)"), @AllowedValue(value = "deviation-approved", description = "A risk deviation, such as false positive, risk reduction, or operational requirement has been approved. (Open risk)"), @AllowedValue(value = "closed", description = "The risk has been resolved.")})) 111 ) 112 private String _status; 113 114 @BoundAssembly( 115 formalName = "Origin", 116 description = "Identifies the source of the finding, such as a tool, interviewed person, or activity.", 117 useName = "origin", 118 remarks = "Used to identify the individual and/or tool that identified this risk.", 119 maxOccurs = -1, 120 groupAs = @GroupAs(name = "origins", inJson = JsonGroupAsBehavior.LIST) 121 ) 122 private List<Origin> _origins; 123 124 @BoundField( 125 formalName = "Threat ID", 126 description = "A pointer, by ID, to an externally-defined threat.", 127 useName = "threat-id", 128 maxOccurs = -1, 129 groupAs = @GroupAs(name = "threat-ids", inJson = JsonGroupAsBehavior.LIST) 130 ) 131 private List<ThreatId> _threatIds; 132 133 @BoundAssembly( 134 formalName = "Characterization", 135 description = "A collection of descriptive data about the containing object from a specific origin.", 136 useName = "characterization", 137 maxOccurs = -1, 138 groupAs = @GroupAs(name = "characterizations", inJson = JsonGroupAsBehavior.LIST) 139 ) 140 private List<Characterization> _characterizations; 141 142 @BoundAssembly( 143 formalName = "Mitigating Factor", 144 description = "Describes an existing mitigating factor that may affect the overall determination of the risk, with an optional link to an implementation statement in the SSP.", 145 useName = "mitigating-factor", 146 maxOccurs = -1, 147 groupAs = @GroupAs(name = "mitigating-factors", inJson = JsonGroupAsBehavior.LIST) 148 ) 149 private List<MitigatingFactor> _mitigatingFactors; 150 151 @BoundField( 152 formalName = "Risk Resolution Deadline", 153 description = "The date/time by which the risk must be resolved.", 154 useName = "deadline", 155 typeAdapter = DateTimeWithTZAdapter.class 156 ) 157 private ZonedDateTime _deadline; 158 159 @BoundAssembly( 160 formalName = "Risk Response", 161 description = "Describes either recommended or an actual plan for addressing the risk.", 162 useName = "response", 163 maxOccurs = -1, 164 groupAs = @GroupAs(name = "remediations", inJson = JsonGroupAsBehavior.LIST) 165 ) 166 private List<Response> _remediations; 167 168 @BoundAssembly( 169 formalName = "Risk Log", 170 description = "A log of all risk-related tasks taken.", 171 useName = "risk-log" 172 ) 173 private RiskLog _riskLog; 174 175 @BoundAssembly( 176 formalName = "Related Observation", 177 description = "Relates the finding to a set of referenced observations that were used to determine the finding.", 178 useName = "related-observation", 179 maxOccurs = -1, 180 groupAs = @GroupAs(name = "related-observations", inJson = JsonGroupAsBehavior.LIST) 181 ) 182 private List<RelatedObservation> _relatedObservations; 183 184 public Risk() { 185 this(null); 186 } 187 188 public Risk(IMetaschemaData data) { 189 this.__metaschemaData = data; 190 } 191 192 @Override 193 public IMetaschemaData getMetaschemaData() { 194 return __metaschemaData; 195 } 196 197 public UUID getUuid() { 198 return _uuid; 199 } 200 201 public void setUuid(UUID value) { 202 _uuid = value; 203 } 204 205 public MarkupLine getTitle() { 206 return _title; 207 } 208 209 public void setTitle(MarkupLine value) { 210 _title = value; 211 } 212 213 public MarkupMultiline getDescription() { 214 return _description; 215 } 216 217 public void setDescription(MarkupMultiline value) { 218 _description = value; 219 } 220 221 public MarkupMultiline getStatement() { 222 return _statement; 223 } 224 225 public void setStatement(MarkupMultiline value) { 226 _statement = value; 227 } 228 229 public List<Property> getProps() { 230 return _props; 231 } 232 233 public void setProps(List<Property> value) { 234 _props = value; 235 } 236 237 /** 238 * Add a new {@link Property} item to the underlying collection. 239 * @param item the item to add 240 * @return {@code true} 241 */ 242 public boolean addProp(Property item) { 243 Property value = ObjectUtils.requireNonNull(item,"item cannot be null"); 244 if (_props == null) { 245 _props = new LinkedList<>(); 246 } 247 return _props.add(value); 248 } 249 250 /** 251 * Remove the first matching {@link Property} item from the underlying collection. 252 * @param item the item to remove 253 * @return {@code true} if the item was removed or {@code false} otherwise 254 */ 255 public boolean removeProp(Property item) { 256 Property value = ObjectUtils.requireNonNull(item,"item cannot be null"); 257 return _props != null && _props.remove(value); 258 } 259 260 public List<Link> getLinks() { 261 return _links; 262 } 263 264 public void setLinks(List<Link> value) { 265 _links = value; 266 } 267 268 /** 269 * Add a new {@link Link} item to the underlying collection. 270 * @param item the item to add 271 * @return {@code true} 272 */ 273 public boolean addLink(Link item) { 274 Link value = ObjectUtils.requireNonNull(item,"item cannot be null"); 275 if (_links == null) { 276 _links = new LinkedList<>(); 277 } 278 return _links.add(value); 279 } 280 281 /** 282 * Remove the first matching {@link Link} item from the underlying collection. 283 * @param item the item to remove 284 * @return {@code true} if the item was removed or {@code false} otherwise 285 */ 286 public boolean removeLink(Link item) { 287 Link value = ObjectUtils.requireNonNull(item,"item cannot be null"); 288 return _links != null && _links.remove(value); 289 } 290 291 public String getStatus() { 292 return _status; 293 } 294 295 public void setStatus(String value) { 296 _status = value; 297 } 298 299 public List<Origin> getOrigins() { 300 return _origins; 301 } 302 303 public void setOrigins(List<Origin> value) { 304 _origins = value; 305 } 306 307 /** 308 * Add a new {@link Origin} item to the underlying collection. 309 * @param item the item to add 310 * @return {@code true} 311 */ 312 public boolean addOrigin(Origin item) { 313 Origin value = ObjectUtils.requireNonNull(item,"item cannot be null"); 314 if (_origins == null) { 315 _origins = new LinkedList<>(); 316 } 317 return _origins.add(value); 318 } 319 320 /** 321 * Remove the first matching {@link Origin} item from the underlying collection. 322 * @param item the item to remove 323 * @return {@code true} if the item was removed or {@code false} otherwise 324 */ 325 public boolean removeOrigin(Origin item) { 326 Origin value = ObjectUtils.requireNonNull(item,"item cannot be null"); 327 return _origins != null && _origins.remove(value); 328 } 329 330 public List<ThreatId> getThreatIds() { 331 return _threatIds; 332 } 333 334 public void setThreatIds(List<ThreatId> value) { 335 _threatIds = value; 336 } 337 338 /** 339 * Add a new {@link ThreatId} item to the underlying collection. 340 * @param item the item to add 341 * @return {@code true} 342 */ 343 public boolean addThreatId(ThreatId item) { 344 ThreatId value = ObjectUtils.requireNonNull(item,"item cannot be null"); 345 if (_threatIds == null) { 346 _threatIds = new LinkedList<>(); 347 } 348 return _threatIds.add(value); 349 } 350 351 /** 352 * Remove the first matching {@link ThreatId} item from the underlying collection. 353 * @param item the item to remove 354 * @return {@code true} if the item was removed or {@code false} otherwise 355 */ 356 public boolean removeThreatId(ThreatId item) { 357 ThreatId value = ObjectUtils.requireNonNull(item,"item cannot be null"); 358 return _threatIds != null && _threatIds.remove(value); 359 } 360 361 public List<Characterization> getCharacterizations() { 362 return _characterizations; 363 } 364 365 public void setCharacterizations(List<Characterization> value) { 366 _characterizations = value; 367 } 368 369 /** 370 * Add a new {@link Characterization} item to the underlying collection. 371 * @param item the item to add 372 * @return {@code true} 373 */ 374 public boolean addCharacterization(Characterization item) { 375 Characterization value = ObjectUtils.requireNonNull(item,"item cannot be null"); 376 if (_characterizations == null) { 377 _characterizations = new LinkedList<>(); 378 } 379 return _characterizations.add(value); 380 } 381 382 /** 383 * Remove the first matching {@link Characterization} item from the underlying collection. 384 * @param item the item to remove 385 * @return {@code true} if the item was removed or {@code false} otherwise 386 */ 387 public boolean removeCharacterization(Characterization item) { 388 Characterization value = ObjectUtils.requireNonNull(item,"item cannot be null"); 389 return _characterizations != null && _characterizations.remove(value); 390 } 391 392 public List<MitigatingFactor> getMitigatingFactors() { 393 return _mitigatingFactors; 394 } 395 396 public void setMitigatingFactors(List<MitigatingFactor> value) { 397 _mitigatingFactors = value; 398 } 399 400 /** 401 * Add a new {@link MitigatingFactor} item to the underlying collection. 402 * @param item the item to add 403 * @return {@code true} 404 */ 405 public boolean addMitigatingFactor(MitigatingFactor item) { 406 MitigatingFactor value = ObjectUtils.requireNonNull(item,"item cannot be null"); 407 if (_mitigatingFactors == null) { 408 _mitigatingFactors = new LinkedList<>(); 409 } 410 return _mitigatingFactors.add(value); 411 } 412 413 /** 414 * Remove the first matching {@link MitigatingFactor} item from the underlying collection. 415 * @param item the item to remove 416 * @return {@code true} if the item was removed or {@code false} otherwise 417 */ 418 public boolean removeMitigatingFactor(MitigatingFactor item) { 419 MitigatingFactor value = ObjectUtils.requireNonNull(item,"item cannot be null"); 420 return _mitigatingFactors != null && _mitigatingFactors.remove(value); 421 } 422 423 public ZonedDateTime getDeadline() { 424 return _deadline; 425 } 426 427 public void setDeadline(ZonedDateTime value) { 428 _deadline = value; 429 } 430 431 public List<Response> getRemediations() { 432 return _remediations; 433 } 434 435 public void setRemediations(List<Response> value) { 436 _remediations = value; 437 } 438 439 /** 440 * Add a new {@link Response} item to the underlying collection. 441 * @param item the item to add 442 * @return {@code true} 443 */ 444 public boolean addResponse(Response item) { 445 Response value = ObjectUtils.requireNonNull(item,"item cannot be null"); 446 if (_remediations == null) { 447 _remediations = new LinkedList<>(); 448 } 449 return _remediations.add(value); 450 } 451 452 /** 453 * Remove the first matching {@link Response} item from the underlying collection. 454 * @param item the item to remove 455 * @return {@code true} if the item was removed or {@code false} otherwise 456 */ 457 public boolean removeResponse(Response item) { 458 Response value = ObjectUtils.requireNonNull(item,"item cannot be null"); 459 return _remediations != null && _remediations.remove(value); 460 } 461 462 public RiskLog getRiskLog() { 463 return _riskLog; 464 } 465 466 public void setRiskLog(RiskLog value) { 467 _riskLog = value; 468 } 469 470 public List<RelatedObservation> getRelatedObservations() { 471 return _relatedObservations; 472 } 473 474 public void setRelatedObservations(List<RelatedObservation> value) { 475 _relatedObservations = value; 476 } 477 478 /** 479 * Add a new {@link RelatedObservation} item to the underlying collection. 480 * @param item the item to add 481 * @return {@code true} 482 */ 483 public boolean addRelatedObservation(RelatedObservation item) { 484 RelatedObservation value = ObjectUtils.requireNonNull(item,"item cannot be null"); 485 if (_relatedObservations == null) { 486 _relatedObservations = new LinkedList<>(); 487 } 488 return _relatedObservations.add(value); 489 } 490 491 /** 492 * Remove the first matching {@link RelatedObservation} item from the underlying collection. 493 * @param item the item to remove 494 * @return {@code true} if the item was removed or {@code false} otherwise 495 */ 496 public boolean removeRelatedObservation(RelatedObservation item) { 497 RelatedObservation value = ObjectUtils.requireNonNull(item,"item cannot be null"); 498 return _relatedObservations != null && _relatedObservations.remove(value); 499 } 500 501 @Override 502 public String toString() { 503 return new ReflectionToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).toString(); 504 } 505 506 /** 507 * Describes an existing mitigating factor that may affect the overall determination of the risk, with an optional link to an implementation statement in the SSP. 508 */ 509 @MetaschemaAssembly( 510 formalName = "Mitigating Factor", 511 description = "Describes an existing mitigating factor that may affect the overall determination of the risk, with an optional link to an implementation statement in the SSP.", 512 name = "mitigating-factor", 513 moduleClass = OscalAssessmentCommonModule.class 514 ) 515 public static class MitigatingFactor implements IBoundObject { 516 private final IMetaschemaData __metaschemaData; 517 518 /** 519 * "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 mitigating factor 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>mitigating factor</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." 520 */ 521 @BoundFlag( 522 formalName = "Mitigating Factor Universally Unique Identifier", 523 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 mitigating factor elsewhere in [this or other OSCAL instances](https://pages.nist.gov/OSCAL/concepts/identifier-use/#scope). The locally defined *UUID* of the `mitigating factor` 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.", 524 name = "uuid", 525 required = true, 526 typeAdapter = UuidAdapter.class 527 ) 528 private UUID _uuid; 529 530 /** 531 * "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 implementation statement elsewhere in <a href=\"https://pages.nist.gov/OSCAL/concepts/identifier-use/#scope\">this or other OSCAL instances</a>s. The locally defined <em>UUID</em> of the <code>implementation statement</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." 532 */ 533 @BoundFlag( 534 formalName = "Implementation UUID", 535 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 implementation statement elsewhere in [this or other OSCAL instances](https://pages.nist.gov/OSCAL/concepts/identifier-use/#scope)s. The locally defined *UUID* of the `implementation statement` 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.", 536 name = "implementation-uuid", 537 typeAdapter = UuidAdapter.class 538 ) 539 private UUID _implementationUuid; 540 541 @BoundField( 542 formalName = "Mitigating Factor Description", 543 description = "A human-readable description of this mitigating factor.", 544 useName = "description", 545 minOccurs = 1, 546 typeAdapter = MarkupMultilineAdapter.class 547 ) 548 private MarkupMultiline _description; 549 550 @BoundAssembly( 551 formalName = "Property", 552 description = "An attribute, characteristic, or quality of the containing object expressed as a namespace qualified name/value pair.", 553 useName = "prop", 554 maxOccurs = -1, 555 groupAs = @GroupAs(name = "props", inJson = JsonGroupAsBehavior.LIST) 556 ) 557 private List<Property> _props; 558 559 @BoundAssembly( 560 formalName = "Link", 561 description = "A reference to a local or remote resource, that has a specific relation to the containing object.", 562 useName = "link", 563 maxOccurs = -1, 564 groupAs = @GroupAs(name = "links", inJson = JsonGroupAsBehavior.LIST) 565 ) 566 private List<Link> _links; 567 568 @BoundAssembly( 569 formalName = "Identifies the Subject", 570 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.", 571 useName = "subject", 572 remarks = "Links identifiable elements of the system to this mitigating factor, such as an inventory-item or component.", 573 maxOccurs = -1, 574 groupAs = @GroupAs(name = "subjects", inJson = JsonGroupAsBehavior.LIST) 575 ) 576 private List<SubjectReference> _subjects; 577 578 public MitigatingFactor() { 579 this(null); 580 } 581 582 public MitigatingFactor(IMetaschemaData data) { 583 this.__metaschemaData = data; 584 } 585 586 @Override 587 public IMetaschemaData getMetaschemaData() { 588 return __metaschemaData; 589 } 590 591 public UUID getUuid() { 592 return _uuid; 593 } 594 595 public void setUuid(UUID value) { 596 _uuid = value; 597 } 598 599 public UUID getImplementationUuid() { 600 return _implementationUuid; 601 } 602 603 public void setImplementationUuid(UUID value) { 604 _implementationUuid = value; 605 } 606 607 public MarkupMultiline getDescription() { 608 return _description; 609 } 610 611 public void setDescription(MarkupMultiline value) { 612 _description = value; 613 } 614 615 public List<Property> getProps() { 616 return _props; 617 } 618 619 public void setProps(List<Property> value) { 620 _props = value; 621 } 622 623 /** 624 * Add a new {@link Property} item to the underlying collection. 625 * @param item the item to add 626 * @return {@code true} 627 */ 628 public boolean addProp(Property item) { 629 Property value = ObjectUtils.requireNonNull(item,"item cannot be null"); 630 if (_props == null) { 631 _props = new LinkedList<>(); 632 } 633 return _props.add(value); 634 } 635 636 /** 637 * Remove the first matching {@link Property} item from the underlying collection. 638 * @param item the item to remove 639 * @return {@code true} if the item was removed or {@code false} otherwise 640 */ 641 public boolean removeProp(Property item) { 642 Property value = ObjectUtils.requireNonNull(item,"item cannot be null"); 643 return _props != null && _props.remove(value); 644 } 645 646 public List<Link> getLinks() { 647 return _links; 648 } 649 650 public void setLinks(List<Link> value) { 651 _links = value; 652 } 653 654 /** 655 * Add a new {@link Link} item to the underlying collection. 656 * @param item the item to add 657 * @return {@code true} 658 */ 659 public boolean addLink(Link item) { 660 Link value = ObjectUtils.requireNonNull(item,"item cannot be null"); 661 if (_links == null) { 662 _links = new LinkedList<>(); 663 } 664 return _links.add(value); 665 } 666 667 /** 668 * Remove the first matching {@link Link} item from the underlying collection. 669 * @param item the item to remove 670 * @return {@code true} if the item was removed or {@code false} otherwise 671 */ 672 public boolean removeLink(Link item) { 673 Link value = ObjectUtils.requireNonNull(item,"item cannot be null"); 674 return _links != null && _links.remove(value); 675 } 676 677 public List<SubjectReference> getSubjects() { 678 return _subjects; 679 } 680 681 public void setSubjects(List<SubjectReference> value) { 682 _subjects = value; 683 } 684 685 /** 686 * Add a new {@link SubjectReference} item to the underlying collection. 687 * @param item the item to add 688 * @return {@code true} 689 */ 690 public boolean addSubject(SubjectReference item) { 691 SubjectReference value = ObjectUtils.requireNonNull(item,"item cannot be null"); 692 if (_subjects == null) { 693 _subjects = new LinkedList<>(); 694 } 695 return _subjects.add(value); 696 } 697 698 /** 699 * Remove the first matching {@link SubjectReference} item from the underlying collection. 700 * @param item the item to remove 701 * @return {@code true} if the item was removed or {@code false} otherwise 702 */ 703 public boolean removeSubject(SubjectReference item) { 704 SubjectReference value = ObjectUtils.requireNonNull(item,"item cannot be null"); 705 return _subjects != null && _subjects.remove(value); 706 } 707 708 @Override 709 public String toString() { 710 return new ReflectionToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).toString(); 711 } 712 } 713 714 /** 715 * A log of all risk-related tasks taken. 716 */ 717 @MetaschemaAssembly( 718 formalName = "Risk Log", 719 description = "A log of all risk-related tasks taken.", 720 name = "risk-log", 721 moduleClass = OscalAssessmentCommonModule.class 722 ) 723 public static class RiskLog implements IBoundObject { 724 private final IMetaschemaData __metaschemaData; 725 726 @BoundAssembly( 727 formalName = "Risk Log Entry", 728 description = "Identifies an individual risk response that occurred as part of managing an identified risk.", 729 useName = "entry", 730 minOccurs = 1, 731 maxOccurs = -1, 732 groupAs = @GroupAs(name = "entries", inJson = JsonGroupAsBehavior.LIST) 733 ) 734 private List<Entry> _entries; 735 736 public RiskLog() { 737 this(null); 738 } 739 740 public RiskLog(IMetaschemaData data) { 741 this.__metaschemaData = data; 742 } 743 744 @Override 745 public IMetaschemaData getMetaschemaData() { 746 return __metaschemaData; 747 } 748 749 public List<Entry> getEntries() { 750 return _entries; 751 } 752 753 public void setEntries(List<Entry> value) { 754 _entries = value; 755 } 756 757 /** 758 * Add a new {@link Entry} item to the underlying collection. 759 * @param item the item to add 760 * @return {@code true} 761 */ 762 public boolean addEntry(Entry item) { 763 Entry value = ObjectUtils.requireNonNull(item,"item cannot be null"); 764 if (_entries == null) { 765 _entries = new LinkedList<>(); 766 } 767 return _entries.add(value); 768 } 769 770 /** 771 * Remove the first matching {@link Entry} item from the underlying collection. 772 * @param item the item to remove 773 * @return {@code true} if the item was removed or {@code false} otherwise 774 */ 775 public boolean removeEntry(Entry item) { 776 Entry value = ObjectUtils.requireNonNull(item,"item cannot be null"); 777 return _entries != null && _entries.remove(value); 778 } 779 780 @Override 781 public String toString() { 782 return new ReflectionToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).toString(); 783 } 784 785 /** 786 * Identifies an individual risk response that occurred as part of managing an identified risk. 787 */ 788 @MetaschemaAssembly( 789 formalName = "Risk Log Entry", 790 description = "Identifies an individual risk response that occurred as part of managing an identified risk.", 791 name = "entry", 792 moduleClass = OscalAssessmentCommonModule.class, 793 valueConstraints = @ValueConstraints(allowedValues = {@AllowedValues(level = IConstraint.Level.ERROR, target = "prop[has-oscal-namespace('http://csrc.nist.gov/ns/oscal')]/@name", values = @AllowedValue(value = "type", description = "The type of remediation tracking entry. Can be multi-valued.")), @AllowedValues(level = IConstraint.Level.ERROR, target = "prop[has-oscal-namespace('http://csrc.nist.gov/ns/oscal') and @name='type']/@value", allowOthers = true, values = {@AllowedValue(value = "vendor-check-in", description = "Contacted vendor to determine the status of a pending fix to a known vulnerability."), @AllowedValue(value = "status-update", description = "Information related to the current state of response to this risk."), @AllowedValue(value = "milestone-complete", description = "A significant step in the response plan has been achieved."), @AllowedValue(value = "mitigation", description = "An activity was completed that reduces the likelihood or impact of this risk."), @AllowedValue(value = "remediated", description = "An activity was completed that eliminates the likelihood or impact of this risk."), @AllowedValue(value = "closed", description = "The risk is no longer applicable to the system."), @AllowedValue(value = "dr-submission", description = "A deviation request was made to the authorizing official."), @AllowedValue(value = "dr-updated", description = "A previously submitted deviation request has been modified."), @AllowedValue(value = "dr-approved", description = "The authorizing official approved the deviation."), @AllowedValue(value = "dr-rejected", description = "The authorizing official rejected the deviation.")})}) 794 ) 795 public static class Entry implements IBoundObject { 796 private final IMetaschemaData __metaschemaData; 797 798 /** 799 * "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 risk log entry 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 log entry</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." 800 */ 801 @BoundFlag( 802 formalName = "Risk Log Entry Universally Unique Identifier", 803 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 risk log entry elsewhere in [this or other OSCAL instances](https://pages.nist.gov/OSCAL/concepts/identifier-use/#scope). The locally defined *UUID* of the `risk log entry` 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.", 804 name = "uuid", 805 required = true, 806 typeAdapter = UuidAdapter.class 807 ) 808 private UUID _uuid; 809 810 @BoundField( 811 formalName = "Title", 812 description = "The title for this risk log entry.", 813 useName = "title", 814 typeAdapter = MarkupLineAdapter.class 815 ) 816 private MarkupLine _title; 817 818 @BoundField( 819 formalName = "Risk Task Description", 820 description = "A human-readable description of what was done regarding the risk.", 821 useName = "description", 822 typeAdapter = MarkupMultilineAdapter.class 823 ) 824 private MarkupMultiline _description; 825 826 @BoundField( 827 formalName = "Start", 828 description = "Identifies the start date and time of the event.", 829 useName = "start", 830 minOccurs = 1, 831 typeAdapter = DateTimeWithTZAdapter.class 832 ) 833 private ZonedDateTime _start; 834 835 @BoundField( 836 formalName = "End", 837 description = "Identifies the end date and time of the event. If the event is a point in time, the start and end will be the same date and time.", 838 useName = "end", 839 typeAdapter = DateTimeWithTZAdapter.class 840 ) 841 private ZonedDateTime _end; 842 843 @BoundAssembly( 844 formalName = "Property", 845 description = "An attribute, characteristic, or quality of the containing object expressed as a namespace qualified name/value pair.", 846 useName = "prop", 847 maxOccurs = -1, 848 groupAs = @GroupAs(name = "props", inJson = JsonGroupAsBehavior.LIST) 849 ) 850 private List<Property> _props; 851 852 @BoundAssembly( 853 formalName = "Link", 854 description = "A reference to a local or remote resource, that has a specific relation to the containing object.", 855 useName = "link", 856 maxOccurs = -1, 857 groupAs = @GroupAs(name = "links", inJson = JsonGroupAsBehavior.LIST) 858 ) 859 private List<Link> _links; 860 861 @BoundAssembly( 862 formalName = "Logged By", 863 description = "Used to indicate who created a log entry in what role.", 864 useName = "logged-by", 865 maxOccurs = -1, 866 groupAs = @GroupAs(name = "logged-by", inJson = JsonGroupAsBehavior.LIST) 867 ) 868 private List<LoggedBy> _loggedBy; 869 870 @BoundField( 871 formalName = "Risk Status", 872 description = "Describes the status of the associated risk.", 873 useName = "status-change", 874 remarks = "Identifies a change in risk status made resulting from the task described by this risk log entry. This allows the risk's status history to be captured as a sequence of risk log entries.", 875 typeAdapter = TokenAdapter.class, 876 valueConstraints = @ValueConstraints(allowedValues = @AllowedValues(level = IConstraint.Level.ERROR, allowOthers = true, values = {@AllowedValue(value = "open", description = "The risk has been identified."), @AllowedValue(value = "investigating", description = "The identified risk is being investigated. (Open risk)"), @AllowedValue(value = "remediating", description = "Remediation activities are underway, but are not yet complete. (Open risk)"), @AllowedValue(value = "deviation-requested", description = "A risk deviation, such as false positive, risk reduction, or operational requirement has been submitted for approval. (Open risk)"), @AllowedValue(value = "deviation-approved", description = "A risk deviation, such as false positive, risk reduction, or operational requirement has been approved. (Open risk)"), @AllowedValue(value = "closed", description = "The risk has been resolved.")})) 877 ) 878 private String _statusChange; 879 880 @BoundAssembly( 881 formalName = "Risk Response Reference", 882 description = "Identifies an individual risk response that this log entry is for.", 883 useName = "related-response", 884 maxOccurs = -1, 885 groupAs = @GroupAs(name = "related-responses", inJson = JsonGroupAsBehavior.LIST) 886 ) 887 private List<RelatedResponse> _relatedResponses; 888 889 @BoundField( 890 formalName = "Remarks", 891 description = "Additional commentary about the containing object.", 892 useName = "remarks", 893 typeAdapter = MarkupMultilineAdapter.class 894 ) 895 private MarkupMultiline _remarks; 896 897 public Entry() { 898 this(null); 899 } 900 901 public Entry(IMetaschemaData data) { 902 this.__metaschemaData = data; 903 } 904 905 @Override 906 public IMetaschemaData getMetaschemaData() { 907 return __metaschemaData; 908 } 909 910 public UUID getUuid() { 911 return _uuid; 912 } 913 914 public void setUuid(UUID value) { 915 _uuid = value; 916 } 917 918 public MarkupLine getTitle() { 919 return _title; 920 } 921 922 public void setTitle(MarkupLine value) { 923 _title = value; 924 } 925 926 public MarkupMultiline getDescription() { 927 return _description; 928 } 929 930 public void setDescription(MarkupMultiline value) { 931 _description = value; 932 } 933 934 public ZonedDateTime getStart() { 935 return _start; 936 } 937 938 public void setStart(ZonedDateTime value) { 939 _start = value; 940 } 941 942 public ZonedDateTime getEnd() { 943 return _end; 944 } 945 946 public void setEnd(ZonedDateTime value) { 947 _end = value; 948 } 949 950 public List<Property> getProps() { 951 return _props; 952 } 953 954 public void setProps(List<Property> value) { 955 _props = value; 956 } 957 958 /** 959 * Add a new {@link Property} item to the underlying collection. 960 * @param item the item to add 961 * @return {@code true} 962 */ 963 public boolean addProp(Property item) { 964 Property value = ObjectUtils.requireNonNull(item,"item cannot be null"); 965 if (_props == null) { 966 _props = new LinkedList<>(); 967 } 968 return _props.add(value); 969 } 970 971 /** 972 * Remove the first matching {@link Property} item from the underlying collection. 973 * @param item the item to remove 974 * @return {@code true} if the item was removed or {@code false} otherwise 975 */ 976 public boolean removeProp(Property item) { 977 Property value = ObjectUtils.requireNonNull(item,"item cannot be null"); 978 return _props != null && _props.remove(value); 979 } 980 981 public List<Link> getLinks() { 982 return _links; 983 } 984 985 public void setLinks(List<Link> value) { 986 _links = value; 987 } 988 989 /** 990 * Add a new {@link Link} item to the underlying collection. 991 * @param item the item to add 992 * @return {@code true} 993 */ 994 public boolean addLink(Link item) { 995 Link value = ObjectUtils.requireNonNull(item,"item cannot be null"); 996 if (_links == null) { 997 _links = new LinkedList<>(); 998 } 999 return _links.add(value); 1000 } 1001 1002 /** 1003 * Remove the first matching {@link Link} item from the underlying collection. 1004 * @param item the item to remove 1005 * @return {@code true} if the item was removed or {@code false} otherwise 1006 */ 1007 public boolean removeLink(Link item) { 1008 Link value = ObjectUtils.requireNonNull(item,"item cannot be null"); 1009 return _links != null && _links.remove(value); 1010 } 1011 1012 public List<LoggedBy> getLoggedBy() { 1013 return _loggedBy; 1014 } 1015 1016 public void setLoggedBy(List<LoggedBy> value) { 1017 _loggedBy = value; 1018 } 1019 1020 /** 1021 * Add a new {@link LoggedBy} item to the underlying collection. 1022 * @param item the item to add 1023 * @return {@code true} 1024 */ 1025 public boolean addLoggedBy(LoggedBy item) { 1026 LoggedBy value = ObjectUtils.requireNonNull(item,"item cannot be null"); 1027 if (_loggedBy == null) { 1028 _loggedBy = new LinkedList<>(); 1029 } 1030 return _loggedBy.add(value); 1031 } 1032 1033 /** 1034 * Remove the first matching {@link LoggedBy} item from the underlying collection. 1035 * @param item the item to remove 1036 * @return {@code true} if the item was removed or {@code false} otherwise 1037 */ 1038 public boolean removeLoggedBy(LoggedBy item) { 1039 LoggedBy value = ObjectUtils.requireNonNull(item,"item cannot be null"); 1040 return _loggedBy != null && _loggedBy.remove(value); 1041 } 1042 1043 public String getStatusChange() { 1044 return _statusChange; 1045 } 1046 1047 public void setStatusChange(String value) { 1048 _statusChange = value; 1049 } 1050 1051 public List<RelatedResponse> getRelatedResponses() { 1052 return _relatedResponses; 1053 } 1054 1055 public void setRelatedResponses(List<RelatedResponse> value) { 1056 _relatedResponses = value; 1057 } 1058 1059 /** 1060 * Add a new {@link RelatedResponse} item to the underlying collection. 1061 * @param item the item to add 1062 * @return {@code true} 1063 */ 1064 public boolean addRelatedResponse(RelatedResponse item) { 1065 RelatedResponse value = ObjectUtils.requireNonNull(item,"item cannot be null"); 1066 if (_relatedResponses == null) { 1067 _relatedResponses = new LinkedList<>(); 1068 } 1069 return _relatedResponses.add(value); 1070 } 1071 1072 /** 1073 * Remove the first matching {@link RelatedResponse} item from the underlying collection. 1074 * @param item the item to remove 1075 * @return {@code true} if the item was removed or {@code false} otherwise 1076 */ 1077 public boolean removeRelatedResponse(RelatedResponse item) { 1078 RelatedResponse value = ObjectUtils.requireNonNull(item,"item cannot be null"); 1079 return _relatedResponses != null && _relatedResponses.remove(value); 1080 } 1081 1082 public MarkupMultiline getRemarks() { 1083 return _remarks; 1084 } 1085 1086 public void setRemarks(MarkupMultiline value) { 1087 _remarks = value; 1088 } 1089 1090 @Override 1091 public String toString() { 1092 return new ReflectionToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).toString(); 1093 } 1094 1095 /** 1096 * Identifies an individual risk response that this log entry is for. 1097 */ 1098 @MetaschemaAssembly( 1099 formalName = "Risk Response Reference", 1100 description = "Identifies an individual risk response that this log entry is for.", 1101 name = "related-response", 1102 moduleClass = OscalAssessmentCommonModule.class 1103 ) 1104 public static class RelatedResponse implements IBoundObject { 1105 private final IMetaschemaData __metaschemaData; 1106 1107 /** 1108 * "A <a href=\"https://pages.nist.gov/OSCAL/concepts/identifier-use/#machine-oriented\">machine-oriented</a> identifier reference to a unique risk response." 1109 */ 1110 @BoundFlag( 1111 formalName = "Response Universally Unique Identifier Reference", 1112 description = "A [machine-oriented](https://pages.nist.gov/OSCAL/concepts/identifier-use/#machine-oriented) identifier reference to a unique risk response.", 1113 name = "response-uuid", 1114 required = true, 1115 typeAdapter = UuidAdapter.class 1116 ) 1117 private UUID _responseUuid; 1118 1119 @BoundAssembly( 1120 formalName = "Property", 1121 description = "An attribute, characteristic, or quality of the containing object expressed as a namespace qualified name/value pair.", 1122 useName = "prop", 1123 maxOccurs = -1, 1124 groupAs = @GroupAs(name = "props", inJson = JsonGroupAsBehavior.LIST) 1125 ) 1126 private List<Property> _props; 1127 1128 @BoundAssembly( 1129 formalName = "Link", 1130 description = "A reference to a local or remote resource, that has a specific relation to the containing object.", 1131 useName = "link", 1132 maxOccurs = -1, 1133 groupAs = @GroupAs(name = "links", inJson = JsonGroupAsBehavior.LIST) 1134 ) 1135 private List<Link> _links; 1136 1137 @BoundAssembly( 1138 formalName = "Task Reference", 1139 description = "Identifies an individual task for which the containing object is a consequence of.", 1140 useName = "related-task", 1141 remarks = "This is used to identify the task(s) that this log entry was generated for.", 1142 maxOccurs = -1, 1143 groupAs = @GroupAs(name = "related-tasks", inJson = JsonGroupAsBehavior.LIST) 1144 ) 1145 private List<RelatedTask> _relatedTasks; 1146 1147 @BoundField( 1148 formalName = "Remarks", 1149 description = "Additional commentary about the containing object.", 1150 useName = "remarks", 1151 typeAdapter = MarkupMultilineAdapter.class 1152 ) 1153 private MarkupMultiline _remarks; 1154 1155 public RelatedResponse() { 1156 this(null); 1157 } 1158 1159 public RelatedResponse(IMetaschemaData data) { 1160 this.__metaschemaData = data; 1161 } 1162 1163 @Override 1164 public IMetaschemaData getMetaschemaData() { 1165 return __metaschemaData; 1166 } 1167 1168 public UUID getResponseUuid() { 1169 return _responseUuid; 1170 } 1171 1172 public void setResponseUuid(UUID value) { 1173 _responseUuid = value; 1174 } 1175 1176 public List<Property> getProps() { 1177 return _props; 1178 } 1179 1180 public void setProps(List<Property> value) { 1181 _props = value; 1182 } 1183 1184 /** 1185 * Add a new {@link Property} item to the underlying collection. 1186 * @param item the item to add 1187 * @return {@code true} 1188 */ 1189 public boolean addProp(Property item) { 1190 Property value = ObjectUtils.requireNonNull(item,"item cannot be null"); 1191 if (_props == null) { 1192 _props = new LinkedList<>(); 1193 } 1194 return _props.add(value); 1195 } 1196 1197 /** 1198 * Remove the first matching {@link Property} item from the underlying collection. 1199 * @param item the item to remove 1200 * @return {@code true} if the item was removed or {@code false} otherwise 1201 */ 1202 public boolean removeProp(Property item) { 1203 Property value = ObjectUtils.requireNonNull(item,"item cannot be null"); 1204 return _props != null && _props.remove(value); 1205 } 1206 1207 public List<Link> getLinks() { 1208 return _links; 1209 } 1210 1211 public void setLinks(List<Link> value) { 1212 _links = value; 1213 } 1214 1215 /** 1216 * Add a new {@link Link} item to the underlying collection. 1217 * @param item the item to add 1218 * @return {@code true} 1219 */ 1220 public boolean addLink(Link item) { 1221 Link value = ObjectUtils.requireNonNull(item,"item cannot be null"); 1222 if (_links == null) { 1223 _links = new LinkedList<>(); 1224 } 1225 return _links.add(value); 1226 } 1227 1228 /** 1229 * Remove the first matching {@link Link} item from the underlying collection. 1230 * @param item the item to remove 1231 * @return {@code true} if the item was removed or {@code false} otherwise 1232 */ 1233 public boolean removeLink(Link item) { 1234 Link value = ObjectUtils.requireNonNull(item,"item cannot be null"); 1235 return _links != null && _links.remove(value); 1236 } 1237 1238 public List<RelatedTask> getRelatedTasks() { 1239 return _relatedTasks; 1240 } 1241 1242 public void setRelatedTasks(List<RelatedTask> value) { 1243 _relatedTasks = value; 1244 } 1245 1246 /** 1247 * Add a new {@link RelatedTask} item to the underlying collection. 1248 * @param item the item to add 1249 * @return {@code true} 1250 */ 1251 public boolean addRelatedTask(RelatedTask item) { 1252 RelatedTask value = ObjectUtils.requireNonNull(item,"item cannot be null"); 1253 if (_relatedTasks == null) { 1254 _relatedTasks = new LinkedList<>(); 1255 } 1256 return _relatedTasks.add(value); 1257 } 1258 1259 /** 1260 * Remove the first matching {@link RelatedTask} item from the underlying collection. 1261 * @param item the item to remove 1262 * @return {@code true} if the item was removed or {@code false} otherwise 1263 */ 1264 public boolean removeRelatedTask(RelatedTask item) { 1265 RelatedTask value = ObjectUtils.requireNonNull(item,"item cannot be null"); 1266 return _relatedTasks != null && _relatedTasks.remove(value); 1267 } 1268 1269 public MarkupMultiline getRemarks() { 1270 return _remarks; 1271 } 1272 1273 public void setRemarks(MarkupMultiline value) { 1274 _remarks = value; 1275 } 1276 1277 @Override 1278 public String toString() { 1279 return new ReflectionToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).toString(); 1280 } 1281 } 1282 } 1283 } 1284 1285 /** 1286 * Relates the finding to a set of referenced observations that were used to determine the finding. 1287 */ 1288 @MetaschemaAssembly( 1289 formalName = "Related Observation", 1290 description = "Relates the finding to a set of referenced observations that were used to determine the finding.", 1291 name = "related-observation", 1292 moduleClass = OscalAssessmentCommonModule.class 1293 ) 1294 public static class RelatedObservation implements IBoundObject { 1295 private final IMetaschemaData __metaschemaData; 1296 1297 /** 1298 * "A <a href=\"https://pages.nist.gov/OSCAL/concepts/identifier-use/#machine-oriented\">machine-oriented</a> identifier reference to an observation defined in the list of observations." 1299 */ 1300 @BoundFlag( 1301 formalName = "Observation Universally Unique Identifier Reference", 1302 description = "A [machine-oriented](https://pages.nist.gov/OSCAL/concepts/identifier-use/#machine-oriented) identifier reference to an observation defined in the list of observations.", 1303 name = "observation-uuid", 1304 required = true, 1305 typeAdapter = UuidAdapter.class 1306 ) 1307 private UUID _observationUuid; 1308 1309 public RelatedObservation() { 1310 this(null); 1311 } 1312 1313 public RelatedObservation(IMetaschemaData data) { 1314 this.__metaschemaData = data; 1315 } 1316 1317 @Override 1318 public IMetaschemaData getMetaschemaData() { 1319 return __metaschemaData; 1320 } 1321 1322 public UUID getObservationUuid() { 1323 return _observationUuid; 1324 } 1325 1326 public void setObservationUuid(UUID value) { 1327 _observationUuid = value; 1328 } 1329 1330 @Override 1331 public String toString() { 1332 return new ReflectionToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).toString(); 1333 } 1334 } 1335}