DocumentId.java

package gov.nist.secauto.oscal.lib.model;

import gov.nist.secauto.metaschema.binding.model.annotations.AllowedValue;
import gov.nist.secauto.metaschema.binding.model.annotations.AllowedValues;
import gov.nist.secauto.metaschema.binding.model.annotations.BoundFlag;
import gov.nist.secauto.metaschema.binding.model.annotations.MetaschemaField;
import gov.nist.secauto.metaschema.binding.model.annotations.MetaschemaFieldValue;
import gov.nist.secauto.metaschema.binding.model.annotations.ValueConstraints;
import gov.nist.secauto.metaschema.model.common.constraint.IConstraint;
import gov.nist.secauto.metaschema.model.common.datatype.adapter.UriAdapter;
import java.lang.Override;
import java.lang.String;
import java.net.URI;
import org.apache.commons.lang3.builder.MultilineRecursiveToStringStyle;
import org.apache.commons.lang3.builder.ReflectionToStringBuilder;

/**
 * A document identifier qualified by an identifier <code>scheme</code>.
 */
@MetaschemaField(
    formalName = "Document Identifier",
    description = "A document identifier qualified by an identifier `scheme`.",
    name = "document-id",
    metaschema = OscalMetadataMetaschema.class,
    isCollapsible = false
)
public class DocumentId {
  @MetaschemaFieldValue(
      valueKeyName = "identifier"
  )
  private String _value;

  @BoundFlag(
      formalName = "Document Identification Scheme",
      description = "Qualifies the kind of document identifier using a URI. If the scheme is not provided the value of the element will be interpreted as a string of characters.",
      useName = "scheme",
      typeAdapter = UriAdapter.class,
      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)."
  )
  @ValueConstraints(
      allowedValues = @AllowedValues(level = IConstraint.Level.ERROR, allowOthers = true, values = @AllowedValue(value = "http://www.doi.org/", description = "A [Digital Object Identifier](https://www.doi.org/hb.html) (DOI); use is preferred, since this allows for retrieval of a full bibliographic record."))
  )
  private URI _scheme;

  public DocumentId() {
  }

  public String getValue() {
    return _value;
  }

  public void setValue(String value) {
    _value = value;
  }

  public URI getScheme() {
    return _scheme;
  }

  public void setScheme(URI value) {
    _scheme = value;
  }

  @Override
  public String toString() {
    return new ReflectionToStringBuilder(this, MultilineRecursiveToStringStyle.MULTI_LINE_STYLE).toString();
  }
}