Task.java

package gov.nist.secauto.oscal.lib.model;

import gov.nist.secauto.metaschema.binding.model.annotations.AllowedValue;
import gov.nist.secauto.metaschema.binding.model.annotations.AllowedValues;
import gov.nist.secauto.metaschema.binding.model.annotations.AssemblyConstraints;
import gov.nist.secauto.metaschema.binding.model.annotations.BoundAssembly;
import gov.nist.secauto.metaschema.binding.model.annotations.BoundField;
import gov.nist.secauto.metaschema.binding.model.annotations.BoundFieldValue;
import gov.nist.secauto.metaschema.binding.model.annotations.BoundFlag;
import gov.nist.secauto.metaschema.binding.model.annotations.GroupAs;
import gov.nist.secauto.metaschema.binding.model.annotations.IsUnique;
import gov.nist.secauto.metaschema.binding.model.annotations.KeyField;
import gov.nist.secauto.metaschema.binding.model.annotations.MetaschemaAssembly;
import gov.nist.secauto.metaschema.binding.model.annotations.ValueConstraints;
import gov.nist.secauto.metaschema.model.common.JsonGroupAsBehavior;
import gov.nist.secauto.metaschema.model.common.constraint.IConstraint;
import gov.nist.secauto.metaschema.model.common.datatype.adapter.DateTimeWithTZAdapter;
import gov.nist.secauto.metaschema.model.common.datatype.adapter.PositiveIntegerAdapter;
import gov.nist.secauto.metaschema.model.common.datatype.adapter.StringAdapter;
import gov.nist.secauto.metaschema.model.common.datatype.adapter.TokenAdapter;
import gov.nist.secauto.metaschema.model.common.datatype.adapter.UuidAdapter;
import gov.nist.secauto.metaschema.model.common.datatype.markup.MarkupLine;
import gov.nist.secauto.metaschema.model.common.datatype.markup.MarkupLineAdapter;
import gov.nist.secauto.metaschema.model.common.datatype.markup.MarkupMultiline;
import gov.nist.secauto.metaschema.model.common.datatype.markup.MarkupMultilineAdapter;
import gov.nist.secauto.metaschema.model.common.util.ObjectUtils;
import java.lang.Override;
import java.lang.String;
import java.math.BigInteger;
import java.time.ZonedDateTime;
import java.util.LinkedList;
import java.util.List;
import java.util.UUID;
import org.apache.commons.lang3.builder.MultilineRecursiveToStringStyle;
import org.apache.commons.lang3.builder.ReflectionToStringBuilder;

/**
 * Represents a scheduled event or milestone, which may be associated with a series of assessment actions.
 */
@MetaschemaAssembly(
    formalName = "Task",
    description = "Represents a scheduled event or milestone, which may be associated with a series of assessment actions.",
    name = "task",
    metaschema = OscalAssessmentCommonMetaschema.class
)
public class Task {
  @BoundFlag(
      formalName = "Task Universally Unique Identifier",
      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.",
      useName = "uuid",
      required = true,
      typeAdapter = UuidAdapter.class
  )
  private UUID _uuid;

  @BoundFlag(
      formalName = "Task Type",
      description = "The type of task.",
      useName = "type",
      required = true,
      typeAdapter = TokenAdapter.class
  )
  @ValueConstraints(
      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.")})
  )
  private String _type;

  /**
   * "The title for this task."
   */
  @BoundField(
      formalName = "Task Title",
      description = "The title for this task.",
      useName = "title",
      minOccurs = 1
  )
  @BoundFieldValue(
      typeAdapter = MarkupLineAdapter.class
  )
  private MarkupLine _title;

  /**
   * "A human-readable description of this task."
   */
  @BoundField(
      formalName = "Task Description",
      description = "A human-readable description of this task.",
      useName = "description"
  )
  @BoundFieldValue(
      typeAdapter = MarkupMultilineAdapter.class
  )
  private MarkupMultiline _description;

