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.StringAdapter;
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.model.constraint.IConstraint;
012import dev.metaschema.core.util.ObjectUtils;
013import dev.metaschema.databind.model.annotations.AllowedValue;
014import dev.metaschema.databind.model.annotations.AllowedValues;
015import dev.metaschema.databind.model.annotations.BoundAssembly;
016import dev.metaschema.databind.model.annotations.BoundField;
017import dev.metaschema.databind.model.annotations.BoundFlag;
018import dev.metaschema.databind.model.annotations.GroupAs;
019import dev.metaschema.databind.model.annotations.MetaschemaAssembly;
020import dev.metaschema.databind.model.annotations.ValueConstraints;
021import edu.umd.cs.findbugs.annotations.NonNull;
022import edu.umd.cs.findbugs.annotations.Nullable;
023import java.util.LinkedList;
024import java.util.List;
025import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
026import org.apache.commons.lang3.builder.ToStringStyle;
027
028/**
029 * Describes requirements, incompatibilities and gaps that are identified between a target and source in a mapping item.
030 */
031@MetaschemaAssembly(
032    formalName = "Mapping Provenance",
033    description = "Describes requirements, incompatibilities and gaps that are identified between a target and source in a mapping item.",
034    name = "mapping-provenance",
035    moduleClass = OscalMappingCommonModule.class
036)
037public class MappingProvenance implements IBoundObject {
038  private final IMetaschemaData __metaschemaData;
039
040  /**
041   * The method used to complete the overall mapping.
042   */
043  @BoundFlag(
044      formalName = "Method",
045      description = "The method used to complete the overall mapping.",
046      name = "method",
047      required = true,
048      typeAdapter = StringAdapter.class,
049      valueConstraints = @ValueConstraints(allowedValues = @AllowedValues(level = IConstraint.Level.ERROR, values = {@AllowedValue(value = "human", description = "Human"), @AllowedValue(value = "automation", description = "Automation"), @AllowedValue(value = "hybrid", description = "Hybrid")}))
050  )
051  private String _method;
052
053  /**
054   * The method used for relating controls within the mapping. The supported methods are aligned with the <a href="https://doi.org/10.6028/NIST.IR.8477">NIST Interagency Report (IR) 8477</a>, Section 4.3 Set Theory Relationship Mapping.
055   */
056  @BoundFlag(
057      formalName = "Matching",
058      description = "The method used for relating controls within the mapping. The supported methods are aligned with the [NIST Interagency Report (IR) 8477](https://doi.org/10.6028/NIST.IR.8477), Section 4.3 Set Theory Relationship Mapping.",
059      name = "matching-rationale",
060      required = true,
061      typeAdapter = StringAdapter.class,
062      valueConstraints = @ValueConstraints(allowedValues = @AllowedValues(level = IConstraint.Level.ERROR, values = {@AllowedValue(value = "syntactic", description = "Syntactic: How similar is the *wording* that expresses the two concepts. This is a word-for-word analysis of the relationship, not an interpretation of the language."), @AllowedValue(value = "semantic", description = "Semantic: How similar are the *meanings* of the two concepts? This involves some interpretation of each concept’s language."), @AllowedValue(value = "functional", description = "Functional: How similar are the *results* of executing the two concepts? This involves understanding what will happen if the two concepts are implemented, performed, or otherwise executed.")}))
063  )
064  private String _matchingRationale;
065
066  /**
067   * The current status of this mapping document.
068   */
069  @BoundFlag(
070      formalName = "Status",
071      description = "The current status of this mapping document.",
072      name = "status",
073      required = true,
074      typeAdapter = StringAdapter.class,
075      valueConstraints = @ValueConstraints(allowedValues = @AllowedValues(level = IConstraint.Level.ERROR, values = {@AllowedValue(value = "complete", description = "Complete"), @AllowedValue(value = "not-complete", description = "Not Complete"), @AllowedValue(value = "draft", description = "Draft"), @AllowedValue(value = "deprecated", description = "Deprecated"), @AllowedValue(value = "superseded", description = "Superseded")}))
076  )
077  private String _status;
078
079  /**
080   * This records either a string category or a decimal value from 0-1 representing a percentage. Both of these values describe an estimation of the author's confidence that this mapping is correct and accurate.
081   */
082  @BoundField(
083      formalName = "Confidence Score",
084      description = "This records either a string category or a decimal value from 0-1 representing a percentage. Both of these values describe an estimation of the author's confidence that this mapping is correct and accurate.",
085      useName = "confidence-score"
086  )
087  private ConfidenceScore _confidenceScore;
088
089  /**
090   * A decimal value from 0-1, representing the percentage coverage of the targets by the sources.
091   */
092  @BoundField(
093      formalName = "Coverage",
094      description = "A decimal value from 0-1, representing the percentage coverage of the targets by the sources.",
095      useName = "coverage"
096  )
097  private Coverage _coverage;
098
099  /**
100   * Description of the context and intended use of the mapping set.
101   */
102  @BoundField(
103      formalName = "Mapping Description",
104      description = "Description of the context and intended use of the mapping set.",
105      useName = "mapping-description",
106      minOccurs = 1,
107      typeAdapter = MarkupMultilineAdapter.class
108  )
109  private MarkupMultiline _mappingDescription;
110
111  /**
112   * A reference to a set of persons and/or organizations that have responsibility for performing the referenced role in the context of the containing object.
113   */
114  @BoundAssembly(
115      formalName = "Responsible Party",
116      description = "A reference to a set of persons and/or organizations that have responsibility for performing the referenced role in the context of the containing object.",
117      useName = "responsible-party",
118      maxOccurs = -1,
119      groupAs = @GroupAs(name = "responsible-parties", inJson = JsonGroupAsBehavior.LIST)
120  )
121  private List<ResponsibleParty> _responsibleParties;
122
123  /**
124   * An attribute, characteristic, or quality of the containing object expressed as a namespace qualified name/value pair.
125   */
126  @BoundAssembly(
127      formalName = "Property",
128      description = "An attribute, characteristic, or quality of the containing object expressed as a namespace qualified name/value pair.",
129      useName = "prop",
130      maxOccurs = -1,
131      groupAs = @GroupAs(name = "props", inJson = JsonGroupAsBehavior.LIST)
132  )
133  private List<Property> _props;
134
135  /**
136   * A reference to a local or remote resource, that has a specific relation to the containing object.
137   */
138  @BoundAssembly(
139      formalName = "Link",
140      description = "A reference to a local or remote resource, that has a specific relation to the containing object.",
141      useName = "link",
142      maxOccurs = -1,
143      groupAs = @GroupAs(name = "links", inJson = JsonGroupAsBehavior.LIST)
144  )
145  private List<Link> _links;
146
147  /**
148   * Additional commentary about the containing object.
149   */
150  @BoundField(
151      formalName = "Remarks",
152      description = "Additional commentary about the containing object.",
153      useName = "remarks",
154      typeAdapter = MarkupMultilineAdapter.class
155  )
156  private MarkupMultiline _remarks;
157
158  /**
159   * Constructs a new {@code dev.metaschema.oscal.lib.model.MappingProvenance} instance with no metadata.
160   */
161  public MappingProvenance() {
162    this(null);
163  }
164
165  /**
166   * Constructs a new {@code dev.metaschema.oscal.lib.model.MappingProvenance} instance with the specified metadata.
167   *
168   * @param data
169   *           the metaschema data, or {@code null} if none
170   */
171  public MappingProvenance(IMetaschemaData data) {
172    this.__metaschemaData = data;
173  }
174
175  @Override
176  public IMetaschemaData getMetaschemaData() {
177    return __metaschemaData;
178  }
179
180  /**
181   * Get the "{@literal Method}".
182   *
183   * <p>
184   * The method used to complete the overall mapping.
185   *
186   * @return the method value
187   */
188  @NonNull
189  public String getMethod() {
190    return _method;
191  }
192
193  /**
194   * Set the "{@literal Method}".
195   *
196   * <p>
197   * The method used to complete the overall mapping.
198   *
199   * @param value
200   *           the method value to set
201   */
202  public void setMethod(@NonNull String value) {
203    _method = value;
204  }
205
206  /**
207   * Get the "{@literal Matching}".
208   *
209   * <p>
210   * The method used for relating controls within the mapping. The supported methods are aligned with the <a href="https://doi.org/10.6028/NIST.IR.8477">NIST Interagency Report (IR) 8477</a>, Section 4.3 Set Theory Relationship Mapping.
211   *
212   * @return the matching-rationale value
213   */
214  @NonNull
215  public String getMatchingRationale() {
216    return _matchingRationale;
217  }
218
219  /**
220   * Set the "{@literal Matching}".
221   *
222   * <p>
223   * The method used for relating controls within the mapping. The supported methods are aligned with the <a href="https://doi.org/10.6028/NIST.IR.8477">NIST Interagency Report (IR) 8477</a>, Section 4.3 Set Theory Relationship Mapping.
224   *
225   * @param value
226   *           the matching-rationale value to set
227   */
228  public void setMatchingRationale(@NonNull String value) {
229    _matchingRationale = value;
230  }
231
232  /**
233   * Get the "{@literal Status}".
234   *
235   * <p>
236   * The current status of this mapping document.
237   *
238   * @return the status value
239   */
240  @NonNull
241  public String getStatus() {
242    return _status;
243  }
244
245  /**
246   * Set the "{@literal Status}".
247   *
248   * <p>
249   * The current status of this mapping document.
250   *
251   * @param value
252   *           the status value to set
253   */
254  public void setStatus(@NonNull String value) {
255    _status = value;
256  }
257
258  /**
259   * Get the "{@literal Confidence Score}".
260   *
261   * <p>
262   * This records either a string category or a decimal value from 0-1 representing a percentage. Both of these values describe an estimation of the author's confidence that this mapping is correct and accurate.
263   *
264   * @return the confidence-score value, or {@code null} if not set
265   */
266  @Nullable
267  public ConfidenceScore getConfidenceScore() {
268    return _confidenceScore;
269  }
270
271  /**
272   * Set the "{@literal Confidence Score}".
273   *
274   * <p>
275   * This records either a string category or a decimal value from 0-1 representing a percentage. Both of these values describe an estimation of the author's confidence that this mapping is correct and accurate.
276   *
277   * @param value
278   *           the confidence-score value to set, or {@code null} to clear
279   */
280  public void setConfidenceScore(@Nullable ConfidenceScore value) {
281    _confidenceScore = value;
282  }
283
284  /**
285   * Get the "{@literal Coverage}".
286   *
287   * <p>
288   * A decimal value from 0-1, representing the percentage coverage of the targets by the sources.
289   *
290   * @return the coverage value, or {@code null} if not set
291   */
292  @Nullable
293  public Coverage getCoverage() {
294    return _coverage;
295  }
296
297  /**
298   * Set the "{@literal Coverage}".
299   *
300   * <p>
301   * A decimal value from 0-1, representing the percentage coverage of the targets by the sources.
302   *
303   * @param value
304   *           the coverage value to set, or {@code null} to clear
305   */
306  public void setCoverage(@Nullable Coverage value) {
307    _coverage = value;
308  }
309
310  /**
311   * Get the "{@literal Mapping Description}".
312   *
313   * <p>
314   * Description of the context and intended use of the mapping set.
315   *
316   * @return the mapping-description value
317   */
318  @NonNull
319  public MarkupMultiline getMappingDescription() {
320    return _mappingDescription;
321  }
322
323  /**
324   * Set the "{@literal Mapping Description}".
325   *
326   * <p>
327   * Description of the context and intended use of the mapping set.
328   *
329   * @param value
330   *           the mapping-description value to set
331   */
332  public void setMappingDescription(@NonNull MarkupMultiline value) {
333    _mappingDescription = value;
334  }
335
336  /**
337   * Get the "{@literal Responsible Party}".
338   *
339   * <p>
340   * A reference to a set of persons and/or organizations that have responsibility for performing the referenced role in the context of the containing object.
341   *
342   * @return the responsible-party value
343   */
344  @NonNull
345  public List<ResponsibleParty> getResponsibleParties() {
346    if (_responsibleParties == null) {
347      _responsibleParties = new LinkedList<>();
348    }
349    return ObjectUtils.notNull(_responsibleParties);
350  }
351
352  /**
353   * Set the "{@literal Responsible Party}".
354   *
355   * <p>
356   * A reference to a set of persons and/or organizations that have responsibility for performing the referenced role in the context of the containing object.
357   *
358   * @param value
359   *           the responsible-party value to set
360   */
361  public void setResponsibleParties(@NonNull List<ResponsibleParty> value) {
362    _responsibleParties = value;
363  }
364
365  /**
366   * Add a new {@link ResponsibleParty} item to the underlying collection.
367   * @param item the item to add
368   * @return {@code true}
369   */
370  public boolean addResponsibleParty(ResponsibleParty item) {
371    ResponsibleParty value = ObjectUtils.requireNonNull(item,"item cannot be null");
372    if (_responsibleParties == null) {
373      _responsibleParties = new LinkedList<>();
374    }
375    return _responsibleParties.add(value);
376  }
377
378  /**
379   * Remove the first matching {@link ResponsibleParty} item from the underlying collection.
380   * @param item the item to remove
381   * @return {@code true} if the item was removed or {@code false} otherwise
382   */
383  public boolean removeResponsibleParty(ResponsibleParty item) {
384    ResponsibleParty value = ObjectUtils.requireNonNull(item,"item cannot be null");
385    return _responsibleParties != null && _responsibleParties.remove(value);
386  }
387
388  /**
389   * Get the "{@literal Property}".
390   *
391   * <p>
392   * An attribute, characteristic, or quality of the containing object expressed as a namespace qualified name/value pair.
393   *
394   * @return the prop value
395   */
396  @NonNull
397  public List<Property> getProps() {
398    if (_props == null) {
399      _props = new LinkedList<>();
400    }
401    return ObjectUtils.notNull(_props);
402  }
403
404  /**
405   * Set the "{@literal Property}".
406   *
407   * <p>
408   * An attribute, characteristic, or quality of the containing object expressed as a namespace qualified name/value pair.
409   *
410   * @param value
411   *           the prop value to set
412   */
413  public void setProps(@NonNull List<Property> value) {
414    _props = value;
415  }
416
417  /**
418   * Add a new {@link Property} item to the underlying collection.
419   * @param item the item to add
420   * @return {@code true}
421   */
422  public boolean addProp(Property item) {
423    Property value = ObjectUtils.requireNonNull(item,"item cannot be null");
424    if (_props == null) {
425      _props = new LinkedList<>();
426    }
427    return _props.add(value);
428  }
429
430  /**
431   * Remove the first matching {@link Property} item from the underlying collection.
432   * @param item the item to remove
433   * @return {@code true} if the item was removed or {@code false} otherwise
434   */
435  public boolean removeProp(Property item) {
436    Property value = ObjectUtils.requireNonNull(item,"item cannot be null");
437    return _props != null && _props.remove(value);
438  }
439
440  /**
441   * Get the "{@literal Link}".
442   *
443   * <p>
444   * A reference to a local or remote resource, that has a specific relation to the containing object.
445   *
446   * @return the link value
447   */
448  @NonNull
449  public List<Link> getLinks() {
450    if (_links == null) {
451      _links = new LinkedList<>();
452    }
453    return ObjectUtils.notNull(_links);
454  }
455
456  /**
457   * Set the "{@literal Link}".
458   *
459   * <p>
460   * A reference to a local or remote resource, that has a specific relation to the containing object.
461   *
462   * @param value
463   *           the link value to set
464   */
465  public void setLinks(@NonNull List<Link> value) {
466    _links = value;
467  }
468
469  /**
470   * Add a new {@link Link} item to the underlying collection.
471   * @param item the item to add
472   * @return {@code true}
473   */
474  public boolean addLink(Link item) {
475    Link value = ObjectUtils.requireNonNull(item,"item cannot be null");
476    if (_links == null) {
477      _links = new LinkedList<>();
478    }
479    return _links.add(value);
480  }
481
482  /**
483   * Remove the first matching {@link Link} item from the underlying collection.
484   * @param item the item to remove
485   * @return {@code true} if the item was removed or {@code false} otherwise
486   */
487  public boolean removeLink(Link item) {
488    Link value = ObjectUtils.requireNonNull(item,"item cannot be null");
489    return _links != null && _links.remove(value);
490  }
491
492  /**
493   * Get the "{@literal Remarks}".
494   *
495   * <p>
496   * Additional commentary about the containing object.
497   *
498   * @return the remarks value, or {@code null} if not set
499   */
500  @Nullable
501  public MarkupMultiline getRemarks() {
502    return _remarks;
503  }
504
505  /**
506   * Set the "{@literal Remarks}".
507   *
508   * <p>
509   * Additional commentary about the containing object.
510   *
511   * @param value
512   *           the remarks value to set, or {@code null} to clear
513   */
514  public void setRemarks(@Nullable MarkupMultiline value) {
515    _remarks = value;
516  }
517
518  @Override
519  public String toString() {
520    return ObjectUtils.notNull(new ReflectionToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).toString());
521  }
522}