All Downloads are FREE. Search and download functionalities are using the official Maven repository.

gov.nist.secauto.oscal.lib.model.AssessmentSubject 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.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.binding.model.annotations.ValueConstraints;
import gov.nist.secauto.metaschema.model.common.JsonGroupAsBehavior;
import gov.nist.secauto.metaschema.model.common.constraint.IConstraint;
import gov.nist.secauto.metaschema.model.common.datatype.adapter.TokenAdapter;
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 org.apache.commons.lang3.builder.MultilineRecursiveToStringStyle;
import org.apache.commons.lang3.builder.ReflectionToStringBuilder;

/**
 * 

Identifies system elements being assessed, such as components, inventory items, and locations. In the assessment plan, this identifies a planned assessment subject. In the assessment results this is an actual assessment subject, and reflects any changes from the plan. exactly what will be the focus of this assessment. Any subjects not identified in this way are out-of-scope.

*/ @MetaschemaAssembly( formalName = "Subject of Assessment", description = "Identifies system elements being assessed, such as components, inventory items, and locations. In the assessment plan, this identifies a planned assessment subject. In the assessment results this is an actual assessment subject, and reflects any changes from the plan. exactly what will be the focus of this assessment. Any subjects not identified in this way are out-of-scope.", name = "assessment-subject", metaschema = OscalAssessmentCommonMetaschema.class, remarks = "Processing of an include/exclude pair starts with processing the include, then removing matching entries in the exclude." ) public class AssessmentSubject { @BoundFlag( formalName = "Subject Type", description = "Indicates the type of assessment subject, such as a component, inventory, item, location, or party represented by this selection statement.", useName = "type", required = true, typeAdapter = TokenAdapter.class ) @ValueConstraints( allowedValues = @AllowedValues(level = IConstraint.Level.ERROR, allowOthers = true, values = {@AllowedValue(value = "component", description = "The referenced assessment subject is a component defined in the SSP, or in the `local-definitions` of an Assessment Plan or Assessment Results."), @AllowedValue(value = "inventory-item", description = "The referenced assessment subject is a inventory item defined in the SSP, or in the `local-definitions` of an Assessment Plan or Assessment Results."), @AllowedValue(value = "location", description = "The referenced assessment subject is a `location` defined in the `metadata` of the SSP, Assessment Plan, or Assessment Results."), @AllowedValue(value = "party", description = "The referenced assessment subject is a person or team to interview, who is defined as a `party` in the `metadata` of the SSP, Assessment Plan, or Assessment Results."), @AllowedValue(value = "user", description = "The referenced assessment subject is a `user` defined in the SSP, or in the `local-definitions` of an Assessment Plan or Assessment Results.")}) ) private String _type; /** * "

A human-readable description of the collection of subjects being included in this assessment.

" */ @BoundField( formalName = "Include Subjects Description", description = "A human-readable description of the collection of subjects being included in this assessment.", useName = "description" ) @BoundFieldValue( typeAdapter = MarkupMultilineAdapter.class ) private MarkupMultiline _description; @BoundAssembly( useName = "prop", maxOccurs = -1 ) @GroupAs( name = "props", inJson = JsonGroupAsBehavior.LIST ) private List _props; @BoundAssembly( useName = "link", maxOccurs = -1 ) @GroupAs( name = "links", inJson = JsonGroupAsBehavior.LIST ) private List _links; @BoundAssembly( useName = "include-all", minOccurs = 1 ) private IncludeAll _includeAll; @BoundAssembly( useName = "include-subject", minOccurs = 1, maxOccurs = -1 ) @GroupAs( name = "include-subjects", inJson = JsonGroupAsBehavior.LIST ) private List _includeSubjects; @BoundAssembly( useName = "exclude-subject", maxOccurs = -1 ) @GroupAs( name = "exclude-subjects", inJson = JsonGroupAsBehavior.LIST ) private List _excludeSubjects; @BoundField( useName = "remarks" ) @BoundFieldValue( typeAdapter = MarkupMultilineAdapter.class ) private MarkupMultiline _remarks; public AssessmentSubject() { } public String getType() { return _type; } public void setType(String value) { _type = value; } public MarkupMultiline getDescription() { return _description; } public void setDescription(MarkupMultiline value) { _description = value; } public List getProps() { return _props; } public void setProps(List value) { _props = value; } /** * Add a new {@link Property} item to the underlying collection. * @param item the item to add * @return {@code true} */ public boolean addProp(Property item) { Property value = ObjectUtils.requireNonNull(item,"item cannot be null"); if (_props == null) { _props = new LinkedList<>(); } return _props.add(value); } /** * Remove the first matching {@link Property} 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 removeProp(Property item) { Property value = ObjectUtils.requireNonNull(item,"item cannot be null"); return _props == null ? false : _props.remove(value); } public List getLinks() { return _links; } public void setLinks(List value) { _links = value; } /** * Add a new {@link Link} item to the underlying collection. * @param item the item to add * @return {@code true} */ public boolean addLink(Link item) { Link value = ObjectUtils.requireNonNull(item,"item cannot be null"); if (_links == null) { _links = new LinkedList<>(); } return _links.add(value); } /** * Remove the first matching {@link Link} 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 removeLink(Link item) { Link value = ObjectUtils.requireNonNull(item,"item cannot be null"); return _links == null ? false : _links.remove(value); } public IncludeAll getIncludeAll() { return _includeAll; } public void setIncludeAll(IncludeAll value) { _includeAll = value; } public List getIncludeSubjects() { return _includeSubjects; } public void setIncludeSubjects(List value) { _includeSubjects = value; } /** * Add a new {@link SelectSubjectById} item to the underlying collection. * @param item the item to add * @return {@code true} */ public boolean addIncludeSubject(SelectSubjectById item) { SelectSubjectById value = ObjectUtils.requireNonNull(item,"item cannot be null"); if (_includeSubjects == null) { _includeSubjects = new LinkedList<>(); } return _includeSubjects.add(value); } /** * Remove the first matching {@link SelectSubjectById} 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 removeIncludeSubject(SelectSubjectById item) { SelectSubjectById value = ObjectUtils.requireNonNull(item,"item cannot be null"); return _includeSubjects == null ? false : _includeSubjects.remove(value); } public List getExcludeSubjects() { return _excludeSubjects; } public void setExcludeSubjects(List value) { _excludeSubjects = value; } /** * Add a new {@link SelectSubjectById} item to the underlying collection. * @param item the item to add * @return {@code true} */ public boolean addExcludeSubject(SelectSubjectById item) { SelectSubjectById value = ObjectUtils.requireNonNull(item,"item cannot be null"); if (_excludeSubjects == null) { _excludeSubjects = new LinkedList<>(); } return _excludeSubjects.add(value); } /** * Remove the first matching {@link SelectSubjectById} 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 removeExcludeSubject(SelectSubjectById item) { SelectSubjectById value = ObjectUtils.requireNonNull(item,"item cannot be null"); return _excludeSubjects == null ? false : _excludeSubjects.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(); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy