001// Generated from: ../../../../../../../../oscal/src/metaschema/oscal_assessment-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.datatype.markup.MarkupMultiline; 007import dev.metaschema.core.datatype.markup.MarkupMultilineAdapter; 008import dev.metaschema.core.model.IBoundObject; 009import dev.metaschema.core.model.IMetaschemaData; 010import dev.metaschema.core.model.JsonGroupAsBehavior; 011import dev.metaschema.core.util.ObjectUtils; 012import dev.metaschema.databind.model.annotations.BoundAssembly; 013import dev.metaschema.databind.model.annotations.BoundField; 014import dev.metaschema.databind.model.annotations.BoundFlag; 015import dev.metaschema.databind.model.annotations.GroupAs; 016import dev.metaschema.databind.model.annotations.MetaschemaAssembly; 017import edu.umd.cs.findbugs.annotations.NonNull; 018import edu.umd.cs.findbugs.annotations.Nullable; 019import java.util.LinkedList; 020import java.util.List; 021import java.util.UUID; 022import org.apache.commons.lang3.builder.ReflectionToStringBuilder; 023import org.apache.commons.lang3.builder.ToStringStyle; 024 025/** 026 * A local definition of a control objective. Uses catalog syntax for control objective and assessment activities. 027 */ 028@MetaschemaAssembly( 029 formalName = "Assessment Method", 030 description = "A local definition of a control objective. Uses catalog syntax for control objective and assessment activities.", 031 name = "assessment-method", 032 moduleClass = OscalAssessmentCommonModule.class 033) 034public class AssessmentMethod implements IBoundObject { 035 private final IMetaschemaData __metaschemaData; 036 037 /** 038 * 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 assessment method elsewhere in <a href="https://pages.nist.gov/OSCAL/concepts/identifier-use/#scope">this or other OSCAL instances</a>. The locally defined <em>UUID</em> of the <code>assessment method</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. 039 */ 040 @BoundFlag( 041 formalName = "Assessment Method Universally Unique Identifier", 042 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 assessment method elsewhere in [this or other OSCAL instances](https://pages.nist.gov/OSCAL/concepts/identifier-use/#scope). The locally defined *UUID* of the `assessment method` 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.", 043 name = "uuid", 044 required = true, 045 typeAdapter = UuidAdapter.class 046 ) 047 private UUID _uuid; 048 049 /** 050 * A human-readable description of this assessment method. 051 */ 052 @BoundField( 053 formalName = "Assessment Method Description", 054 description = "A human-readable description of this assessment method.", 055 useName = "description", 056 typeAdapter = MarkupMultilineAdapter.class 057 ) 058 private MarkupMultiline _description; 059 060 /** 061 * An attribute, characteristic, or quality of the containing object expressed as a namespace qualified name/value pair. 062 */ 063 @BoundAssembly( 064 formalName = "Property", 065 description = "An attribute, characteristic, or quality of the containing object expressed as a namespace qualified name/value pair.", 066 useName = "prop", 067 maxOccurs = -1, 068 groupAs = @GroupAs(name = "props", inJson = JsonGroupAsBehavior.LIST) 069 ) 070 private List<Property> _props; 071 072 /** 073 * A reference to a local or remote resource, that has a specific relation to the containing object. 074 */ 075 @BoundAssembly( 076 formalName = "Link", 077 description = "A reference to a local or remote resource, that has a specific relation to the containing object.", 078 useName = "link", 079 maxOccurs = -1, 080 groupAs = @GroupAs(name = "links", inJson = JsonGroupAsBehavior.LIST) 081 ) 082 private List<Link> _links; 083 084 /** 085 * A partition of an assessment plan or results or a child of another part. 086 */ 087 @BoundAssembly( 088 formalName = "Assessment Part", 089 description = "A partition of an assessment plan or results or a child of another part.", 090 useName = "part", 091 minOccurs = 1 092 ) 093 private AssessmentPart _part; 094 095 /** 096 * Additional commentary about the containing object. 097 */ 098 @BoundField( 099 formalName = "Remarks", 100 description = "Additional commentary about the containing object.", 101 useName = "remarks", 102 typeAdapter = MarkupMultilineAdapter.class 103 ) 104 private MarkupMultiline _remarks; 105 106 /** 107 * Constructs a new {@code dev.metaschema.oscal.lib.model.AssessmentMethod} instance with no metadata. 108 */ 109 public AssessmentMethod() { 110 this(null); 111 } 112 113 /** 114 * Constructs a new {@code dev.metaschema.oscal.lib.model.AssessmentMethod} instance with the specified metadata. 115 * 116 * @param data 117 * the metaschema data, or {@code null} if none 118 */ 119 public AssessmentMethod(IMetaschemaData data) { 120 this.__metaschemaData = data; 121 } 122 123 @Override 124 public IMetaschemaData getMetaschemaData() { 125 return __metaschemaData; 126 } 127 128 /** 129 * Get the "{@literal Assessment Method Universally Unique Identifier}". 130 * 131 * <p> 132 * 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 assessment method elsewhere in <a href="https://pages.nist.gov/OSCAL/concepts/identifier-use/#scope">this or other OSCAL instances</a>. The locally defined <em>UUID</em> of the <code>assessment method</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. 133 * 134 * @return the uuid value 135 */ 136 @NonNull 137 public UUID getUuid() { 138 return _uuid; 139 } 140 141 /** 142 * Set the "{@literal Assessment Method Universally Unique Identifier}". 143 * 144 * <p> 145 * 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 assessment method elsewhere in <a href="https://pages.nist.gov/OSCAL/concepts/identifier-use/#scope">this or other OSCAL instances</a>. The locally defined <em>UUID</em> of the <code>assessment method</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. 146 * 147 * @param value 148 * the uuid value to set 149 */ 150 public void setUuid(@NonNull UUID value) { 151 _uuid = value; 152 } 153 154 /** 155 * Get the "{@literal Assessment Method Description}". 156 * 157 * <p> 158 * A human-readable description of this assessment method. 159 * 160 * @return the description value, or {@code null} if not set 161 */ 162 @Nullable 163 public MarkupMultiline getDescription() { 164 return _description; 165 } 166 167 /** 168 * Set the "{@literal Assessment Method Description}". 169 * 170 * <p> 171 * A human-readable description of this assessment method. 172 * 173 * @param value 174 * the description value to set, or {@code null} to clear 175 */ 176 public void setDescription(@Nullable MarkupMultiline value) { 177 _description = value; 178 } 179 180 /** 181 * Get the "{@literal Property}". 182 * 183 * <p> 184 * An attribute, characteristic, or quality of the containing object expressed as a namespace qualified name/value pair. 185 * 186 * @return the prop value 187 */ 188 @NonNull 189 public List<Property> getProps() { 190 if (_props == null) { 191 _props = new LinkedList<>(); 192 } 193 return ObjectUtils.notNull(_props); 194 } 195 196 /** 197 * Set the "{@literal Property}". 198 * 199 * <p> 200 * An attribute, characteristic, or quality of the containing object expressed as a namespace qualified name/value pair. 201 * 202 * @param value 203 * the prop value to set 204 */ 205 public void setProps(@NonNull List<Property> value) { 206 _props = value; 207 } 208 209 /** 210 * Add a new {@link Property} item to the underlying collection. 211 * @param item the item to add 212 * @return {@code true} 213 */ 214 public boolean addProp(Property item) { 215 Property value = ObjectUtils.requireNonNull(item,"item cannot be null"); 216 if (_props == null) { 217 _props = new LinkedList<>(); 218 } 219 return _props.add(value); 220 } 221 222 /** 223 * Remove the first matching {@link Property} item from the underlying collection. 224 * @param item the item to remove 225 * @return {@code true} if the item was removed or {@code false} otherwise 226 */ 227 public boolean removeProp(Property item) { 228 Property value = ObjectUtils.requireNonNull(item,"item cannot be null"); 229 return _props != null && _props.remove(value); 230 } 231 232 /** 233 * Get the "{@literal Link}". 234 * 235 * <p> 236 * A reference to a local or remote resource, that has a specific relation to the containing object. 237 * 238 * @return the link value 239 */ 240 @NonNull 241 public List<Link> getLinks() { 242 if (_links == null) { 243 _links = new LinkedList<>(); 244 } 245 return ObjectUtils.notNull(_links); 246 } 247 248 /** 249 * Set the "{@literal Link}". 250 * 251 * <p> 252 * A reference to a local or remote resource, that has a specific relation to the containing object. 253 * 254 * @param value 255 * the link value to set 256 */ 257 public void setLinks(@NonNull List<Link> value) { 258 _links = value; 259 } 260 261 /** 262 * Add a new {@link Link} item to the underlying collection. 263 * @param item the item to add 264 * @return {@code true} 265 */ 266 public boolean addLink(Link item) { 267 Link value = ObjectUtils.requireNonNull(item,"item cannot be null"); 268 if (_links == null) { 269 _links = new LinkedList<>(); 270 } 271 return _links.add(value); 272 } 273 274 /** 275 * Remove the first matching {@link Link} item from the underlying collection. 276 * @param item the item to remove 277 * @return {@code true} if the item was removed or {@code false} otherwise 278 */ 279 public boolean removeLink(Link item) { 280 Link value = ObjectUtils.requireNonNull(item,"item cannot be null"); 281 return _links != null && _links.remove(value); 282 } 283 284 /** 285 * Get the "{@literal Assessment Part}". 286 * 287 * <p> 288 * A partition of an assessment plan or results or a child of another part. 289 * 290 * @return the part value 291 */ 292 @NonNull 293 public AssessmentPart getPart() { 294 return _part; 295 } 296 297 /** 298 * Set the "{@literal Assessment Part}". 299 * 300 * <p> 301 * A partition of an assessment plan or results or a child of another part. 302 * 303 * @param value 304 * the part value to set 305 */ 306 public void setPart(@NonNull AssessmentPart value) { 307 _part = value; 308 } 309 310 /** 311 * Get the "{@literal Remarks}". 312 * 313 * <p> 314 * Additional commentary about the containing object. 315 * 316 * @return the remarks value, or {@code null} if not set 317 */ 318 @Nullable 319 public MarkupMultiline getRemarks() { 320 return _remarks; 321 } 322 323 /** 324 * Set the "{@literal Remarks}". 325 * 326 * <p> 327 * Additional commentary about the containing object. 328 * 329 * @param value 330 * the remarks value to set, or {@code null} to clear 331 */ 332 public void setRemarks(@Nullable MarkupMultiline value) { 333 _remarks = value; 334 } 335 336 @Override 337 public String toString() { 338 return ObjectUtils.notNull(new ReflectionToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).toString()); 339 } 340}