  @BoundAssembly(
      formalName = "Property",
      description = "An attribute, characteristic, or quality of the containing object expressed as a namespace qualified name/value pair.",
      useName = "prop",
      maxOccurs = -1
  )
  @GroupAs(
      name = "props",
      inJson = JsonGroupAsBehavior.LIST
  )
  private List<Property> _props;

  @BoundAssembly(
      formalName = "Link",
      description = "A reference to a local or remote resource, that has a specific relation to the containing object.",
      useName = "link",
      maxOccurs = -1
  )
  @GroupAs(
      name = "links",
      inJson = JsonGroupAsBehavior.LIST
  )
  private List<Link> _links;

  /**
   * "The timing under which the task is intended to occur."
   */
  @BoundAssembly(
      formalName = "Event Timing",
      description = "The timing under which the task is intended to occur.",
      useName = "timing"
  )
  private Timing _timing;

  /**
   * "Used to indicate that a task is dependent on another task."
   */
  @BoundAssembly(
      formalName = "Task Dependency",
      description = "Used to indicate that a task is dependent on another task.",
      useName = "dependency",
      maxOccurs = -1
  )
  @GroupAs(
      name = "dependencies",
      inJson = JsonGroupAsBehavior.LIST
  )
  private List<Dependency> _dependencies;

  @BoundAssembly(
      formalName = "Task",
      description = "Represents a scheduled event or milestone, which may be associated with a series of assessment actions.",
      useName = "task",
      maxOccurs = -1
  )
  @GroupAs(
      name = "tasks",
      inJson = JsonGroupAsBehavior.LIST
  )
  private List<Task> _tasks;

  /**
   * "Identifies an individual activity to be performed as part of a task."
   */
  @BoundAssembly(
      formalName = "Associated Activity",
      description = "Identifies an individual activity to be performed as part of a task.",
      useName = "associated-activity",
      maxOccurs = -1
  )
  @GroupAs(
      name = "associated-activities",
      inJson = JsonGroupAsBehavior.LIST
  )
  private List<AssociatedActivity> _associatedActivities;

  @BoundAssembly(
      formalName = "Subject of Assessment",
      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.",
      useName = "subject",
      maxOccurs = -1,
      remarks = "The assessment subjects that the activity was performed against."
  )
  @GroupAs(
      name = "subjects",
      inJson = JsonGroupAsBehavior.LIST
  )
  private List<AssessmentSubject> _subjects;

  @BoundAssembly(
      formalName = "Responsible Role",
      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.",
      useName = "responsible-role",
      maxOccurs = -1,
      remarks = "Identifies the person or organization responsible for performing a specific role related to the task."
  )
  @GroupAs(
      name = "responsible-roles",
      inJson = JsonGroupAsBehavior.LIST
  )
  private List<ResponsibleRole> _responsibleRoles;

  @BoundField(
      formalName = "Remarks",
      description = "Additional commentary about the containing object.",
      useName = "remarks"
  )
  @BoundFieldValue(
      typeAdapter = MarkupMultilineAdapter.class
  )
  private MarkupMultiline _remarks;

  public Task() {
  }

  public UUID getUuid() {
    return _uuid;
  }

  public void setUuid(UUID value) {
    _uuid = value;
  }

  public String getType() {
    return _type;
  }

  public void setType(String value) {
    _type = value;
  }

  public MarkupLine getTitle() {
    return _title;
  }

  public void setTitle(MarkupLine value) {
    _title = value;
  }

  public MarkupMultiline getDescription() {
    return _description;
  }

  public void setDescription(MarkupMultiline value) {
    _description = value;
  }

  public List<Property> getProps() {
    return _props;
  }

  public void setProps(List<Property> value) {
    _props = value;
  }

  /**
   * Add a new {@link Property} item to the underlying collection.
   * @param item the item to add
   * @return {@code true}
   */
  public boolean addProp(Property item) {
    Property value = ObjectUtils.requireNonNull(item,"item cannot be null");
    if (_props == null) {
      _props = new LinkedList<>();
    }
    return _props.add(value);
  }

