001package gov.nist.secauto.oscal.lib.model;
002
003import gov.nist.secauto.metaschema.core.datatype.adapter.UriAdapter;
004import gov.nist.secauto.metaschema.core.model.IBoundObject;
005import gov.nist.secauto.metaschema.core.model.IMetaschemaData;
006import gov.nist.secauto.metaschema.core.model.constraint.IConstraint;
007import gov.nist.secauto.metaschema.databind.model.annotations.AllowedValue;
008import gov.nist.secauto.metaschema.databind.model.annotations.AllowedValues;
009import gov.nist.secauto.metaschema.databind.model.annotations.BoundFieldValue;
010import gov.nist.secauto.metaschema.databind.model.annotations.BoundFlag;
011import gov.nist.secauto.metaschema.databind.model.annotations.MetaschemaField;
012import gov.nist.secauto.metaschema.databind.model.annotations.ValueConstraints;
013import java.lang.Override;
014import java.lang.String;
015import java.net.URI;
016import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
017import org.apache.commons.lang3.builder.ToStringStyle;
018
019/**
020 * A <a href="https://pages.nist.gov/OSCAL/concepts/identifier-use/#human-oriented">human-oriented</a>, <a href="https://pages.nist.gov/OSCAL/concepts/identifier-use/#globally-unique">globally unique</a> identifier with <a href="https://pages.nist.gov/OSCAL/concepts/identifier-use/#cross-instance">cross-instance</a> scope that can be used to reference this system identification property elsewhere in <a href="https://pages.nist.gov/OSCAL/concepts/identifier-use/#scope">this or other OSCAL instances</a>. When referencing an externally defined <code>system identification</code>, the <code>system identification</code> must be used in the context of the external / imported OSCAL instance (e.g., uri-reference). This string should be assigned <a href="https://pages.nist.gov/OSCAL/concepts/identifier-use/#consistency">per-subject</a>, which means it should be consistently used to identify the same system across revisions of the document.
021 */
022@MetaschemaField(
023    formalName = "System Identification",
024    description = "A [human-oriented](https://pages.nist.gov/OSCAL/concepts/identifier-use/#human-oriented), [globally unique](https://pages.nist.gov/OSCAL/concepts/identifier-use/#globally-unique) identifier with [cross-instance](https://pages.nist.gov/OSCAL/concepts/identifier-use/#cross-instance) scope that can be used to reference this system identification property elsewhere in [this or other OSCAL instances](https://pages.nist.gov/OSCAL/concepts/identifier-use/#scope). When referencing an externally defined `system identification`, the `system identification` must be used in the context of the external / imported OSCAL instance (e.g., uri-reference). This string should be assigned [per-subject](https://pages.nist.gov/OSCAL/concepts/identifier-use/#consistency), which means it should be consistently used to identify the same system across revisions of the document.",
025    name = "system-id",
026    moduleClass = OscalImplementationCommonModule.class
027)
028public class SystemId implements IBoundObject {
029  private final IMetaschemaData __metaschemaData;
030
031  /**
032   * "Identifies the identification system from which the provided identifier was assigned."
033   */
034  @BoundFlag(
035      formalName = "Identification System Type",
036      description = "Identifies the identification system from which the provided identifier was assigned.",
037      name = "identifier-type",
038      typeAdapter = UriAdapter.class,
039      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).",
040      valueConstraints = @ValueConstraints(allowedValues = @AllowedValues(level = IConstraint.Level.ERROR, allowOthers = true, values = {@AllowedValue(value = "https://fedramp.gov", description = "\\*\\*deprecated\\*\\* The identifier was assigned by FedRAMP. This has been deprecated; use `http://fedramp.gov/ns/oscal` instead."), @AllowedValue(value = "http://fedramp.gov/ns/oscal", description = "The identifier was assigned by FedRAMP."), @AllowedValue(value = "https://ietf.org/rfc/rfc4122", description = "\\*\\*deprecated\\*\\* A Universally Unique Identifier (UUID) as defined by RFC4122. This value has been deprecated; use `http://ietf.org/rfc/rfc4122` instead."), @AllowedValue(value = "http://ietf.org/rfc/rfc4122", description = "A Universally Unique Identifier (UUID) as defined by RFC4122.")}))
041  )
042  private URI _identifierType;
043
044  @BoundFieldValue(
045      valueKeyName = "id"
046  )
047  private String _id;
048
049  public SystemId() {
050    this(null);
051  }
052
053  public SystemId(IMetaschemaData data) {
054    this.__metaschemaData = data;
055  }
056
057  @Override
058  public IMetaschemaData getMetaschemaData() {
059    return __metaschemaData;
060  }
061
062  public URI getIdentifierType() {
063    return _identifierType;
064  }
065
066  public void setIdentifierType(URI value) {
067    _identifierType = value;
068  }
069
070  public String getId() {
071    return _id;
072  }
073
074  public void setId(String value) {
075    _id = value;
076  }
077
078  @Override
079  public String toString() {
080    return new ReflectionToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).toString();
081  }
082}