gov.nist.secauto.oscal.lib.model.AssessmentResults Maven / Gradle / Ivy
package gov.nist.secauto.oscal.lib.model;
import gov.nist.secauto.metaschema.binding.model.annotations.BoundAssembly;
import gov.nist.secauto.metaschema.binding.model.annotations.BoundField;
import gov.nist.secauto.metaschema.binding.model.annotations.BoundFieldValue;
import gov.nist.secauto.metaschema.binding.model.annotations.BoundFlag;
import gov.nist.secauto.metaschema.binding.model.annotations.GroupAs;
import gov.nist.secauto.metaschema.binding.model.annotations.MetaschemaAssembly;
import gov.nist.secauto.metaschema.model.common.JsonGroupAsBehavior;
import gov.nist.secauto.metaschema.model.common.datatype.adapter.UuidAdapter;
import gov.nist.secauto.metaschema.model.common.datatype.markup.MarkupMultiline;
import gov.nist.secauto.metaschema.model.common.datatype.markup.MarkupMultilineAdapter;
import gov.nist.secauto.metaschema.model.common.util.ObjectUtils;
import java.lang.Override;
import java.lang.String;
import java.util.LinkedList;
import java.util.List;
import java.util.UUID;
import org.apache.commons.lang3.builder.MultilineRecursiveToStringStyle;
import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
/**
* Security assessment results, such as those provided by a FedRAMP assessor in the FedRAMP Security Assessment Report.
*/
@MetaschemaAssembly(
formalName = "Security Assessment Results (SAR)",
description = "Security assessment results, such as those provided by a FedRAMP assessor in the FedRAMP Security Assessment Report.",
name = "assessment-results",
metaschema = OscalArMetaschema.class,
rootName = "assessment-results"
)
public class AssessmentResults {
@BoundFlag(
formalName = "Assessment Results Universally Unique Identifier",
description = "A [machine-oriented](/concepts/identifier-use/#machine-oriented), [globally unique](/concepts/identifier-use/#globally-unique) identifier with [cross-instance](/concepts/identifier-use/#cross-instance) scope that can be used to reference this assessment results instance in [this or other OSCAL instances](/concepts/identifier-use/#ar-identifiers). The locally defined *UUID* of the `assessment result` can be used to reference the data item locally or globally (e.g., in an imported OSCAL instance). This UUID should be assigned [per-subject](/concepts/identifier-use/#consistency), which means it should be consistently used to identify the same subject across revisions of the document.",
useName = "uuid",
required = true,
typeAdapter = UuidAdapter.class
)
private UUID _uuid;
@BoundAssembly(
useName = "metadata",
minOccurs = 1
)
private Metadata _metadata;
@BoundAssembly(
useName = "import-ap",
minOccurs = 1,
remarks = "Used by the SAR to import information about the original plan for assessing the system."
)
private ImportAp _importAp;
/**
* "Used to define data objects that are used in the assessment plan, that do not appear in the referenced SSP.
"
*/
@BoundAssembly(
formalName = "Local Definitions",
description = "Used to define data objects that are used in the assessment plan, that do not appear in the referenced SSP.",
useName = "local-definitions"
)
private LocalDefinitions _localDefinitions;
@BoundAssembly(
useName = "result",
minOccurs = 1,
maxOccurs = -1
)
@GroupAs(
name = "results",
inJson = JsonGroupAsBehavior.LIST
)
private List _results;
@BoundAssembly(
useName = "back-matter"
)
private BackMatter _backMatter;
public AssessmentResults() {
}
public UUID getUuid() {
return _uuid;
}
public void setUuid(UUID value) {
_uuid = value;
}
public Metadata getMetadata() {
return _metadata;
}
public void setMetadata(Metadata value) {
_metadata = value;
}
public ImportAp getImportAp() {
return _importAp;
}
public void setImportAp(ImportAp value) {
_importAp = value;
}
public LocalDefinitions getLocalDefinitions() {
return _localDefinitions;
}
public void setLocalDefinitions(LocalDefinitions value) {
_localDefinitions = value;
}
public List getResults() {
return _results;
}
public void setResults(List value) {
_results = value;
}
/**
* Add a new {@link Result} item to the underlying collection.
* @param item the item to add
* @return {@code true}
*/
public boolean addResult(Result item) {
Result value = ObjectUtils.requireNonNull(item,"item cannot be null");
if (_results == null) {
_results = new LinkedList<>();
}
return _results.add(value);
}
/**
* Remove the first matching {@link Result} item from the underlying collection.
* @param item the item to remove
* @return {@code true} if the item was removed or {@code false} otherwise
*/
public boolean removeResult(Result item) {
Result value = ObjectUtils.requireNonNull(item,"item cannot be null");
return _results == null ? false : _results.remove(value);
}
public BackMatter getBackMatter() {
return _backMatter;
}
public void setBackMatter(BackMatter value) {
_backMatter = value;
}
@Override
public String toString() {
return new ReflectionToStringBuilder(this, MultilineRecursiveToStringStyle.MULTI_LINE_STYLE).toString();
}
/**
* Used to define data objects that are used in the assessment plan, that do not appear in the referenced SSP.
*/
@MetaschemaAssembly(
formalName = "Local Definitions",
description = "Used to define data objects that are used in the assessment plan, that do not appear in the referenced SSP.",
name = "local-definitions",
metaschema = OscalArMetaschema.class
)
public static class LocalDefinitions {
@BoundAssembly(
useName = "objectives-and-methods",
maxOccurs = -1
)
@GroupAs(
name = "objectives-and-methods",
inJson = JsonGroupAsBehavior.LIST
)
private List _objectivesAndMethods;
@BoundAssembly(
useName = "activity",
maxOccurs = -1
)
@GroupAs(
name = "activities",
inJson = JsonGroupAsBehavior.LIST
)
private List _activities;
@BoundField(
useName = "remarks"
)
@BoundFieldValue(
typeAdapter = MarkupMultilineAdapter.class
)
private MarkupMultiline _remarks;
public LocalDefinitions() {
}
public List getObjectivesAndMethods() {
return _objectivesAndMethods;
}
public void setObjectivesAndMethods(List value) {
_objectivesAndMethods = value;
}
/**
* Add a new {@link LocalObjective} item to the underlying collection.
* @param item the item to add
* @return {@code true}
*/
public boolean addObjectivesAndMethods(LocalObjective item) {
LocalObjective value = ObjectUtils.requireNonNull(item,"item cannot be null");
if (_objectivesAndMethods == null) {
_objectivesAndMethods = new LinkedList<>();
}
return _objectivesAndMethods.add(value);
}
/**
* Remove the first matching {@link LocalObjective} item from the underlying collection.
* @param item the item to remove
* @return {@code true} if the item was removed or {@code false} otherwise
*/
public boolean removeObjectivesAndMethods(LocalObjective item) {
LocalObjective value = ObjectUtils.requireNonNull(item,"item cannot be null");
return _objectivesAndMethods == null ? false : _objectivesAndMethods.remove(value);
}
public List getActivities() {
return _activities;
}
public void setActivities(List value) {
_activities = value;
}
/**
* Add a new {@link Activity} item to the underlying collection.
* @param item the item to add
* @return {@code true}
*/
public boolean addActivity(Activity item) {
Activity value = ObjectUtils.requireNonNull(item,"item cannot be null");
if (_activities == null) {
_activities = new LinkedList<>();
}
return _activities.add(value);
}
/**
* Remove the first matching {@link Activity} item from the underlying collection.
* @param item the item to remove
* @return {@code true} if the item was removed or {@code false} otherwise
*/
public boolean removeActivity(Activity item) {
Activity value = ObjectUtils.requireNonNull(item,"item cannot be null");
return _activities == null ? false : _activities.remove(value);
}
public MarkupMultiline getRemarks() {
return _remarks;
}
public void setRemarks(MarkupMultiline value) {
_remarks = value;
}
@Override
public String toString() {
return new ReflectionToStringBuilder(this, MultilineRecursiveToStringStyle.MULTI_LINE_STYLE).toString();
}
}
}