  /**
   * Remove the first matching {@link Property} item from the underlying collection.
   * @param item the item to remove
   * @return {@code true} if the item was removed or {@code false} otherwise
   */
  public boolean removeProp(Property item) {
    Property value = ObjectUtils.requireNonNull(item,"item cannot be null");
    return _props == null ? false : _props.remove(value);
  }

  public List<Link> getLinks() {
    return _links;
  }

  public void setLinks(List<Link> value) {
    _links = value;
  }

  /**
   * Add a new {@link Link} item to the underlying collection.
   * @param item the item to add
   * @return {@code true}
   */
  public boolean addLink(Link item) {
    Link value = ObjectUtils.requireNonNull(item,"item cannot be null");
    if (_links == null) {
      _links = new LinkedList<>();
    }
    return _links.add(value);
  }

  /**
   * Remove the first matching {@link Link} item from the underlying collection.
   * @param item the item to remove
   * @return {@code true} if the item was removed or {@code false} otherwise
   */
  public boolean removeLink(Link item) {
    Link value = ObjectUtils.requireNonNull(item,"item cannot be null");
    return _links == null ? false : _links.remove(value);
  }

  public Timing getTiming() {
    return _timing;
  }

  public void setTiming(Timing value) {
    _timing = value;
  }

  public List<Dependency> getDependencies() {
    return _dependencies;
  }

  public void setDependencies(List<Dependency> value) {
    _dependencies = value;
  }

  /**
   * Add a new {@link Dependency} item to the underlying collection.
   * @param item the item to add
   * @return {@code true}
   */
  public boolean addDependency(Dependency item) {
    Dependency value = ObjectUtils.requireNonNull(item,"item cannot be null");
    if (_dependencies == null) {
      _dependencies = new LinkedList<>();
    }
    return _dependencies.add(value);
  }

  /**
   * Remove the first matching {@link Dependency} item from the underlying collection.
   * @param item the item to remove
   * @return {@code true} if the item was removed or {@code false} otherwise
   */
  public boolean removeDependency(Dependency item) {
    Dependency value = ObjectUtils.requireNonNull(item,"item cannot be null");
    return _dependencies == null ? false : _dependencies.remove(value);
  }

  public List<Task> getTasks() {
    return _tasks;
  }

  public void setTasks(List<Task> value) {
    _tasks = value;
  }

  /**
   * Add a new {@link Task} item to the underlying collection.
   * @param item the item to add
   * @return {@code true}
   */
  public boolean addTask(Task item) {
    Task value = ObjectUtils.requireNonNull(item,"item cannot be null");
    if (_tasks == null) {
      _tasks = new LinkedList<>();
    }
    return _tasks.add(value);
  }

  /**
   * Remove the first matching {@link Task} item from the underlying collection.
   * @param item the item to remove
   * @return {@code true} if the item was removed or {@code false} otherwise
   */
  public boolean removeTask(Task item) {
    Task value = ObjectUtils.requireNonNull(item,"item cannot be null");
    return _tasks == null ? false : _tasks.remove(value);
  }

  public List<AssociatedActivity> getAssociatedActivities() {
    return _associatedActivities;
  }

  public void setAssociatedActivities(List<AssociatedActivity> value) {
    _associatedActivities = value;
  }

  /**
   * Add a new {@link AssociatedActivity} item to the underlying collection.
   * @param item the item to add
   * @return {@code true}
   */
  public boolean addAssociatedActivity(AssociatedActivity item) {
    AssociatedActivity value = ObjectUtils.requireNonNull(item,"item cannot be null");
    if (_associatedActivities == null) {
      _associatedActivities = new LinkedList<>();
    }
    return _associatedActivities.add(value);
  }

  /**
   * Remove the first matching {@link AssociatedActivity} item from the underlying collection.
   * @param item the item to remove
   * @return {@code true} if the item was removed or {@code false} otherwise
   */
  public boolean removeAssociatedActivity(AssociatedActivity item) {
    AssociatedActivity value = ObjectUtils.requireNonNull(item,"item cannot be null");
    return _associatedActivities == null ? false : _associatedActivities.remove(value);
  }

