gov.nist.secauto.oscal.lib.model.DocumentId Maven / Gradle / Ivy
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 scheme
. A document identifier provides a globally unique identifier with a cross-instance scope that is used for a group of documents that are to be treated as different versions of the same document. If this element does not appear, or if the value of this element is empty, the value of document-id
is equal to the value of the uuid
flag of the top-level root element.
*/
@MetaschemaField(
formalName = "Document Identifier",
description = "A document identifier qualified by an identifier `scheme`. A document identifier provides a [globally unique](/concepts/identifier-use/#globally-unique) identifier with a [cross-instance](/concepts/identifier-use/#cross-instance) scope that is used for a group of documents that are to be treated as different versions of the same document. If this element does not appear, or if the value of this element is empty, the value of \"document-id\" is equal to the value of the \"uuid\" flag of the top-level root element.",
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
)
@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();
}
}