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.HasCardinality;
012import gov.nist.secauto.metaschema.binding.model.annotations.Index;
013import gov.nist.secauto.metaschema.binding.model.annotations.IndexHasKey;
014import gov.nist.secauto.metaschema.binding.model.annotations.IsUnique;
015import gov.nist.secauto.metaschema.binding.model.annotations.KeyField;
016import gov.nist.secauto.metaschema.binding.model.annotations.MetaschemaAssembly;
017import gov.nist.secauto.metaschema.binding.model.annotations.MetaschemaField;
018import gov.nist.secauto.metaschema.binding.model.annotations.MetaschemaFieldValue;
019import gov.nist.secauto.metaschema.binding.model.annotations.ValueConstraints;
020import gov.nist.secauto.metaschema.model.common.JsonGroupAsBehavior;
021import gov.nist.secauto.metaschema.model.common.XmlGroupAsBehavior;
022import gov.nist.secauto.metaschema.model.common.constraint.IConstraint;
023import gov.nist.secauto.metaschema.model.common.datatype.adapter.DateTimeWithTZAdapter;
024import gov.nist.secauto.metaschema.model.common.datatype.adapter.EmailAddressAdapter;
025import gov.nist.secauto.metaschema.model.common.datatype.adapter.StringAdapter;
026import gov.nist.secauto.metaschema.model.common.datatype.adapter.TokenAdapter;
027import gov.nist.secauto.metaschema.model.common.datatype.adapter.UriAdapter;
028import gov.nist.secauto.metaschema.model.common.datatype.adapter.UuidAdapter;
029import gov.nist.secauto.metaschema.model.common.datatype.markup.MarkupLine;
030import gov.nist.secauto.metaschema.model.common.datatype.markup.MarkupLineAdapter;
031import gov.nist.secauto.metaschema.model.common.datatype.markup.MarkupMultiline;
032import gov.nist.secauto.metaschema.model.common.datatype.markup.MarkupMultilineAdapter;
033import gov.nist.secauto.metaschema.model.common.util.ObjectUtils;
034import gov.nist.secauto.oscal.lib.model.metadata.AbstractMetadata;
035import java.lang.Override;
036import java.lang.String;
037import java.net.URI;
038import java.time.ZonedDateTime;
039import java.util.LinkedList;
040import java.util.List;
041import java.util.UUID;
042import org.apache.commons.lang3.builder.MultilineRecursiveToStringStyle;
043import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
044
045/**
046 * Provides information about the containing document, and defines concepts that are shared across the document.
047 */
048@MetaschemaAssembly(
049    formalName = "Document Metadata",
050    description = "Provides information about the containing document, and defines concepts that are shared across the document.",
051    name = "metadata",
052    metaschema = OscalMetadataMetaschema.class,
053    remarks = "All OSCAL documents use the same metadata structure, that provides a consistent way of expressing OSCAL document metadata across all OSCAL models. The metadata section also includes declarations of individual objects (i.e., roles, location, parties) that may be referenced within and across linked OSCAL documents.\n"
054            + "\n"
055            + "The metadata in an OSCAL document has few required fields, representing only the bare minimum data needed to differentiate one instance from another. Tools and users creating OSCAL documents may choose to use any of the optional fields, as well as extension mechanisms (e.g., properties, links) to go beyond this minimum to suit their use cases.\n"
056            + "\n"
057            + "A publisher of OSCAL content can use the `published`, `last-modified`, and `version` fields to establish information about an individual in a sequence of successive revisions of a given OSCAL-based publication. The metadata for a previous revision can be represented as a `revision` within this object. Links may also be provided using the `predecessor-version` and `successor-version` link relations to provide for direct access to the related resource. These relations can be provided as a link child of this object or as `link` within a given `revision`.\n"
058            + "\n"
059            + "A `responsible-party` entry in this context refers to roles and parties that have responsibility relative to the production, review, publication, and use of the containing document."
060)
061@ValueConstraints(
062    allowedValues = {
063        @AllowedValues(id = "allowed-metadata-responsibe-party-role-ids", level = IConstraint.Level.ERROR, target = "responsible-party/@role-id", allowOthers = true, values = {@AllowedValue(value = "creator", description = "Indicates the person or organization that created this content."), @AllowedValue(value = "prepared-by", description = "Indicates the person or organization that prepared this content."), @AllowedValue(value = "prepared-for", description = "Indicates the person or organization for which this content was created."), @AllowedValue(value = "content-approver", description = "Indicates the person or organization responsible for all content represented in the \"document\"."), @AllowedValue(value = "contact", description = "Indicates the person or organization to contact for questions or support related to this content.")}),
064        @AllowedValues(level = IConstraint.Level.ERROR, target = "prop[has-oscal-namespace('http://csrc.nist.gov/ns/oscal')]/@name", values = @AllowedValue(value = "keywords", description = "The value identifies a comma-seperated listing of keywords associated with this content. These keywords may be used as search terms for indexing and other applications.")),
065        @AllowedValues(level = IConstraint.Level.ERROR, target = "link/@rel", allowOthers = true, values = {@AllowedValue(value = "canonical", description = "The link identifies the authoritative location for this resource. Defined by [RFC 6596](https://tools.ietf.org/html/rfc6596)."), @AllowedValue(value = "alternate", description = "The link identifies an alternative location or format for this resource. Defined by [the HTML Living Standard](https://html.spec.whatwg.org/multipage/links.html#linkTypes)"), @AllowedValue(value = "latest-version", description = "This link identifies a resource containing the latest version in the version history. Defined by [RFC 5829](https://tools.ietf.org/html/rfc5829)."), @AllowedValue(value = "predecessor-version", description = "This link identifies a resource containing the predecessor version in the version history. Defined by [RFC 5829](https://tools.ietf.org/html/rfc5829)."), @AllowedValue(value = "successor-version", description = "This link identifies a resource containing the predecessor version in the version history. Defined by [RFC 5829](https://tools.ietf.org/html/rfc5829).")})
066    }
067)
068@AssemblyConstraints(
069    index = {
070        @Index(id = "index-metadata-roles", level = IConstraint.Level.ERROR, target = "role", name = "index-metadata-role-ids", keyFields = @KeyField(target = "@id")),
071        @Index(id = "index-metadata-property-uuid", level = IConstraint.Level.ERROR, target = ".//prop", name = "index-metadata-property-uuid", keyFields = @KeyField(target = "@uuid")),
072        @Index(id = "index-metadata-role-id", level = IConstraint.Level.ERROR, target = "role", name = "index-metadata-role-id", keyFields = @KeyField(target = "@id")),
073        @Index(id = "index-metadata-location-uuid", level = IConstraint.Level.ERROR, target = "location", name = "index-metadata-location-uuid", keyFields = @KeyField(target = "@uuid")),
074        @Index(id = "index-metadata-party-uuid", level = IConstraint.Level.ERROR, target = "party", name = "index-metadata-party-uuid", keyFields = @KeyField(target = "@uuid")),
075        @Index(id = "index-metadata-party-organizations-uuid", level = IConstraint.Level.ERROR, target = "party[@type='organization']", name = "index-metadata-party-organizations-uuid", keyFields = @KeyField(target = "@uuid"))
076    },
077    isUnique = {
078        @IsUnique(id = "unique-metadata-doc-id", level = IConstraint.Level.ERROR, target = "document-id", keyFields = {@KeyField(target = "@scheme"), @KeyField}),
079        @IsUnique(id = "unique-metadata-property", level = IConstraint.Level.ERROR, target = "prop", keyFields = {@KeyField(target = "@name"), @KeyField(target = "@ns"), @KeyField(target = "@class"), @KeyField(target = "@group"), @KeyField(target = "@value")}),
080        @IsUnique(id = "unique-metadata-link", level = IConstraint.Level.ERROR, target = "link", keyFields = {@KeyField(target = "@href"), @KeyField(target = "@rel"), @KeyField(target = "@media-type")}),
081        @IsUnique(id = "unique-metadata-responsible-party", level = IConstraint.Level.ERROR, target = "responsible-party", keyFields = @KeyField(target = "@role-id"), remarks = "Since `responsible-party` associates multiple `party-uuid` entries with a single `role-id`, each role-id must be referenced only once."),
082        @IsUnique(level = IConstraint.Level.ERROR, target = "document-id", keyFields = {@KeyField(target = "@scheme"), @KeyField}, remarks = "The combination of `scheme` and the field value must be unique.")
083    }
084)
085public class Metadata extends AbstractMetadata {
086  /**
087   * "A name given to the document, which may be used by a tool for display and navigation."
088   */
089  @BoundField(
090      formalName = "Document Title",
091      description = "A name given to the document, which may be used by a tool for display and navigation.",
092      useName = "title",
093      minOccurs = 1
094  )
095  @BoundFieldValue(
096      typeAdapter = MarkupLineAdapter.class
097  )
098  private MarkupLine _title;
099
100  @BoundField(
101      formalName = "Publication Timestamp",
102      description = "The date and time the document was last made available.",
103      useName = "published"
104  )
105  @BoundFieldValue(
106      typeAdapter = DateTimeWithTZAdapter.class
107  )
108  private ZonedDateTime _published;
109
110  @BoundField(
111      formalName = "Last Modified Timestamp",
112      description = "The date and time the document was last stored for later retrieval.",
113      useName = "last-modified",
114      minOccurs = 1
115  )
116  @BoundFieldValue(
117      typeAdapter = DateTimeWithTZAdapter.class
118  )
119  private ZonedDateTime _lastModified;
120
121  @BoundField(
122      formalName = "Document Version",
123      description = "Used to distinguish a specific revision of an OSCAL document from other previous and future versions.",
124      useName = "version",
125      minOccurs = 1
126  )
127  private String _version;
128
129  @BoundField(
130      formalName = "OSCAL Version",
131      description = "The OSCAL model version the document was authored against and will conform to as valid.",
132      useName = "oscal-version",
133      minOccurs = 1
134  )
135  private String _oscalVersion;
136
137  /**
138   * "An entry in a sequential list of revisions to the containing document, expected to be in reverse chronological order (i.e. latest first)."
139   */
140  @BoundAssembly(
141      formalName = "Revision History Entry",
142      description = "An entry in a sequential list of revisions to the containing document, expected to be in reverse chronological order (i.e. latest first).",
143      useName = "revision",
144      maxOccurs = -1,
145      remarks = "While `published`, `last-modified`, and `oscal-version` are not required, values for these entries should be provided if the information is known. A `link` with a `rel` of \"source\" should be provided if the information is known."
146  )
147  @GroupAs(
148      name = "revisions",
149      inJson = JsonGroupAsBehavior.LIST,
150      inXml = XmlGroupAsBehavior.GROUPED
151  )
152  private List<Revision> _revisions;
153
154  @BoundField(
155      formalName = "Document Identifier",
156      description = "A document identifier qualified by an identifier `scheme`.",
157      useName = "document-id",
158      maxOccurs = -1
159  )
160  @GroupAs(
161      name = "document-ids",
162      inJson = JsonGroupAsBehavior.LIST
163  )
164  private List<DocumentId> _documentIds;
165
166  @BoundAssembly(
167      formalName = "Property",
168      description = "An attribute, characteristic, or quality of the containing object expressed as a namespace qualified name/value pair.",
169      useName = "prop",
170      maxOccurs = -1
171  )
172  @GroupAs(
173      name = "props",
174      inJson = JsonGroupAsBehavior.LIST
175  )
176  private List<Property> _props;
177
178  @BoundAssembly(
179      formalName = "Link",
180      description = "A reference to a local or remote resource, that has a specific relation to the containing object.",
181      useName = "link",
182      maxOccurs = -1
183  )
184  @GroupAs(
185      name = "links",
186      inJson = JsonGroupAsBehavior.LIST
187  )
188  private List<Link> _links;
189
190  /**
191   * "Defines a function, which might be assigned to a party in a specific situation."
192   */
193  @BoundAssembly(
194      formalName = "Role",
195      description = "Defines a function, which might be assigned to a party in a specific situation.",
196      useName = "role",
197      maxOccurs = -1,
198      remarks = "Permissible values to be determined closer to the application (e.g. by a receiving authority).\n"
199              + "\n"
200              + "OSCAL has defined a set of standardized roles for consistent use in OSCAL documents. This allows tools consuming OSCAL content to infer specific semantics when these roles are used. These roles are documented in the specific contexts of their use (e.g., responsible-party, responsible-role). When using such a role, it is necessary to define these roles in this list, which will then allow such a role to be referenced."
201  )
202  @GroupAs(
203      name = "roles",
204      inJson = JsonGroupAsBehavior.LIST
205  )
206  private List<Role> _roles;
207
208  /**
209   * "A physical point of presence, which may be associated with people, organizations, or other concepts within the current or linked OSCAL document."
210   */
211  @BoundAssembly(
212      formalName = "Location",
213      description = "A physical point of presence, which may be associated with people, organizations, or other concepts within the current or linked OSCAL document.",
214      useName = "location",
215      maxOccurs = -1,
216      remarks = "An address might be sensitive in nature. In such cases a title, mailing address, email-address, and/or phone number may be used instead."
217  )
218  @GroupAs(
219      name = "locations",
220      inJson = JsonGroupAsBehavior.LIST
221  )
222  private List<Location> _locations;
223
224  /**
225   * "An organization or person, which may be associated with roles or other concepts within the current or linked OSCAL document."
226   */
227  @BoundAssembly(
228      formalName = "Party",
229      description = "An organization or person, which may be associated with roles or other concepts within the current or linked OSCAL document.",
230      useName = "party",
231      maxOccurs = -1,
232      remarks = "A party can be optionally associated with either an address or a location. While providing a meaningful location for a party is desired, there are some cases where it might not be possible to provide an exact location or even any location."
233  )
234  @GroupAs(
235      name = "parties",
236      inJson = JsonGroupAsBehavior.LIST
237  )
238  private List<Party> _parties;
239
240  @BoundAssembly(
241      formalName = "Responsible Party",
242      description = "A reference to a set of persons and/or organizations that have responsibility for performing the referenced role in the context of the containing object.",
243      useName = "responsible-party",
244      maxOccurs = -1
245  )
246  @GroupAs(
247      name = "responsible-parties",
248      inJson = JsonGroupAsBehavior.LIST
249  )
250  private List<ResponsibleParty> _responsibleParties;
251
252  @BoundAssembly(
253      formalName = "Action",
254      description = "An action applied by a role within a given party to the content.",
255      useName = "action",
256      maxOccurs = -1
257  )
258  @GroupAs(
259      name = "actions",
260      inJson = JsonGroupAsBehavior.LIST
261  )
262  private List<Action> _actions;
263
264  @BoundField(
265      formalName = "Remarks",
266      description = "Additional commentary about the containing object.",
267      useName = "remarks"
268  )
269  @BoundFieldValue(
270      typeAdapter = MarkupMultilineAdapter.class
271  )
272  private MarkupMultiline _remarks;
273
274  public Metadata() {
275  }
276
277  public MarkupLine getTitle() {
278    return _title;
279  }
280
281  public void setTitle(MarkupLine value) {
282    _title = value;
283  }
284
285  public ZonedDateTime getPublished() {
286    return _published;
287  }
288
289  public void setPublished(ZonedDateTime value) {
290    _published = value;
291  }
292
293  public ZonedDateTime getLastModified() {
294    return _lastModified;
295  }
296
297  public void setLastModified(ZonedDateTime value) {
298    _lastModified = value;
299  }
300
301  public String getVersion() {
302    return _version;
303  }
304
305  public void setVersion(String value) {
306    _version = value;
307  }
308
309  public String getOscalVersion() {
310    return _oscalVersion;
311  }
312
313  public void setOscalVersion(String value) {
314    _oscalVersion = value;
315  }
316
317  public List<Revision> getRevisions() {
318    return _revisions;
319  }
320
321  public void setRevisions(List<Revision> value) {
322    _revisions = value;
323  }
324
325  /**
326   * Add a new {@link Revision} item to the underlying collection.
327   * @param item the item to add
328   * @return {@code true}
329   */
330  public boolean addRevision(Revision item) {
331    Revision value = ObjectUtils.requireNonNull(item,"item cannot be null");
332    if (_revisions == null) {
333      _revisions = new LinkedList<>();
334    }
335    return _revisions.add(value);
336  }
337
338  /**
339   * Remove the first matching {@link Revision} item from the underlying collection.
340   * @param item the item to remove
341   * @return {@code true} if the item was removed or {@code false} otherwise
342   */
343  public boolean removeRevision(Revision item) {
344    Revision value = ObjectUtils.requireNonNull(item,"item cannot be null");
345    return _revisions == null ? false : _revisions.remove(value);
346  }
347
348  public List<DocumentId> getDocumentIds() {
349    return _documentIds;
350  }
351
352  public void setDocumentIds(List<DocumentId> value) {
353    _documentIds = value;
354  }
355
356  /**
357   * Add a new {@link DocumentId} item to the underlying collection.
358   * @param item the item to add
359   * @return {@code true}
360   */
361  public boolean addDocumentId(DocumentId item) {
362    DocumentId value = ObjectUtils.requireNonNull(item,"item cannot be null");
363    if (_documentIds == null) {
364      _documentIds = new LinkedList<>();
365    }
366    return _documentIds.add(value);
367  }
368
369  /**
370   * Remove the first matching {@link DocumentId} item from the underlying collection.
371   * @param item the item to remove
372   * @return {@code true} if the item was removed or {@code false} otherwise
373   */
374  public boolean removeDocumentId(DocumentId item) {
375    DocumentId value = ObjectUtils.requireNonNull(item,"item cannot be null");
376    return _documentIds == null ? false : _documentIds.remove(value);
377  }
378
379  public List<Property> getProps() {
380    return _props;
381  }
382
383  public void setProps(List<Property> value) {
384    _props = value;
385  }
386
387  /**
388   * Add a new {@link Property} item to the underlying collection.
389   * @param item the item to add
390   * @return {@code true}
391   */
392  public boolean addProp(Property item) {
393    Property value = ObjectUtils.requireNonNull(item,"item cannot be null");
394    if (_props == null) {
395      _props = new LinkedList<>();
396    }
397    return _props.add(value);
398  }
399
400  /**
401   * Remove the first matching {@link Property} item from the underlying collection.
402   * @param item the item to remove
403   * @return {@code true} if the item was removed or {@code false} otherwise
404   */
405  public boolean removeProp(Property item) {
406    Property value = ObjectUtils.requireNonNull(item,"item cannot be null");
407    return _props == null ? false : _props.remove(value);
408  }
409
410  public List<Link> getLinks() {
411    return _links;
412  }
413
414  public void setLinks(List<Link> value) {
415    _links = value;
416  }
417
418  /**
419   * Add a new {@link Link} item to the underlying collection.
420   * @param item the item to add
421   * @return {@code true}
422   */
423  public boolean addLink(Link item) {
424    Link value = ObjectUtils.requireNonNull(item,"item cannot be null");
425    if (_links == null) {
426      _links = new LinkedList<>();
427    }
428    return _links.add(value);
429  }
430
431  /**
432   * Remove the first matching {@link Link} item from the underlying collection.
433   * @param item the item to remove
434   * @return {@code true} if the item was removed or {@code false} otherwise
435   */
436  public boolean removeLink(Link item) {
437    Link value = ObjectUtils.requireNonNull(item,"item cannot be null");
438    return _links == null ? false : _links.remove(value);
439  }
440
441  public List<Role> getRoles() {
442    return _roles;
443  }
444
445  public void setRoles(List<Role> value) {
446    _roles = value;
447  }
448
449  /**
450   * Add a new {@link Role} item to the underlying collection.
451   * @param item the item to add
452   * @return {@code true}
453   */
454  public boolean addRole(Role item) {
455    Role value = ObjectUtils.requireNonNull(item,"item cannot be null");
456    if (_roles == null) {
457      _roles = new LinkedList<>();
458    }
459    return _roles.add(value);
460  }
461
462  /**
463   * Remove the first matching {@link Role} item from the underlying collection.
464   * @param item the item to remove
465   * @return {@code true} if the item was removed or {@code false} otherwise
466   */
467  public boolean removeRole(Role item) {
468    Role value = ObjectUtils.requireNonNull(item,"item cannot be null");
469    return _roles == null ? false : _roles.remove(value);
470  }
471
472  public List<Location> getLocations() {
473    return _locations;
474  }
475
476  public void setLocations(List<Location> value) {
477    _locations = value;
478  }
479
480  /**
481   * Add a new {@link Location} item to the underlying collection.
482   * @param item the item to add
483   * @return {@code true}
484   */
485  public boolean addLocation(Location item) {
486    Location value = ObjectUtils.requireNonNull(item,"item cannot be null");
487    if (_locations == null) {
488      _locations = new LinkedList<>();
489    }
490    return _locations.add(value);
491  }
492
493  /**
494   * Remove the first matching {@link Location} item from the underlying collection.
495   * @param item the item to remove
496   * @return {@code true} if the item was removed or {@code false} otherwise
497   */
498  public boolean removeLocation(Location item) {
499    Location value = ObjectUtils.requireNonNull(item,"item cannot be null");
500    return _locations == null ? false : _locations.remove(value);
501  }
502
503  public List<Party> getParties() {
504    return _parties;
505  }
506
507  public void setParties(List<Party> value) {
508    _parties = value;
509  }
510
511  /**
512   * Add a new {@link Party} item to the underlying collection.
513   * @param item the item to add
514   * @return {@code true}
515   */
516  public boolean addParty(Party item) {
517    Party value = ObjectUtils.requireNonNull(item,"item cannot be null");
518    if (_parties == null) {
519      _parties = new LinkedList<>();
520    }
521    return _parties.add(value);
522  }
523
524  /**
525   * Remove the first matching {@link Party} item from the underlying collection.
526   * @param item the item to remove
527   * @return {@code true} if the item was removed or {@code false} otherwise
528   */
529  public boolean removeParty(Party item) {
530    Party value = ObjectUtils.requireNonNull(item,"item cannot be null");
531    return _parties == null ? false : _parties.remove(value);
532  }
533
534  public List<ResponsibleParty> getResponsibleParties() {
535    return _responsibleParties;
536  }
537
538  public void setResponsibleParties(List<ResponsibleParty> value) {
539    _responsibleParties = value;
540  }
541
542  /**
543   * Add a new {@link ResponsibleParty} item to the underlying collection.
544   * @param item the item to add
545   * @return {@code true}
546   */
547  public boolean addResponsibleParty(ResponsibleParty item) {
548    ResponsibleParty value = ObjectUtils.requireNonNull(item,"item cannot be null");
549    if (_responsibleParties == null) {
550      _responsibleParties = new LinkedList<>();
551    }
552    return _responsibleParties.add(value);
553  }
554
555  /**
556   * Remove the first matching {@link ResponsibleParty} item from the underlying collection.
557   * @param item the item to remove
558   * @return {@code true} if the item was removed or {@code false} otherwise
559   */
560  public boolean removeResponsibleParty(ResponsibleParty item) {
561    ResponsibleParty value = ObjectUtils.requireNonNull(item,"item cannot be null");
562    return _responsibleParties == null ? false : _responsibleParties.remove(value);
563  }
564
565  public List<Action> getActions() {
566    return _actions;
567  }
568
569  public void setActions(List<Action> value) {
570    _actions = value;
571  }
572
573  /**
574   * Add a new {@link Action} item to the underlying collection.
575   * @param item the item to add
576   * @return {@code true}
577   */
578  public boolean addAction(Action item) {
579    Action value = ObjectUtils.requireNonNull(item,"item cannot be null");
580    if (_actions == null) {
581      _actions = new LinkedList<>();
582    }
583    return _actions.add(value);
584  }
585
586  /**
587   * Remove the first matching {@link Action} item from the underlying collection.
588   * @param item the item to remove
589   * @return {@code true} if the item was removed or {@code false} otherwise
590   */
591  public boolean removeAction(Action item) {
592    Action value = ObjectUtils.requireNonNull(item,"item cannot be null");
593    return _actions == null ? false : _actions.remove(value);
594  }
595
596  public MarkupMultiline getRemarks() {
597    return _remarks;
598  }
599
600  public void setRemarks(MarkupMultiline value) {
601    _remarks = value;
602  }
603
604  @Override
605  public String toString() {
606    return new ReflectionToStringBuilder(this, MultilineRecursiveToStringStyle.MULTI_LINE_STYLE).toString();
607  }
608
609  /**
610   * An entry in a sequential list of revisions to the containing document, expected to be in reverse chronological order (i.e. latest first).
611   */
612  @MetaschemaAssembly(
613      formalName = "Revision History Entry",
614      description = "An entry in a sequential list of revisions to the containing document, expected to be in reverse chronological order (i.e. latest first).",
615      name = "revision",
616      metaschema = OscalMetadataMetaschema.class,
617      remarks = "While `published`, `last-modified`, and `oscal-version` are not required, values for these entries should be provided if the information is known. A `link` with a `rel` of \"source\" should be provided if the information is known."
618  )
619  @ValueConstraints(
620      allowedValues = @AllowedValues(level = IConstraint.Level.ERROR, target = "link/@rel", allowOthers = true, values = {@AllowedValue(value = "canonical", description = "The link identifies the authoritative location for this resource. Defined by [RFC 6596](https://tools.ietf.org/html/rfc6596)."), @AllowedValue(value = "alternate", description = "The link identifies an alternative location or format for this resource. Defined by [the HTML Living Standard](https://html.spec.whatwg.org/multipage/links.html#linkTypes)"), @AllowedValue(value = "predecessor-version", description = "This link identifies a resource containing the predecessor version in the version history. Defined by [RFC 5829](https://tools.ietf.org/html/rfc5829)."), @AllowedValue(value = "successor-version", description = "This link identifies a resource containing the predecessor version in the version history. Defined by [RFC 5829](https://tools.ietf.org/html/rfc5829)."), @AllowedValue(value = "version-history", description = "This link identifies a resource containing the version history of this document. Defined by [RFC 5829](https://tools.ietf.org/html/rfc5829).")})
621  )
622  public static class Revision {
623    /**
624     * "A name given to the document revision, which may be used by a tool for display and navigation."
625     */
626    @BoundField(
627        formalName = "Document Title",
628        description = "A name given to the document revision, which may be used by a tool for display and navigation.",
629        useName = "title"
630    )
631    @BoundFieldValue(
632        typeAdapter = MarkupLineAdapter.class
633    )
634    private MarkupLine _title;
635
636    @BoundField(
637        formalName = "Publication Timestamp",
638        description = "The date and time the document was last made available.",
639        useName = "published"
640    )
641    @BoundFieldValue(
642        typeAdapter = DateTimeWithTZAdapter.class
643    )
644    private ZonedDateTime _published;
645
646    @BoundField(
647        formalName = "Last Modified Timestamp",
648        description = "The date and time the document was last stored for later retrieval.",
649        useName = "last-modified"
650    )
651    @BoundFieldValue(
652        typeAdapter = DateTimeWithTZAdapter.class
653    )
654    private ZonedDateTime _lastModified;
655
656    @BoundField(
657        formalName = "Document Version",
658        description = "Used to distinguish a specific revision of an OSCAL document from other previous and future versions.",
659        useName = "version",
660        minOccurs = 1
661    )
662    private String _version;
663
664    @BoundField(
665        formalName = "OSCAL Version",
666        description = "The OSCAL model version the document was authored against and will conform to as valid.",
667        useName = "oscal-version"
668    )
669    private String _oscalVersion;
670
671    @BoundAssembly(
672        formalName = "Property",
673        description = "An attribute, characteristic, or quality of the containing object expressed as a namespace qualified name/value pair.",
674        useName = "prop",
675        maxOccurs = -1
676    )
677    @GroupAs(
678        name = "props",
679        inJson = JsonGroupAsBehavior.LIST
680    )
681    private List<Property> _props;
682
683    @BoundAssembly(
684        formalName = "Link",
685        description = "A reference to a local or remote resource, that has a specific relation to the containing object.",
686        useName = "link",
687        maxOccurs = -1
688    )
689    @GroupAs(
690        name = "links",
691        inJson = JsonGroupAsBehavior.LIST
692    )
693    private List<Link> _links;
694
695    @BoundField(
696        formalName = "Remarks",
697        description = "Additional commentary about the containing object.",
698        useName = "remarks"
699    )
700    @BoundFieldValue(
701        typeAdapter = MarkupMultilineAdapter.class
702    )
703    private MarkupMultiline _remarks;
704
705    public Revision() {
706    }
707
708    public MarkupLine getTitle() {
709      return _title;
710    }
711
712    public void setTitle(MarkupLine value) {
713      _title = value;
714    }
715
716    public ZonedDateTime getPublished() {
717      return _published;
718    }
719
720    public void setPublished(ZonedDateTime value) {
721      _published = value;
722    }
723
724    public ZonedDateTime getLastModified() {
725      return _lastModified;
726    }
727
728    public void setLastModified(ZonedDateTime value) {
729      _lastModified = value;
730    }
731
732    public String getVersion() {
733      return _version;
734    }
735
736    public void setVersion(String value) {
737      _version = value;
738    }
739
740    public String getOscalVersion() {
741      return _oscalVersion;
742    }
743
744    public void setOscalVersion(String value) {
745      _oscalVersion = value;
746    }
747
748    public List<Property> getProps() {
749      return _props;
750    }
751
752    public void setProps(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 ? false : _props.remove(value);
777    }
778
779    public List<Link> getLinks() {
780      return _links;
781    }
782
783    public void setLinks(List<Link> value) {
784      _links = value;
785    }
786
787    /**
788     * Add a new {@link Link} item to the underlying collection.
789     * @param item the item to add
790     * @return {@code true}
791     */
792    public boolean addLink(Link item) {
793      Link value = ObjectUtils.requireNonNull(item,"item cannot be null");
794      if (_links == null) {
795        _links = new LinkedList<>();
796      }
797      return _links.add(value);
798    }
799
800    /**
801     * Remove the first matching {@link Link} item from the underlying collection.
802     * @param item the item to remove
803     * @return {@code true} if the item was removed or {@code false} otherwise
804     */
805    public boolean removeLink(Link item) {
806      Link value = ObjectUtils.requireNonNull(item,"item cannot be null");
807      return _links == null ? false : _links.remove(value);
808    }
809
810    public MarkupMultiline getRemarks() {
811      return _remarks;
812    }
813
814    public void setRemarks(MarkupMultiline value) {
815      _remarks = value;
816    }
817
818    @Override
819    public String toString() {
820      return new ReflectionToStringBuilder(this, MultilineRecursiveToStringStyle.MULTI_LINE_STYLE).toString();
821    }
822  }
823
824  /**
825   * An organization or person, which may be associated with roles or other concepts within the current or linked OSCAL document.
826   */
827  @MetaschemaAssembly(
828      formalName = "Party",
829      description = "An organization or person, which may be associated with roles or other concepts within the current or linked OSCAL document.",
830      name = "party",
831      metaschema = OscalMetadataMetaschema.class,
832      remarks = "A party can be optionally associated with either an address or a location. While providing a meaningful location for a party is desired, there are some cases where it might not be possible to provide an exact location or even any location."
833  )
834  @ValueConstraints(
835      allowedValues = @AllowedValues(level = IConstraint.Level.ERROR, target = "prop[has-oscal-namespace('http://csrc.nist.gov/ns/oscal')]/@name", values = {@AllowedValue(value = "mail-stop", description = "A mail stop associated with the party."), @AllowedValue(value = "office", description = "The name or number of the party's office."), @AllowedValue(value = "job-title", description = "The formal job title of a person.")})
836  )
837  public static class Party {
838    @BoundFlag(
839        formalName = "Party Universally Unique Identifier",
840        description = "A unique identifier for the party.",
841        useName = "uuid",
842        required = true,
843        typeAdapter = UuidAdapter.class
844    )
845    private UUID _uuid;
846
847    @BoundFlag(
848        formalName = "Party Type",
849        description = "A category describing the kind of party the object describes.",
850        useName = "type",
851        required = true,
852        typeAdapter = StringAdapter.class
853    )
854    @ValueConstraints(
855        allowedValues = @AllowedValues(level = IConstraint.Level.ERROR, values = {@AllowedValue(value = "person", description = "A human being regarded as an individual."), @AllowedValue(value = "organization", description = "An organized group of one or more `person` individuals with a specific purpose.")})
856    )
857    private String _type;
858
859    /**
860     * "The full name of the party. This is typically the legal name associated with the party."
861     */
862    @BoundField(
863        formalName = "Party Name",
864        description = "The full name of the party. This is typically the legal name associated with the party.",
865        useName = "name"
866    )
867    private String _name;
868
869    /**
870     * "A short common name, abbreviation, or acronym for the party."
871     */
872    @BoundField(
873        formalName = "Party Short Name",
874        description = "A short common name, abbreviation, or acronym for the party.",
875        useName = "short-name"
876    )
877    private String _shortName;
878
879    /**
880     * "An identifier for a person or organization using a designated scheme. e.g. an Open Researcher and Contributor ID (ORCID)."
881     */
882    @BoundField(
883        formalName = "Party External Identifier",
884        description = "An identifier for a person or organization using a designated scheme. e.g. an Open Researcher and Contributor ID (ORCID).",
885        useName = "external-id",
886        maxOccurs = -1
887    )
888    @GroupAs(
889        name = "external-ids",
890        inJson = JsonGroupAsBehavior.LIST
891    )
892    private List<ExternalId> _externalIds;
893
894    @BoundAssembly(
895        formalName = "Property",
896        description = "An attribute, characteristic, or quality of the containing object expressed as a namespace qualified name/value pair.",
897        useName = "prop",
898        maxOccurs = -1
899    )
900    @GroupAs(
901        name = "props",
902        inJson = JsonGroupAsBehavior.LIST
903    )
904    private List<Property> _props;
905
906    @BoundAssembly(
907        formalName = "Link",
908        description = "A reference to a local or remote resource, that has a specific relation to the containing object.",
909        useName = "link",
910        maxOccurs = -1
911    )
912    @GroupAs(
913        name = "links",
914        inJson = JsonGroupAsBehavior.LIST
915    )
916    private List<Link> _links;
917
918    @BoundField(
919        formalName = "Email Address",
920        description = "An email address as defined by [RFC 5322 Section 3.4.1](https://tools.ietf.org/html/rfc5322#section-3.4.1).",
921        useName = "email-address",
922        maxOccurs = -1,
923        remarks = "This is a contact email associated with the party."
924    )
925    @BoundFieldValue(
926        typeAdapter = EmailAddressAdapter.class
927    )
928    @GroupAs(
929        name = "email-addresses",
930        inJson = JsonGroupAsBehavior.LIST
931    )
932    private List<String> _emailAddresses;
933
934    @BoundField(
935        formalName = "Telephone Number",
936        description = "A telephone service number as defined by [ITU-T E.164](https://www.itu.int/rec/T-REC-E.164-201011-I/en).",
937        useName = "telephone-number",
938        maxOccurs = -1,
939        remarks = "A phone number used to contact the party."
940    )
941    @GroupAs(
942        name = "telephone-numbers",
943        inJson = JsonGroupAsBehavior.LIST
944    )
945    private List<TelephoneNumber> _telephoneNumbers;
946
947    @BoundAssembly(
948        formalName = "Address",
949        description = "A postal address for the location.",
950        useName = "address",
951        maxOccurs = -1
952    )
953    @GroupAs(
954        name = "addresses",
955        inJson = JsonGroupAsBehavior.LIST
956    )
957    private List<Address> _addresses;
958
959    @BoundField(
960        formalName = "Location Universally Unique Identifier Reference",
961        description = "Reference to a location by UUID.",
962        useName = "location-uuid",
963        maxOccurs = -1
964    )
965    @BoundFieldValue(
966        typeAdapter = UuidAdapter.class
967    )
968    @ValueConstraints(
969        indexHasKey = @IndexHasKey(level = IConstraint.Level.ERROR, indexName = "index-metadata-location-uuid", keyFields = @KeyField)
970    )
971    @GroupAs(
972        name = "location-uuids",
973        inJson = JsonGroupAsBehavior.LIST
974    )
975    private List<UUID> _locationUuids;
976
977    /**
978     * "A reference to another <code>party</code> by UUID, typically an organization, that this subject is associated with."
979     */
980    @BoundField(
981        formalName = "Organizational Affiliation",
982        description = "A reference to another `party` by UUID, typically an organization, that this subject is associated with.",
983        useName = "member-of-organization",
984        maxOccurs = -1,
985        remarks = "Since the reference target of an organizational affiliation must be another `party` (whether further qualified as person or organization) as inidcated by its `uuid`. As a [machine-oriented](https://pages.nist.gov/OSCAL/concepts/identifier-use/#machine-oriented) identifier with uniqueness across document and trans-document scope, this `uuid` value is sufficient to reference the data item locally or globally across related documents, e.g., in an imported OSCAL instance.\n"
986                + "\n"
987                + "Parties of both the `person` or `organization` type can be associated with an organization using the `member-of-organization`."
988    )
989    @BoundFieldValue(
990        typeAdapter = UuidAdapter.class
991    )
992    @ValueConstraints(
993        indexHasKey = @IndexHasKey(level = IConstraint.Level.ERROR, indexName = "index-metadata-party-organizations-uuid", keyFields = @KeyField)
994    )
995    @GroupAs(
996        name = "member-of-organizations",
997        inJson = JsonGroupAsBehavior.LIST
998    )
999    private List<UUID> _memberOfOrganizations;
1000
1001    @BoundField(
1002        formalName = "Remarks",
1003        description = "Additional commentary about the containing object.",
1004        useName = "remarks"
1005    )
1006    @BoundFieldValue(
1007        typeAdapter = MarkupMultilineAdapter.class
1008    )
1009    private MarkupMultiline _remarks;
1010
1011    public Party() {
1012    }
1013
1014    public UUID getUuid() {
1015      return _uuid;
1016    }
1017
1018    public void setUuid(UUID value) {
1019      _uuid = value;
1020    }
1021
1022    public String getType() {
1023      return _type;
1024    }
1025
1026    public void setType(String value) {
1027      _type = value;
1028    }
1029
1030    public String getName() {
1031      return _name;
1032    }
1033
1034    public void setName(String value) {
1035      _name = value;
1036    }
1037
1038    public String getShortName() {
1039      return _shortName;
1040    }
1041
1042    public void setShortName(String value) {
1043      _shortName = value;
1044    }
1045
1046    public List<ExternalId> getExternalIds() {
1047      return _externalIds;
1048    }
1049
1050    public void setExternalIds(List<ExternalId> value) {
1051      _externalIds = value;
1052    }
1053
1054    /**
1055     * Add a new {@link ExternalId} item to the underlying collection.
1056     * @param item the item to add
1057     * @return {@code true}
1058     */
1059    public boolean addExternalId(ExternalId item) {
1060      ExternalId value = ObjectUtils.requireNonNull(item,"item cannot be null");
1061      if (_externalIds == null) {
1062        _externalIds = new LinkedList<>();
1063      }
1064      return _externalIds.add(value);
1065    }
1066
1067    /**
1068     * Remove the first matching {@link ExternalId} item from the underlying collection.
1069     * @param item the item to remove
1070     * @return {@code true} if the item was removed or {@code false} otherwise
1071     */
1072    public boolean removeExternalId(ExternalId item) {
1073      ExternalId value = ObjectUtils.requireNonNull(item,"item cannot be null");
1074      return _externalIds == null ? false : _externalIds.remove(value);
1075    }
1076
1077    public List<Property> getProps() {
1078      return _props;
1079    }
1080
1081    public void setProps(List<Property> value) {
1082      _props = value;
1083    }
1084
1085    /**
1086     * Add a new {@link Property} item to the underlying collection.
1087     * @param item the item to add
1088     * @return {@code true}
1089     */
1090    public boolean addProp(Property item) {
1091      Property value = ObjectUtils.requireNonNull(item,"item cannot be null");
1092      if (_props == null) {
1093        _props = new LinkedList<>();
1094      }
1095      return _props.add(value);
1096    }
1097
1098    /**
1099     * Remove the first matching {@link Property} item from the underlying collection.
1100     * @param item the item to remove
1101     * @return {@code true} if the item was removed or {@code false} otherwise
1102     */
1103    public boolean removeProp(Property item) {
1104      Property value = ObjectUtils.requireNonNull(item,"item cannot be null");
1105      return _props == null ? false : _props.remove(value);
1106    }
1107
1108    public List<Link> getLinks() {
1109      return _links;
1110    }
1111
1112    public void setLinks(List<Link> value) {
1113      _links = value;
1114    }
1115
1116    /**
1117     * Add a new {@link Link} item to the underlying collection.
1118     * @param item the item to add
1119     * @return {@code true}
1120     */
1121    public boolean addLink(Link item) {
1122      Link value = ObjectUtils.requireNonNull(item,"item cannot be null");
1123      if (_links == null) {
1124        _links = new LinkedList<>();
1125      }
1126      return _links.add(value);
1127    }
1128
1129    /**
1130     * Remove the first matching {@link Link} item from the underlying collection.
1131     * @param item the item to remove
1132     * @return {@code true} if the item was removed or {@code false} otherwise
1133     */
1134    public boolean removeLink(Link item) {
1135      Link value = ObjectUtils.requireNonNull(item,"item cannot be null");
1136      return _links == null ? false : _links.remove(value);
1137    }
1138
1139    public List<String> getEmailAddresses() {
1140      return _emailAddresses;
1141    }
1142
1143    public void setEmailAddresses(List<String> value) {
1144      _emailAddresses = value;
1145    }
1146
1147    /**
1148     * Add a new {@link String} item to the underlying collection.
1149     * @param item the item to add
1150     * @return {@code true}
1151     */
1152    public boolean addEmailAddress(String item) {
1153      String value = ObjectUtils.requireNonNull(item,"item cannot be null");
1154      if (_emailAddresses == null) {
1155        _emailAddresses = new LinkedList<>();
1156      }
1157      return _emailAddresses.add(value);
1158    }
1159
1160    /**
1161     * Remove the first matching {@link String} item from the underlying collection.
1162     * @param item the item to remove
1163     * @return {@code true} if the item was removed or {@code false} otherwise
1164     */
1165    public boolean removeEmailAddress(String item) {
1166      String value = ObjectUtils.requireNonNull(item,"item cannot be null");
1167      return _emailAddresses == null ? false : _emailAddresses.remove(value);
1168    }
1169
1170    public List<TelephoneNumber> getTelephoneNumbers() {
1171      return _telephoneNumbers;
1172    }
1173
1174    public void setTelephoneNumbers(List<TelephoneNumber> value) {
1175      _telephoneNumbers = value;
1176    }
1177
1178    /**
1179     * Add a new {@link TelephoneNumber} item to the underlying collection.
1180     * @param item the item to add
1181     * @return {@code true}
1182     */
1183    public boolean addTelephoneNumber(TelephoneNumber item) {
1184      TelephoneNumber value = ObjectUtils.requireNonNull(item,"item cannot be null");
1185      if (_telephoneNumbers == null) {
1186        _telephoneNumbers = new LinkedList<>();
1187      }
1188      return _telephoneNumbers.add(value);
1189    }
1190
1191    /**
1192     * Remove the first matching {@link TelephoneNumber} item from the underlying collection.
1193     * @param item the item to remove
1194     * @return {@code true} if the item was removed or {@code false} otherwise
1195     */
1196    public boolean removeTelephoneNumber(TelephoneNumber item) {
1197      TelephoneNumber value = ObjectUtils.requireNonNull(item,"item cannot be null");
1198      return _telephoneNumbers == null ? false : _telephoneNumbers.remove(value);
1199    }
1200
1201    public List<Address> getAddresses() {
1202      return _addresses;
1203    }
1204
1205    public void setAddresses(List<Address> value) {
1206      _addresses = value;
1207    }
1208
1209    /**
1210     * Add a new {@link Address} item to the underlying collection.
1211     * @param item the item to add
1212     * @return {@code true}
1213     */
1214    public boolean addAddress(Address item) {
1215      Address value = ObjectUtils.requireNonNull(item,"item cannot be null");
1216      if (_addresses == null) {
1217        _addresses = new LinkedList<>();
1218      }
1219      return _addresses.add(value);
1220    }
1221
1222    /**
1223     * Remove the first matching {@link Address} item from the underlying collection.
1224     * @param item the item to remove
1225     * @return {@code true} if the item was removed or {@code false} otherwise
1226     */
1227    public boolean removeAddress(Address item) {
1228      Address value = ObjectUtils.requireNonNull(item,"item cannot be null");
1229      return _addresses == null ? false : _addresses.remove(value);
1230    }
1231
1232    public List<UUID> getLocationUuids() {
1233      return _locationUuids;
1234    }
1235
1236    public void setLocationUuids(List<UUID> value) {
1237      _locationUuids = value;
1238    }
1239
1240    /**
1241     * Add a new {@link UUID} item to the underlying collection.
1242     * @param item the item to add
1243     * @return {@code true}
1244     */
1245    public boolean addLocationUuid(UUID item) {
1246      UUID value = ObjectUtils.requireNonNull(item,"item cannot be null");
1247      if (_locationUuids == null) {
1248        _locationUuids = new LinkedList<>();
1249      }
1250      return _locationUuids.add(value);
1251    }
1252
1253    /**
1254     * Remove the first matching {@link UUID} item from the underlying collection.
1255     * @param item the item to remove
1256     * @return {@code true} if the item was removed or {@code false} otherwise
1257     */
1258    public boolean removeLocationUuid(UUID item) {
1259      UUID value = ObjectUtils.requireNonNull(item,"item cannot be null");
1260      return _locationUuids == null ? false : _locationUuids.remove(value);
1261    }
1262
1263    public List<UUID> getMemberOfOrganizations() {
1264      return _memberOfOrganizations;
1265    }
1266
1267    public void setMemberOfOrganizations(List<UUID> value) {
1268      _memberOfOrganizations = value;
1269    }
1270
1271    /**
1272     * Add a new {@link UUID} item to the underlying collection.
1273     * @param item the item to add
1274     * @return {@code true}
1275     */
1276    public boolean addMemberOfOrganization(UUID item) {
1277      UUID value = ObjectUtils.requireNonNull(item,"item cannot be null");
1278      if (_memberOfOrganizations == null) {
1279        _memberOfOrganizations = new LinkedList<>();
1280      }
1281      return _memberOfOrganizations.add(value);
1282    }
1283
1284    /**
1285     * Remove the first matching {@link UUID} item from the underlying collection.
1286     * @param item the item to remove
1287     * @return {@code true} if the item was removed or {@code false} otherwise
1288     */
1289    public boolean removeMemberOfOrganization(UUID item) {
1290      UUID value = ObjectUtils.requireNonNull(item,"item cannot be null");
1291      return _memberOfOrganizations == null ? false : _memberOfOrganizations.remove(value);
1292    }
1293
1294    public MarkupMultiline getRemarks() {
1295      return _remarks;
1296    }
1297
1298    public void setRemarks(MarkupMultiline value) {
1299      _remarks = value;
1300    }
1301
1302    @Override
1303    public String toString() {
1304      return new ReflectionToStringBuilder(this, MultilineRecursiveToStringStyle.MULTI_LINE_STYLE).toString();
1305    }
1306
1307    /**
1308     * An identifier for a person or organization using a designated scheme. e.g. an Open Researcher and Contributor ID (ORCID).
1309     */
1310    @MetaschemaField(
1311        formalName = "Party External Identifier",
1312        description = "An identifier for a person or organization using a designated scheme. e.g. an Open Researcher and Contributor ID (ORCID).",
1313        name = "external-id",
1314        metaschema = OscalMetadataMetaschema.class,
1315        isCollapsible = false
1316    )
1317    public static class ExternalId {
1318      @MetaschemaFieldValue(
1319          valueKeyName = "id"
1320      )
1321      private String _value;
1322
1323      @BoundFlag(
1324          formalName = "External Identifier Schema",
1325          description = "Indicates the type of external identifier.",
1326          useName = "scheme",
1327          required = true,
1328          typeAdapter = UriAdapter.class,
1329          remarks = "This value must be an [absolute URI](https://pages.nist.gov/OSCAL/concepts/uri-use/#absolute-uri) that serves as a [naming system identifier](https://pages.nist.gov/OSCAL/concepts/uri-use/#use-as-a-naming-system-identifier)."
1330      )
1331      @ValueConstraints(
1332          allowedValues = @AllowedValues(level = IConstraint.Level.ERROR, allowOthers = true, values = @AllowedValue(value = "http://orcid.org/", description = "The identifier is Open Researcher and Contributor ID (ORCID)."))
1333      )
1334      private URI _scheme;
1335
1336      public ExternalId() {
1337      }
1338
1339      public String getValue() {
1340        return _value;
1341      }
1342
1343      public void setValue(String value) {
1344        _value = value;
1345      }
1346
1347      public URI getScheme() {
1348        return _scheme;
1349      }
1350
1351      public void setScheme(URI value) {
1352        _scheme = value;
1353      }
1354
1355      @Override
1356      public String toString() {
1357        return new ReflectionToStringBuilder(this, MultilineRecursiveToStringStyle.MULTI_LINE_STYLE).toString();
1358      }
1359    }
1360  }
1361
1362  /**
1363   * Defines a function, which might be assigned to a party in a specific situation.
1364   */
1365  @MetaschemaAssembly(
1366      formalName = "Role",
1367      description = "Defines a function, which might be assigned to a party in a specific situation.",
1368      name = "role",
1369      metaschema = OscalMetadataMetaschema.class,
1370      remarks = "Permissible values to be determined closer to the application (e.g. by a receiving authority).\n"
1371              + "\n"
1372              + "OSCAL has defined a set of standardized roles for consistent use in OSCAL documents. This allows tools consuming OSCAL content to infer specific semantics when these roles are used. These roles are documented in the specific contexts of their use (e.g., responsible-party, responsible-role). When using such a role, it is necessary to define these roles in this list, which will then allow such a role to be referenced."
1373  )
1374  public static class Role {
1375    @BoundFlag(
1376        formalName = "Role Identifier",
1377        description = "A unique identifier for the role.",
1378        useName = "id",
1379        required = true,
1380        typeAdapter = TokenAdapter.class
1381    )
1382    private String _id;
1383
1384    /**
1385     * "A name given to the role, which may be used by a tool for display and navigation."
1386     */
1387    @BoundField(
1388        formalName = "Role Title",
1389        description = "A name given to the role, which may be used by a tool for display and navigation.",
1390        useName = "title",
1391        minOccurs = 1
1392    )
1393    @BoundFieldValue(
1394        typeAdapter = MarkupLineAdapter.class
1395    )
1396    private MarkupLine _title;
1397
1398    /**
1399     * "A short common name, abbreviation, or acronym for the role."
1400     */
1401    @BoundField(
1402        formalName = "Role Short Name",
1403        description = "A short common name, abbreviation, or acronym for the role.",
1404        useName = "short-name"
1405    )
1406    private String _shortName;
1407
1408    /**
1409     * "A summary of the role's purpose and associated responsibilities."
1410     */
1411    @BoundField(
1412        formalName = "Role Description",
1413        description = "A summary of the role's purpose and associated responsibilities.",
1414        useName = "description"
1415    )
1416    @BoundFieldValue(
1417        typeAdapter = MarkupMultilineAdapter.class
1418    )
1419    private MarkupMultiline _description;
1420
1421    @BoundAssembly(
1422        formalName = "Property",
1423        description = "An attribute, characteristic, or quality of the containing object expressed as a namespace qualified name/value pair.",
1424        useName = "prop",
1425        maxOccurs = -1
1426    )
1427    @GroupAs(
1428        name = "props",
1429        inJson = JsonGroupAsBehavior.LIST
1430    )
1431    private List<Property> _props;
1432
1433    @BoundAssembly(
1434        formalName = "Link",
1435        description = "A reference to a local or remote resource, that has a specific relation to the containing object.",
1436        useName = "link",
1437        maxOccurs = -1
1438    )
1439    @GroupAs(
1440        name = "links",
1441        inJson = JsonGroupAsBehavior.LIST
1442    )
1443    private List<Link> _links;
1444
1445    @BoundField(
1446        formalName = "Remarks",
1447        description = "Additional commentary about the containing object.",
1448        useName = "remarks"
1449    )
1450    @BoundFieldValue(
1451        typeAdapter = MarkupMultilineAdapter.class
1452    )
1453    private MarkupMultiline _remarks;
1454
1455    public Role() {
1456    }
1457
1458    public String getId() {
1459      return _id;
1460    }
1461
1462    public void setId(String value) {
1463      _id = value;
1464    }
1465
1466    public MarkupLine getTitle() {
1467      return _title;
1468    }
1469
1470    public void setTitle(MarkupLine value) {
1471      _title = value;
1472    }
1473
1474    public String getShortName() {
1475      return _shortName;
1476    }
1477
1478    public void setShortName(String value) {
1479      _shortName = value;
1480    }
1481
1482    public MarkupMultiline getDescription() {
1483      return _description;
1484    }
1485
1486    public void setDescription(MarkupMultiline value) {
1487      _description = value;
1488    }
1489
1490    public List<Property> getProps() {
1491      return _props;
1492    }
1493
1494    public void setProps(List<Property> value) {
1495      _props = value;
1496    }
1497
1498    /**
1499     * Add a new {@link Property} item to the underlying collection.
1500     * @param item the item to add
1501     * @return {@code true}
1502     */
1503    public boolean addProp(Property item) {
1504      Property value = ObjectUtils.requireNonNull(item,"item cannot be null");
1505      if (_props == null) {
1506        _props = new LinkedList<>();
1507      }
1508      return _props.add(value);
1509    }
1510
1511    /**
1512     * Remove the first matching {@link Property} item from the underlying collection.
1513     * @param item the item to remove
1514     * @return {@code true} if the item was removed or {@code false} otherwise
1515     */
1516    public boolean removeProp(Property item) {
1517      Property value = ObjectUtils.requireNonNull(item,"item cannot be null");
1518      return _props == null ? false : _props.remove(value);
1519    }
1520
1521    public List<Link> getLinks() {
1522      return _links;
1523    }
1524
1525    public void setLinks(List<Link> value) {
1526      _links = value;
1527    }
1528
1529    /**
1530     * Add a new {@link Link} item to the underlying collection.
1531     * @param item the item to add
1532     * @return {@code true}
1533     */
1534    public boolean addLink(Link item) {
1535      Link value = ObjectUtils.requireNonNull(item,"item cannot be null");
1536      if (_links == null) {
1537        _links = new LinkedList<>();
1538      }
1539      return _links.add(value);
1540    }
1541
1542    /**
1543     * Remove the first matching {@link Link} item from the underlying collection.
1544     * @param item the item to remove
1545     * @return {@code true} if the item was removed or {@code false} otherwise
1546     */
1547    public boolean removeLink(Link item) {
1548      Link value = ObjectUtils.requireNonNull(item,"item cannot be null");
1549      return _links == null ? false : _links.remove(value);
1550    }
1551
1552    public MarkupMultiline getRemarks() {
1553      return _remarks;
1554    }
1555
1556    public void setRemarks(MarkupMultiline value) {
1557      _remarks = value;
1558    }
1559
1560    @Override
1561    public String toString() {
1562      return new ReflectionToStringBuilder(this, MultilineRecursiveToStringStyle.MULTI_LINE_STYLE).toString();
1563    }
1564  }
1565
1566  /**
1567   * A physical point of presence, which may be associated with people, organizations, or other concepts within the current or linked OSCAL document.
1568   */
1569  @MetaschemaAssembly(
1570      formalName = "Location",
1571      description = "A physical point of presence, which may be associated with people, organizations, or other concepts within the current or linked OSCAL document.",
1572      name = "location",
1573      metaschema = OscalMetadataMetaschema.class,
1574      remarks = "An address might be sensitive in nature. In such cases a title, mailing address, email-address, and/or phone number may be used instead."
1575  )
1576  @ValueConstraints(
1577      allowedValues = {
1578          @AllowedValues(level = IConstraint.Level.ERROR, target = "prop[has-oscal-namespace('http://csrc.nist.gov/ns/oscal')]/@name", values = @AllowedValue(value = "type", description = "Characterizes the kind of location.")),
1579          @AllowedValues(level = IConstraint.Level.ERROR, target = "prop[has-oscal-namespace('http://csrc.nist.gov/ns/oscal') and @name='type']/@value", values = @AllowedValue(value = "data-center", description = "A location that contains computing assets. A `class` can be used to indicate the sub-type of data-center as *primary* or *alternate*.")),
1580          @AllowedValues(level = IConstraint.Level.ERROR, target = "prop[has-oscal-namespace('http://csrc.nist.gov/ns/oscal') and @name='type' and @value='data-center']/@class", values = {@AllowedValue(value = "primary", description = "The location is a data-center used for normal operations."), @AllowedValue(value = "alternate", description = "The location is a data-center used for fail-over or backup operations.")})
1581      }
1582  )
1583  @AssemblyConstraints(
1584      hasCardinality = {
1585          @HasCardinality(level = IConstraint.Level.WARNING, target = "address", minOccurs = 1),
1586          @HasCardinality(level = IConstraint.Level.ERROR, target = "title|address|email-address|telephone-number", minOccurs = 1)
1587      }
1588  )
1589  public static class Location {
1590    @BoundFlag(
1591        formalName = "Location Universally Unique Identifier",
1592        description = "A unique ID for the location, for reference.",
1593        useName = "uuid",
1594        required = true,
1595        typeAdapter = UuidAdapter.class
1596    )
1597    private UUID _uuid;
1598
1599    /**
1600     * "A name given to the location, which may be used by a tool for display and navigation."
1601     */
1602    @BoundField(
1603        formalName = "Location Title",
1604        description = "A name given to the location, which may be used by a tool for display and navigation.",
1605        useName = "title"
1606    )
1607    @BoundFieldValue(
1608        typeAdapter = MarkupLineAdapter.class
1609    )
1610    private MarkupLine _title;
1611
1612    @BoundAssembly(
1613        formalName = "Address",
1614        description = "A postal address for the location.",
1615        useName = "address",
1616        remarks = "The physical address of the location, which will provided for physical locations. Virtual locations can omit this data item."
1617    )
1618    private Address _address;
1619
1620    @BoundField(
1621        formalName = "Email Address",
1622        description = "An email address as defined by [RFC 5322 Section 3.4.1](https://tools.ietf.org/html/rfc5322#section-3.4.1).",
1623        useName = "email-address",
1624        maxOccurs = -1,
1625        remarks = "A contact email associated with the location."
1626    )
1627    @BoundFieldValue(
1628        typeAdapter = EmailAddressAdapter.class
1629    )
1630    @GroupAs(
1631        name = "email-addresses",
1632        inJson = JsonGroupAsBehavior.LIST
1633    )
1634    private List<String> _emailAddresses;
1635
1636    @BoundField(
1637        formalName = "Telephone Number",
1638        description = "A telephone service number as defined by [ITU-T E.164](https://www.itu.int/rec/T-REC-E.164-201011-I/en).",
1639        useName = "telephone-number",
1640        maxOccurs = -1,
1641        remarks = "A phone number used to contact the location."
1642    )
1643    @GroupAs(
1644        name = "telephone-numbers",
1645        inJson = JsonGroupAsBehavior.LIST
1646    )
1647    private List<TelephoneNumber> _telephoneNumbers;
1648
1649    /**
1650     * "The uniform resource locator (URL) for a web site or other resource associated with the location."
1651     */
1652    @BoundField(
1653        formalName = "Location URL",
1654        description = "The uniform resource locator (URL) for a web site or other resource associated with the location.",
1655        useName = "url",
1656        maxOccurs = -1,
1657        remarks = "This data field is deprecated in favor of using a link with an appropriate relationship."
1658    )
1659    @BoundFieldValue(
1660        typeAdapter = UriAdapter.class
1661    )
1662    @GroupAs(
1663        name = "urls",
1664        inJson = JsonGroupAsBehavior.LIST
1665    )
1666    private List<URI> _urls;
1667
1668    @BoundAssembly(
1669        formalName = "Property",
1670        description = "An attribute, characteristic, or quality of the containing object expressed as a namespace qualified name/value pair.",
1671        useName = "prop",
1672        maxOccurs = -1
1673    )
1674    @GroupAs(
1675        name = "props",
1676        inJson = JsonGroupAsBehavior.LIST
1677    )
1678    private List<Property> _props;
1679
1680    @BoundAssembly(
1681        formalName = "Link",
1682        description = "A reference to a local or remote resource, that has a specific relation to the containing object.",
1683        useName = "link",
1684        maxOccurs = -1
1685    )
1686    @GroupAs(
1687        name = "links",
1688        inJson = JsonGroupAsBehavior.LIST
1689    )
1690    private List<Link> _links;
1691
1692    @BoundField(
1693        formalName = "Remarks",
1694        description = "Additional commentary about the containing object.",
1695        useName = "remarks"
1696    )
1697    @BoundFieldValue(
1698        typeAdapter = MarkupMultilineAdapter.class
1699    )
1700    private MarkupMultiline _remarks;
1701
1702    public Location() {
1703    }
1704
1705    public UUID getUuid() {
1706      return _uuid;
1707    }
1708
1709    public void setUuid(UUID value) {
1710      _uuid = value;
1711    }
1712
1713    public MarkupLine getTitle() {
1714      return _title;
1715    }
1716
1717    public void setTitle(MarkupLine value) {
1718      _title = value;
1719    }
1720
1721    public Address getAddress() {
1722      return _address;
1723    }
1724
1725    public void setAddress(Address value) {
1726      _address = value;
1727    }
1728
1729    public List<String> getEmailAddresses() {
1730      return _emailAddresses;
1731    }
1732
1733    public void setEmailAddresses(List<String> value) {
1734      _emailAddresses = value;
1735    }
1736
1737    /**
1738     * Add a new {@link String} item to the underlying collection.
1739     * @param item the item to add
1740     * @return {@code true}
1741     */
1742    public boolean addEmailAddress(String item) {
1743      String value = ObjectUtils.requireNonNull(item,"item cannot be null");
1744      if (_emailAddresses == null) {
1745        _emailAddresses = new LinkedList<>();
1746      }
1747      return _emailAddresses.add(value);
1748    }
1749
1750    /**
1751     * Remove the first matching {@link String} item from the underlying collection.
1752     * @param item the item to remove
1753     * @return {@code true} if the item was removed or {@code false} otherwise
1754     */
1755    public boolean removeEmailAddress(String item) {
1756      String value = ObjectUtils.requireNonNull(item,"item cannot be null");
1757      return _emailAddresses == null ? false : _emailAddresses.remove(value);
1758    }
1759
1760    public List<TelephoneNumber> getTelephoneNumbers() {
1761      return _telephoneNumbers;
1762    }
1763
1764    public void setTelephoneNumbers(List<TelephoneNumber> value) {
1765      _telephoneNumbers = value;
1766    }
1767
1768    /**
1769     * Add a new {@link TelephoneNumber} item to the underlying collection.
1770     * @param item the item to add
1771     * @return {@code true}
1772     */
1773    public boolean addTelephoneNumber(TelephoneNumber item) {
1774      TelephoneNumber value = ObjectUtils.requireNonNull(item,"item cannot be null");
1775      if (_telephoneNumbers == null) {
1776        _telephoneNumbers = new LinkedList<>();
1777      }
1778      return _telephoneNumbers.add(value);
1779    }
1780
1781    /**
1782     * Remove the first matching {@link TelephoneNumber} item from the underlying collection.
1783     * @param item the item to remove
1784     * @return {@code true} if the item was removed or {@code false} otherwise
1785     */
1786    public boolean removeTelephoneNumber(TelephoneNumber item) {
1787      TelephoneNumber value = ObjectUtils.requireNonNull(item,"item cannot be null");
1788      return _telephoneNumbers == null ? false : _telephoneNumbers.remove(value);
1789    }
1790
1791    public List<URI> getUrls() {
1792      return _urls;
1793    }
1794
1795    public void setUrls(List<URI> value) {
1796      _urls = value;
1797    }
1798
1799    /**
1800     * Add a new {@link URI} item to the underlying collection.
1801     * @param item the item to add
1802     * @return {@code true}
1803     */
1804    public boolean addUrl(URI item) {
1805      URI value = ObjectUtils.requireNonNull(item,"item cannot be null");
1806      if (_urls == null) {
1807        _urls = new LinkedList<>();
1808      }
1809      return _urls.add(value);
1810    }
1811
1812    /**
1813     * Remove the first matching {@link URI} item from the underlying collection.
1814     * @param item the item to remove
1815     * @return {@code true} if the item was removed or {@code false} otherwise
1816     */
1817    public boolean removeUrl(URI item) {
1818      URI value = ObjectUtils.requireNonNull(item,"item cannot be null");
1819      return _urls == null ? false : _urls.remove(value);
1820    }
1821
1822    public List<Property> getProps() {
1823      return _props;
1824    }
1825
1826    public void setProps(List<Property> value) {
1827      _props = value;
1828    }
1829
1830    /**
1831     * Add a new {@link Property} item to the underlying collection.
1832     * @param item the item to add
1833     * @return {@code true}
1834     */
1835    public boolean addProp(Property item) {
1836      Property value = ObjectUtils.requireNonNull(item,"item cannot be null");
1837      if (_props == null) {
1838        _props = new LinkedList<>();
1839      }
1840      return _props.add(value);
1841    }
1842
1843    /**
1844     * Remove the first matching {@link Property} item from the underlying collection.
1845     * @param item the item to remove
1846     * @return {@code true} if the item was removed or {@code false} otherwise
1847     */
1848    public boolean removeProp(Property item) {
1849      Property value = ObjectUtils.requireNonNull(item,"item cannot be null");
1850      return _props == null ? false : _props.remove(value);
1851    }
1852
1853    public List<Link> getLinks() {
1854      return _links;
1855    }
1856
1857    public void setLinks(List<Link> value) {
1858      _links = value;
1859    }
1860
1861    /**
1862     * Add a new {@link Link} item to the underlying collection.
1863     * @param item the item to add
1864     * @return {@code true}
1865     */
1866    public boolean addLink(Link item) {
1867      Link value = ObjectUtils.requireNonNull(item,"item cannot be null");
1868      if (_links == null) {
1869        _links = new LinkedList<>();
1870      }
1871      return _links.add(value);
1872    }
1873
1874    /**
1875     * Remove the first matching {@link Link} item from the underlying collection.
1876     * @param item the item to remove
1877     * @return {@code true} if the item was removed or {@code false} otherwise
1878     */
1879    public boolean removeLink(Link item) {
1880      Link value = ObjectUtils.requireNonNull(item,"item cannot be null");
1881      return _links == null ? false : _links.remove(value);
1882    }
1883
1884    public MarkupMultiline getRemarks() {
1885      return _remarks;
1886    }
1887
1888    public void setRemarks(MarkupMultiline value) {
1889      _remarks = value;
1890    }
1891
1892    @Override
1893    public String toString() {
1894      return new ReflectionToStringBuilder(this, MultilineRecursiveToStringStyle.MULTI_LINE_STYLE).toString();
1895    }
1896  }
1897}