  public List<AssessmentSubject> getSubjects() {
    return _subjects;
  }

  public void setSubjects(List<AssessmentSubject> value) {
    _subjects = value;
  }

  /**
   * Add a new {@link AssessmentSubject} item to the underlying collection.
   * @param item the item to add
   * @return {@code true}
   */
  public boolean addSubject(AssessmentSubject item) {
    AssessmentSubject value = ObjectUtils.requireNonNull(item,"item cannot be null");
    if (_subjects == null) {
      _subjects = new LinkedList<>();
    }
    return _subjects.add(value);
  }

  /**
   * Remove the first matching {@link AssessmentSubject} item from the underlying collection.
   * @param item the item to remove
   * @return {@code true} if the item was removed or {@code false} otherwise
   */
  public boolean removeSubject(AssessmentSubject item) {
    AssessmentSubject value = ObjectUtils.requireNonNull(item,"item cannot be null");
    return _subjects == null ? false : _subjects.remove(value);
  }

  public List<ResponsibleRole> getResponsibleRoles() {
    return _responsibleRoles;
  }

  public void setResponsibleRoles(List<ResponsibleRole> value) {
    _responsibleRoles = value;
  }

  /**
   * Add a new {@link ResponsibleRole} item to the underlying collection.
   * @param item the item to add
   * @return {@code true}
   */
  public boolean addResponsibleRole(ResponsibleRole item) {
    ResponsibleRole value = ObjectUtils.requireNonNull(item,"item cannot be null");
    if (_responsibleRoles == null) {
      _responsibleRoles = new LinkedList<>();
    }
    return _responsibleRoles.add(value);
  }

  /**
   * Remove the first matching {@link ResponsibleRole} item from the underlying collection.
   * @param item the item to remove
   * @return {@code true} if the item was removed or {@code false} otherwise
   */
  public boolean removeResponsibleRole(ResponsibleRole item) {
    ResponsibleRole value = ObjectUtils.requireNonNull(item,"item cannot be null");
    return _responsibleRoles == null ? false : _responsibleRoles.remove(value);
  }

  public MarkupMultiline getRemarks() {
    return _remarks;
  }

  public void setRemarks(MarkupMultiline value) {
    _remarks = value;
  }

  @Override
  public String toString() {
    return new ReflectionToStringBuilder(this, MultilineRecursiveToStringStyle.MULTI_LINE_STYLE).toString();
  }

  /**
   * The timing under which the task is intended to occur.
   */
  @MetaschemaAssembly(
      formalName = "Event Timing",
      description = "The timing under which the task is intended to occur.",
      name = "timing",
      metaschema = OscalAssessmentCommonMetaschema.class
  )
  public static class Timing {
    /**
     * "The task is intended to occur on the specified date."
     */
    @BoundAssembly(
        formalName = "On Date Condition",
        description = "The task is intended to occur on the specified date.",
        useName = "on-date",
        minOccurs = 1
    )
    private OnDate _onDate;

    /**
     * "The task is intended to occur within the specified date range."
     */
    @BoundAssembly(
        formalName = "On Date Range Condition",
        description = "The task is intended to occur within the specified date range.",
        useName = "within-date-range",
        minOccurs = 1
    )
    private WithinDateRange _withinDateRange;

    /**
     * "The task is intended to occur at the specified frequency."
     */
    @BoundAssembly(
        formalName = "Frequency Condition",
        description = "The task is intended to occur at the specified frequency.",
        useName = "at-frequency",
        minOccurs = 1
    )
    private AtFrequency _atFrequency;

    public Timing() {
    }

    public OnDate getOnDate() {
      return _onDate;
    }

    public void setOnDate(OnDate value) {
      _onDate = value;
    }

    public WithinDateRange getWithinDateRange() {
      return _withinDateRange;
    }

