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