001// Generated from: ../../../../../../../../oscal/src/metaschema/oscal_ssp_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.util.ObjectUtils;
012import dev.metaschema.databind.model.annotations.BoundAssembly;
013import dev.metaschema.databind.model.annotations.BoundField;
014import dev.metaschema.databind.model.annotations.GroupAs;
015import dev.metaschema.databind.model.annotations.MetaschemaAssembly;
016import edu.umd.cs.findbugs.annotations.NonNull;
017import edu.umd.cs.findbugs.annotations.Nullable;
018import java.util.LinkedList;
019import java.util.List;
020import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
021import org.apache.commons.lang3.builder.ToStringStyle;
022
023/**
024 * The expected level of impact resulting from the described information.
025 */
026@MetaschemaAssembly(
027    formalName = "Impact Level",
028    description = "The expected level of impact resulting from the described information.",
029    name = "impact",
030    moduleClass = OscalSspModule.class
031)
032public class Impact implements IBoundObject {
033  private final IMetaschemaData __metaschemaData;
034
035  /**
036   * An attribute, characteristic, or quality of the containing object expressed as a namespace qualified name/value pair.
037   */
038  @BoundAssembly(
039      formalName = "Property",
040      description = "An attribute, characteristic, or quality of the containing object expressed as a namespace qualified name/value pair.",
041      useName = "prop",
042      maxOccurs = -1,
043      groupAs = @GroupAs(name = "props", inJson = JsonGroupAsBehavior.LIST)
044  )
045  private List<Property> _props;
046
047  /**
048   * A reference to a local or remote resource, that has a specific relation to the containing object.
049   */
050  @BoundAssembly(
051      formalName = "Link",
052      description = "A reference to a local or remote resource, that has a specific relation to the containing object.",
053      useName = "link",
054      maxOccurs = -1,
055      groupAs = @GroupAs(name = "links", inJson = JsonGroupAsBehavior.LIST)
056  )
057  private List<Link> _links;
058
059  /**
060   * The prescribed base (Confidentiality, Integrity, or Availability) security impact level.
061   */
062  @BoundField(
063      formalName = "Base Level (Confidentiality, Integrity, or Availability)",
064      description = "The prescribed base (Confidentiality, Integrity, or Availability) security impact level.",
065      useName = "base",
066      minOccurs = 1,
067      typeAdapter = StringAdapter.class
068  )
069  private String _base;
070
071  /**
072   * The selected (Confidentiality, Integrity, or Availability) security impact level.
073   */
074  @BoundField(
075      formalName = "Selected Level (Confidentiality, Integrity, or Availability)",
076      description = "The selected (Confidentiality, Integrity, or Availability) security impact level.",
077      useName = "selected",
078      typeAdapter = StringAdapter.class
079  )
080  private String _selected;
081
082  /**
083   * If the selected security level is different from the base security level, this contains the justification for the change.
084   */
085  @BoundField(
086      formalName = "Adjustment Justification",
087      description = "If the selected security level is different from the base security level, this contains the justification for the change.",
088      useName = "adjustment-justification",
089      typeAdapter = MarkupMultilineAdapter.class
090  )
091  private MarkupMultiline _adjustmentJustification;
092
093  /**
094   * Constructs a new {@code dev.metaschema.oscal.lib.model.Impact} instance with no metadata.
095   */
096  public Impact() {
097    this(null);
098  }
099
100  /**
101   * Constructs a new {@code dev.metaschema.oscal.lib.model.Impact} instance with the specified metadata.
102   *
103   * @param data
104   *           the metaschema data, or {@code null} if none
105   */
106  public Impact(IMetaschemaData data) {
107    this.__metaschemaData = data;
108  }
109
110  @Override
111  public IMetaschemaData getMetaschemaData() {
112    return __metaschemaData;
113  }
114
115  /**
116   * Get the "{@literal Property}".
117   *
118   * <p>
119   * An attribute, characteristic, or quality of the containing object expressed as a namespace qualified name/value pair.
120   *
121   * @return the prop value
122   */
123  @NonNull
124  public List<Property> getProps() {
125    if (_props == null) {
126      _props = new LinkedList<>();
127    }
128    return ObjectUtils.notNull(_props);
129  }
130
131  /**
132   * Set the "{@literal Property}".
133   *
134   * <p>
135   * An attribute, characteristic, or quality of the containing object expressed as a namespace qualified name/value pair.
136   *
137   * @param value
138   *           the prop value to set
139   */
140  public void setProps(@NonNull List<Property> value) {
141    _props = value;
142  }
143
144  /**
145   * Add a new {@link Property} item to the underlying collection.
146   * @param item the item to add
147   * @return {@code true}
148   */
149  public boolean addProp(Property item) {
150    Property value = ObjectUtils.requireNonNull(item,"item cannot be null");
151    if (_props == null) {
152      _props = new LinkedList<>();
153    }
154    return _props.add(value);
155  }
156
157  /**
158   * Remove the first matching {@link Property} item from the underlying collection.
159   * @param item the item to remove
160   * @return {@code true} if the item was removed or {@code false} otherwise
161   */
162  public boolean removeProp(Property item) {
163    Property value = ObjectUtils.requireNonNull(item,"item cannot be null");
164    return _props != null && _props.remove(value);
165  }
166
167  /**
168   * Get the "{@literal Link}".
169   *
170   * <p>
171   * A reference to a local or remote resource, that has a specific relation to the containing object.
172   *
173   * @return the link value
174   */
175  @NonNull
176  public List<Link> getLinks() {
177    if (_links == null) {
178      _links = new LinkedList<>();
179    }
180    return ObjectUtils.notNull(_links);
181  }
182
183  /**
184   * Set the "{@literal Link}".
185   *
186   * <p>
187   * A reference to a local or remote resource, that has a specific relation to the containing object.
188   *
189   * @param value
190   *           the link value to set
191   */
192  public void setLinks(@NonNull List<Link> value) {
193    _links = value;
194  }
195
196  /**
197   * Add a new {@link Link} item to the underlying collection.
198   * @param item the item to add
199   * @return {@code true}
200   */
201  public boolean addLink(Link item) {
202    Link value = ObjectUtils.requireNonNull(item,"item cannot be null");
203    if (_links == null) {
204      _links = new LinkedList<>();
205    }
206    return _links.add(value);
207  }
208
209  /**
210   * Remove the first matching {@link Link} item from the underlying collection.
211   * @param item the item to remove
212   * @return {@code true} if the item was removed or {@code false} otherwise
213   */
214  public boolean removeLink(Link item) {
215    Link value = ObjectUtils.requireNonNull(item,"item cannot be null");
216    return _links != null && _links.remove(value);
217  }
218
219  /**
220   * Get the "{@literal Base Level (Confidentiality, Integrity, or Availability)}".
221   *
222   * <p>
223   * The prescribed base (Confidentiality, Integrity, or Availability) security impact level.
224   *
225   * @return the base value
226   */
227  @NonNull
228  public String getBase() {
229    return _base;
230  }
231
232  /**
233   * Set the "{@literal Base Level (Confidentiality, Integrity, or Availability)}".
234   *
235   * <p>
236   * The prescribed base (Confidentiality, Integrity, or Availability) security impact level.
237   *
238   * @param value
239   *           the base value to set
240   */
241  public void setBase(@NonNull String value) {
242    _base = value;
243  }
244
245  /**
246   * Get the "{@literal Selected Level (Confidentiality, Integrity, or Availability)}".
247   *
248   * <p>
249   * The selected (Confidentiality, Integrity, or Availability) security impact level.
250   *
251   * @return the selected value, or {@code null} if not set
252   */
253  @Nullable
254  public String getSelected() {
255    return _selected;
256  }
257
258  /**
259   * Set the "{@literal Selected Level (Confidentiality, Integrity, or Availability)}".
260   *
261   * <p>
262   * The selected (Confidentiality, Integrity, or Availability) security impact level.
263   *
264   * @param value
265   *           the selected value to set, or {@code null} to clear
266   */
267  public void setSelected(@Nullable String value) {
268    _selected = value;
269  }
270
271  /**
272   * Get the "{@literal Adjustment Justification}".
273   *
274   * <p>
275   * If the selected security level is different from the base security level, this contains the justification for the change.
276   *
277   * @return the adjustment-justification value, or {@code null} if not set
278   */
279  @Nullable
280  public MarkupMultiline getAdjustmentJustification() {
281    return _adjustmentJustification;
282  }
283
284  /**
285   * Set the "{@literal Adjustment Justification}".
286   *
287   * <p>
288   * If the selected security level is different from the base security level, this contains the justification for the change.
289   *
290   * @param value
291   *           the adjustment-justification value to set, or {@code null} to clear
292   */
293  public void setAdjustmentJustification(@Nullable MarkupMultiline value) {
294    _adjustmentJustification = value;
295  }
296
297  @Override
298  public String toString() {
299    return ObjectUtils.notNull(new ReflectionToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).toString());
300  }
301}