001// Generated from: ../../../../../../../../oscal/src/metaschema/oscal_implementation-common_metaschema.xml
002// Do not edit - changes will be lost when regenerated.
003package dev.metaschema.oscal.lib.model;
004
005import dev.metaschema.core.datatype.adapter.UriAdapter;
006import dev.metaschema.core.model.IBoundObject;
007import dev.metaschema.core.model.IMetaschemaData;
008import dev.metaschema.core.model.constraint.IConstraint;
009import dev.metaschema.core.util.ObjectUtils;
010import dev.metaschema.databind.model.annotations.AllowedValue;
011import dev.metaschema.databind.model.annotations.AllowedValues;
012import dev.metaschema.databind.model.annotations.BoundFieldValue;
013import dev.metaschema.databind.model.annotations.BoundFlag;
014import dev.metaschema.databind.model.annotations.MetaschemaField;
015import dev.metaschema.databind.model.annotations.ValueConstraints;
016import edu.umd.cs.findbugs.annotations.Nullable;
017import java.net.URI;
018import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
019import org.apache.commons.lang3.builder.ToStringStyle;
020
021/**
022 * 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.
023 */
024@MetaschemaField(
025    formalName = "System Identification",
026    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.",
027    name = "system-id",
028    moduleClass = OscalImplementationCommonModule.class
029)
030public class SystemId implements IBoundObject {
031  private final IMetaschemaData __metaschemaData;
032
033  /**
034   * Identifies the identification system from which the provided identifier was assigned.
035   */
036  @BoundFlag(
037      formalName = "Identification System Type",
038      description = "Identifies the identification system from which the provided identifier was assigned.",
039      name = "identifier-type",
040      typeAdapter = UriAdapter.class,
041      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).",
042      valueConstraints = @ValueConstraints(allowedValues = @AllowedValues(id = "oscal-system-identifier-type-values", level = IConstraint.Level.ERROR, allowOthers = true, values = {@AllowedValue(value = "http://fedramp.gov", description = "\\*\\*deprecated\\*\\* The identifier was assigned by FedRAMP. This has been deprecated; use `http://fedramp.gov/ns/oscal` instead.", deprecatedVersion = "1.0.3"), @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://datatracker.ietf.org/doc/html/rfc4122` instead.", deprecatedVersion = "1.0.3"), @AllowedValue(value = "http://ietf.org/rfc/rfc4122", description = "\\*\\*deprecated\\*\\* A Universally Unique Identifier (UUID) as defined by RFC4122. This value has been deprecated; use `http://datatracker.ietf.org/doc/html/rfc4122` instead.", deprecatedVersion = "1.1.4"), @AllowedValue(value = "http://datatracker.ietf.org/doc/html/rfc4122", description = "A Universally Unique Identifier (UUID) as defined by RFC4122.")}))
043  )
044  private URI _identifierType;
045
046  /**
047   * The field value.
048   */
049  @BoundFieldValue(
050      valueKeyName = "id"
051  )
052  private String _id;
053
054  /**
055   * Constructs a new {@code dev.metaschema.oscal.lib.model.SystemId} instance with no metadata.
056   */
057  public SystemId() {
058    this(null);
059  }
060
061  /**
062   * Constructs a new {@code dev.metaschema.oscal.lib.model.SystemId} instance with the specified metadata.
063   *
064   * @param data
065   *           the metaschema data, or {@code null} if none
066   */
067  public SystemId(IMetaschemaData data) {
068    this.__metaschemaData = data;
069  }
070
071  @Override
072  public IMetaschemaData getMetaschemaData() {
073    return __metaschemaData;
074  }
075
076  /**
077   * Get the "{@literal Identification System Type}".
078   *
079   * <p>
080   * Identifies the identification system from which the provided identifier was assigned.
081   *
082   * @return the identifier-type value, or {@code null} if not set
083   */
084  @Nullable
085  public URI getIdentifierType() {
086    return _identifierType;
087  }
088
089  /**
090   * Set the "{@literal Identification System Type}".
091   *
092   * <p>
093   * Identifies the identification system from which the provided identifier was assigned.
094   *
095   * @param value
096   *           the identifier-type value to set, or {@code null} to clear
097   */
098  public void setIdentifierType(@Nullable URI value) {
099    _identifierType = value;
100  }
101
102  /**
103   * Get the field value.
104   *
105   * @return the value
106   */
107  @Nullable
108  public String getId() {
109    return _id;
110  }
111
112  /**
113   * Set the field value.
114   *
115   * @param value
116   *           the value to set
117   */
118  public void setId(@Nullable String value) {
119    _id = value;
120  }
121
122  @Override
123  public String toString() {
124    return ObjectUtils.notNull(new ReflectionToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).toString());
125  }
126}