    public void setWithinDateRange(WithinDateRange value) {
      _withinDateRange = value;
    }

    public AtFrequency getAtFrequency() {
      return _atFrequency;
    }

    public void setAtFrequency(AtFrequency value) {
      _atFrequency = value;
    }

    @Override
    public String toString() {
      return new ReflectionToStringBuilder(this, MultilineRecursiveToStringStyle.MULTI_LINE_STYLE).toString();
    }

    /**
     * The task is intended to occur at the specified frequency.
     */
    @MetaschemaAssembly(
        formalName = "Frequency Condition",
        description = "The task is intended to occur at the specified frequency.",
        name = "at-frequency",
        metaschema = OscalAssessmentCommonMetaschema.class
    )
    public static class AtFrequency {
      @BoundFlag(
          formalName = "Period",
          description = "The task must occur after the specified period has elapsed.",
          useName = "period",
          required = true,
          typeAdapter = PositiveIntegerAdapter.class
      )
      private BigInteger _period;

      @BoundFlag(
          formalName = "Time Unit",
          description = "The unit of time for the period.",
          useName = "unit",
          required = true,
          typeAdapter = StringAdapter.class
      )
      @ValueConstraints(
          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.")})
      )
      private String _unit;

      public AtFrequency() {
      }

      public BigInteger getPeriod() {
        return _period;
      }

      public void setPeriod(BigInteger value) {
        _period = value;
      }

      public String getUnit() {
        return _unit;
      }

      public void setUnit(String value) {
        _unit = value;
      }

      @Override
      public String toString() {
        return new ReflectionToStringBuilder(this, MultilineRecursiveToStringStyle.MULTI_LINE_STYLE).toString();
      }
    }

    /**
     * The task is intended to occur within the specified date range.
     */
    @MetaschemaAssembly(
        formalName = "On Date Range Condition",
        description = "The task is intended to occur within the specified date range.",
        name = "within-date-range",
        metaschema = OscalAssessmentCommonMetaschema.class
    )
    public static class WithinDateRange {
      @BoundFlag(
          formalName = "Start Date Condition",
          description = "The task must occur on or after the specified date.",
          useName = "start",
          required = true,
          typeAdapter = DateTimeWithTZAdapter.class
      )
      private ZonedDateTime _start;

      @BoundFlag(
          formalName = "End Date Condition",
          description = "The task must occur on or before the specified date.",
          useName = "end",
          required = true,
          typeAdapter = DateTimeWithTZAdapter.class
      )
      private ZonedDateTime _end;

      public WithinDateRange() {
      }

      public ZonedDateTime getStart() {
        return _start;
      }

      public void setStart(ZonedDateTime value) {
        _start = value;
      }

      public ZonedDateTime getEnd() {
        return _end;
      }

      public void setEnd(ZonedDateTime value) {
        _end = value;
      }

      @Override
      public String toString() {
        return new ReflectionToStringBuilder(this, MultilineRecursiveToStringStyle.MULTI_LINE_STYLE).toString();
      }
    }

    /**
     * The task is intended to occur on the specified date.
     */
    @MetaschemaAssembly(
        formalName = "On Date Condition",
        description = "The task is intended to occur on the specified date.",
        name = "on-date",
        metaschema = OscalAssessmentCommonMetaschema.class
    )
    public static class OnDate {
      @BoundFlag(
          formalName = "On Date Condition",
          description = "The task must occur on the specified date.",
          useName = "date",
          required = true,
          typeAdapter = DateTimeWithTZAdapter.class
      )
      private ZonedDateTime _date;

      public OnDate() {
      }

      public ZonedDateTime getDate() {
        return _date;
      }

      public void setDate(ZonedDateTime value) {
        _date = value;
      }

      @Override
      public String toString() {
        return new ReflectionToStringBuilder(this, MultilineRecursiveToStringStyle.MULTI_LINE_STYLE).toString();
      }
    }
  }

