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.util.ObjectUtils; 011import dev.metaschema.databind.model.annotations.BoundField; 012import dev.metaschema.databind.model.annotations.BoundFlag; 013import dev.metaschema.databind.model.annotations.MetaschemaAssembly; 014import edu.umd.cs.findbugs.annotations.NonNull; 015import edu.umd.cs.findbugs.annotations.Nullable; 016import java.util.UUID; 017import org.apache.commons.lang3.builder.ReflectionToStringBuilder; 018import org.apache.commons.lang3.builder.ToStringStyle; 019 020/** 021 * Relates the finding to a set of referenced risks that were used to determine the finding. 022 */ 023@MetaschemaAssembly( 024 formalName = "Associated Risk", 025 description = "Relates the finding to a set of referenced risks that were used to determine the finding.", 026 name = "associated-risk", 027 moduleClass = OscalAssessmentCommonModule.class 028) 029public class AssociatedRisk implements IBoundObject { 030 private final IMetaschemaData __metaschemaData; 031 032 /** 033 * A <a href="https://pages.nist.gov/OSCAL/concepts/identifier-use/#machine-oriented">machine-oriented</a> identifier reference to a risk defined in the list of risks. 034 */ 035 @BoundFlag( 036 formalName = "Risk Universally Unique Identifier Reference", 037 description = "A [machine-oriented](https://pages.nist.gov/OSCAL/concepts/identifier-use/#machine-oriented) identifier reference to a risk defined in the list of risks.", 038 name = "risk-uuid", 039 required = true, 040 typeAdapter = UuidAdapter.class 041 ) 042 private UUID _riskUuid; 043 044 /** 045 * Additional commentary about the containing object. 046 */ 047 @BoundField( 048 formalName = "Remarks", 049 description = "Additional commentary about the containing object.", 050 useName = "remarks", 051 typeAdapter = MarkupMultilineAdapter.class 052 ) 053 private MarkupMultiline _remarks; 054 055 /** 056 * Constructs a new {@code dev.metaschema.oscal.lib.model.AssociatedRisk} instance with no metadata. 057 */ 058 public AssociatedRisk() { 059 this(null); 060 } 061 062 /** 063 * Constructs a new {@code dev.metaschema.oscal.lib.model.AssociatedRisk} instance with the specified metadata. 064 * 065 * @param data 066 * the metaschema data, or {@code null} if none 067 */ 068 public AssociatedRisk(IMetaschemaData data) { 069 this.__metaschemaData = data; 070 } 071 072 @Override 073 public IMetaschemaData getMetaschemaData() { 074 return __metaschemaData; 075 } 076 077 /** 078 * Get the "{@literal Risk Universally Unique Identifier Reference}". 079 * 080 * <p> 081 * A <a href="https://pages.nist.gov/OSCAL/concepts/identifier-use/#machine-oriented">machine-oriented</a> identifier reference to a risk defined in the list of risks. 082 * 083 * @return the risk-uuid value 084 */ 085 @NonNull 086 public UUID getRiskUuid() { 087 return _riskUuid; 088 } 089 090 /** 091 * Set the "{@literal Risk Universally Unique Identifier Reference}". 092 * 093 * <p> 094 * A <a href="https://pages.nist.gov/OSCAL/concepts/identifier-use/#machine-oriented">machine-oriented</a> identifier reference to a risk defined in the list of risks. 095 * 096 * @param value 097 * the risk-uuid value to set 098 */ 099 public void setRiskUuid(@NonNull UUID value) { 100 _riskUuid = value; 101 } 102 103 /** 104 * Get the "{@literal Remarks}". 105 * 106 * <p> 107 * Additional commentary about the containing object. 108 * 109 * @return the remarks value, or {@code null} if not set 110 */ 111 @Nullable 112 public MarkupMultiline getRemarks() { 113 return _remarks; 114 } 115 116 /** 117 * Set the "{@literal Remarks}". 118 * 119 * <p> 120 * Additional commentary about the containing object. 121 * 122 * @param value 123 * the remarks value to set, or {@code null} to clear 124 */ 125 public void setRemarks(@Nullable MarkupMultiline value) { 126 _remarks = value; 127 } 128 129 @Override 130 public String toString() { 131 return ObjectUtils.notNull(new ReflectionToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).toString()); 132 } 133}