001// Generated from: ../../../../../../../../oscal/src/metaschema/oscal_metadata_metaschema.xml 002// Do not edit - changes will be lost when regenerated. 003package dev.metaschema.oscal.lib.model; 004 005import dev.metaschema.core.datatype.adapter.DateTimeWithTZAdapter; 006import dev.metaschema.core.datatype.adapter.EmailAddressAdapter; 007import dev.metaschema.core.datatype.adapter.StringAdapter; 008import dev.metaschema.core.datatype.adapter.TokenAdapter; 009import dev.metaschema.core.datatype.adapter.UriAdapter; 010import dev.metaschema.core.datatype.adapter.UuidAdapter; 011import dev.metaschema.core.datatype.markup.MarkupLine; 012import dev.metaschema.core.datatype.markup.MarkupLineAdapter; 013import dev.metaschema.core.datatype.markup.MarkupMultiline; 014import dev.metaschema.core.datatype.markup.MarkupMultilineAdapter; 015import dev.metaschema.core.model.IBoundObject; 016import dev.metaschema.core.model.IMetaschemaData; 017import dev.metaschema.core.model.JsonGroupAsBehavior; 018import dev.metaschema.core.model.XmlGroupAsBehavior; 019import dev.metaschema.core.model.constraint.IConstraint; 020import dev.metaschema.core.util.ObjectUtils; 021import dev.metaschema.databind.model.annotations.AllowedValue; 022import dev.metaschema.databind.model.annotations.AllowedValues; 023import dev.metaschema.databind.model.annotations.AssemblyConstraints; 024import dev.metaschema.databind.model.annotations.BoundAssembly; 025import dev.metaschema.databind.model.annotations.BoundChoice; 026import dev.metaschema.databind.model.annotations.BoundField; 027import dev.metaschema.databind.model.annotations.BoundFieldValue; 028import dev.metaschema.databind.model.annotations.BoundFlag; 029import dev.metaschema.databind.model.annotations.GroupAs; 030import dev.metaschema.databind.model.annotations.HasCardinality; 031import dev.metaschema.databind.model.annotations.Index; 032import dev.metaschema.databind.model.annotations.IndexHasKey; 033import dev.metaschema.databind.model.annotations.IsUnique; 034import dev.metaschema.databind.model.annotations.KeyField; 035import dev.metaschema.databind.model.annotations.MetaschemaAssembly; 036import dev.metaschema.databind.model.annotations.MetaschemaField; 037import dev.metaschema.databind.model.annotations.ValueConstraints; 038import dev.metaschema.oscal.lib.model.metadata.AbstractMetadata; 039import edu.umd.cs.findbugs.annotations.NonNull; 040import edu.umd.cs.findbugs.annotations.Nullable; 041import java.net.URI; 042import java.time.ZonedDateTime; 043import java.util.LinkedList; 044import java.util.List; 045import java.util.UUID; 046import org.apache.commons.lang3.builder.ReflectionToStringBuilder; 047import org.apache.commons.lang3.builder.ToStringStyle; 048 049/** 050 * Provides information about the containing document, and defines concepts that are shared across the document. 051 */ 052@MetaschemaAssembly( 053 formalName = "Document Metadata", 054 description = "Provides information about the containing document, and defines concepts that are shared across the document.", 055 name = "metadata", 056 moduleClass = OscalMetadataModule.class, 057 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" 058 + "\n" 059 + "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" 060 + "\n" 061 + "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" 062 + "\n" 063 + "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.", 064 valueConstraints = @ValueConstraints(allowedValues = {@AllowedValues(id = "oscal-metadata-responsible-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(id = "oscal-metadata-prop-name-values", 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(id = "oscal-metadata-link-rel-values", 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).")}), @AllowedValues(id = "oscal-metadata-allowed-roles", formalName = "Standard Role Identifiers", description = "The values provided here represent standardized role identifiers for common roles.", level = IConstraint.Level.ERROR, target = "responsible-party/@role-id", allowOthers = true, values = {@AllowedValue(value = "creator", description = "Indicates the organization that created this content."), @AllowedValue(value = "prepared-by", description = "Indicates the organization that prepared this content."), @AllowedValue(value = "prepared-for", description = "Indicates the organization for which this content was created."), @AllowedValue(value = "content-approver", description = "Indicates the organization responsible for all content represented in the \"document\"."), @AllowedValue(value = "contact", description = "Indicates the organization to contact for questions or support related to this content.")}), @AllowedValues(id = "oscal-metadata-allowed-props", formalName = "Metadata Keywords Property", level = IConstraint.Level.ERROR, target = "prop[not(@ns) or @ns='http://csrc.nist.gov/ns/oscal']/@name", values = @AllowedValue(value = "keywords", description = "The value identifies a comma-separated listing of keywords associated with this content. These keywords may be used as search terms for indexing and other applications.")), @AllowedValues(id = "oscal-allowed-link-rels", formalName = "Standard Metadata Link Relations", level = IConstraint.Level.ERROR, target = "link/@rel", allowOthers = true, values = {@AllowedValue(value = "canonical", description = "The link identifies the authoritative location for this file. Defined by [RFC 6596](https://tools.ietf.org/html/rfc6596)."), @AllowedValue(value = "alternate", description = "The link identifies an alternative location or format for this file. 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).")})}), 065 modelConstraints = @AssemblyConstraints(index = {@Index(id = "oscal-index-metadata-roles", level = IConstraint.Level.ERROR, target = "role", name = "index-metadata-role-ids", keyFields = @KeyField(target = "@id")), @Index(id = "oscal-index-metadata-property-uuid", level = IConstraint.Level.ERROR, target = ".//prop", name = "index-metadata-property-uuid", keyFields = @KeyField(target = "@uuid")), @Index(id = "oscal-index-metadata-role-id", level = IConstraint.Level.ERROR, target = "role", name = "index-metadata-role-id", keyFields = @KeyField(target = "@id")), @Index(id = "oscal-index-metadata-location-uuid", level = IConstraint.Level.ERROR, target = "location", name = "index-metadata-location-uuid", keyFields = @KeyField(target = "@uuid")), @Index(id = "oscal-index-metadata-party-uuid", level = IConstraint.Level.ERROR, target = "party", name = "index-metadata-party-uuid", keyFields = @KeyField(target = "@uuid")), @Index(id = "oscal-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 = "oscal-unique-metadata-doc-id", level = IConstraint.Level.ERROR, target = "document-id", keyFields = {@KeyField(target = "@scheme"), @KeyField}), @IsUnique(id = "oscal-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 = "oscal-unique-metadata-link", level = IConstraint.Level.ERROR, target = "link", keyFields = {@KeyField(target = "@href"), @KeyField(target = "@rel"), @KeyField(target = "@media-type")}), @IsUnique(id = "oscal-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(id = "oscal-metadata-unique-document-id", level = IConstraint.Level.ERROR, target = "document-id", keyFields = {@KeyField(target = "@scheme"), @KeyField}, remarks = "The combination of `scheme` and the field value must be unique.")}) 066) 067public class Metadata extends AbstractMetadata implements IBoundObject { 068 private final IMetaschemaData __metaschemaData; 069 070 /** 071 * A name given to the document, which may be used by a tool for display and navigation. 072 */ 073 @BoundField( 074 formalName = "Document Title", 075 description = "A name given to the document, which may be used by a tool for display and navigation.", 076 useName = "title", 077 minOccurs = 1, 078 typeAdapter = MarkupLineAdapter.class 079 ) 080 private MarkupLine _title; 081 082 /** 083 * The date and time the document was last made available. 084 */ 085 @BoundField( 086 formalName = "Publication Timestamp", 087 description = "The date and time the document was last made available.", 088 useName = "published", 089 typeAdapter = DateTimeWithTZAdapter.class 090 ) 091 private ZonedDateTime _published; 092 093 /** 094 * The date and time the document was last stored for later retrieval. 095 */ 096 @BoundField( 097 formalName = "Last Modified Timestamp", 098 description = "The date and time the document was last stored for later retrieval.", 099 useName = "last-modified", 100 minOccurs = 1, 101 typeAdapter = DateTimeWithTZAdapter.class 102 ) 103 private ZonedDateTime _lastModified; 104 105 /** 106 * Used to distinguish a specific revision of an OSCAL document from other previous and future versions. 107 */ 108 @BoundField( 109 formalName = "Document Version", 110 description = "Used to distinguish a specific revision of an OSCAL document from other previous and future versions.", 111 useName = "version", 112 minOccurs = 1, 113 typeAdapter = StringAdapter.class 114 ) 115 private String _version; 116 117 /** 118 * The OSCAL model version the document was authored against and will conform to as valid. 119 */ 120 @BoundField( 121 formalName = "OSCAL Version", 122 description = "The OSCAL model version the document was authored against and will conform to as valid.", 123 useName = "oscal-version", 124 minOccurs = 1, 125 typeAdapter = StringAdapter.class 126 ) 127 private String _oscalVersion; 128 129 /** 130 * An entry in a sequential list of revisions to the containing document, expected to be in reverse chronological order (i.e. latest first). 131 */ 132 @BoundAssembly( 133 formalName = "Revision History Entry", 134 description = "An entry in a sequential list of revisions to the containing document, expected to be in reverse chronological order (i.e. latest first).", 135 useName = "revision", 136 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.", 137 maxOccurs = -1, 138 groupAs = @GroupAs(name = "revisions", inJson = JsonGroupAsBehavior.LIST, inXml = XmlGroupAsBehavior.GROUPED) 139 ) 140 private List<Revision> _revisions; 141 142 /** 143 * A document identifier qualified by an identifier <code>scheme</code>. 144 */ 145 @BoundField( 146 formalName = "Document Identifier", 147 description = "A document identifier qualified by an identifier `scheme`.", 148 useName = "document-id", 149 maxOccurs = -1, 150 groupAs = @GroupAs(name = "document-ids", inJson = JsonGroupAsBehavior.LIST) 151 ) 152 private List<DocumentId> _documentIds; 153 154 /** 155 * An attribute, characteristic, or quality of the containing object expressed as a namespace qualified name/value pair. 156 */ 157 @BoundAssembly( 158 formalName = "Property", 159 description = "An attribute, characteristic, or quality of the containing object expressed as a namespace qualified name/value pair.", 160 useName = "prop", 161 maxOccurs = -1, 162 groupAs = @GroupAs(name = "props", inJson = JsonGroupAsBehavior.LIST) 163 ) 164 private List<Property> _props; 165 166 /** 167 * A reference to a local or remote resource, that has a specific relation to the containing object. 168 */ 169 @BoundAssembly( 170 formalName = "Link", 171 description = "A reference to a local or remote resource, that has a specific relation to the containing object.", 172 useName = "link", 173 maxOccurs = -1, 174 groupAs = @GroupAs(name = "links", inJson = JsonGroupAsBehavior.LIST) 175 ) 176 private List<Link> _links; 177 178 /** 179 * Defines a function, which might be assigned to a party in a specific situation. 180 */ 181 @BoundAssembly( 182 formalName = "Role", 183 description = "Defines a function, which might be assigned to a party in a specific situation.", 184 useName = "role", 185 remarks = "Permissible values to be determined closer to the application (e.g. by a receiving authority).\n" 186 + "\n" 187 + "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.", 188 maxOccurs = -1, 189 groupAs = @GroupAs(name = "roles", inJson = JsonGroupAsBehavior.LIST) 190 ) 191 private List<Role> _roles; 192 193 /** 194 * A physical point of presence, which may be associated with people, organizations, or other concepts within the current or linked OSCAL document. 195 */ 196 @BoundAssembly( 197 formalName = "Location", 198 description = "A physical point of presence, which may be associated with people, organizations, or other concepts within the current or linked OSCAL document.", 199 useName = "location", 200 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.", 201 maxOccurs = -1, 202 groupAs = @GroupAs(name = "locations", inJson = JsonGroupAsBehavior.LIST) 203 ) 204 private List<Location> _locations; 205 206 /** 207 * An organization or person, which may be associated with roles or other concepts within the current or linked OSCAL document. 208 */ 209 @BoundAssembly( 210 formalName = "Party", 211 description = "An organization or person, which may be associated with roles or other concepts within the current or linked OSCAL document.", 212 useName = "party", 213 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.", 214 maxOccurs = -1, 215 groupAs = @GroupAs(name = "parties", inJson = JsonGroupAsBehavior.LIST) 216 ) 217 private List<Party> _parties; 218 219 /** 220 * 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. 221 */ 222 @BoundAssembly( 223 formalName = "Responsible Party", 224 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.", 225 useName = "responsible-party", 226 maxOccurs = -1, 227 groupAs = @GroupAs(name = "responsible-parties", inJson = JsonGroupAsBehavior.LIST) 228 ) 229 private List<ResponsibleParty> _responsibleParties; 230 231 /** 232 * An action applied by a role within a given party to the content. 233 */ 234 @BoundAssembly( 235 formalName = "Action", 236 description = "An action applied by a role within a given party to the content.", 237 useName = "action", 238 maxOccurs = -1, 239 groupAs = @GroupAs(name = "actions", inJson = JsonGroupAsBehavior.LIST) 240 ) 241 private List<Action> _actions; 242 243 /** 244 * Additional commentary about the containing object. 245 */ 246 @BoundField( 247 formalName = "Remarks", 248 description = "Additional commentary about the containing object.", 249 useName = "remarks", 250 typeAdapter = MarkupMultilineAdapter.class 251 ) 252 private MarkupMultiline _remarks; 253 254 /** 255 * Constructs a new {@code dev.metaschema.oscal.lib.model.Metadata} instance with no metadata. 256 */ 257 public Metadata() { 258 this(null); 259 } 260 261 /** 262 * Constructs a new {@code dev.metaschema.oscal.lib.model.Metadata} instance with the specified metadata. 263 * 264 * @param data 265 * the metaschema data, or {@code null} if none 266 */ 267 public Metadata(IMetaschemaData data) { 268 this.__metaschemaData = data; 269 } 270 271 @Override 272 public IMetaschemaData getMetaschemaData() { 273 return __metaschemaData; 274 } 275 276 /** 277 * Get the "{@literal Document Title}". 278 * 279 * <p> 280 * A name given to the document, which may be used by a tool for display and navigation. 281 * 282 * @return the title value 283 */ 284 @NonNull 285 public MarkupLine getTitle() { 286 return _title; 287 } 288 289 /** 290 * Set the "{@literal Document Title}". 291 * 292 * <p> 293 * A name given to the document, which may be used by a tool for display and navigation. 294 * 295 * @param value 296 * the title value to set 297 */ 298 public void setTitle(@NonNull MarkupLine value) { 299 _title = value; 300 } 301 302 /** 303 * Get the "{@literal Publication Timestamp}". 304 * 305 * <p> 306 * The date and time the document was last made available. 307 * 308 * @return the published value, or {@code null} if not set 309 */ 310 @Nullable 311 public ZonedDateTime getPublished() { 312 return _published; 313 } 314 315 /** 316 * Set the "{@literal Publication Timestamp}". 317 * 318 * <p> 319 * The date and time the document was last made available. 320 * 321 * @param value 322 * the published value to set, or {@code null} to clear 323 */ 324 public void setPublished(@Nullable ZonedDateTime value) { 325 _published = value; 326 } 327 328 /** 329 * Get the "{@literal Last Modified Timestamp}". 330 * 331 * <p> 332 * The date and time the document was last stored for later retrieval. 333 * 334 * @return the last-modified value 335 */ 336 @NonNull 337 public ZonedDateTime getLastModified() { 338 return _lastModified; 339 } 340 341 /** 342 * Set the "{@literal Last Modified Timestamp}". 343 * 344 * <p> 345 * The date and time the document was last stored for later retrieval. 346 * 347 * @param value 348 * the last-modified value to set 349 */ 350 public void setLastModified(@NonNull ZonedDateTime value) { 351 _lastModified = value; 352 } 353 354 /** 355 * Get the "{@literal Document Version}". 356 * 357 * <p> 358 * Used to distinguish a specific revision of an OSCAL document from other previous and future versions. 359 * 360 * @return the version value 361 */ 362 @NonNull 363 public String getVersion() { 364 return _version; 365 } 366 367 /** 368 * Set the "{@literal Document Version}". 369 * 370 * <p> 371 * Used to distinguish a specific revision of an OSCAL document from other previous and future versions. 372 * 373 * @param value 374 * the version value to set 375 */ 376 public void setVersion(@NonNull String value) { 377 _version = value; 378 } 379 380 /** 381 * Get the "{@literal OSCAL Version}". 382 * 383 * <p> 384 * The OSCAL model version the document was authored against and will conform to as valid. 385 * 386 * @return the oscal-version value 387 */ 388 @NonNull 389 public String getOscalVersion() { 390 return _oscalVersion; 391 } 392 393 /** 394 * Set the "{@literal OSCAL Version}". 395 * 396 * <p> 397 * The OSCAL model version the document was authored against and will conform to as valid. 398 * 399 * @param value 400 * the oscal-version value to set 401 */ 402 public void setOscalVersion(@NonNull String value) { 403 _oscalVersion = value; 404 } 405 406 /** 407 * Get the "{@literal Revision History Entry}". 408 * 409 * <p> 410 * An entry in a sequential list of revisions to the containing document, expected to be in reverse chronological order (i.e. latest first). 411 * 412 * @return the revision value 413 */ 414 @NonNull 415 public List<Revision> getRevisions() { 416 if (_revisions == null) { 417 _revisions = new LinkedList<>(); 418 } 419 return ObjectUtils.notNull(_revisions); 420 } 421 422 /** 423 * Set the "{@literal Revision History Entry}". 424 * 425 * <p> 426 * An entry in a sequential list of revisions to the containing document, expected to be in reverse chronological order (i.e. latest first). 427 * 428 * @param value 429 * the revision value to set 430 */ 431 public void setRevisions(@NonNull List<Revision> value) { 432 _revisions = value; 433 } 434 435 /** 436 * Add a new {@link Revision} item to the underlying collection. 437 * @param item the item to add 438 * @return {@code true} 439 */ 440 public boolean addRevision(Revision item) { 441 Revision value = ObjectUtils.requireNonNull(item,"item cannot be null"); 442 if (_revisions == null) { 443 _revisions = new LinkedList<>(); 444 } 445 return _revisions.add(value); 446 } 447 448 /** 449 * Remove the first matching {@link Revision} item from the underlying collection. 450 * @param item the item to remove 451 * @return {@code true} if the item was removed or {@code false} otherwise 452 */ 453 public boolean removeRevision(Revision item) { 454 Revision value = ObjectUtils.requireNonNull(item,"item cannot be null"); 455 return _revisions != null && _revisions.remove(value); 456 } 457 458 /** 459 * Get the "{@literal Document Identifier}". 460 * 461 * <p> 462 * A document identifier qualified by an identifier <code>scheme</code>. 463 * 464 * @return the document-id value 465 */ 466 @NonNull 467 public List<DocumentId> getDocumentIds() { 468 if (_documentIds == null) { 469 _documentIds = new LinkedList<>(); 470 } 471 return ObjectUtils.notNull(_documentIds); 472 } 473 474 /** 475 * Set the "{@literal Document Identifier}". 476 * 477 * <p> 478 * A document identifier qualified by an identifier <code>scheme</code>. 479 * 480 * @param value 481 * the document-id value to set 482 */ 483 public void setDocumentIds(@NonNull List<DocumentId> value) { 484 _documentIds = value; 485 } 486 487 /** 488 * Add a new {@link DocumentId} item to the underlying collection. 489 * @param item the item to add 490 * @return {@code true} 491 */ 492 public boolean addDocumentId(DocumentId item) { 493 DocumentId value = ObjectUtils.requireNonNull(item,"item cannot be null"); 494 if (_documentIds == null) { 495 _documentIds = new LinkedList<>(); 496 } 497 return _documentIds.add(value); 498 } 499 500 /** 501 * Remove the first matching {@link DocumentId} item from the underlying collection. 502 * @param item the item to remove 503 * @return {@code true} if the item was removed or {@code false} otherwise 504 */ 505 public boolean removeDocumentId(DocumentId item) { 506 DocumentId value = ObjectUtils.requireNonNull(item,"item cannot be null"); 507 return _documentIds != null && _documentIds.remove(value); 508 } 509 510 /** 511 * Get the "{@literal Property}". 512 * 513 * <p> 514 * An attribute, characteristic, or quality of the containing object expressed as a namespace qualified name/value pair. 515 * 516 * @return the prop value 517 */ 518 @NonNull 519 public List<Property> getProps() { 520 if (_props == null) { 521 _props = new LinkedList<>(); 522 } 523 return ObjectUtils.notNull(_props); 524 } 525 526 /** 527 * Set the "{@literal Property}". 528 * 529 * <p> 530 * An attribute, characteristic, or quality of the containing object expressed as a namespace qualified name/value pair. 531 * 532 * @param value 533 * the prop value to set 534 */ 535 public void setProps(@NonNull List<Property> value) { 536 _props = value; 537 } 538 539 /** 540 * Add a new {@link Property} item to the underlying collection. 541 * @param item the item to add 542 * @return {@code true} 543 */ 544 public boolean addProp(Property item) { 545 Property value = ObjectUtils.requireNonNull(item,"item cannot be null"); 546 if (_props == null) { 547 _props = new LinkedList<>(); 548 } 549 return _props.add(value); 550 } 551 552 /** 553 * Remove the first matching {@link Property} item from the underlying collection. 554 * @param item the item to remove 555 * @return {@code true} if the item was removed or {@code false} otherwise 556 */ 557 public boolean removeProp(Property item) { 558 Property value = ObjectUtils.requireNonNull(item,"item cannot be null"); 559 return _props != null && _props.remove(value); 560 } 561 562 /** 563 * Get the "{@literal Link}". 564 * 565 * <p> 566 * A reference to a local or remote resource, that has a specific relation to the containing object. 567 * 568 * @return the link value 569 */ 570 @NonNull 571 public List<Link> getLinks() { 572 if (_links == null) { 573 _links = new LinkedList<>(); 574 } 575 return ObjectUtils.notNull(_links); 576 } 577 578 /** 579 * Set the "{@literal Link}". 580 * 581 * <p> 582 * A reference to a local or remote resource, that has a specific relation to the containing object. 583 * 584 * @param value 585 * the link value to set 586 */ 587 public void setLinks(@NonNull List<Link> value) { 588 _links = value; 589 } 590 591 /** 592 * Add a new {@link Link} item to the underlying collection. 593 * @param item the item to add 594 * @return {@code true} 595 */ 596 public boolean addLink(Link item) { 597 Link value = ObjectUtils.requireNonNull(item,"item cannot be null"); 598 if (_links == null) { 599 _links = new LinkedList<>(); 600 } 601 return _links.add(value); 602 } 603 604 /** 605 * Remove the first matching {@link Link} item from the underlying collection. 606 * @param item the item to remove 607 * @return {@code true} if the item was removed or {@code false} otherwise 608 */ 609 public boolean removeLink(Link item) { 610 Link value = ObjectUtils.requireNonNull(item,"item cannot be null"); 611 return _links != null && _links.remove(value); 612 } 613 614 /** 615 * Get the "{@literal Role}". 616 * 617 * <p> 618 * Defines a function, which might be assigned to a party in a specific situation. 619 * 620 * @return the role value 621 */ 622 @NonNull 623 public List<Role> getRoles() { 624 if (_roles == null) { 625 _roles = new LinkedList<>(); 626 } 627 return ObjectUtils.notNull(_roles); 628 } 629 630 /** 631 * Set the "{@literal Role}". 632 * 633 * <p> 634 * Defines a function, which might be assigned to a party in a specific situation. 635 * 636 * @param value 637 * the role value to set 638 */ 639 public void setRoles(@NonNull List<Role> value) { 640 _roles = value; 641 } 642 643 /** 644 * Add a new {@link Role} item to the underlying collection. 645 * @param item the item to add 646 * @return {@code true} 647 */ 648 public boolean addRole(Role item) { 649 Role value = ObjectUtils.requireNonNull(item,"item cannot be null"); 650 if (_roles == null) { 651 _roles = new LinkedList<>(); 652 } 653 return _roles.add(value); 654 } 655 656 /** 657 * Remove the first matching {@link Role} item from the underlying collection. 658 * @param item the item to remove 659 * @return {@code true} if the item was removed or {@code false} otherwise 660 */ 661 public boolean removeRole(Role item) { 662 Role value = ObjectUtils.requireNonNull(item,"item cannot be null"); 663 return _roles != null && _roles.remove(value); 664 } 665 666 /** 667 * Get the "{@literal Location}". 668 * 669 * <p> 670 * A physical point of presence, which may be associated with people, organizations, or other concepts within the current or linked OSCAL document. 671 * 672 * @return the location value 673 */ 674 @NonNull 675 public List<Location> getLocations() { 676 if (_locations == null) { 677 _locations = new LinkedList<>(); 678 } 679 return ObjectUtils.notNull(_locations); 680 } 681 682 /** 683 * Set the "{@literal Location}". 684 * 685 * <p> 686 * A physical point of presence, which may be associated with people, organizations, or other concepts within the current or linked OSCAL document. 687 * 688 * @param value 689 * the location value to set 690 */ 691 public void setLocations(@NonNull List<Location> value) { 692 _locations = value; 693 } 694 695 /** 696 * Add a new {@link Location} item to the underlying collection. 697 * @param item the item to add 698 * @return {@code true} 699 */ 700 public boolean addLocation(Location item) { 701 Location value = ObjectUtils.requireNonNull(item,"item cannot be null"); 702 if (_locations == null) { 703 _locations = new LinkedList<>(); 704 } 705 return _locations.add(value); 706 } 707 708 /** 709 * Remove the first matching {@link Location} item from the underlying collection. 710 * @param item the item to remove 711 * @return {@code true} if the item was removed or {@code false} otherwise 712 */ 713 public boolean removeLocation(Location item) { 714 Location value = ObjectUtils.requireNonNull(item,"item cannot be null"); 715 return _locations != null && _locations.remove(value); 716 } 717 718 /** 719 * Get the "{@literal Party}". 720 * 721 * <p> 722 * An organization or person, which may be associated with roles or other concepts within the current or linked OSCAL document. 723 * 724 * @return the party value 725 */ 726 @NonNull 727 public List<Party> getParties() { 728 if (_parties == null) { 729 _parties = new LinkedList<>(); 730 } 731 return ObjectUtils.notNull(_parties); 732 } 733 734 /** 735 * Set the "{@literal Party}". 736 * 737 * <p> 738 * An organization or person, which may be associated with roles or other concepts within the current or linked OSCAL document. 739 * 740 * @param value 741 * the party value to set 742 */ 743 public void setParties(@NonNull List<Party> value) { 744 _parties = value; 745 } 746 747 /** 748 * Add a new {@link Party} item to the underlying collection. 749 * @param item the item to add 750 * @return {@code true} 751 */ 752 public boolean addParty(Party item) { 753 Party value = ObjectUtils.requireNonNull(item,"item cannot be null"); 754 if (_parties == null) { 755 _parties = new LinkedList<>(); 756 } 757 return _parties.add(value); 758 } 759 760 /** 761 * Remove the first matching {@link Party} item from the underlying collection. 762 * @param item the item to remove 763 * @return {@code true} if the item was removed or {@code false} otherwise 764 */ 765 public boolean removeParty(Party item) { 766 Party value = ObjectUtils.requireNonNull(item,"item cannot be null"); 767 return _parties != null && _parties.remove(value); 768 } 769 770 /** 771 * Get the "{@literal Responsible Party}". 772 * 773 * <p> 774 * 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. 775 * 776 * @return the responsible-party value 777 */ 778 @NonNull 779 public List<ResponsibleParty> getResponsibleParties() { 780 if (_responsibleParties == null) { 781 _responsibleParties = new LinkedList<>(); 782 } 783 return ObjectUtils.notNull(_responsibleParties); 784 } 785 786 /** 787 * Set the "{@literal Responsible Party}". 788 * 789 * <p> 790 * 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. 791 * 792 * @param value 793 * the responsible-party value to set 794 */ 795 public void setResponsibleParties(@NonNull List<ResponsibleParty> value) { 796 _responsibleParties = value; 797 } 798 799 /** 800 * Add a new {@link ResponsibleParty} item to the underlying collection. 801 * @param item the item to add 802 * @return {@code true} 803 */ 804 public boolean addResponsibleParty(ResponsibleParty item) { 805 ResponsibleParty value = ObjectUtils.requireNonNull(item,"item cannot be null"); 806 if (_responsibleParties == null) { 807 _responsibleParties = new LinkedList<>(); 808 } 809 return _responsibleParties.add(value); 810 } 811 812 /** 813 * Remove the first matching {@link ResponsibleParty} item from the underlying collection. 814 * @param item the item to remove 815 * @return {@code true} if the item was removed or {@code false} otherwise 816 */ 817 public boolean removeResponsibleParty(ResponsibleParty item) { 818 ResponsibleParty value = ObjectUtils.requireNonNull(item,"item cannot be null"); 819 return _responsibleParties != null && _responsibleParties.remove(value); 820 } 821 822 /** 823 * Get the "{@literal Action}". 824 * 825 * <p> 826 * An action applied by a role within a given party to the content. 827 * 828 * @return the action value 829 */ 830 @NonNull 831 public List<Action> getActions() { 832 if (_actions == null) { 833 _actions = new LinkedList<>(); 834 } 835 return ObjectUtils.notNull(_actions); 836 } 837 838 /** 839 * Set the "{@literal Action}". 840 * 841 * <p> 842 * An action applied by a role within a given party to the content. 843 * 844 * @param value 845 * the action value to set 846 */ 847 public void setActions(@NonNull List<Action> value) { 848 _actions = value; 849 } 850 851 /** 852 * Add a new {@link Action} item to the underlying collection. 853 * @param item the item to add 854 * @return {@code true} 855 */ 856 public boolean addAction(Action item) { 857 Action value = ObjectUtils.requireNonNull(item,"item cannot be null"); 858 if (_actions == null) { 859 _actions = new LinkedList<>(); 860 } 861 return _actions.add(value); 862 } 863 864 /** 865 * Remove the first matching {@link Action} item from the underlying collection. 866 * @param item the item to remove 867 * @return {@code true} if the item was removed or {@code false} otherwise 868 */ 869 public boolean removeAction(Action item) { 870 Action value = ObjectUtils.requireNonNull(item,"item cannot be null"); 871 return _actions != null && _actions.remove(value); 872 } 873 874 /** 875 * Get the "{@literal Remarks}". 876 * 877 * <p> 878 * Additional commentary about the containing object. 879 * 880 * @return the remarks value, or {@code null} if not set 881 */ 882 @Nullable 883 public MarkupMultiline getRemarks() { 884 return _remarks; 885 } 886 887 /** 888 * Set the "{@literal Remarks}". 889 * 890 * <p> 891 * Additional commentary about the containing object. 892 * 893 * @param value 894 * the remarks value to set, or {@code null} to clear 895 */ 896 public void setRemarks(@Nullable MarkupMultiline value) { 897 _remarks = value; 898 } 899 900 @Override 901 public String toString() { 902 return ObjectUtils.notNull(new ReflectionToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).toString()); 903 } 904 905 /** 906 * An entry in a sequential list of revisions to the containing document, expected to be in reverse chronological order (i.e. latest first). 907 */ 908 @MetaschemaAssembly( 909 formalName = "Revision History Entry", 910 description = "An entry in a sequential list of revisions to the containing document, expected to be in reverse chronological order (i.e. latest first).", 911 name = "revision", 912 moduleClass = OscalMetadataModule.class, 913 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.", 914 valueConstraints = @ValueConstraints(allowedValues = @AllowedValues(id = "oscal-metadata-revision-link-rel-types", 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).")})) 915 ) 916 public static class Revision implements IBoundObject { 917 private final IMetaschemaData __metaschemaData; 918 919 /** 920 * A name given to the document revision, which may be used by a tool for display and navigation. 921 */ 922 @BoundField( 923 formalName = "Document Title", 924 description = "A name given to the document revision, which may be used by a tool for display and navigation.", 925 useName = "title", 926 typeAdapter = MarkupLineAdapter.class 927 ) 928 private MarkupLine _title; 929 930 /** 931 * The date and time the document was last made available. 932 */ 933 @BoundField( 934 formalName = "Publication Timestamp", 935 description = "The date and time the document was last made available.", 936 useName = "published", 937 typeAdapter = DateTimeWithTZAdapter.class 938 ) 939 private ZonedDateTime _published; 940 941 /** 942 * The date and time the document was last stored for later retrieval. 943 */ 944 @BoundField( 945 formalName = "Last Modified Timestamp", 946 description = "The date and time the document was last stored for later retrieval.", 947 useName = "last-modified", 948 typeAdapter = DateTimeWithTZAdapter.class 949 ) 950 private ZonedDateTime _lastModified; 951 952 /** 953 * Used to distinguish a specific revision of an OSCAL document from other previous and future versions. 954 */ 955 @BoundField( 956 formalName = "Document Version", 957 description = "Used to distinguish a specific revision of an OSCAL document from other previous and future versions.", 958 useName = "version", 959 minOccurs = 1, 960 typeAdapter = StringAdapter.class 961 ) 962 private String _version; 963 964 /** 965 * The OSCAL model version the document was authored against and will conform to as valid. 966 */ 967 @BoundField( 968 formalName = "OSCAL Version", 969 description = "The OSCAL model version the document was authored against and will conform to as valid.", 970 useName = "oscal-version", 971 typeAdapter = StringAdapter.class 972 ) 973 private String _oscalVersion; 974 975 /** 976 * An attribute, characteristic, or quality of the containing object expressed as a namespace qualified name/value pair. 977 */ 978 @BoundAssembly( 979 formalName = "Property", 980 description = "An attribute, characteristic, or quality of the containing object expressed as a namespace qualified name/value pair.", 981 useName = "prop", 982 maxOccurs = -1, 983 groupAs = @GroupAs(name = "props", inJson = JsonGroupAsBehavior.LIST) 984 ) 985 private List<Property> _props; 986 987 /** 988 * A reference to a local or remote resource, that has a specific relation to the containing object. 989 */ 990 @BoundAssembly( 991 formalName = "Link", 992 description = "A reference to a local or remote resource, that has a specific relation to the containing object.", 993 useName = "link", 994 maxOccurs = -1, 995 groupAs = @GroupAs(name = "links", inJson = JsonGroupAsBehavior.LIST) 996 ) 997 private List<Link> _links; 998 999 /** 1000 * Additional commentary about the containing object. 1001 */ 1002 @BoundField( 1003 formalName = "Remarks", 1004 description = "Additional commentary about the containing object.", 1005 useName = "remarks", 1006 typeAdapter = MarkupMultilineAdapter.class 1007 ) 1008 private MarkupMultiline _remarks; 1009 1010 /** 1011 * Constructs a new {@code dev.metaschema.oscal.lib.model.Metadata.Revision} instance with no metadata. 1012 */ 1013 public Revision() { 1014 this(null); 1015 } 1016 1017 /** 1018 * Constructs a new {@code dev.metaschema.oscal.lib.model.Metadata.Revision} instance with the specified metadata. 1019 * 1020 * @param data 1021 * the metaschema data, or {@code null} if none 1022 */ 1023 public Revision(IMetaschemaData data) { 1024 this.__metaschemaData = data; 1025 } 1026 1027 @Override 1028 public IMetaschemaData getMetaschemaData() { 1029 return __metaschemaData; 1030 } 1031 1032 /** 1033 * Get the "{@literal Document Title}". 1034 * 1035 * <p> 1036 * A name given to the document revision, which may be used by a tool for display and navigation. 1037 * 1038 * @return the title value, or {@code null} if not set 1039 */ 1040 @Nullable 1041 public MarkupLine getTitle() { 1042 return _title; 1043 } 1044 1045 /** 1046 * Set the "{@literal Document Title}". 1047 * 1048 * <p> 1049 * A name given to the document revision, which may be used by a tool for display and navigation. 1050 * 1051 * @param value 1052 * the title value to set, or {@code null} to clear 1053 */ 1054 public void setTitle(@Nullable MarkupLine value) { 1055 _title = value; 1056 } 1057 1058 /** 1059 * Get the "{@literal Publication Timestamp}". 1060 * 1061 * <p> 1062 * The date and time the document was last made available. 1063 * 1064 * @return the published value, or {@code null} if not set 1065 */ 1066 @Nullable 1067 public ZonedDateTime getPublished() { 1068 return _published; 1069 } 1070 1071 /** 1072 * Set the "{@literal Publication Timestamp}". 1073 * 1074 * <p> 1075 * The date and time the document was last made available. 1076 * 1077 * @param value 1078 * the published value to set, or {@code null} to clear 1079 */ 1080 public void setPublished(@Nullable ZonedDateTime value) { 1081 _published = value; 1082 } 1083 1084 /** 1085 * Get the "{@literal Last Modified Timestamp}". 1086 * 1087 * <p> 1088 * The date and time the document was last stored for later retrieval. 1089 * 1090 * @return the last-modified value, or {@code null} if not set 1091 */ 1092 @Nullable 1093 public ZonedDateTime getLastModified() { 1094 return _lastModified; 1095 } 1096 1097 /** 1098 * Set the "{@literal Last Modified Timestamp}". 1099 * 1100 * <p> 1101 * The date and time the document was last stored for later retrieval. 1102 * 1103 * @param value 1104 * the last-modified value to set, or {@code null} to clear 1105 */ 1106 public void setLastModified(@Nullable ZonedDateTime value) { 1107 _lastModified = value; 1108 } 1109 1110 /** 1111 * Get the "{@literal Document Version}". 1112 * 1113 * <p> 1114 * Used to distinguish a specific revision of an OSCAL document from other previous and future versions. 1115 * 1116 * @return the version value 1117 */ 1118 @NonNull 1119 public String getVersion() { 1120 return _version; 1121 } 1122 1123 /** 1124 * Set the "{@literal Document Version}". 1125 * 1126 * <p> 1127 * Used to distinguish a specific revision of an OSCAL document from other previous and future versions. 1128 * 1129 * @param value 1130 * the version value to set 1131 */ 1132 public void setVersion(@NonNull String value) { 1133 _version = value; 1134 } 1135 1136 /** 1137 * Get the "{@literal OSCAL Version}". 1138 * 1139 * <p> 1140 * The OSCAL model version the document was authored against and will conform to as valid. 1141 * 1142 * @return the oscal-version value, or {@code null} if not set 1143 */ 1144 @Nullable 1145 public String getOscalVersion() { 1146 return _oscalVersion; 1147 } 1148 1149 /** 1150 * Set the "{@literal OSCAL Version}". 1151 * 1152 * <p> 1153 * The OSCAL model version the document was authored against and will conform to as valid. 1154 * 1155 * @param value 1156 * the oscal-version value to set, or {@code null} to clear 1157 */ 1158 public void setOscalVersion(@Nullable String value) { 1159 _oscalVersion = value; 1160 } 1161 1162 /** 1163 * Get the "{@literal Property}". 1164 * 1165 * <p> 1166 * An attribute, characteristic, or quality of the containing object expressed as a namespace qualified name/value pair. 1167 * 1168 * @return the prop value 1169 */ 1170 @NonNull 1171 public List<Property> getProps() { 1172 if (_props == null) { 1173 _props = new LinkedList<>(); 1174 } 1175 return ObjectUtils.notNull(_props); 1176 } 1177 1178 /** 1179 * Set the "{@literal Property}". 1180 * 1181 * <p> 1182 * An attribute, characteristic, or quality of the containing object expressed as a namespace qualified name/value pair. 1183 * 1184 * @param value 1185 * the prop value to set 1186 */ 1187 public void setProps(@NonNull List<Property> value) { 1188 _props = value; 1189 } 1190 1191 /** 1192 * Add a new {@link Property} item to the underlying collection. 1193 * @param item the item to add 1194 * @return {@code true} 1195 */ 1196 public boolean addProp(Property item) { 1197 Property value = ObjectUtils.requireNonNull(item,"item cannot be null"); 1198 if (_props == null) { 1199 _props = new LinkedList<>(); 1200 } 1201 return _props.add(value); 1202 } 1203 1204 /** 1205 * Remove the first matching {@link Property} item from the underlying collection. 1206 * @param item the item to remove 1207 * @return {@code true} if the item was removed or {@code false} otherwise 1208 */ 1209 public boolean removeProp(Property item) { 1210 Property value = ObjectUtils.requireNonNull(item,"item cannot be null"); 1211 return _props != null && _props.remove(value); 1212 } 1213 1214 /** 1215 * Get the "{@literal Link}". 1216 * 1217 * <p> 1218 * A reference to a local or remote resource, that has a specific relation to the containing object. 1219 * 1220 * @return the link value 1221 */ 1222 @NonNull 1223 public List<Link> getLinks() { 1224 if (_links == null) { 1225 _links = new LinkedList<>(); 1226 } 1227 return ObjectUtils.notNull(_links); 1228 } 1229 1230 /** 1231 * Set the "{@literal Link}". 1232 * 1233 * <p> 1234 * A reference to a local or remote resource, that has a specific relation to the containing object. 1235 * 1236 * @param value 1237 * the link value to set 1238 */ 1239 public void setLinks(@NonNull List<Link> value) { 1240 _links = value; 1241 } 1242 1243 /** 1244 * Add a new {@link Link} item to the underlying collection. 1245 * @param item the item to add 1246 * @return {@code true} 1247 */ 1248 public boolean addLink(Link item) { 1249 Link value = ObjectUtils.requireNonNull(item,"item cannot be null"); 1250 if (_links == null) { 1251 _links = new LinkedList<>(); 1252 } 1253 return _links.add(value); 1254 } 1255 1256 /** 1257 * Remove the first matching {@link Link} item from the underlying collection. 1258 * @param item the item to remove 1259 * @return {@code true} if the item was removed or {@code false} otherwise 1260 */ 1261 public boolean removeLink(Link item) { 1262 Link value = ObjectUtils.requireNonNull(item,"item cannot be null"); 1263 return _links != null && _links.remove(value); 1264 } 1265 1266 /** 1267 * Get the "{@literal Remarks}". 1268 * 1269 * <p> 1270 * Additional commentary about the containing object. 1271 * 1272 * @return the remarks value, or {@code null} if not set 1273 */ 1274 @Nullable 1275 public MarkupMultiline getRemarks() { 1276 return _remarks; 1277 } 1278 1279 /** 1280 * Set the "{@literal Remarks}". 1281 * 1282 * <p> 1283 * Additional commentary about the containing object. 1284 * 1285 * @param value 1286 * the remarks value to set, or {@code null} to clear 1287 */ 1288 public void setRemarks(@Nullable MarkupMultiline value) { 1289 _remarks = value; 1290 } 1291 1292 @Override 1293 public String toString() { 1294 return ObjectUtils.notNull(new ReflectionToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).toString()); 1295 } 1296 } 1297 1298 /** 1299 * Defines a function, which might be assigned to a party in a specific situation. 1300 */ 1301 @MetaschemaAssembly( 1302 formalName = "Role", 1303 description = "Defines a function, which might be assigned to a party in a specific situation.", 1304 name = "role", 1305 moduleClass = OscalMetadataModule.class, 1306 remarks = "Permissible values to be determined closer to the application (e.g. by a receiving authority).\n" 1307 + "\n" 1308 + "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." 1309 ) 1310 public static class Role implements IBoundObject { 1311 private final IMetaschemaData __metaschemaData; 1312 1313 /** 1314 * A unique identifier for the role. 1315 */ 1316 @BoundFlag( 1317 formalName = "Role Identifier", 1318 description = "A unique identifier for the role.", 1319 name = "id", 1320 required = true, 1321 typeAdapter = TokenAdapter.class 1322 ) 1323 private String _id; 1324 1325 /** 1326 * A name given to the role, which may be used by a tool for display and navigation. 1327 */ 1328 @BoundField( 1329 formalName = "Role Title", 1330 description = "A name given to the role, which may be used by a tool for display and navigation.", 1331 useName = "title", 1332 minOccurs = 1, 1333 typeAdapter = MarkupLineAdapter.class 1334 ) 1335 private MarkupLine _title; 1336 1337 /** 1338 * A short common name, abbreviation, or acronym for the role. 1339 */ 1340 @BoundField( 1341 formalName = "Role Short Name", 1342 description = "A short common name, abbreviation, or acronym for the role.", 1343 useName = "short-name", 1344 typeAdapter = StringAdapter.class 1345 ) 1346 private String _shortName; 1347 1348 /** 1349 * A summary of the role's purpose and associated responsibilities. 1350 */ 1351 @BoundField( 1352 formalName = "Role Description", 1353 description = "A summary of the role's purpose and associated responsibilities.", 1354 useName = "description", 1355 typeAdapter = MarkupMultilineAdapter.class 1356 ) 1357 private MarkupMultiline _description; 1358 1359 /** 1360 * An attribute, characteristic, or quality of the containing object expressed as a namespace qualified name/value pair. 1361 */ 1362 @BoundAssembly( 1363 formalName = "Property", 1364 description = "An attribute, characteristic, or quality of the containing object expressed as a namespace qualified name/value pair.", 1365 useName = "prop", 1366 maxOccurs = -1, 1367 groupAs = @GroupAs(name = "props", inJson = JsonGroupAsBehavior.LIST) 1368 ) 1369 private List<Property> _props; 1370 1371 /** 1372 * A reference to a local or remote resource, that has a specific relation to the containing object. 1373 */ 1374 @BoundAssembly( 1375 formalName = "Link", 1376 description = "A reference to a local or remote resource, that has a specific relation to the containing object.", 1377 useName = "link", 1378 maxOccurs = -1, 1379 groupAs = @GroupAs(name = "links", inJson = JsonGroupAsBehavior.LIST) 1380 ) 1381 private List<Link> _links; 1382 1383 /** 1384 * Additional commentary about the containing object. 1385 */ 1386 @BoundField( 1387 formalName = "Remarks", 1388 description = "Additional commentary about the containing object.", 1389 useName = "remarks", 1390 typeAdapter = MarkupMultilineAdapter.class 1391 ) 1392 private MarkupMultiline _remarks; 1393 1394 /** 1395 * Constructs a new {@code dev.metaschema.oscal.lib.model.Metadata.Role} instance with no metadata. 1396 */ 1397 public Role() { 1398 this(null); 1399 } 1400 1401 /** 1402 * Constructs a new {@code dev.metaschema.oscal.lib.model.Metadata.Role} instance with the specified metadata. 1403 * 1404 * @param data 1405 * the metaschema data, or {@code null} if none 1406 */ 1407 public Role(IMetaschemaData data) { 1408 this.__metaschemaData = data; 1409 } 1410 1411 @Override 1412 public IMetaschemaData getMetaschemaData() { 1413 return __metaschemaData; 1414 } 1415 1416 /** 1417 * Get the "{@literal Role Identifier}". 1418 * 1419 * <p> 1420 * A unique identifier for the role. 1421 * 1422 * @return the id value 1423 */ 1424 @NonNull 1425 public String getId() { 1426 return _id; 1427 } 1428 1429 /** 1430 * Set the "{@literal Role Identifier}". 1431 * 1432 * <p> 1433 * A unique identifier for the role. 1434 * 1435 * @param value 1436 * the id value to set 1437 */ 1438 public void setId(@NonNull String value) { 1439 _id = value; 1440 } 1441 1442 /** 1443 * Get the "{@literal Role Title}". 1444 * 1445 * <p> 1446 * A name given to the role, which may be used by a tool for display and navigation. 1447 * 1448 * @return the title value 1449 */ 1450 @NonNull 1451 public MarkupLine getTitle() { 1452 return _title; 1453 } 1454 1455 /** 1456 * Set the "{@literal Role Title}". 1457 * 1458 * <p> 1459 * A name given to the role, which may be used by a tool for display and navigation. 1460 * 1461 * @param value 1462 * the title value to set 1463 */ 1464 public void setTitle(@NonNull MarkupLine value) { 1465 _title = value; 1466 } 1467 1468 /** 1469 * Get the "{@literal Role Short Name}". 1470 * 1471 * <p> 1472 * A short common name, abbreviation, or acronym for the role. 1473 * 1474 * @return the short-name value, or {@code null} if not set 1475 */ 1476 @Nullable 1477 public String getShortName() { 1478 return _shortName; 1479 } 1480 1481 /** 1482 * Set the "{@literal Role Short Name}". 1483 * 1484 * <p> 1485 * A short common name, abbreviation, or acronym for the role. 1486 * 1487 * @param value 1488 * the short-name value to set, or {@code null} to clear 1489 */ 1490 public void setShortName(@Nullable String value) { 1491 _shortName = value; 1492 } 1493 1494 /** 1495 * Get the "{@literal Role Description}". 1496 * 1497 * <p> 1498 * A summary of the role's purpose and associated responsibilities. 1499 * 1500 * @return the description value, or {@code null} if not set 1501 */ 1502 @Nullable 1503 public MarkupMultiline getDescription() { 1504 return _description; 1505 } 1506 1507 /** 1508 * Set the "{@literal Role Description}". 1509 * 1510 * <p> 1511 * A summary of the role's purpose and associated responsibilities. 1512 * 1513 * @param value 1514 * the description value to set, or {@code null} to clear 1515 */ 1516 public void setDescription(@Nullable MarkupMultiline value) { 1517 _description = value; 1518 } 1519 1520 /** 1521 * Get the "{@literal Property}". 1522 * 1523 * <p> 1524 * An attribute, characteristic, or quality of the containing object expressed as a namespace qualified name/value pair. 1525 * 1526 * @return the prop value 1527 */ 1528 @NonNull 1529 public List<Property> getProps() { 1530 if (_props == null) { 1531 _props = new LinkedList<>(); 1532 } 1533 return ObjectUtils.notNull(_props); 1534 } 1535 1536 /** 1537 * Set the "{@literal Property}". 1538 * 1539 * <p> 1540 * An attribute, characteristic, or quality of the containing object expressed as a namespace qualified name/value pair. 1541 * 1542 * @param value 1543 * the prop value to set 1544 */ 1545 public void setProps(@NonNull List<Property> value) { 1546 _props = value; 1547 } 1548 1549 /** 1550 * Add a new {@link Property} item to the underlying collection. 1551 * @param item the item to add 1552 * @return {@code true} 1553 */ 1554 public boolean addProp(Property item) { 1555 Property value = ObjectUtils.requireNonNull(item,"item cannot be null"); 1556 if (_props == null) { 1557 _props = new LinkedList<>(); 1558 } 1559 return _props.add(value); 1560 } 1561 1562 /** 1563 * Remove the first matching {@link Property} item from the underlying collection. 1564 * @param item the item to remove 1565 * @return {@code true} if the item was removed or {@code false} otherwise 1566 */ 1567 public boolean removeProp(Property item) { 1568 Property value = ObjectUtils.requireNonNull(item,"item cannot be null"); 1569 return _props != null && _props.remove(value); 1570 } 1571 1572 /** 1573 * Get the "{@literal Link}". 1574 * 1575 * <p> 1576 * A reference to a local or remote resource, that has a specific relation to the containing object. 1577 * 1578 * @return the link value 1579 */ 1580 @NonNull 1581 public List<Link> getLinks() { 1582 if (_links == null) { 1583 _links = new LinkedList<>(); 1584 } 1585 return ObjectUtils.notNull(_links); 1586 } 1587 1588 /** 1589 * Set the "{@literal Link}". 1590 * 1591 * <p> 1592 * A reference to a local or remote resource, that has a specific relation to the containing object. 1593 * 1594 * @param value 1595 * the link value to set 1596 */ 1597 public void setLinks(@NonNull List<Link> value) { 1598 _links = value; 1599 } 1600 1601 /** 1602 * Add a new {@link Link} item to the underlying collection. 1603 * @param item the item to add 1604 * @return {@code true} 1605 */ 1606 public boolean addLink(Link item) { 1607 Link value = ObjectUtils.requireNonNull(item,"item cannot be null"); 1608 if (_links == null) { 1609 _links = new LinkedList<>(); 1610 } 1611 return _links.add(value); 1612 } 1613 1614 /** 1615 * Remove the first matching {@link Link} item from the underlying collection. 1616 * @param item the item to remove 1617 * @return {@code true} if the item was removed or {@code false} otherwise 1618 */ 1619 public boolean removeLink(Link item) { 1620 Link value = ObjectUtils.requireNonNull(item,"item cannot be null"); 1621 return _links != null && _links.remove(value); 1622 } 1623 1624 /** 1625 * Get the "{@literal Remarks}". 1626 * 1627 * <p> 1628 * Additional commentary about the containing object. 1629 * 1630 * @return the remarks value, or {@code null} if not set 1631 */ 1632 @Nullable 1633 public MarkupMultiline getRemarks() { 1634 return _remarks; 1635 } 1636 1637 /** 1638 * Set the "{@literal Remarks}". 1639 * 1640 * <p> 1641 * Additional commentary about the containing object. 1642 * 1643 * @param value 1644 * the remarks value to set, or {@code null} to clear 1645 */ 1646 public void setRemarks(@Nullable MarkupMultiline value) { 1647 _remarks = value; 1648 } 1649 1650 @Override 1651 public String toString() { 1652 return ObjectUtils.notNull(new ReflectionToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).toString()); 1653 } 1654 } 1655 1656 /** 1657 * A physical point of presence, which may be associated with people, organizations, or other concepts within the current or linked OSCAL document. 1658 */ 1659 @MetaschemaAssembly( 1660 formalName = "Location", 1661 description = "A physical point of presence, which may be associated with people, organizations, or other concepts within the current or linked OSCAL document.", 1662 name = "location", 1663 moduleClass = OscalMetadataModule.class, 1664 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.", 1665 valueConstraints = @ValueConstraints(allowedValues = {@AllowedValues(id = "oscal-metadata-location-prop-name-values", 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(id = "oscal-metadata-location-prop-type-values", 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(id = "oscal-metadata-location-prop-type-data-center-values", 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.")})}), 1666 modelConstraints = @AssemblyConstraints(cardinality = {@HasCardinality(id = "oscal-metadata-location-address-cardinality", 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(id = "oscal-metadata-location-title-address-email-address-telephone-cardinality", 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)}) 1667 ) 1668 public static class Location implements IBoundObject { 1669 private final IMetaschemaData __metaschemaData; 1670 1671 /** 1672 * A unique ID for the location, for reference. 1673 */ 1674 @BoundFlag( 1675 formalName = "Location Universally Unique Identifier", 1676 description = "A unique ID for the location, for reference.", 1677 name = "uuid", 1678 required = true, 1679 typeAdapter = UuidAdapter.class 1680 ) 1681 private UUID _uuid; 1682 1683 /** 1684 * A name given to the location, which may be used by a tool for display and navigation. 1685 */ 1686 @BoundField( 1687 formalName = "Location Title", 1688 description = "A name given to the location, which may be used by a tool for display and navigation.", 1689 useName = "title", 1690 typeAdapter = MarkupLineAdapter.class 1691 ) 1692 private MarkupLine _title; 1693 1694 /** 1695 * A postal address for the location. 1696 */ 1697 @BoundAssembly( 1698 formalName = "Address", 1699 description = "A postal address for the location.", 1700 useName = "address", 1701 remarks = "The physical address of the location, which will provided for physical locations. Virtual locations can omit this data item." 1702 ) 1703 private Address _address; 1704 1705 /** 1706 * An email address as defined by <a href="https://tools.ietf.org/html/rfc5322#section-3.4.1">RFC 5322 Section 3.4.1</a>. 1707 */ 1708 @BoundField( 1709 formalName = "Email Address", 1710 description = "An email address as defined by [RFC 5322 Section 3.4.1](https://tools.ietf.org/html/rfc5322#section-3.4.1).", 1711 useName = "email-address", 1712 remarks = "A contact email associated with the location.", 1713 maxOccurs = -1, 1714 groupAs = @GroupAs(name = "email-addresses", inJson = JsonGroupAsBehavior.LIST), 1715 typeAdapter = EmailAddressAdapter.class 1716 ) 1717 private List<String> _emailAddresses; 1718 1719 /** 1720 * A telephone service number as defined by <a href="https://www.itu.int/rec/T-REC-E.164-201011-I/en">ITU-T E.164</a>. 1721 */ 1722 @BoundField( 1723 formalName = "Telephone Number", 1724 description = "A telephone service number as defined by [ITU-T E.164](https://www.itu.int/rec/T-REC-E.164-201011-I/en).", 1725 useName = "telephone-number", 1726 remarks = "A phone number used to contact the location.", 1727 maxOccurs = -1, 1728 groupAs = @GroupAs(name = "telephone-numbers", inJson = JsonGroupAsBehavior.LIST) 1729 ) 1730 private List<TelephoneNumber> _telephoneNumbers; 1731 1732 /** 1733 * The uniform resource locator (URL) for a web site or other resource associated with the location. 1734 */ 1735 @BoundField( 1736 formalName = "Location URL", 1737 description = "The uniform resource locator (URL) for a web site or other resource associated with the location.", 1738 useName = "url", 1739 remarks = "This data field is deprecated in favor of using a link with an appropriate relationship.", 1740 maxOccurs = -1, 1741 groupAs = @GroupAs(name = "urls", inJson = JsonGroupAsBehavior.LIST), 1742 typeAdapter = UriAdapter.class 1743 ) 1744 private List<URI> _urls; 1745 1746 /** 1747 * An attribute, characteristic, or quality of the containing object expressed as a namespace qualified name/value pair. 1748 */ 1749 @BoundAssembly( 1750 formalName = "Property", 1751 description = "An attribute, characteristic, or quality of the containing object expressed as a namespace qualified name/value pair.", 1752 useName = "prop", 1753 maxOccurs = -1, 1754 groupAs = @GroupAs(name = "props", inJson = JsonGroupAsBehavior.LIST) 1755 ) 1756 private List<Property> _props; 1757 1758 /** 1759 * A reference to a local or remote resource, that has a specific relation to the containing object. 1760 */ 1761 @BoundAssembly( 1762 formalName = "Link", 1763 description = "A reference to a local or remote resource, that has a specific relation to the containing object.", 1764 useName = "link", 1765 maxOccurs = -1, 1766 groupAs = @GroupAs(name = "links", inJson = JsonGroupAsBehavior.LIST) 1767 ) 1768 private List<Link> _links; 1769 1770 /** 1771 * Additional commentary about the containing object. 1772 */ 1773 @BoundField( 1774 formalName = "Remarks", 1775 description = "Additional commentary about the containing object.", 1776 useName = "remarks", 1777 typeAdapter = MarkupMultilineAdapter.class 1778 ) 1779 private MarkupMultiline _remarks; 1780 1781 /** 1782 * Constructs a new {@code dev.metaschema.oscal.lib.model.Metadata.Location} instance with no metadata. 1783 */ 1784 public Location() { 1785 this(null); 1786 } 1787 1788 /** 1789 * Constructs a new {@code dev.metaschema.oscal.lib.model.Metadata.Location} instance with the specified metadata. 1790 * 1791 * @param data 1792 * the metaschema data, or {@code null} if none 1793 */ 1794 public Location(IMetaschemaData data) { 1795 this.__metaschemaData = data; 1796 } 1797 1798 @Override 1799 public IMetaschemaData getMetaschemaData() { 1800 return __metaschemaData; 1801 } 1802 1803 /** 1804 * Get the "{@literal Location Universally Unique Identifier}". 1805 * 1806 * <p> 1807 * A unique ID for the location, for reference. 1808 * 1809 * @return the uuid value 1810 */ 1811 @NonNull 1812 public UUID getUuid() { 1813 return _uuid; 1814 } 1815 1816 /** 1817 * Set the "{@literal Location Universally Unique Identifier}". 1818 * 1819 * <p> 1820 * A unique ID for the location, for reference. 1821 * 1822 * @param value 1823 * the uuid value to set 1824 */ 1825 public void setUuid(@NonNull UUID value) { 1826 _uuid = value; 1827 } 1828 1829 /** 1830 * Get the "{@literal Location Title}". 1831 * 1832 * <p> 1833 * A name given to the location, which may be used by a tool for display and navigation. 1834 * 1835 * @return the title value, or {@code null} if not set 1836 */ 1837 @Nullable 1838 public MarkupLine getTitle() { 1839 return _title; 1840 } 1841 1842 /** 1843 * Set the "{@literal Location Title}". 1844 * 1845 * <p> 1846 * A name given to the location, which may be used by a tool for display and navigation. 1847 * 1848 * @param value 1849 * the title value to set, or {@code null} to clear 1850 */ 1851 public void setTitle(@Nullable MarkupLine value) { 1852 _title = value; 1853 } 1854 1855 /** 1856 * Get the "{@literal Address}". 1857 * 1858 * <p> 1859 * A postal address for the location. 1860 * 1861 * @return the address value, or {@code null} if not set 1862 */ 1863 @Nullable 1864 public Address getAddress() { 1865 return _address; 1866 } 1867 1868 /** 1869 * Set the "{@literal Address}". 1870 * 1871 * <p> 1872 * A postal address for the location. 1873 * 1874 * @param value 1875 * the address value to set, or {@code null} to clear 1876 */ 1877 public void setAddress(@Nullable Address value) { 1878 _address = value; 1879 } 1880 1881 /** 1882 * Get the "{@literal Email Address}". 1883 * 1884 * <p> 1885 * An email address as defined by <a href="https://tools.ietf.org/html/rfc5322#section-3.4.1">RFC 5322 Section 3.4.1</a>. 1886 * 1887 * @return the email-address value 1888 */ 1889 @NonNull 1890 public List<String> getEmailAddresses() { 1891 if (_emailAddresses == null) { 1892 _emailAddresses = new LinkedList<>(); 1893 } 1894 return ObjectUtils.notNull(_emailAddresses); 1895 } 1896 1897 /** 1898 * Set the "{@literal Email Address}". 1899 * 1900 * <p> 1901 * An email address as defined by <a href="https://tools.ietf.org/html/rfc5322#section-3.4.1">RFC 5322 Section 3.4.1</a>. 1902 * 1903 * @param value 1904 * the email-address value to set 1905 */ 1906 public void setEmailAddresses(@NonNull List<String> value) { 1907 _emailAddresses = value; 1908 } 1909 1910 /** 1911 * Add a new {@link String} item to the underlying collection. 1912 * @param item the item to add 1913 * @return {@code true} 1914 */ 1915 public boolean addEmailAddress(String item) { 1916 String value = ObjectUtils.requireNonNull(item,"item cannot be null"); 1917 if (_emailAddresses == null) { 1918 _emailAddresses = new LinkedList<>(); 1919 } 1920 return _emailAddresses.add(value); 1921 } 1922 1923 /** 1924 * Remove the first matching {@link String} item from the underlying collection. 1925 * @param item the item to remove 1926 * @return {@code true} if the item was removed or {@code false} otherwise 1927 */ 1928 public boolean removeEmailAddress(String item) { 1929 String value = ObjectUtils.requireNonNull(item,"item cannot be null"); 1930 return _emailAddresses != null && _emailAddresses.remove(value); 1931 } 1932 1933 /** 1934 * Get the "{@literal Telephone Number}". 1935 * 1936 * <p> 1937 * A telephone service number as defined by <a href="https://www.itu.int/rec/T-REC-E.164-201011-I/en">ITU-T E.164</a>. 1938 * 1939 * @return the telephone-number value 1940 */ 1941 @NonNull 1942 public List<TelephoneNumber> getTelephoneNumbers() { 1943 if (_telephoneNumbers == null) { 1944 _telephoneNumbers = new LinkedList<>(); 1945 } 1946 return ObjectUtils.notNull(_telephoneNumbers); 1947 } 1948 1949 /** 1950 * Set the "{@literal Telephone Number}". 1951 * 1952 * <p> 1953 * A telephone service number as defined by <a href="https://www.itu.int/rec/T-REC-E.164-201011-I/en">ITU-T E.164</a>. 1954 * 1955 * @param value 1956 * the telephone-number value to set 1957 */ 1958 public void setTelephoneNumbers(@NonNull List<TelephoneNumber> value) { 1959 _telephoneNumbers = value; 1960 } 1961 1962 /** 1963 * Add a new {@link TelephoneNumber} item to the underlying collection. 1964 * @param item the item to add 1965 * @return {@code true} 1966 */ 1967 public boolean addTelephoneNumber(TelephoneNumber item) { 1968 TelephoneNumber value = ObjectUtils.requireNonNull(item,"item cannot be null"); 1969 if (_telephoneNumbers == null) { 1970 _telephoneNumbers = new LinkedList<>(); 1971 } 1972 return _telephoneNumbers.add(value); 1973 } 1974 1975 /** 1976 * Remove the first matching {@link TelephoneNumber} item from the underlying collection. 1977 * @param item the item to remove 1978 * @return {@code true} if the item was removed or {@code false} otherwise 1979 */ 1980 public boolean removeTelephoneNumber(TelephoneNumber item) { 1981 TelephoneNumber value = ObjectUtils.requireNonNull(item,"item cannot be null"); 1982 return _telephoneNumbers != null && _telephoneNumbers.remove(value); 1983 } 1984 1985 /** 1986 * Get the "{@literal Location URL}". 1987 * 1988 * <p> 1989 * The uniform resource locator (URL) for a web site or other resource associated with the location. 1990 * 1991 * @return the url value 1992 */ 1993 @NonNull 1994 public List<URI> getUrls() { 1995 if (_urls == null) { 1996 _urls = new LinkedList<>(); 1997 } 1998 return ObjectUtils.notNull(_urls); 1999 } 2000 2001 /** 2002 * Set the "{@literal Location URL}". 2003 * 2004 * <p> 2005 * The uniform resource locator (URL) for a web site or other resource associated with the location. 2006 * 2007 * @param value 2008 * the url value to set 2009 */ 2010 public void setUrls(@NonNull List<URI> value) { 2011 _urls = value; 2012 } 2013 2014 /** 2015 * Add a new {@link URI} item to the underlying collection. 2016 * @param item the item to add 2017 * @return {@code true} 2018 */ 2019 public boolean addUrl(URI item) { 2020 URI value = ObjectUtils.requireNonNull(item,"item cannot be null"); 2021 if (_urls == null) { 2022 _urls = new LinkedList<>(); 2023 } 2024 return _urls.add(value); 2025 } 2026 2027 /** 2028 * Remove the first matching {@link URI} item from the underlying collection. 2029 * @param item the item to remove 2030 * @return {@code true} if the item was removed or {@code false} otherwise 2031 */ 2032 public boolean removeUrl(URI item) { 2033 URI value = ObjectUtils.requireNonNull(item,"item cannot be null"); 2034 return _urls != null && _urls.remove(value); 2035 } 2036 2037 /** 2038 * Get the "{@literal Property}". 2039 * 2040 * <p> 2041 * An attribute, characteristic, or quality of the containing object expressed as a namespace qualified name/value pair. 2042 * 2043 * @return the prop value 2044 */ 2045 @NonNull 2046 public List<Property> getProps() { 2047 if (_props == null) { 2048 _props = new LinkedList<>(); 2049 } 2050 return ObjectUtils.notNull(_props); 2051 } 2052 2053 /** 2054 * Set the "{@literal Property}". 2055 * 2056 * <p> 2057 * An attribute, characteristic, or quality of the containing object expressed as a namespace qualified name/value pair. 2058 * 2059 * @param value 2060 * the prop value to set 2061 */ 2062 public void setProps(@NonNull List<Property> value) { 2063 _props = value; 2064 } 2065 2066 /** 2067 * Add a new {@link Property} item to the underlying collection. 2068 * @param item the item to add 2069 * @return {@code true} 2070 */ 2071 public boolean addProp(Property item) { 2072 Property value = ObjectUtils.requireNonNull(item,"item cannot be null"); 2073 if (_props == null) { 2074 _props = new LinkedList<>(); 2075 } 2076 return _props.add(value); 2077 } 2078 2079 /** 2080 * Remove the first matching {@link Property} item from the underlying collection. 2081 * @param item the item to remove 2082 * @return {@code true} if the item was removed or {@code false} otherwise 2083 */ 2084 public boolean removeProp(Property item) { 2085 Property value = ObjectUtils.requireNonNull(item,"item cannot be null"); 2086 return _props != null && _props.remove(value); 2087 } 2088 2089 /** 2090 * Get the "{@literal Link}". 2091 * 2092 * <p> 2093 * A reference to a local or remote resource, that has a specific relation to the containing object. 2094 * 2095 * @return the link value 2096 */ 2097 @NonNull 2098 public List<Link> getLinks() { 2099 if (_links == null) { 2100 _links = new LinkedList<>(); 2101 } 2102 return ObjectUtils.notNull(_links); 2103 } 2104 2105 /** 2106 * Set the "{@literal Link}". 2107 * 2108 * <p> 2109 * A reference to a local or remote resource, that has a specific relation to the containing object. 2110 * 2111 * @param value 2112 * the link value to set 2113 */ 2114 public void setLinks(@NonNull List<Link> value) { 2115 _links = value; 2116 } 2117 2118 /** 2119 * Add a new {@link Link} item to the underlying collection. 2120 * @param item the item to add 2121 * @return {@code true} 2122 */ 2123 public boolean addLink(Link item) { 2124 Link value = ObjectUtils.requireNonNull(item,"item cannot be null"); 2125 if (_links == null) { 2126 _links = new LinkedList<>(); 2127 } 2128 return _links.add(value); 2129 } 2130 2131 /** 2132 * Remove the first matching {@link Link} item from the underlying collection. 2133 * @param item the item to remove 2134 * @return {@code true} if the item was removed or {@code false} otherwise 2135 */ 2136 public boolean removeLink(Link item) { 2137 Link value = ObjectUtils.requireNonNull(item,"item cannot be null"); 2138 return _links != null && _links.remove(value); 2139 } 2140 2141 /** 2142 * Get the "{@literal Remarks}". 2143 * 2144 * <p> 2145 * Additional commentary about the containing object. 2146 * 2147 * @return the remarks value, or {@code null} if not set 2148 */ 2149 @Nullable 2150 public MarkupMultiline getRemarks() { 2151 return _remarks; 2152 } 2153 2154 /** 2155 * Set the "{@literal Remarks}". 2156 * 2157 * <p> 2158 * Additional commentary about the containing object. 2159 * 2160 * @param value 2161 * the remarks value to set, or {@code null} to clear 2162 */ 2163 public void setRemarks(@Nullable MarkupMultiline value) { 2164 _remarks = value; 2165 } 2166 2167 @Override 2168 public String toString() { 2169 return ObjectUtils.notNull(new ReflectionToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).toString()); 2170 } 2171 } 2172 2173 /** 2174 * An organization or person, which may be associated with roles or other concepts within the current or linked OSCAL document. 2175 */ 2176 @MetaschemaAssembly( 2177 formalName = "Party", 2178 description = "An organization or person, which may be associated with roles or other concepts within the current or linked OSCAL document.", 2179 name = "party", 2180 moduleClass = OscalMetadataModule.class, 2181 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.", 2182 valueConstraints = @ValueConstraints(allowedValues = @AllowedValues(id = "oscal-metadata-party-prop-name-values", 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.")})) 2183 ) 2184 public static class Party implements IBoundObject { 2185 private final IMetaschemaData __metaschemaData; 2186 2187 /** 2188 * A unique identifier for the party. 2189 */ 2190 @BoundFlag( 2191 formalName = "Party Universally Unique Identifier", 2192 description = "A unique identifier for the party.", 2193 name = "uuid", 2194 required = true, 2195 typeAdapter = UuidAdapter.class 2196 ) 2197 private UUID _uuid; 2198 2199 /** 2200 * A category describing the kind of party the object describes. 2201 */ 2202 @BoundFlag( 2203 formalName = "Party Type", 2204 description = "A category describing the kind of party the object describes.", 2205 name = "type", 2206 required = true, 2207 typeAdapter = StringAdapter.class, 2208 valueConstraints = @ValueConstraints(allowedValues = @AllowedValues(id = "oscal-metadata-party-type-values", 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.")})) 2209 ) 2210 private String _type; 2211 2212 /** 2213 * The full name of the party. This is typically the legal name associated with the party. 2214 */ 2215 @BoundField( 2216 formalName = "Party Name", 2217 description = "The full name of the party. This is typically the legal name associated with the party.", 2218 useName = "name", 2219 typeAdapter = StringAdapter.class 2220 ) 2221 private String _name; 2222 2223 /** 2224 * A short common name, abbreviation, or acronym for the party. 2225 */ 2226 @BoundField( 2227 formalName = "Party Short Name", 2228 description = "A short common name, abbreviation, or acronym for the party.", 2229 useName = "short-name", 2230 typeAdapter = StringAdapter.class 2231 ) 2232 private String _shortName; 2233 2234 /** 2235 * An identifier for a person or organization using a designated scheme. e.g. an Open Researcher and Contributor ID (ORCID). 2236 */ 2237 @BoundField( 2238 formalName = "Party External Identifier", 2239 description = "An identifier for a person or organization using a designated scheme. e.g. an Open Researcher and Contributor ID (ORCID).", 2240 useName = "external-id", 2241 maxOccurs = -1, 2242 groupAs = @GroupAs(name = "external-ids", inJson = JsonGroupAsBehavior.LIST) 2243 ) 2244 private List<ExternalId> _externalIds; 2245 2246 /** 2247 * An attribute, characteristic, or quality of the containing object expressed as a namespace qualified name/value pair. 2248 */ 2249 @BoundAssembly( 2250 formalName = "Property", 2251 description = "An attribute, characteristic, or quality of the containing object expressed as a namespace qualified name/value pair.", 2252 useName = "prop", 2253 maxOccurs = -1, 2254 groupAs = @GroupAs(name = "props", inJson = JsonGroupAsBehavior.LIST) 2255 ) 2256 private List<Property> _props; 2257 2258 /** 2259 * A reference to a local or remote resource, that has a specific relation to the containing object. 2260 */ 2261 @BoundAssembly( 2262 formalName = "Link", 2263 description = "A reference to a local or remote resource, that has a specific relation to the containing object.", 2264 useName = "link", 2265 maxOccurs = -1, 2266 groupAs = @GroupAs(name = "links", inJson = JsonGroupAsBehavior.LIST) 2267 ) 2268 private List<Link> _links; 2269 2270 /** 2271 * An email address as defined by <a href="https://tools.ietf.org/html/rfc5322#section-3.4.1">RFC 5322 Section 3.4.1</a>. 2272 */ 2273 @BoundField( 2274 formalName = "Email Address", 2275 description = "An email address as defined by [RFC 5322 Section 3.4.1](https://tools.ietf.org/html/rfc5322#section-3.4.1).", 2276 useName = "email-address", 2277 remarks = "This is a contact email associated with the party.", 2278 maxOccurs = -1, 2279 groupAs = @GroupAs(name = "email-addresses", inJson = JsonGroupAsBehavior.LIST), 2280 typeAdapter = EmailAddressAdapter.class 2281 ) 2282 private List<String> _emailAddresses; 2283 2284 /** 2285 * A telephone service number as defined by <a href="https://www.itu.int/rec/T-REC-E.164-201011-I/en">ITU-T E.164</a>. 2286 */ 2287 @BoundField( 2288 formalName = "Telephone Number", 2289 description = "A telephone service number as defined by [ITU-T E.164](https://www.itu.int/rec/T-REC-E.164-201011-I/en).", 2290 useName = "telephone-number", 2291 remarks = "A phone number used to contact the party.", 2292 maxOccurs = -1, 2293 groupAs = @GroupAs(name = "telephone-numbers", inJson = JsonGroupAsBehavior.LIST) 2294 ) 2295 private List<TelephoneNumber> _telephoneNumbers; 2296 2297 /** 2298 * A postal address for the location. 2299 */ 2300 @BoundAssembly( 2301 formalName = "Address", 2302 description = "A postal address for the location.", 2303 useName = "address", 2304 maxOccurs = -1, 2305 groupAs = @GroupAs(name = "addresses", inJson = JsonGroupAsBehavior.LIST) 2306 ) 2307 @BoundChoice( 2308 choiceId = "choice-1" 2309 ) 2310 private List<Address> _addresses; 2311 2312 /** 2313 * Reference to a location by UUID. 2314 */ 2315 @BoundField( 2316 formalName = "Location Universally Unique Identifier Reference", 2317 description = "Reference to a location by UUID.", 2318 useName = "location-uuid", 2319 maxOccurs = -1, 2320 groupAs = @GroupAs(name = "location-uuids", inJson = JsonGroupAsBehavior.LIST), 2321 typeAdapter = UuidAdapter.class, 2322 valueConstraints = @ValueConstraints(indexHasKey = @IndexHasKey(id = "oscal-index-metadata-location-uuid", level = IConstraint.Level.ERROR, indexName = "index-metadata-location-uuid", keyFields = @KeyField)) 2323 ) 2324 @BoundChoice( 2325 choiceId = "choice-1" 2326 ) 2327 private List<UUID> _locationUuids; 2328 2329 /** 2330 * A reference to another <code>party</code> by UUID, typically an organization, that this subject is associated with. 2331 */ 2332 @BoundField( 2333 formalName = "Organizational Affiliation", 2334 description = "A reference to another `party` by UUID, typically an organization, that this subject is associated with.", 2335 useName = "member-of-organization", 2336 remarks = "Since the reference target of an organizational affiliation must be another `party` (whether further qualified as person or organization) as indicated 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" 2337 + "\n" 2338 + "Parties of both the `person` or `organization` type can be associated with an organization using the `member-of-organization`.", 2339 maxOccurs = -1, 2340 groupAs = @GroupAs(name = "member-of-organizations", inJson = JsonGroupAsBehavior.LIST), 2341 typeAdapter = UuidAdapter.class, 2342 valueConstraints = @ValueConstraints(indexHasKey = @IndexHasKey(id = "oscal-index-metadata-party-organizations-uuid", level = IConstraint.Level.ERROR, indexName = "index-metadata-party-organizations-uuid", keyFields = @KeyField)) 2343 ) 2344 private List<UUID> _memberOfOrganizations; 2345 2346 /** 2347 * Additional commentary about the containing object. 2348 */ 2349 @BoundField( 2350 formalName = "Remarks", 2351 description = "Additional commentary about the containing object.", 2352 useName = "remarks", 2353 typeAdapter = MarkupMultilineAdapter.class 2354 ) 2355 private MarkupMultiline _remarks; 2356 2357 /** 2358 * Constructs a new {@code dev.metaschema.oscal.lib.model.Metadata.Party} instance with no metadata. 2359 */ 2360 public Party() { 2361 this(null); 2362 } 2363 2364 /** 2365 * Constructs a new {@code dev.metaschema.oscal.lib.model.Metadata.Party} instance with the specified metadata. 2366 * 2367 * @param data 2368 * the metaschema data, or {@code null} if none 2369 */ 2370 public Party(IMetaschemaData data) { 2371 this.__metaschemaData = data; 2372 } 2373 2374 @Override 2375 public IMetaschemaData getMetaschemaData() { 2376 return __metaschemaData; 2377 } 2378 2379 /** 2380 * Get the "{@literal Party Universally Unique Identifier}". 2381 * 2382 * <p> 2383 * A unique identifier for the party. 2384 * 2385 * @return the uuid value 2386 */ 2387 @NonNull 2388 public UUID getUuid() { 2389 return _uuid; 2390 } 2391 2392 /** 2393 * Set the "{@literal Party Universally Unique Identifier}". 2394 * 2395 * <p> 2396 * A unique identifier for the party. 2397 * 2398 * @param value 2399 * the uuid value to set 2400 */ 2401 public void setUuid(@NonNull UUID value) { 2402 _uuid = value; 2403 } 2404 2405 /** 2406 * Get the "{@literal Party Type}". 2407 * 2408 * <p> 2409 * A category describing the kind of party the object describes. 2410 * 2411 * @return the type value 2412 */ 2413 @NonNull 2414 public String getType() { 2415 return _type; 2416 } 2417 2418 /** 2419 * Set the "{@literal Party Type}". 2420 * 2421 * <p> 2422 * A category describing the kind of party the object describes. 2423 * 2424 * @param value 2425 * the type value to set 2426 */ 2427 public void setType(@NonNull String value) { 2428 _type = value; 2429 } 2430 2431 /** 2432 * Get the "{@literal Party Name}". 2433 * 2434 * <p> 2435 * The full name of the party. This is typically the legal name associated with the party. 2436 * 2437 * @return the name value, or {@code null} if not set 2438 */ 2439 @Nullable 2440 public String getName() { 2441 return _name; 2442 } 2443 2444 /** 2445 * Set the "{@literal Party Name}". 2446 * 2447 * <p> 2448 * The full name of the party. This is typically the legal name associated with the party. 2449 * 2450 * @param value 2451 * the name value to set, or {@code null} to clear 2452 */ 2453 public void setName(@Nullable String value) { 2454 _name = value; 2455 } 2456 2457 /** 2458 * Get the "{@literal Party Short Name}". 2459 * 2460 * <p> 2461 * A short common name, abbreviation, or acronym for the party. 2462 * 2463 * @return the short-name value, or {@code null} if not set 2464 */ 2465 @Nullable 2466 public String getShortName() { 2467 return _shortName; 2468 } 2469 2470 /** 2471 * Set the "{@literal Party Short Name}". 2472 * 2473 * <p> 2474 * A short common name, abbreviation, or acronym for the party. 2475 * 2476 * @param value 2477 * the short-name value to set, or {@code null} to clear 2478 */ 2479 public void setShortName(@Nullable String value) { 2480 _shortName = value; 2481 } 2482 2483 /** 2484 * Get the "{@literal Party External Identifier}". 2485 * 2486 * <p> 2487 * An identifier for a person or organization using a designated scheme. e.g. an Open Researcher and Contributor ID (ORCID). 2488 * 2489 * @return the external-id value 2490 */ 2491 @NonNull 2492 public List<ExternalId> getExternalIds() { 2493 if (_externalIds == null) { 2494 _externalIds = new LinkedList<>(); 2495 } 2496 return ObjectUtils.notNull(_externalIds); 2497 } 2498 2499 /** 2500 * Set the "{@literal Party External Identifier}". 2501 * 2502 * <p> 2503 * An identifier for a person or organization using a designated scheme. e.g. an Open Researcher and Contributor ID (ORCID). 2504 * 2505 * @param value 2506 * the external-id value to set 2507 */ 2508 public void setExternalIds(@NonNull List<ExternalId> value) { 2509 _externalIds = value; 2510 } 2511 2512 /** 2513 * Add a new {@link ExternalId} item to the underlying collection. 2514 * @param item the item to add 2515 * @return {@code true} 2516 */ 2517 public boolean addExternalId(ExternalId item) { 2518 ExternalId value = ObjectUtils.requireNonNull(item,"item cannot be null"); 2519 if (_externalIds == null) { 2520 _externalIds = new LinkedList<>(); 2521 } 2522 return _externalIds.add(value); 2523 } 2524 2525 /** 2526 * Remove the first matching {@link ExternalId} item from the underlying collection. 2527 * @param item the item to remove 2528 * @return {@code true} if the item was removed or {@code false} otherwise 2529 */ 2530 public boolean removeExternalId(ExternalId item) { 2531 ExternalId value = ObjectUtils.requireNonNull(item,"item cannot be null"); 2532 return _externalIds != null && _externalIds.remove(value); 2533 } 2534 2535 /** 2536 * Get the "{@literal Property}". 2537 * 2538 * <p> 2539 * An attribute, characteristic, or quality of the containing object expressed as a namespace qualified name/value pair. 2540 * 2541 * @return the prop value 2542 */ 2543 @NonNull 2544 public List<Property> getProps() { 2545 if (_props == null) { 2546 _props = new LinkedList<>(); 2547 } 2548 return ObjectUtils.notNull(_props); 2549 } 2550 2551 /** 2552 * Set the "{@literal Property}". 2553 * 2554 * <p> 2555 * An attribute, characteristic, or quality of the containing object expressed as a namespace qualified name/value pair. 2556 * 2557 * @param value 2558 * the prop value to set 2559 */ 2560 public void setProps(@NonNull List<Property> value) { 2561 _props = value; 2562 } 2563 2564 /** 2565 * Add a new {@link Property} item to the underlying collection. 2566 * @param item the item to add 2567 * @return {@code true} 2568 */ 2569 public boolean addProp(Property item) { 2570 Property value = ObjectUtils.requireNonNull(item,"item cannot be null"); 2571 if (_props == null) { 2572 _props = new LinkedList<>(); 2573 } 2574 return _props.add(value); 2575 } 2576 2577 /** 2578 * Remove the first matching {@link Property} item from the underlying collection. 2579 * @param item the item to remove 2580 * @return {@code true} if the item was removed or {@code false} otherwise 2581 */ 2582 public boolean removeProp(Property item) { 2583 Property value = ObjectUtils.requireNonNull(item,"item cannot be null"); 2584 return _props != null && _props.remove(value); 2585 } 2586 2587 /** 2588 * Get the "{@literal Link}". 2589 * 2590 * <p> 2591 * A reference to a local or remote resource, that has a specific relation to the containing object. 2592 * 2593 * @return the link value 2594 */ 2595 @NonNull 2596 public List<Link> getLinks() { 2597 if (_links == null) { 2598 _links = new LinkedList<>(); 2599 } 2600 return ObjectUtils.notNull(_links); 2601 } 2602 2603 /** 2604 * Set the "{@literal Link}". 2605 * 2606 * <p> 2607 * A reference to a local or remote resource, that has a specific relation to the containing object. 2608 * 2609 * @param value 2610 * the link value to set 2611 */ 2612 public void setLinks(@NonNull List<Link> value) { 2613 _links = value; 2614 } 2615 2616 /** 2617 * Add a new {@link Link} item to the underlying collection. 2618 * @param item the item to add 2619 * @return {@code true} 2620 */ 2621 public boolean addLink(Link item) { 2622 Link value = ObjectUtils.requireNonNull(item,"item cannot be null"); 2623 if (_links == null) { 2624 _links = new LinkedList<>(); 2625 } 2626 return _links.add(value); 2627 } 2628 2629 /** 2630 * Remove the first matching {@link Link} item from the underlying collection. 2631 * @param item the item to remove 2632 * @return {@code true} if the item was removed or {@code false} otherwise 2633 */ 2634 public boolean removeLink(Link item) { 2635 Link value = ObjectUtils.requireNonNull(item,"item cannot be null"); 2636 return _links != null && _links.remove(value); 2637 } 2638 2639 /** 2640 * Get the "{@literal Email Address}". 2641 * 2642 * <p> 2643 * An email address as defined by <a href="https://tools.ietf.org/html/rfc5322#section-3.4.1">RFC 5322 Section 3.4.1</a>. 2644 * 2645 * @return the email-address value 2646 */ 2647 @NonNull 2648 public List<String> getEmailAddresses() { 2649 if (_emailAddresses == null) { 2650 _emailAddresses = new LinkedList<>(); 2651 } 2652 return ObjectUtils.notNull(_emailAddresses); 2653 } 2654 2655 /** 2656 * Set the "{@literal Email Address}". 2657 * 2658 * <p> 2659 * An email address as defined by <a href="https://tools.ietf.org/html/rfc5322#section-3.4.1">RFC 5322 Section 3.4.1</a>. 2660 * 2661 * @param value 2662 * the email-address value to set 2663 */ 2664 public void setEmailAddresses(@NonNull List<String> value) { 2665 _emailAddresses = value; 2666 } 2667 2668 /** 2669 * Add a new {@link String} item to the underlying collection. 2670 * @param item the item to add 2671 * @return {@code true} 2672 */ 2673 public boolean addEmailAddress(String item) { 2674 String value = ObjectUtils.requireNonNull(item,"item cannot be null"); 2675 if (_emailAddresses == null) { 2676 _emailAddresses = new LinkedList<>(); 2677 } 2678 return _emailAddresses.add(value); 2679 } 2680 2681 /** 2682 * Remove the first matching {@link String} item from the underlying collection. 2683 * @param item the item to remove 2684 * @return {@code true} if the item was removed or {@code false} otherwise 2685 */ 2686 public boolean removeEmailAddress(String item) { 2687 String value = ObjectUtils.requireNonNull(item,"item cannot be null"); 2688 return _emailAddresses != null && _emailAddresses.remove(value); 2689 } 2690 2691 /** 2692 * Get the "{@literal Telephone Number}". 2693 * 2694 * <p> 2695 * A telephone service number as defined by <a href="https://www.itu.int/rec/T-REC-E.164-201011-I/en">ITU-T E.164</a>. 2696 * 2697 * @return the telephone-number value 2698 */ 2699 @NonNull 2700 public List<TelephoneNumber> getTelephoneNumbers() { 2701 if (_telephoneNumbers == null) { 2702 _telephoneNumbers = new LinkedList<>(); 2703 } 2704 return ObjectUtils.notNull(_telephoneNumbers); 2705 } 2706 2707 /** 2708 * Set the "{@literal Telephone Number}". 2709 * 2710 * <p> 2711 * A telephone service number as defined by <a href="https://www.itu.int/rec/T-REC-E.164-201011-I/en">ITU-T E.164</a>. 2712 * 2713 * @param value 2714 * the telephone-number value to set 2715 */ 2716 public void setTelephoneNumbers(@NonNull List<TelephoneNumber> value) { 2717 _telephoneNumbers = value; 2718 } 2719 2720 /** 2721 * Add a new {@link TelephoneNumber} item to the underlying collection. 2722 * @param item the item to add 2723 * @return {@code true} 2724 */ 2725 public boolean addTelephoneNumber(TelephoneNumber item) { 2726 TelephoneNumber value = ObjectUtils.requireNonNull(item,"item cannot be null"); 2727 if (_telephoneNumbers == null) { 2728 _telephoneNumbers = new LinkedList<>(); 2729 } 2730 return _telephoneNumbers.add(value); 2731 } 2732 2733 /** 2734 * Remove the first matching {@link TelephoneNumber} item from the underlying collection. 2735 * @param item the item to remove 2736 * @return {@code true} if the item was removed or {@code false} otherwise 2737 */ 2738 public boolean removeTelephoneNumber(TelephoneNumber item) { 2739 TelephoneNumber value = ObjectUtils.requireNonNull(item,"item cannot be null"); 2740 return _telephoneNumbers != null && _telephoneNumbers.remove(value); 2741 } 2742 2743 /** 2744 * Get the "{@literal Address}". 2745 * 2746 * <p> 2747 * A postal address for the location. 2748 * 2749 * @return the address value 2750 */ 2751 @NonNull 2752 public List<Address> getAddresses() { 2753 if (_addresses == null) { 2754 _addresses = new LinkedList<>(); 2755 } 2756 return ObjectUtils.notNull(_addresses); 2757 } 2758 2759 /** 2760 * Set the "{@literal Address}". 2761 * 2762 * <p> 2763 * A postal address for the location. 2764 * 2765 * @param value 2766 * the address value to set 2767 */ 2768 public void setAddresses(@NonNull List<Address> value) { 2769 _addresses = value; 2770 } 2771 2772 /** 2773 * Add a new {@link Address} item to the underlying collection. 2774 * @param item the item to add 2775 * @return {@code true} 2776 */ 2777 public boolean addAddress(Address item) { 2778 Address value = ObjectUtils.requireNonNull(item,"item cannot be null"); 2779 if (_addresses == null) { 2780 _addresses = new LinkedList<>(); 2781 } 2782 return _addresses.add(value); 2783 } 2784 2785 /** 2786 * Remove the first matching {@link Address} item from the underlying collection. 2787 * @param item the item to remove 2788 * @return {@code true} if the item was removed or {@code false} otherwise 2789 */ 2790 public boolean removeAddress(Address item) { 2791 Address value = ObjectUtils.requireNonNull(item,"item cannot be null"); 2792 return _addresses != null && _addresses.remove(value); 2793 } 2794 2795 /** 2796 * Get the "{@literal Location Universally Unique Identifier Reference}". 2797 * 2798 * <p> 2799 * Reference to a location by UUID. 2800 * 2801 * @return the location-uuid value 2802 */ 2803 @NonNull 2804 public List<UUID> getLocationUuids() { 2805 if (_locationUuids == null) { 2806 _locationUuids = new LinkedList<>(); 2807 } 2808 return ObjectUtils.notNull(_locationUuids); 2809 } 2810 2811 /** 2812 * Set the "{@literal Location Universally Unique Identifier Reference}". 2813 * 2814 * <p> 2815 * Reference to a location by UUID. 2816 * 2817 * @param value 2818 * the location-uuid value to set 2819 */ 2820 public void setLocationUuids(@NonNull List<UUID> value) { 2821 _locationUuids = value; 2822 } 2823 2824 /** 2825 * Add a new {@link UUID} item to the underlying collection. 2826 * @param item the item to add 2827 * @return {@code true} 2828 */ 2829 public boolean addLocationUuid(UUID item) { 2830 UUID value = ObjectUtils.requireNonNull(item,"item cannot be null"); 2831 if (_locationUuids == null) { 2832 _locationUuids = new LinkedList<>(); 2833 } 2834 return _locationUuids.add(value); 2835 } 2836 2837 /** 2838 * Remove the first matching {@link UUID} item from the underlying collection. 2839 * @param item the item to remove 2840 * @return {@code true} if the item was removed or {@code false} otherwise 2841 */ 2842 public boolean removeLocationUuid(UUID item) { 2843 UUID value = ObjectUtils.requireNonNull(item,"item cannot be null"); 2844 return _locationUuids != null && _locationUuids.remove(value); 2845 } 2846 2847 /** 2848 * Get the "{@literal Organizational Affiliation}". 2849 * 2850 * <p> 2851 * A reference to another <code>party</code> by UUID, typically an organization, that this subject is associated with. 2852 * 2853 * @return the member-of-organization value 2854 */ 2855 @NonNull 2856 public List<UUID> getMemberOfOrganizations() { 2857 if (_memberOfOrganizations == null) { 2858 _memberOfOrganizations = new LinkedList<>(); 2859 } 2860 return ObjectUtils.notNull(_memberOfOrganizations); 2861 } 2862 2863 /** 2864 * Set the "{@literal Organizational Affiliation}". 2865 * 2866 * <p> 2867 * A reference to another <code>party</code> by UUID, typically an organization, that this subject is associated with. 2868 * 2869 * @param value 2870 * the member-of-organization value to set 2871 */ 2872 public void setMemberOfOrganizations(@NonNull List<UUID> value) { 2873 _memberOfOrganizations = value; 2874 } 2875 2876 /** 2877 * Add a new {@link UUID} item to the underlying collection. 2878 * @param item the item to add 2879 * @return {@code true} 2880 */ 2881 public boolean addMemberOfOrganization(UUID item) { 2882 UUID value = ObjectUtils.requireNonNull(item,"item cannot be null"); 2883 if (_memberOfOrganizations == null) { 2884 _memberOfOrganizations = new LinkedList<>(); 2885 } 2886 return _memberOfOrganizations.add(value); 2887 } 2888 2889 /** 2890 * Remove the first matching {@link UUID} item from the underlying collection. 2891 * @param item the item to remove 2892 * @return {@code true} if the item was removed or {@code false} otherwise 2893 */ 2894 public boolean removeMemberOfOrganization(UUID item) { 2895 UUID value = ObjectUtils.requireNonNull(item,"item cannot be null"); 2896 return _memberOfOrganizations != null && _memberOfOrganizations.remove(value); 2897 } 2898 2899 /** 2900 * Get the "{@literal Remarks}". 2901 * 2902 * <p> 2903 * Additional commentary about the containing object. 2904 * 2905 * @return the remarks value, or {@code null} if not set 2906 */ 2907 @Nullable 2908 public MarkupMultiline getRemarks() { 2909 return _remarks; 2910 } 2911 2912 /** 2913 * Set the "{@literal Remarks}". 2914 * 2915 * <p> 2916 * Additional commentary about the containing object. 2917 * 2918 * @param value 2919 * the remarks value to set, or {@code null} to clear 2920 */ 2921 public void setRemarks(@Nullable MarkupMultiline value) { 2922 _remarks = value; 2923 } 2924 2925 @Override 2926 public String toString() { 2927 return ObjectUtils.notNull(new ReflectionToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).toString()); 2928 } 2929 2930 /** 2931 * An identifier for a person or organization using a designated scheme. e.g. an Open Researcher and Contributor ID (ORCID). 2932 */ 2933 @MetaschemaField( 2934 formalName = "Party External Identifier", 2935 description = "An identifier for a person or organization using a designated scheme. e.g. an Open Researcher and Contributor ID (ORCID).", 2936 name = "external-id", 2937 moduleClass = OscalMetadataModule.class 2938 ) 2939 public static class ExternalId implements IBoundObject { 2940 private final IMetaschemaData __metaschemaData; 2941 2942 /** 2943 * Indicates the type of external identifier. 2944 */ 2945 @BoundFlag( 2946 formalName = "External Identifier Schema", 2947 description = "Indicates the type of external identifier.", 2948 name = "scheme", 2949 required = true, 2950 typeAdapter = UriAdapter.class, 2951 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).", 2952 valueConstraints = @ValueConstraints(allowedValues = @AllowedValues(id = "oscal-metadata-party-external-id-values", level = IConstraint.Level.ERROR, allowOthers = true, values = @AllowedValue(value = "http://orcid.org/", description = "The identifier is Open Researcher and Contributor ID (ORCID)."))) 2953 ) 2954 private URI _scheme; 2955 2956 /** 2957 * The field value. 2958 */ 2959 @BoundFieldValue( 2960 valueKeyName = "id" 2961 ) 2962 private String _id; 2963 2964 /** 2965 * Constructs a new {@code dev.metaschema.oscal.lib.model.Metadata.Party.ExternalId} instance with no metadata. 2966 */ 2967 public ExternalId() { 2968 this(null); 2969 } 2970 2971 /** 2972 * Constructs a new {@code dev.metaschema.oscal.lib.model.Metadata.Party.ExternalId} instance with the specified metadata. 2973 * 2974 * @param data 2975 * the metaschema data, or {@code null} if none 2976 */ 2977 public ExternalId(IMetaschemaData data) { 2978 this.__metaschemaData = data; 2979 } 2980 2981 @Override 2982 public IMetaschemaData getMetaschemaData() { 2983 return __metaschemaData; 2984 } 2985 2986 /** 2987 * Get the "{@literal External Identifier Schema}". 2988 * 2989 * <p> 2990 * Indicates the type of external identifier. 2991 * 2992 * @return the scheme value 2993 */ 2994 @NonNull 2995 public URI getScheme() { 2996 return _scheme; 2997 } 2998 2999 /** 3000 * Set the "{@literal External Identifier Schema}". 3001 * 3002 * <p> 3003 * Indicates the type of external identifier. 3004 * 3005 * @param value 3006 * the scheme value to set 3007 */ 3008 public void setScheme(@NonNull URI value) { 3009 _scheme = value; 3010 } 3011 3012 /** 3013 * Get the field value. 3014 * 3015 * @return the value 3016 */ 3017 @Nullable 3018 public String getId() { 3019 return _id; 3020 } 3021 3022 /** 3023 * Set the field value. 3024 * 3025 * @param value 3026 * the value to set 3027 */ 3028 public void setId(@Nullable String value) { 3029 _id = value; 3030 } 3031 3032 @Override 3033 public String toString() { 3034 return ObjectUtils.notNull(new ReflectionToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).toString()); 3035 } 3036 } 3037 } 3038}