  /**
   * Identifies an individual activity to be performed as part of a task.
   */
  @MetaschemaAssembly(
      formalName = "Associated Activity",
      description = "Identifies an individual activity to be performed as part of a task.",
      name = "associated-activity",
      metaschema = OscalAssessmentCommonMetaschema.class
  )
  @AssemblyConstraints(
      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.")
  )
  public static class AssociatedActivity {
    @BoundFlag(
        formalName = "Activity Universally Unique Identifier Reference",
        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.",
        useName = "activity-uuid",
        required = true,
        typeAdapter = UuidAdapter.class
    )
    private UUID _activityUuid;

    @BoundAssembly(
        formalName = "Property",
        description = "An attribute, characteristic, or quality of the containing object expressed as a namespace qualified name/value pair.",
        useName = "prop",
        maxOccurs = -1
    )
    @GroupAs(
        name = "props",
        inJson = JsonGroupAsBehavior.LIST
    )
    private List<Property> _props;

    @BoundAssembly(
        formalName = "Link",
        description = "A reference to a local or remote resource, that has a specific relation to the containing object.",
        useName = "link",
        maxOccurs = -1
    )
    @GroupAs(
        name = "links",
        inJson = JsonGroupAsBehavior.LIST
    )
    private List<Link> _links;

    @BoundAssembly(
        formalName = "Responsible Role",
        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.",
        useName = "responsible-role",
        maxOccurs = -1,
        remarks = "Identifies the person or organization responsible for performing a specific role defined by the activity."
    )
    @GroupAs(
        name = "responsible-roles",
        inJson = JsonGroupAsBehavior.LIST
    )
    private List<ResponsibleRole> _responsibleRoles;

    @BoundAssembly(
        formalName = "Subject of Assessment",
        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.",
        useName = "subject",
        minOccurs = 1,
        maxOccurs = -1
    )
    @GroupAs(
        name = "subjects",
        inJson = JsonGroupAsBehavior.LIST
    )
    private List<AssessmentSubject> _subjects;

    @BoundField(
        formalName = "Remarks",
        description = "Additional commentary about the containing object.",
        useName = "remarks"
    )
    @BoundFieldValue(
        typeAdapter = MarkupMultilineAdapter.class
    )
    private MarkupMultiline _remarks;

    public AssociatedActivity() {
    }

    public UUID getActivityUuid() {
      return _activityUuid;
    }

    public void setActivityUuid(UUID value) {
      _activityUuid = value;
    }

    public List<Property> getProps() {
      return _props;
    }

    public void setProps(List<Property> value) {
      _props = value;
    }

    /**
     * Add a new {@link Property} item to the underlying collection.
     * @param item the item to add
     * @return {@code true}
     */
    public boolean addProp(Property item) {
      Property value = ObjectUtils.requireNonNull(item,"item cannot be null");
      if (_props == null) {
        _props = new LinkedList<>();
      }
      return _props.add(value);
    }

    /**
     * Remove the first matching {@link Property} item from the underlying collection.
     * @param item the item to remove
     * @return {@code true} if the item was removed or {@code false} otherwise
     */
    public boolean removeProp(Property item) {
      Property value = ObjectUtils.requireNonNull(item,"item cannot be null");
      return _props == null ? false : _props.remove(value);
    }

    public List<Link> getLinks() {
      return _links;
    }

    public void setLinks(List<Link> value) {
      _links = value;
    }

    /**
     * Add a new {@link Link} item to the underlying collection.
     * @param item the item to add
     * @return {@code true}
     */
    public boolean addLink(Link item) {
      Link value = ObjectUtils.requireNonNull(item,"item cannot be null");
      if (_links == null) {
        _links = new LinkedList<>();
      }
      return _links.add(value);
    }

    /**
     * Remove the first matching {@link Link} item from the underlying collection.
     * @param item the item to remove
     * @return {@code true} if the item was removed or {@code false} otherwise
     */
    public boolean removeLink(Link item) {
      Link value = ObjectUtils.requireNonNull(item,"item cannot be null");
      return _links == null ? false : _links.remove(value);
    }

