001package gov.nist.secauto.oscal.lib.model; 002 003import gov.nist.secauto.metaschema.binding.model.annotations.AllowedValue; 004import gov.nist.secauto.metaschema.binding.model.annotations.AllowedValues; 005import gov.nist.secauto.metaschema.binding.model.annotations.AssemblyConstraints; 006import gov.nist.secauto.metaschema.binding.model.annotations.BoundAssembly; 007import gov.nist.secauto.metaschema.binding.model.annotations.BoundField; 008import gov.nist.secauto.metaschema.binding.model.annotations.BoundFieldValue; 009import gov.nist.secauto.metaschema.binding.model.annotations.BoundFlag; 010import gov.nist.secauto.metaschema.binding.model.annotations.GroupAs; 011import gov.nist.secauto.metaschema.binding.model.annotations.IsUnique; 012import gov.nist.secauto.metaschema.binding.model.annotations.KeyField; 013import gov.nist.secauto.metaschema.binding.model.annotations.MetaschemaAssembly; 014import gov.nist.secauto.metaschema.binding.model.annotations.ValueConstraints; 015import gov.nist.secauto.metaschema.model.common.JsonGroupAsBehavior; 016import gov.nist.secauto.metaschema.model.common.constraint.IConstraint; 017import gov.nist.secauto.metaschema.model.common.datatype.adapter.DateTimeWithTZAdapter; 018import gov.nist.secauto.metaschema.model.common.datatype.adapter.PositiveIntegerAdapter; 019import gov.nist.secauto.metaschema.model.common.datatype.adapter.StringAdapter; 020import gov.nist.secauto.metaschema.model.common.datatype.adapter.TokenAdapter; 021import gov.nist.secauto.metaschema.model.common.datatype.adapter.UuidAdapter; 022import gov.nist.secauto.metaschema.model.common.datatype.markup.MarkupLine; 023import gov.nist.secauto.metaschema.model.common.datatype.markup.MarkupLineAdapter; 024import gov.nist.secauto.metaschema.model.common.datatype.markup.MarkupMultiline; 025import gov.nist.secauto.metaschema.model.common.datatype.markup.MarkupMultilineAdapter; 026import gov.nist.secauto.metaschema.model.common.util.ObjectUtils; 027import java.lang.Override; 028import java.lang.String; 029import java.math.BigInteger; 030import java.time.ZonedDateTime; 031import java.util.LinkedList; 032import java.util.List; 033import java.util.UUID; 034import org.apache.commons.lang3.builder.MultilineRecursiveToStringStyle; 035import org.apache.commons.lang3.builder.ReflectionToStringBuilder; 036 037/** 038 * Represents a scheduled event or milestone, which may be associated with a series of assessment actions. 039 */ 040@MetaschemaAssembly( 041 formalName = "Task", 042 description = "Represents a scheduled event or milestone, which may be associated with a series of assessment actions.", 043 name = "task", 044 metaschema = OscalAssessmentCommonMetaschema.class 045) 046public class Task { 047 @BoundFlag( 048 formalName = "Task Universally Unique Identifier", 049 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 task elsewhere in [this or other OSCAL instances](https://pages.nist.gov/OSCAL/concepts/identifier-use/#scope). The locally defined *UUID* of the `task` 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.", 050 useName = "uuid", 051 required = true, 052 typeAdapter = UuidAdapter.class 053 ) 054 private UUID _uuid; 055 056 @BoundFlag( 057 formalName = "Task Type", 058 description = "The type of task.", 059 useName = "type", 060 required = true, 061 typeAdapter = TokenAdapter.class 062 ) 063 @ValueConstraints( 064 allowedValues = @AllowedValues(level = IConstraint.Level.ERROR, allowOthers = true, values = {@AllowedValue(value = "milestone", description = "The task represents a planned milestone."), @AllowedValue(value = "action", description = "The task represents a specific assessment action to be performed.")}) 065 ) 066 private String _type; 067 068 /** 069 * "The title for this task." 070 */ 071 @BoundField( 072 formalName = "Task Title", 073 description = "The title for this task.", 074 useName = "title", 075 minOccurs = 1 076 ) 077 @BoundFieldValue( 078 typeAdapter = MarkupLineAdapter.class 079 ) 080 private MarkupLine _title; 081 082 /** 083 * "A human-readable description of this task." 084 */ 085 @BoundField( 086 formalName = "Task Description", 087 description = "A human-readable description of this task.", 088 useName = "description" 089 ) 090 @BoundFieldValue( 091 typeAdapter = MarkupMultilineAdapter.class 092 ) 093 private MarkupMultiline _description; 094 095 @BoundAssembly( 096 formalName = "Property", 097 description = "An attribute, characteristic, or quality of the containing object expressed as a namespace qualified name/value pair.", 098 useName = "prop", 099 maxOccurs = -1 100 ) 101 @GroupAs( 102 name = "props", 103 inJson = JsonGroupAsBehavior.LIST 104 ) 105 private List<Property> _props; 106 107 @BoundAssembly( 108 formalName = "Link", 109 description = "A reference to a local or remote resource, that has a specific relation to the containing object.", 110 useName = "link", 111 maxOccurs = -1 112 ) 113 @GroupAs( 114 name = "links", 115 inJson = JsonGroupAsBehavior.LIST 116 ) 117 private List<Link> _links; 118 119 /** 120 * "The timing under which the task is intended to occur." 121 */ 122 @BoundAssembly( 123 formalName = "Event Timing", 124 description = "The timing under which the task is intended to occur.", 125 useName = "timing" 126 ) 127 private Timing _timing; 128 129 /** 130 * "Used to indicate that a task is dependent on another task." 131 */ 132 @BoundAssembly( 133 formalName = "Task Dependency", 134 description = "Used to indicate that a task is dependent on another task.", 135 useName = "dependency", 136 maxOccurs = -1 137 ) 138 @GroupAs( 139 name = "dependencies", 140 inJson = JsonGroupAsBehavior.LIST 141 ) 142 private List<Dependency> _dependencies; 143 144 @BoundAssembly( 145 formalName = "Task", 146 description = "Represents a scheduled event or milestone, which may be associated with a series of assessment actions.", 147 useName = "task", 148 maxOccurs = -1 149 ) 150 @GroupAs( 151 name = "tasks", 152 inJson = JsonGroupAsBehavior.LIST 153 ) 154 private List<Task> _tasks; 155 156 /** 157 * "Identifies an individual activity to be performed as part of a task." 158 */ 159 @BoundAssembly( 160 formalName = "Associated Activity", 161 description = "Identifies an individual activity to be performed as part of a task.", 162 useName = "associated-activity", 163 maxOccurs = -1 164 ) 165 @GroupAs( 166 name = "associated-activities", 167 inJson = JsonGroupAsBehavior.LIST 168 ) 169 private List<AssociatedActivity> _associatedActivities; 170 171 @BoundAssembly( 172 formalName = "Subject of Assessment", 173 description = "Identifies system elements being assessed, such as components, inventory items, and locations. In the assessment plan, this identifies a planned assessment subject. In the assessment results this is an actual assessment subject, and reflects any changes from the plan. exactly what will be the focus of this assessment. Any subjects not identified in this way are out-of-scope.", 174 useName = "subject", 175 maxOccurs = -1, 176 remarks = "The assessment subjects that the activity was performed against." 177 ) 178 @GroupAs( 179 name = "subjects", 180 inJson = JsonGroupAsBehavior.LIST 181 ) 182 private List<AssessmentSubject> _subjects; 183 184 @BoundAssembly( 185 formalName = "Responsible Role", 186 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.", 187 useName = "responsible-role", 188 maxOccurs = -1, 189 remarks = "Identifies the person or organization responsible for performing a specific role related to the task." 190 ) 191 @GroupAs( 192 name = "responsible-roles", 193 inJson = JsonGroupAsBehavior.LIST 194 ) 195 private List<ResponsibleRole> _responsibleRoles; 196 197 @BoundField( 198 formalName = "Remarks", 199 description = "Additional commentary about the containing object.", 200 useName = "remarks" 201 ) 202 @BoundFieldValue( 203 typeAdapter = MarkupMultilineAdapter.class 204 ) 205 private MarkupMultiline _remarks; 206 207 public Task() { 208 } 209 210 public UUID getUuid() { 211 return _uuid; 212 } 213 214 public void setUuid(UUID value) { 215 _uuid = value; 216 } 217 218 public String getType() { 219 return _type; 220 } 221 222 public void setType(String value) { 223 _type = value; 224 } 225 226 public MarkupLine getTitle() { 227 return _title; 228 } 229 230 public void setTitle(MarkupLine value) { 231 _title = value; 232 } 233 234 public MarkupMultiline getDescription() { 235 return _description; 236 } 237 238 public void setDescription(MarkupMultiline value) { 239 _description = value; 240 } 241 242 public List<Property> getProps() { 243 return _props; 244 } 245 246 public void setProps(List<Property> value) { 247 _props = value; 248 } 249 250 /** 251 * Add a new {@link Property} item to the underlying collection. 252 * @param item the item to add 253 * @return {@code true} 254 */ 255 public boolean addProp(Property item) { 256 Property value = ObjectUtils.requireNonNull(item,"item cannot be null"); 257 if (_props == null) { 258 _props = new LinkedList<>(); 259 } 260 return _props.add(value); 261 } 262 263 /** 264 * Remove the first matching {@link Property} item from the underlying collection. 265 * @param item the item to remove 266 * @return {@code true} if the item was removed or {@code false} otherwise 267 */ 268 public boolean removeProp(Property item) { 269 Property value = ObjectUtils.requireNonNull(item,"item cannot be null"); 270 return _props == null ? false : _props.remove(value); 271 } 272 273 public List<Link> getLinks() { 274 return _links; 275 } 276 277 public void setLinks(List<Link> value) { 278 _links = value; 279 } 280 281 /** 282 * Add a new {@link Link} item to the underlying collection. 283 * @param item the item to add 284 * @return {@code true} 285 */ 286 public boolean addLink(Link item) { 287 Link value = ObjectUtils.requireNonNull(item,"item cannot be null"); 288 if (_links == null) { 289 _links = new LinkedList<>(); 290 } 291 return _links.add(value); 292 } 293 294 /** 295 * Remove the first matching {@link Link} item from the underlying collection. 296 * @param item the item to remove 297 * @return {@code true} if the item was removed or {@code false} otherwise 298 */ 299 public boolean removeLink(Link item) { 300 Link value = ObjectUtils.requireNonNull(item,"item cannot be null"); 301 return _links == null ? false : _links.remove(value); 302 } 303 304 public Timing getTiming() { 305 return _timing; 306 } 307 308 public void setTiming(Timing value) { 309 _timing = value; 310 } 311 312 public List<Dependency> getDependencies() { 313 return _dependencies; 314 } 315 316 public void setDependencies(List<Dependency> value) { 317 _dependencies = value; 318 } 319 320 /** 321 * Add a new {@link Dependency} item to the underlying collection. 322 * @param item the item to add 323 * @return {@code true} 324 */ 325 public boolean addDependency(Dependency item) { 326 Dependency value = ObjectUtils.requireNonNull(item,"item cannot be null"); 327 if (_dependencies == null) { 328 _dependencies = new LinkedList<>(); 329 } 330 return _dependencies.add(value); 331 } 332 333 /** 334 * Remove the first matching {@link Dependency} item from the underlying collection. 335 * @param item the item to remove 336 * @return {@code true} if the item was removed or {@code false} otherwise 337 */ 338 public boolean removeDependency(Dependency item) { 339 Dependency value = ObjectUtils.requireNonNull(item,"item cannot be null"); 340 return _dependencies == null ? false : _dependencies.remove(value); 341 } 342 343 public List<Task> getTasks() { 344 return _tasks; 345 } 346 347 public void setTasks(List<Task> value) { 348 _tasks = value; 349 } 350 351 /** 352 * Add a new {@link Task} item to the underlying collection. 353 * @param item the item to add 354 * @return {@code true} 355 */ 356 public boolean addTask(Task item) { 357 Task value = ObjectUtils.requireNonNull(item,"item cannot be null"); 358 if (_tasks == null) { 359 _tasks = new LinkedList<>(); 360 } 361 return _tasks.add(value); 362 } 363 364 /** 365 * Remove the first matching {@link Task} item from the underlying collection. 366 * @param item the item to remove 367 * @return {@code true} if the item was removed or {@code false} otherwise 368 */ 369 public boolean removeTask(Task item) { 370 Task value = ObjectUtils.requireNonNull(item,"item cannot be null"); 371 return _tasks == null ? false : _tasks.remove(value); 372 } 373 374 public List<AssociatedActivity> getAssociatedActivities() { 375 return _associatedActivities; 376 } 377 378 public void setAssociatedActivities(List<AssociatedActivity> value) { 379 _associatedActivities = value; 380 } 381 382 /** 383 * Add a new {@link AssociatedActivity} item to the underlying collection. 384 * @param item the item to add 385 * @return {@code true} 386 */ 387 public boolean addAssociatedActivity(AssociatedActivity item) { 388 AssociatedActivity value = ObjectUtils.requireNonNull(item,"item cannot be null"); 389 if (_associatedActivities == null) { 390 _associatedActivities = new LinkedList<>(); 391 } 392 return _associatedActivities.add(value); 393 } 394 395 /** 396 * Remove the first matching {@link AssociatedActivity} item from the underlying collection. 397 * @param item the item to remove 398 * @return {@code true} if the item was removed or {@code false} otherwise 399 */ 400 public boolean removeAssociatedActivity(AssociatedActivity item) { 401 AssociatedActivity value = ObjectUtils.requireNonNull(item,"item cannot be null"); 402 return _associatedActivities == null ? false : _associatedActivities.remove(value); 403 } 404 405 public List<AssessmentSubject> getSubjects() { 406 return _subjects; 407 } 408 409 public void setSubjects(List<AssessmentSubject> value) { 410 _subjects = value; 411 } 412 413 /** 414 * Add a new {@link AssessmentSubject} item to the underlying collection. 415 * @param item the item to add 416 * @return {@code true} 417 */ 418 public boolean addSubject(AssessmentSubject item) { 419 AssessmentSubject value = ObjectUtils.requireNonNull(item,"item cannot be null"); 420 if (_subjects == null) { 421 _subjects = new LinkedList<>(); 422 } 423 return _subjects.add(value); 424 } 425 426 /** 427 * Remove the first matching {@link AssessmentSubject} item from the underlying collection. 428 * @param item the item to remove 429 * @return {@code true} if the item was removed or {@code false} otherwise 430 */ 431 public boolean removeSubject(AssessmentSubject item) { 432 AssessmentSubject value = ObjectUtils.requireNonNull(item,"item cannot be null"); 433 return _subjects == null ? false : _subjects.remove(value); 434 } 435 436 public List<ResponsibleRole> getResponsibleRoles() { 437 return _responsibleRoles; 438 } 439 440 public void setResponsibleRoles(List<ResponsibleRole> value) { 441 _responsibleRoles = value; 442 } 443 444 /** 445 * Add a new {@link ResponsibleRole} item to the underlying collection. 446 * @param item the item to add 447 * @return {@code true} 448 */ 449 public boolean addResponsibleRole(ResponsibleRole item) { 450 ResponsibleRole value = ObjectUtils.requireNonNull(item,"item cannot be null"); 451 if (_responsibleRoles == null) { 452 _responsibleRoles = new LinkedList<>(); 453 } 454 return _responsibleRoles.add(value); 455 } 456 457 /** 458 * Remove the first matching {@link ResponsibleRole} item from the underlying collection. 459 * @param item the item to remove 460 * @return {@code true} if the item was removed or {@code false} otherwise 461 */ 462 public boolean removeResponsibleRole(ResponsibleRole item) { 463 ResponsibleRole value = ObjectUtils.requireNonNull(item,"item cannot be null"); 464 return _responsibleRoles == null ? false : _responsibleRoles.remove(value); 465 } 466 467 public MarkupMultiline getRemarks() { 468 return _remarks; 469 } 470 471 public void setRemarks(MarkupMultiline value) { 472 _remarks = value; 473 } 474 475 @Override 476 public String toString() { 477 return new ReflectionToStringBuilder(this, MultilineRecursiveToStringStyle.MULTI_LINE_STYLE).toString(); 478 } 479 480 /** 481 * The timing under which the task is intended to occur. 482 */ 483 @MetaschemaAssembly( 484 formalName = "Event Timing", 485 description = "The timing under which the task is intended to occur.", 486 name = "timing", 487 metaschema = OscalAssessmentCommonMetaschema.class 488 ) 489 public static class Timing { 490 /** 491 * "The task is intended to occur on the specified date." 492 */ 493 @BoundAssembly( 494 formalName = "On Date Condition", 495 description = "The task is intended to occur on the specified date.", 496 useName = "on-date", 497 minOccurs = 1 498 ) 499 private OnDate _onDate; 500 501 /** 502 * "The task is intended to occur within the specified date range." 503 */ 504 @BoundAssembly( 505 formalName = "On Date Range Condition", 506 description = "The task is intended to occur within the specified date range.", 507 useName = "within-date-range", 508 minOccurs = 1 509 ) 510 private WithinDateRange _withinDateRange; 511 512 /** 513 * "The task is intended to occur at the specified frequency." 514 */ 515 @BoundAssembly( 516 formalName = "Frequency Condition", 517 description = "The task is intended to occur at the specified frequency.", 518 useName = "at-frequency", 519 minOccurs = 1 520 ) 521 private AtFrequency _atFrequency; 522 523 public Timing() { 524 } 525 526 public OnDate getOnDate() { 527 return _onDate; 528 } 529 530 public void setOnDate(OnDate value) { 531 _onDate = value; 532 } 533 534 public WithinDateRange getWithinDateRange() { 535 return _withinDateRange; 536 } 537 538 public void setWithinDateRange(WithinDateRange value) { 539 _withinDateRange = value; 540 } 541 542 public AtFrequency getAtFrequency() { 543 return _atFrequency; 544 } 545 546 public void setAtFrequency(AtFrequency value) { 547 _atFrequency = value; 548 } 549 550 @Override 551 public String toString() { 552 return new ReflectionToStringBuilder(this, MultilineRecursiveToStringStyle.MULTI_LINE_STYLE).toString(); 553 } 554 555 /** 556 * The task is intended to occur at the specified frequency. 557 */ 558 @MetaschemaAssembly( 559 formalName = "Frequency Condition", 560 description = "The task is intended to occur at the specified frequency.", 561 name = "at-frequency", 562 metaschema = OscalAssessmentCommonMetaschema.class 563 ) 564 public static class AtFrequency { 565 @BoundFlag( 566 formalName = "Period", 567 description = "The task must occur after the specified period has elapsed.", 568 useName = "period", 569 required = true, 570 typeAdapter = PositiveIntegerAdapter.class 571 ) 572 private BigInteger _period; 573 574 @BoundFlag( 575 formalName = "Time Unit", 576 description = "The unit of time for the period.", 577 useName = "unit", 578 required = true, 579 typeAdapter = StringAdapter.class 580 ) 581 @ValueConstraints( 582 allowedValues = @AllowedValues(level = IConstraint.Level.ERROR, values = {@AllowedValue(value = "seconds", description = "The period is specified in seconds."), @AllowedValue(value = "minutes", description = "The period is specified in minutes."), @AllowedValue(value = "hours", description = "The period is specified in hours."), @AllowedValue(value = "days", description = "The period is specified in days."), @AllowedValue(value = "months", description = "The period is specified in calendar months."), @AllowedValue(value = "years", description = "The period is specified in calendar years.")}) 583 ) 584 private String _unit; 585 586 public AtFrequency() { 587 } 588 589 public BigInteger getPeriod() { 590 return _period; 591 } 592 593 public void setPeriod(BigInteger value) { 594 _period = value; 595 } 596 597 public String getUnit() { 598 return _unit; 599 } 600 601 public void setUnit(String value) { 602 _unit = value; 603 } 604 605 @Override 606 public String toString() { 607 return new ReflectionToStringBuilder(this, MultilineRecursiveToStringStyle.MULTI_LINE_STYLE).toString(); 608 } 609 } 610 611 /** 612 * The task is intended to occur within the specified date range. 613 */ 614 @MetaschemaAssembly( 615 formalName = "On Date Range Condition", 616 description = "The task is intended to occur within the specified date range.", 617 name = "within-date-range", 618 metaschema = OscalAssessmentCommonMetaschema.class 619 ) 620 public static class WithinDateRange { 621 @BoundFlag( 622 formalName = "Start Date Condition", 623 description = "The task must occur on or after the specified date.", 624 useName = "start", 625 required = true, 626 typeAdapter = DateTimeWithTZAdapter.class 627 ) 628 private ZonedDateTime _start; 629 630 @BoundFlag( 631 formalName = "End Date Condition", 632 description = "The task must occur on or before the specified date.", 633 useName = "end", 634 required = true, 635 typeAdapter = DateTimeWithTZAdapter.class 636 ) 637 private ZonedDateTime _end; 638 639 public WithinDateRange() { 640 } 641 642 public ZonedDateTime getStart() { 643 return _start; 644 } 645 646 public void setStart(ZonedDateTime value) { 647 _start = value; 648 } 649 650 public ZonedDateTime getEnd() { 651 return _end; 652 } 653 654 public void setEnd(ZonedDateTime value) { 655 _end = value; 656 } 657 658 @Override 659 public String toString() { 660 return new ReflectionToStringBuilder(this, MultilineRecursiveToStringStyle.MULTI_LINE_STYLE).toString(); 661 } 662 } 663 664 /** 665 * The task is intended to occur on the specified date. 666 */ 667 @MetaschemaAssembly( 668 formalName = "On Date Condition", 669 description = "The task is intended to occur on the specified date.", 670 name = "on-date", 671 metaschema = OscalAssessmentCommonMetaschema.class 672 ) 673 public static class OnDate { 674 @BoundFlag( 675 formalName = "On Date Condition", 676 description = "The task must occur on the specified date.", 677 useName = "date", 678 required = true, 679 typeAdapter = DateTimeWithTZAdapter.class 680 ) 681 private ZonedDateTime _date; 682 683 public OnDate() { 684 } 685 686 public ZonedDateTime getDate() { 687 return _date; 688 } 689 690 public void setDate(ZonedDateTime value) { 691 _date = value; 692 } 693 694 @Override 695 public String toString() { 696 return new ReflectionToStringBuilder(this, MultilineRecursiveToStringStyle.MULTI_LINE_STYLE).toString(); 697 } 698 } 699 } 700 701 /** 702 * Identifies an individual activity to be performed as part of a task. 703 */ 704 @MetaschemaAssembly( 705 formalName = "Associated Activity", 706 description = "Identifies an individual activity to be performed as part of a task.", 707 name = "associated-activity", 708 metaschema = OscalAssessmentCommonMetaschema.class 709 ) 710 @AssemblyConstraints( 711 isUnique = @IsUnique(id = "unique-associated-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.") 712 ) 713 public static class AssociatedActivity { 714 @BoundFlag( 715 formalName = "Activity Universally Unique Identifier Reference", 716 description = "A [machine-oriented](https://pages.nist.gov/OSCAL/concepts/identifier-use/#machine-oriented) identifier reference to an activity defined in the list of activities.", 717 useName = "activity-uuid", 718 required = true, 719 typeAdapter = UuidAdapter.class 720 ) 721 private UUID _activityUuid; 722 723 @BoundAssembly( 724 formalName = "Property", 725 description = "An attribute, characteristic, or quality of the containing object expressed as a namespace qualified name/value pair.", 726 useName = "prop", 727 maxOccurs = -1 728 ) 729 @GroupAs( 730 name = "props", 731 inJson = JsonGroupAsBehavior.LIST 732 ) 733 private List<Property> _props; 734 735 @BoundAssembly( 736 formalName = "Link", 737 description = "A reference to a local or remote resource, that has a specific relation to the containing object.", 738 useName = "link", 739 maxOccurs = -1 740 ) 741 @GroupAs( 742 name = "links", 743 inJson = JsonGroupAsBehavior.LIST 744 ) 745 private List<Link> _links; 746 747 @BoundAssembly( 748 formalName = "Responsible Role", 749 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.", 750 useName = "responsible-role", 751 maxOccurs = -1, 752 remarks = "Identifies the person or organization responsible for performing a specific role defined by the activity." 753 ) 754 @GroupAs( 755 name = "responsible-roles", 756 inJson = JsonGroupAsBehavior.LIST 757 ) 758 private List<ResponsibleRole> _responsibleRoles; 759 760 @BoundAssembly( 761 formalName = "Subject of Assessment", 762 description = "Identifies system elements being assessed, such as components, inventory items, and locations. In the assessment plan, this identifies a planned assessment subject. In the assessment results this is an actual assessment subject, and reflects any changes from the plan. exactly what will be the focus of this assessment. Any subjects not identified in this way are out-of-scope.", 763 useName = "subject", 764 minOccurs = 1, 765 maxOccurs = -1 766 ) 767 @GroupAs( 768 name = "subjects", 769 inJson = JsonGroupAsBehavior.LIST 770 ) 771 private List<AssessmentSubject> _subjects; 772 773 @BoundField( 774 formalName = "Remarks", 775 description = "Additional commentary about the containing object.", 776 useName = "remarks" 777 ) 778 @BoundFieldValue( 779 typeAdapter = MarkupMultilineAdapter.class 780 ) 781 private MarkupMultiline _remarks; 782 783 public AssociatedActivity() { 784 } 785 786 public UUID getActivityUuid() { 787 return _activityUuid; 788 } 789 790 public void setActivityUuid(UUID value) { 791 _activityUuid = value; 792 } 793 794 public List<Property> getProps() { 795 return _props; 796 } 797 798 public void setProps(List<Property> value) { 799 _props = value; 800 } 801 802 /** 803 * Add a new {@link Property} item to the underlying collection. 804 * @param item the item to add 805 * @return {@code true} 806 */ 807 public boolean addProp(Property item) { 808 Property value = ObjectUtils.requireNonNull(item,"item cannot be null"); 809 if (_props == null) { 810 _props = new LinkedList<>(); 811 } 812 return _props.add(value); 813 } 814 815 /** 816 * Remove the first matching {@link Property} item from the underlying collection. 817 * @param item the item to remove 818 * @return {@code true} if the item was removed or {@code false} otherwise 819 */ 820 public boolean removeProp(Property item) { 821 Property value = ObjectUtils.requireNonNull(item,"item cannot be null"); 822 return _props == null ? false : _props.remove(value); 823 } 824 825 public List<Link> getLinks() { 826 return _links; 827 } 828 829 public void setLinks(List<Link> value) { 830 _links = value; 831 } 832 833 /** 834 * Add a new {@link Link} item to the underlying collection. 835 * @param item the item to add 836 * @return {@code true} 837 */ 838 public boolean addLink(Link item) { 839 Link value = ObjectUtils.requireNonNull(item,"item cannot be null"); 840 if (_links == null) { 841 _links = new LinkedList<>(); 842 } 843 return _links.add(value); 844 } 845 846 /** 847 * Remove the first matching {@link Link} item from the underlying collection. 848 * @param item the item to remove 849 * @return {@code true} if the item was removed or {@code false} otherwise 850 */ 851 public boolean removeLink(Link item) { 852 Link value = ObjectUtils.requireNonNull(item,"item cannot be null"); 853 return _links == null ? false : _links.remove(value); 854 } 855 856 public List<ResponsibleRole> getResponsibleRoles() { 857 return _responsibleRoles; 858 } 859 860 public void setResponsibleRoles(List<ResponsibleRole> value) { 861 _responsibleRoles = value; 862 } 863 864 /** 865 * Add a new {@link ResponsibleRole} item to the underlying collection. 866 * @param item the item to add 867 * @return {@code true} 868 */ 869 public boolean addResponsibleRole(ResponsibleRole item) { 870 ResponsibleRole value = ObjectUtils.requireNonNull(item,"item cannot be null"); 871 if (_responsibleRoles == null) { 872 _responsibleRoles = new LinkedList<>(); 873 } 874 return _responsibleRoles.add(value); 875 } 876 877 /** 878 * Remove the first matching {@link ResponsibleRole} item from the underlying collection. 879 * @param item the item to remove 880 * @return {@code true} if the item was removed or {@code false} otherwise 881 */ 882 public boolean removeResponsibleRole(ResponsibleRole item) { 883 ResponsibleRole value = ObjectUtils.requireNonNull(item,"item cannot be null"); 884 return _responsibleRoles == null ? false : _responsibleRoles.remove(value); 885 } 886 887 public List<AssessmentSubject> getSubjects() { 888 return _subjects; 889 } 890 891 public void setSubjects(List<AssessmentSubject> value) { 892 _subjects = value; 893 } 894 895 /** 896 * Add a new {@link AssessmentSubject} item to the underlying collection. 897 * @param item the item to add 898 * @return {@code true} 899 */ 900 public boolean addSubject(AssessmentSubject item) { 901 AssessmentSubject value = ObjectUtils.requireNonNull(item,"item cannot be null"); 902 if (_subjects == null) { 903 _subjects = new LinkedList<>(); 904 } 905 return _subjects.add(value); 906 } 907 908 /** 909 * Remove the first matching {@link AssessmentSubject} item from the underlying collection. 910 * @param item the item to remove 911 * @return {@code true} if the item was removed or {@code false} otherwise 912 */ 913 public boolean removeSubject(AssessmentSubject item) { 914 AssessmentSubject value = ObjectUtils.requireNonNull(item,"item cannot be null"); 915 return _subjects == null ? false : _subjects.remove(value); 916 } 917 918 public MarkupMultiline getRemarks() { 919 return _remarks; 920 } 921 922 public void setRemarks(MarkupMultiline value) { 923 _remarks = value; 924 } 925 926 @Override 927 public String toString() { 928 return new ReflectionToStringBuilder(this, MultilineRecursiveToStringStyle.MULTI_LINE_STYLE).toString(); 929 } 930 } 931 932 /** 933 * Used to indicate that a task is dependent on another task. 934 */ 935 @MetaschemaAssembly( 936 formalName = "Task Dependency", 937 description = "Used to indicate that a task is dependent on another task.", 938 name = "dependency", 939 metaschema = OscalAssessmentCommonMetaschema.class 940 ) 941 public static class Dependency { 942 @BoundFlag( 943 formalName = "Task Universally Unique Identifier Reference", 944 description = "A [machine-oriented](https://pages.nist.gov/OSCAL/concepts/identifier-use/#machine-oriented) identifier reference to a unique task.", 945 useName = "task-uuid", 946 required = true, 947 typeAdapter = UuidAdapter.class 948 ) 949 private UUID _taskUuid; 950 951 @BoundField( 952 formalName = "Remarks", 953 description = "Additional commentary about the containing object.", 954 useName = "remarks" 955 ) 956 @BoundFieldValue( 957 typeAdapter = MarkupMultilineAdapter.class 958 ) 959 private MarkupMultiline _remarks; 960 961 public Dependency() { 962 } 963 964 public UUID getTaskUuid() { 965 return _taskUuid; 966 } 967 968 public void setTaskUuid(UUID value) { 969 _taskUuid = value; 970 } 971 972 public MarkupMultiline getRemarks() { 973 return _remarks; 974 } 975 976 public void setRemarks(MarkupMultiline value) { 977 _remarks = value; 978 } 979 980 @Override 981 public String toString() { 982 return new ReflectionToStringBuilder(this, MultilineRecursiveToStringStyle.MULTI_LINE_STYLE).toString(); 983 } 984 } 985}