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