    public List<ResponsibleRole> getResponsibleRoles() {
      return _responsibleRoles;
    }

    public void setResponsibleRoles(List<ResponsibleRole> value) {
      _responsibleRoles = value;
    }

    /**
     * Add a new {@link ResponsibleRole} item to the underlying collection.
     * @param item the item to add
     * @return {@code true}
     */
    public boolean addResponsibleRole(ResponsibleRole item) {
      ResponsibleRole value = ObjectUtils.requireNonNull(item,"item cannot be null");
      if (_responsibleRoles == null) {
        _responsibleRoles = new LinkedList<>();
      }
      return _responsibleRoles.add(value);
    }

    /**
     * Remove the first matching {@link ResponsibleRole} item from the underlying collection.
     * @param item the item to remove
     * @return {@code true} if the item was removed or {@code false} otherwise
     */
    public boolean removeResponsibleRole(ResponsibleRole item) {
      ResponsibleRole value = ObjectUtils.requireNonNull(item,"item cannot be null");
      return _responsibleRoles == null ? false : _responsibleRoles.remove(value);
    }

    public List<AssessmentSubject> getSubjects() {
      return _subjects;
    }

    public void setSubjects(List<AssessmentSubject> value) {
      _subjects = value;
    }

    /**
     * Add a new {@link AssessmentSubject} item to the underlying collection.
     * @param item the item to add
     * @return {@code true}
     */
    public boolean addSubject(AssessmentSubject item) {
      AssessmentSubject value = ObjectUtils.requireNonNull(item,"item cannot be null");
      if (_subjects == null) {
        _subjects = new LinkedList<>();
      }
      return _subjects.add(value);
    }

    /**
     * Remove the first matching {@link AssessmentSubject} item from the underlying collection.
     * @param item the item to remove
     * @return {@code true} if the item was removed or {@code false} otherwise
     */
    public boolean removeSubject(AssessmentSubject item) {
      AssessmentSubject value = ObjectUtils.requireNonNull(item,"item cannot be null");
      return _subjects == null ? false : _subjects.remove(value);
    }

    public MarkupMultiline getRemarks() {
      return _remarks;
    }

    public void setRemarks(MarkupMultiline value) {
      _remarks = value;
    }

    @Override
    public String toString() {
      return new ReflectionToStringBuilder(this, MultilineRecursiveToStringStyle.MULTI_LINE_STYLE).toString();
    }
  }

  /**
   * Used to indicate that a task is dependent on another task.
   */
  @MetaschemaAssembly(
      formalName = "Task Dependency",
      description = "Used to indicate that a task is dependent on another task.",
      name = "dependency",
      metaschema = OscalAssessmentCommonMetaschema.class
  )
  public static class Dependency {
    @BoundFlag(
        formalName = "Task Universally Unique Identifier Reference",
        description = "A [machine-oriented](https://pages.nist.gov/OSCAL/concepts/identifier-use/#machine-oriented) identifier reference to a unique task.",
        useName = "task-uuid",
        required = true,
        typeAdapter = UuidAdapter.class
    )
    private UUID _taskUuid;

    @BoundField(
        formalName = "Remarks",
        description = "Additional commentary about the containing object.",
        useName = "remarks"
    )
    @BoundFieldValue(
        typeAdapter = MarkupMultilineAdapter.class
    )
    private MarkupMultiline _remarks;

    public Dependency() {
    }

    public UUID getTaskUuid() {
      return _taskUuid;
    }

    public void setTaskUuid(UUID value) {
      _taskUuid = value;
    }

    public MarkupMultiline getRemarks() {
      return _remarks;
    }

    public void setRemarks(MarkupMultiline value) {
      _remarks = value;
    }

    @Override
    public String toString() {
      return new ReflectionToStringBuilder(this, MultilineRecursiveToStringStyle.MULTI_LINE_STYLE).toString();
    }
  }
}