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.constraint.IConstraint; 011import dev.metaschema.core.util.ObjectUtils; 012import dev.metaschema.databind.model.annotations.AllowedValue; 013import dev.metaschema.databind.model.annotations.AllowedValues; 014import dev.metaschema.databind.model.annotations.BoundField; 015import dev.metaschema.databind.model.annotations.BoundFlag; 016import dev.metaschema.databind.model.annotations.MetaschemaAssembly; 017import dev.metaschema.databind.model.annotations.ValueConstraints; 018import edu.umd.cs.findbugs.annotations.NonNull; 019import edu.umd.cs.findbugs.annotations.Nullable; 020import org.apache.commons.lang3.builder.ReflectionToStringBuilder; 021import org.apache.commons.lang3.builder.ToStringStyle; 022 023/** 024 * Describes requirements, incompatibilities and gaps that are identified between a target and source in a mapping item. 025 */ 026@MetaschemaAssembly( 027 formalName = "Relationship Qualifier", 028 description = "Describes requirements, incompatibilities and gaps that are identified between a target and source in a mapping item.", 029 name = "qualifier-item", 030 moduleClass = OscalMappingCommonModule.class 031) 032public class QualifierItem implements IBoundObject { 033 private final IMetaschemaData __metaschemaData; 034 035 /** 036 * The focus of the qualifier. 037 */ 038 @BoundFlag( 039 formalName = "Subject", 040 description = "The focus of the qualifier.", 041 name = "subject", 042 required = true, 043 typeAdapter = StringAdapter.class, 044 valueConstraints = @ValueConstraints(allowedValues = @AllowedValues(level = IConstraint.Level.ERROR, values = {@AllowedValue(value = "source", description = "This qualifier is related to the source in the mapped relationship."), @AllowedValue(value = "target", description = "This qualifier is related to the target in the mapped relationship."), @AllowedValue(value = "both", description = "This qualifier is related to both the source and target in the mapped relationship.")})) 045 ) 046 private String _subject; 047 048 /** 049 * The predicate describes how the qualifer applies to the subject. 050 */ 051 @BoundFlag( 052 formalName = "Predicate", 053 description = "The predicate describes how the qualifer applies to the subject.", 054 name = "predicate", 055 required = true, 056 typeAdapter = StringAdapter.class, 057 valueConstraints = @ValueConstraints(allowedValues = @AllowedValues(level = IConstraint.Level.ERROR, values = {@AllowedValue(value = "has-requirement", description = "The subject has a requirement that must be met for the relationship to be satisfied."), @AllowedValue(value = "has-incompatibility", description = "The subject has an incompatibility which impacts the relationship.")})) 058 ) 059 private String _predicate; 060 061 /** 062 * The category expresses the resolvable nature of the predicate. 063 */ 064 @BoundFlag( 065 formalName = "Category", 066 description = "The category expresses the resolvable nature of the predicate.", 067 name = "category", 068 required = true, 069 typeAdapter = StringAdapter.class, 070 valueConstraints = @ValueConstraints(allowedValues = @AllowedValues(level = IConstraint.Level.ERROR, values = {@AllowedValue(value = "restricted", description = "A restriction exists, and is defined in the description."), @AllowedValue(value = "addressable", description = "The qualifier is addressable, and is outlined in the description."), @AllowedValue(value = "blocked", description = "The mapping is blocked due to the reason noted in the description.")})) 071 ) 072 private String _category; 073 074 /** 075 * Details that outline what requirements must be met, or cannot be met. If the qualifier identifies a gap, this should idenfity the gap, and any incompatibilities. 076 */ 077 @BoundField( 078 formalName = "Description of the qualifier", 079 description = "Details that outline what requirements must be met, or cannot be met. If the qualifier identifies a gap, this should idenfity the gap, and any incompatibilities.", 080 useName = "description", 081 minOccurs = 1, 082 typeAdapter = MarkupMultilineAdapter.class 083 ) 084 private MarkupMultiline _description; 085 086 /** 087 * Additional commentary about the containing object. 088 */ 089 @BoundField( 090 formalName = "Remarks", 091 description = "Additional commentary about the containing object.", 092 useName = "remarks", 093 typeAdapter = MarkupMultilineAdapter.class 094 ) 095 private MarkupMultiline _remarks; 096 097 /** 098 * Constructs a new {@code dev.metaschema.oscal.lib.model.QualifierItem} instance with no metadata. 099 */ 100 public QualifierItem() { 101 this(null); 102 } 103 104 /** 105 * Constructs a new {@code dev.metaschema.oscal.lib.model.QualifierItem} instance with the specified metadata. 106 * 107 * @param data 108 * the metaschema data, or {@code null} if none 109 */ 110 public QualifierItem(IMetaschemaData data) { 111 this.__metaschemaData = data; 112 } 113 114 @Override 115 public IMetaschemaData getMetaschemaData() { 116 return __metaschemaData; 117 } 118 119 /** 120 * Get the "{@literal Subject}". 121 * 122 * <p> 123 * The focus of the qualifier. 124 * 125 * @return the subject value 126 */ 127 @NonNull 128 public String getSubject() { 129 return _subject; 130 } 131 132 /** 133 * Set the "{@literal Subject}". 134 * 135 * <p> 136 * The focus of the qualifier. 137 * 138 * @param value 139 * the subject value to set 140 */ 141 public void setSubject(@NonNull String value) { 142 _subject = value; 143 } 144 145 /** 146 * Get the "{@literal Predicate}". 147 * 148 * <p> 149 * The predicate describes how the qualifer applies to the subject. 150 * 151 * @return the predicate value 152 */ 153 @NonNull 154 public String getPredicate() { 155 return _predicate; 156 } 157 158 /** 159 * Set the "{@literal Predicate}". 160 * 161 * <p> 162 * The predicate describes how the qualifer applies to the subject. 163 * 164 * @param value 165 * the predicate value to set 166 */ 167 public void setPredicate(@NonNull String value) { 168 _predicate = value; 169 } 170 171 /** 172 * Get the "{@literal Category}". 173 * 174 * <p> 175 * The category expresses the resolvable nature of the predicate. 176 * 177 * @return the category value 178 */ 179 @NonNull 180 public String getCategory() { 181 return _category; 182 } 183 184 /** 185 * Set the "{@literal Category}". 186 * 187 * <p> 188 * The category expresses the resolvable nature of the predicate. 189 * 190 * @param value 191 * the category value to set 192 */ 193 public void setCategory(@NonNull String value) { 194 _category = value; 195 } 196 197 /** 198 * Get the "{@literal Description of the qualifier}". 199 * 200 * <p> 201 * Details that outline what requirements must be met, or cannot be met. If the qualifier identifies a gap, this should idenfity the gap, and any incompatibilities. 202 * 203 * @return the description value 204 */ 205 @NonNull 206 public MarkupMultiline getDescription() { 207 return _description; 208 } 209 210 /** 211 * Set the "{@literal Description of the qualifier}". 212 * 213 * <p> 214 * Details that outline what requirements must be met, or cannot be met. If the qualifier identifies a gap, this should idenfity the gap, and any incompatibilities. 215 * 216 * @param value 217 * the description value to set 218 */ 219 public void setDescription(@NonNull MarkupMultiline value) { 220 _description = value; 221 } 222 223 /** 224 * Get the "{@literal Remarks}". 225 * 226 * <p> 227 * Additional commentary about the containing object. 228 * 229 * @return the remarks value, or {@code null} if not set 230 */ 231 @Nullable 232 public MarkupMultiline getRemarks() { 233 return _remarks; 234 } 235 236 /** 237 * Set the "{@literal Remarks}". 238 * 239 * <p> 240 * Additional commentary about the containing object. 241 * 242 * @param value 243 * the remarks value to set, or {@code null} to clear 244 */ 245 public void setRemarks(@Nullable MarkupMultiline value) { 246 _remarks = value; 247 } 248 249 @Override 250 public String toString() { 251 return ObjectUtils.notNull(new ReflectionToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).toString()); 252 } 253}