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.MarkupMultiline;
007import dev.metaschema.core.datatype.markup.MarkupMultilineAdapter;
008import dev.metaschema.core.model.IBoundObject;
009import dev.metaschema.core.model.IMetaschemaData;
010import dev.metaschema.core.model.JsonGroupAsBehavior;
011import dev.metaschema.core.util.ObjectUtils;
012import dev.metaschema.databind.model.annotations.BoundAssembly;
013import dev.metaschema.databind.model.annotations.BoundField;
014import dev.metaschema.databind.model.annotations.BoundFlag;
015import dev.metaschema.databind.model.annotations.GroupAs;
016import dev.metaschema.databind.model.annotations.MetaschemaAssembly;
017import edu.umd.cs.findbugs.annotations.NonNull;
018import edu.umd.cs.findbugs.annotations.Nullable;
019import java.util.LinkedList;
020import java.util.List;
021import java.util.UUID;
022import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
023import org.apache.commons.lang3.builder.ToStringStyle;
024
025/**
026 * Used when the assessment subjects will be determined as part of one or more other assessment activities. These assessment subjects will be recorded in the assessment results in the assessment log.
027 */
028@MetaschemaAssembly(
029    formalName = "Assessment Subject Placeholder",
030    description = "Used when the assessment subjects will be determined as part of one or more other assessment activities. These assessment subjects will be recorded in the assessment results in the assessment log.",
031    name = "assessment-subject-placeholder",
032    moduleClass = OscalAssessmentCommonModule.class
033)
034public class AssessmentSubjectPlaceholder implements IBoundObject {
035  private final IMetaschemaData __metaschemaData;
036
037  /**
038   * 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 for a set of assessment subjects that will be identified by a task or an activity that is part of a task. The locally defined <em>UUID</em> of the <code>assessment subject placeholder</code> can be used to reference the data item locally or globally (e.g., in an <a href="https://pages.nist.gov/OSCAL/concepts/identifier-use/#scope">imported OSCAL instance</a>). 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.
039   */
040  @BoundFlag(
041      formalName = "Assessment Subject Placeholder Universally Unique Identifier",
042      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 for a set of assessment subjects that will be identified by a task or an activity that is part of a task. The locally defined *UUID* of the `assessment subject placeholder` can be used to reference the data item locally or globally (e.g., in an [imported OSCAL instance](https://pages.nist.gov/OSCAL/concepts/identifier-use/#scope)). 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.",
043      name = "uuid",
044      required = true,
045      typeAdapter = UuidAdapter.class
046  )
047  private UUID _uuid;
048
049  /**
050   * A human-readable description of intent of this assessment subject placeholder.
051   */
052  @BoundField(
053      formalName = "Assessment Subject Placeholder Description",
054      description = "A human-readable description of intent of this assessment subject placeholder.",
055      useName = "description",
056      typeAdapter = MarkupMultilineAdapter.class
057  )
058  private MarkupMultiline _description;
059
060  /**
061   * Assessment subjects will be identified while conducting the referenced activity-instance.
062   */
063  @BoundAssembly(
064      formalName = "Assessment Subject Source",
065      description = "Assessment subjects will be identified while conducting the referenced activity-instance.",
066      useName = "source",
067      minOccurs = 1,
068      maxOccurs = -1,
069      groupAs = @GroupAs(name = "sources", inJson = JsonGroupAsBehavior.LIST)
070  )
071  private List<Source> _sources;
072
073  /**
074   * An attribute, characteristic, or quality of the containing object expressed as a namespace qualified name/value pair.
075   */
076  @BoundAssembly(
077      formalName = "Property",
078      description = "An attribute, characteristic, or quality of the containing object expressed as a namespace qualified name/value pair.",
079      useName = "prop",
080      maxOccurs = -1,
081      groupAs = @GroupAs(name = "props", inJson = JsonGroupAsBehavior.LIST)
082  )
083  private List<Property> _props;
084
085  /**
086   * A reference to a local or remote resource, that has a specific relation to the containing object.
087   */
088  @BoundAssembly(
089      formalName = "Link",
090      description = "A reference to a local or remote resource, that has a specific relation to the containing object.",
091      useName = "link",
092      maxOccurs = -1,
093      groupAs = @GroupAs(name = "links", inJson = JsonGroupAsBehavior.LIST)
094  )
095  private List<Link> _links;
096
097  /**
098   * Additional commentary about the containing object.
099   */
100  @BoundField(
101      formalName = "Remarks",
102      description = "Additional commentary about the containing object.",
103      useName = "remarks",
104      typeAdapter = MarkupMultilineAdapter.class
105  )
106  private MarkupMultiline _remarks;
107
108  /**
109   * Constructs a new {@code dev.metaschema.oscal.lib.model.AssessmentSubjectPlaceholder} instance with no metadata.
110   */
111  public AssessmentSubjectPlaceholder() {
112    this(null);
113  }
114
115  /**
116   * Constructs a new {@code dev.metaschema.oscal.lib.model.AssessmentSubjectPlaceholder} instance with the specified metadata.
117   *
118   * @param data
119   *           the metaschema data, or {@code null} if none
120   */
121  public AssessmentSubjectPlaceholder(IMetaschemaData data) {
122    this.__metaschemaData = data;
123  }
124
125  @Override
126  public IMetaschemaData getMetaschemaData() {
127    return __metaschemaData;
128  }
129
130  /**
131   * Get the "{@literal Assessment Subject Placeholder Universally Unique Identifier}".
132   *
133   * <p>
134   * 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 for a set of assessment subjects that will be identified by a task or an activity that is part of a task. The locally defined <em>UUID</em> of the <code>assessment subject placeholder</code> can be used to reference the data item locally or globally (e.g., in an <a href="https://pages.nist.gov/OSCAL/concepts/identifier-use/#scope">imported OSCAL instance</a>). 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.
135   *
136   * @return the uuid value
137   */
138  @NonNull
139  public UUID getUuid() {
140    return _uuid;
141  }
142
143  /**
144   * Set the "{@literal Assessment Subject Placeholder Universally Unique Identifier}".
145   *
146   * <p>
147   * 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 for a set of assessment subjects that will be identified by a task or an activity that is part of a task. The locally defined <em>UUID</em> of the <code>assessment subject placeholder</code> can be used to reference the data item locally or globally (e.g., in an <a href="https://pages.nist.gov/OSCAL/concepts/identifier-use/#scope">imported OSCAL instance</a>). 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.
148   *
149   * @param value
150   *           the uuid value to set
151   */
152  public void setUuid(@NonNull UUID value) {
153    _uuid = value;
154  }
155
156  /**
157   * Get the "{@literal Assessment Subject Placeholder Description}".
158   *
159   * <p>
160   * A human-readable description of intent of this assessment subject placeholder.
161   *
162   * @return the description value, or {@code null} if not set
163   */
164  @Nullable
165  public MarkupMultiline getDescription() {
166    return _description;
167  }
168
169  /**
170   * Set the "{@literal Assessment Subject Placeholder Description}".
171   *
172   * <p>
173   * A human-readable description of intent of this assessment subject placeholder.
174   *
175   * @param value
176   *           the description value to set, or {@code null} to clear
177   */
178  public void setDescription(@Nullable MarkupMultiline value) {
179    _description = value;
180  }
181
182  /**
183   * Get the "{@literal Assessment Subject Source}".
184   *
185   * <p>
186   * Assessment subjects will be identified while conducting the referenced activity-instance.
187   *
188   * @return the source value
189   */
190  @NonNull
191  public List<Source> getSources() {
192    if (_sources == null) {
193      _sources = new LinkedList<>();
194    }
195    return ObjectUtils.notNull(_sources);
196  }
197
198  /**
199   * Set the "{@literal Assessment Subject Source}".
200   *
201   * <p>
202   * Assessment subjects will be identified while conducting the referenced activity-instance.
203   *
204   * @param value
205   *           the source value to set
206   */
207  public void setSources(@NonNull List<Source> value) {
208    _sources = value;
209  }
210
211  /**
212   * Add a new {@link Source} item to the underlying collection.
213   * @param item the item to add
214   * @return {@code true}
215   */
216  public boolean addSource(Source item) {
217    Source value = ObjectUtils.requireNonNull(item,"item cannot be null");
218    if (_sources == null) {
219      _sources = new LinkedList<>();
220    }
221    return _sources.add(value);
222  }
223
224  /**
225   * Remove the first matching {@link Source} item from the underlying collection.
226   * @param item the item to remove
227   * @return {@code true} if the item was removed or {@code false} otherwise
228   */
229  public boolean removeSource(Source item) {
230    Source value = ObjectUtils.requireNonNull(item,"item cannot be null");
231    return _sources != null && _sources.remove(value);
232  }
233
234  /**
235   * Get the "{@literal Property}".
236   *
237   * <p>
238   * An attribute, characteristic, or quality of the containing object expressed as a namespace qualified name/value pair.
239   *
240   * @return the prop value
241   */
242  @NonNull
243  public List<Property> getProps() {
244    if (_props == null) {
245      _props = new LinkedList<>();
246    }
247    return ObjectUtils.notNull(_props);
248  }
249
250  /**
251   * Set the "{@literal Property}".
252   *
253   * <p>
254   * An attribute, characteristic, or quality of the containing object expressed as a namespace qualified name/value pair.
255   *
256   * @param value
257   *           the prop value to set
258   */
259  public void setProps(@NonNull List<Property> value) {
260    _props = value;
261  }
262
263  /**
264   * Add a new {@link Property} item to the underlying collection.
265   * @param item the item to add
266   * @return {@code true}
267   */
268  public boolean addProp(Property item) {
269    Property value = ObjectUtils.requireNonNull(item,"item cannot be null");
270    if (_props == null) {
271      _props = new LinkedList<>();
272    }
273    return _props.add(value);
274  }
275
276  /**
277   * Remove the first matching {@link Property} item from the underlying collection.
278   * @param item the item to remove
279   * @return {@code true} if the item was removed or {@code false} otherwise
280   */
281  public boolean removeProp(Property item) {
282    Property value = ObjectUtils.requireNonNull(item,"item cannot be null");
283    return _props != null && _props.remove(value);
284  }
285
286  /**
287   * Get the "{@literal Link}".
288   *
289   * <p>
290   * A reference to a local or remote resource, that has a specific relation to the containing object.
291   *
292   * @return the link value
293   */
294  @NonNull
295  public List<Link> getLinks() {
296    if (_links == null) {
297      _links = new LinkedList<>();
298    }
299    return ObjectUtils.notNull(_links);
300  }
301
302  /**
303   * Set the "{@literal Link}".
304   *
305   * <p>
306   * A reference to a local or remote resource, that has a specific relation to the containing object.
307   *
308   * @param value
309   *           the link value to set
310   */
311  public void setLinks(@NonNull List<Link> value) {
312    _links = value;
313  }
314
315  /**
316   * Add a new {@link Link} item to the underlying collection.
317   * @param item the item to add
318   * @return {@code true}
319   */
320  public boolean addLink(Link item) {
321    Link value = ObjectUtils.requireNonNull(item,"item cannot be null");
322    if (_links == null) {
323      _links = new LinkedList<>();
324    }
325    return _links.add(value);
326  }
327
328  /**
329   * Remove the first matching {@link Link} item from the underlying collection.
330   * @param item the item to remove
331   * @return {@code true} if the item was removed or {@code false} otherwise
332   */
333  public boolean removeLink(Link item) {
334    Link value = ObjectUtils.requireNonNull(item,"item cannot be null");
335    return _links != null && _links.remove(value);
336  }
337
338  /**
339   * Get the "{@literal Remarks}".
340   *
341   * <p>
342   * Additional commentary about the containing object.
343   *
344   * @return the remarks value, or {@code null} if not set
345   */
346  @Nullable
347  public MarkupMultiline getRemarks() {
348    return _remarks;
349  }
350
351  /**
352   * Set the "{@literal Remarks}".
353   *
354   * <p>
355   * Additional commentary about the containing object.
356   *
357   * @param value
358   *           the remarks value to set, or {@code null} to clear
359   */
360  public void setRemarks(@Nullable MarkupMultiline value) {
361    _remarks = value;
362  }
363
364  @Override
365  public String toString() {
366    return ObjectUtils.notNull(new ReflectionToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).toString());
367  }
368
369  /**
370   * Assessment subjects will be identified while conducting the referenced activity-instance.
371   */
372  @MetaschemaAssembly(
373      formalName = "Assessment Subject Source",
374      description = "Assessment subjects will be identified while conducting the referenced activity-instance.",
375      name = "source",
376      moduleClass = OscalAssessmentCommonModule.class
377  )
378  public static class Source implements IBoundObject {
379    private final IMetaschemaData __metaschemaData;
380
381    /**
382     * 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 (in this or other OSCAL instances) an assessment activity to be performed as part of the event. The locally defined <em>UUID</em> of the <code>task</code> can be used to reference the data item locally or globally (e.g., in an <a href="https://pages.nist.gov/OSCAL/concepts/identifier-use/#scope">imported OSCAL instance</a>). This UUID should be assigned <em>per-subject</em>, which means it should be consistently used to identify the same subject across revisions of the document.
383     */
384    @BoundFlag(
385        formalName = "Task Universally Unique Identifier",
386        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 (in this or other OSCAL instances) an assessment activity to be performed as part of the event. 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](https://pages.nist.gov/OSCAL/concepts/identifier-use/#scope)). This UUID should be assigned *per-subject*, which means it should be consistently used to identify the same subject across revisions of the document.",
387        name = "task-uuid",
388        required = true,
389        typeAdapter = UuidAdapter.class
390    )
391    private UUID _taskUuid;
392
393    /**
394     * Constructs a new {@code dev.metaschema.oscal.lib.model.AssessmentSubjectPlaceholder.Source} instance with no metadata.
395     */
396    public Source() {
397      this(null);
398    }
399
400    /**
401     * Constructs a new {@code dev.metaschema.oscal.lib.model.AssessmentSubjectPlaceholder.Source} instance with the specified metadata.
402     *
403     * @param data
404     *           the metaschema data, or {@code null} if none
405     */
406    public Source(IMetaschemaData data) {
407      this.__metaschemaData = data;
408    }
409
410    @Override
411    public IMetaschemaData getMetaschemaData() {
412      return __metaschemaData;
413    }
414
415    /**
416     * Get the "{@literal Task Universally Unique Identifier}".
417     *
418     * <p>
419     * 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 (in this or other OSCAL instances) an assessment activity to be performed as part of the event. The locally defined <em>UUID</em> of the <code>task</code> can be used to reference the data item locally or globally (e.g., in an <a href="https://pages.nist.gov/OSCAL/concepts/identifier-use/#scope">imported OSCAL instance</a>). This UUID should be assigned <em>per-subject</em>, which means it should be consistently used to identify the same subject across revisions of the document.
420     *
421     * @return the task-uuid value
422     */
423    @NonNull
424    public UUID getTaskUuid() {
425      return _taskUuid;
426    }
427
428    /**
429     * Set the "{@literal Task Universally Unique Identifier}".
430     *
431     * <p>
432     * 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 (in this or other OSCAL instances) an assessment activity to be performed as part of the event. The locally defined <em>UUID</em> of the <code>task</code> can be used to reference the data item locally or globally (e.g., in an <a href="https://pages.nist.gov/OSCAL/concepts/identifier-use/#scope">imported OSCAL instance</a>). This UUID should be assigned <em>per-subject</em>, which means it should be consistently used to identify the same subject across revisions of the document.
433     *
434     * @param value
435     *           the task-uuid value to set
436     */
437    public void setTaskUuid(@NonNull UUID value) {
438      _taskUuid = value;
439    }
440
441    @Override
442    public String toString() {
443      return ObjectUtils.notNull(new ReflectionToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).toString());
444    }
445  }
446}