001// Generated from: ../../../../../../../../oscal/src/metaschema/oscal_mapping-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.UuidAdapter; 006import dev.metaschema.core.model.IBoundObject; 007import dev.metaschema.core.model.IMetaschemaData; 008import dev.metaschema.core.model.JsonGroupAsBehavior; 009import dev.metaschema.core.util.ObjectUtils; 010import dev.metaschema.databind.model.annotations.BoundAssembly; 011import dev.metaschema.databind.model.annotations.BoundFlag; 012import dev.metaschema.databind.model.annotations.GroupAs; 013import dev.metaschema.databind.model.annotations.MetaschemaAssembly; 014import edu.umd.cs.findbugs.annotations.NonNull; 015import java.util.LinkedList; 016import java.util.List; 017import java.util.UUID; 018import org.apache.commons.lang3.builder.ReflectionToStringBuilder; 019import org.apache.commons.lang3.builder.ToStringStyle; 020 021/** 022 * A <em>by-id</em> collection of all controls that were not mapped at all in this <code> mapping-collection</code>. If a control is partially mapped, the parts of the control are not mappable, the gap and discrepancies should be documented in the <code> relationship-gal</code>. 023 */ 024@MetaschemaAssembly( 025 formalName = "Gap Summary", 026 description = "A *by-id* collection of all controls that were not mapped at all in this ` mapping-collection`. If a control is partially mapped, the parts of the control are not mappable, the gap and discrepancies should be documented in the ` relationship-gal`.", 027 name = "gap-summary", 028 moduleClass = OscalMappingCommonModule.class 029) 030public class GapSummary implements IBoundObject { 031 private final IMetaschemaData __metaschemaData; 032 033 /** 034 * A <a href="https://pages.nist.gov/OSCAL/concepts/identifier-use/#machine-oriented">machine-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 mapping gap summary elsewhere in <a href="https://pages.nist.gov/OSCAL/concepts/identifier-use/#ssp-identifiers">this or other OSCAL instances</a>. The locally defined <em>UUID</em> of the <code>SSP</code> can be used to reference the data item locally or globally (e.g., in an imported OSCAL instance).This UUID 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 subject across revisions of the document. 035 */ 036 @BoundFlag( 037 formalName = "Gap Summary Universally Unique Identifier", 038 description = "A [machine-oriented](https://pages.nist.gov/OSCAL/concepts/identifier-use/#machine-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 mapping gap summary elsewhere in [this or other OSCAL instances](https://pages.nist.gov/OSCAL/concepts/identifier-use/#ssp-identifiers). The locally defined *UUID* of the `SSP` 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](https://pages.nist.gov/OSCAL/concepts/identifier-use/#consistency), which means it should be consistently used to identify the same subject across revisions of the document.", 039 name = "uuid", 040 required = true, 041 typeAdapter = UuidAdapter.class 042 ) 043 private UUID _uuid; 044 045 /** 046 * Select a control or controls from an imported control set. 047 */ 048 @BoundAssembly( 049 formalName = "Select Control", 050 description = "Select a control or controls from an imported control set.", 051 useName = "unmapped-controls", 052 remarks = "If `with-child-controls` is \"yes\" on the call to a control, any controls appearing within it (child controls) will be selected, with no additional `call` directives required. This flag provides a way to include controls with all their dependent controls (enhancements) without having to call them individually.", 053 minOccurs = 1, 054 maxOccurs = -1, 055 groupAs = @GroupAs(name = "unmapped-controls", inJson = JsonGroupAsBehavior.LIST) 056 ) 057 private List<SelectControlById> _unmappedControls; 058 059 /** 060 * Constructs a new {@code dev.metaschema.oscal.lib.model.GapSummary} instance with no metadata. 061 */ 062 public GapSummary() { 063 this(null); 064 } 065 066 /** 067 * Constructs a new {@code dev.metaschema.oscal.lib.model.GapSummary} instance with the specified metadata. 068 * 069 * @param data 070 * the metaschema data, or {@code null} if none 071 */ 072 public GapSummary(IMetaschemaData data) { 073 this.__metaschemaData = data; 074 } 075 076 @Override 077 public IMetaschemaData getMetaschemaData() { 078 return __metaschemaData; 079 } 080 081 /** 082 * Get the "{@literal Gap Summary Universally Unique Identifier}". 083 * 084 * <p> 085 * A <a href="https://pages.nist.gov/OSCAL/concepts/identifier-use/#machine-oriented">machine-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 mapping gap summary elsewhere in <a href="https://pages.nist.gov/OSCAL/concepts/identifier-use/#ssp-identifiers">this or other OSCAL instances</a>. The locally defined <em>UUID</em> of the <code>SSP</code> can be used to reference the data item locally or globally (e.g., in an imported OSCAL instance).This UUID 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 subject across revisions of the document. 086 * 087 * @return the uuid value 088 */ 089 @NonNull 090 public UUID getUuid() { 091 return _uuid; 092 } 093 094 /** 095 * Set the "{@literal Gap Summary Universally Unique Identifier}". 096 * 097 * <p> 098 * A <a href="https://pages.nist.gov/OSCAL/concepts/identifier-use/#machine-oriented">machine-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 mapping gap summary elsewhere in <a href="https://pages.nist.gov/OSCAL/concepts/identifier-use/#ssp-identifiers">this or other OSCAL instances</a>. The locally defined <em>UUID</em> of the <code>SSP</code> can be used to reference the data item locally or globally (e.g., in an imported OSCAL instance).This UUID 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 subject across revisions of the document. 099 * 100 * @param value 101 * the uuid value to set 102 */ 103 public void setUuid(@NonNull UUID value) { 104 _uuid = value; 105 } 106 107 /** 108 * Get the "{@literal Select Control}". 109 * 110 * <p> 111 * Select a control or controls from an imported control set. 112 * 113 * @return the unmapped-controls value 114 */ 115 @NonNull 116 public List<SelectControlById> getUnmappedControls() { 117 if (_unmappedControls == null) { 118 _unmappedControls = new LinkedList<>(); 119 } 120 return ObjectUtils.notNull(_unmappedControls); 121 } 122 123 /** 124 * Set the "{@literal Select Control}". 125 * 126 * <p> 127 * Select a control or controls from an imported control set. 128 * 129 * @param value 130 * the unmapped-controls value to set 131 */ 132 public void setUnmappedControls(@NonNull List<SelectControlById> value) { 133 _unmappedControls = value; 134 } 135 136 /** 137 * Add a new {@link SelectControlById} item to the underlying collection. 138 * @param item the item to add 139 * @return {@code true} 140 */ 141 public boolean addUnmappedControls(SelectControlById item) { 142 SelectControlById value = ObjectUtils.requireNonNull(item,"item cannot be null"); 143 if (_unmappedControls == null) { 144 _unmappedControls = new LinkedList<>(); 145 } 146 return _unmappedControls.add(value); 147 } 148 149 /** 150 * Remove the first matching {@link SelectControlById} item from the underlying collection. 151 * @param item the item to remove 152 * @return {@code true} if the item was removed or {@code false} otherwise 153 */ 154 public boolean removeUnmappedControls(SelectControlById item) { 155 SelectControlById value = ObjectUtils.requireNonNull(item,"item cannot be null"); 156 return _unmappedControls != null && _unmappedControls.remove(value); 157 } 158 159 @Override 160 public String toString() { 161 return ObjectUtils.notNull(new ReflectionToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).toString()); 162 } 163}