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.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 the operational status of the system.
025 */
026@MetaschemaAssembly(
027    formalName = "Status",
028    description = "Describes the operational status of the system.",
029    name = "status",
030    moduleClass = OscalSspModule.class,
031    remarks = "If 'other' is selected, a remark must be included to describe the current state."
032)
033public class Status implements IBoundObject {
034  private final IMetaschemaData __metaschemaData;
035
036  /**
037   * The current operating status.
038   */
039  @BoundFlag(
040      formalName = "State",
041      description = "The current operating status.",
042      name = "state",
043      required = true,
044      typeAdapter = StringAdapter.class,
045      valueConstraints = @ValueConstraints(allowedValues = @AllowedValues(id = "oscal-status-state-values", level = IConstraint.Level.ERROR, values = {@AllowedValue(value = "operational", description = "The system is currently operating in production."), @AllowedValue(value = "under-development", description = "The system is being designed, developed, or implemented"), @AllowedValue(value = "under-major-modification", description = "The system is undergoing a major change, development, or transition."), @AllowedValue(value = "disposition", description = "The system is no longer operational."), @AllowedValue(value = "other", description = "Some other state.")}))
046  )
047  private String _state;
048
049  /**
050   * Additional commentary about the containing object.
051   */
052  @BoundField(
053      formalName = "Remarks",
054      description = "Additional commentary about the containing object.",
055      useName = "remarks",
056      typeAdapter = MarkupMultilineAdapter.class
057  )
058  private MarkupMultiline _remarks;
059
060  /**
061   * Constructs a new {@code dev.metaschema.oscal.lib.model.Status} instance with no metadata.
062   */
063  public Status() {
064    this(null);
065  }
066
067  /**
068   * Constructs a new {@code dev.metaschema.oscal.lib.model.Status} instance with the specified metadata.
069   *
070   * @param data
071   *           the metaschema data, or {@code null} if none
072   */
073  public Status(IMetaschemaData data) {
074    this.__metaschemaData = data;
075  }
076
077  @Override
078  public IMetaschemaData getMetaschemaData() {
079    return __metaschemaData;
080  }
081
082  /**
083   * Get the "{@literal State}".
084   *
085   * <p>
086   * The current operating status.
087   *
088   * @return the state value
089   */
090  @NonNull
091  public String getState() {
092    return _state;
093  }
094
095  /**
096   * Set the "{@literal State}".
097   *
098   * <p>
099   * The current operating status.
100   *
101   * @param value
102   *           the state value to set
103   */
104  public void setState(@NonNull String value) {
105    _state = value;
106  }
107
108  /**
109   * Get the "{@literal Remarks}".
110   *
111   * <p>
112   * Additional commentary about the containing object.
113   *
114   * @return the remarks value, or {@code null} if not set
115   */
116  @Nullable
117  public MarkupMultiline getRemarks() {
118    return _remarks;
119  }
120
121  /**
122   * Set the "{@literal Remarks}".
123   *
124   * <p>
125   * Additional commentary about the containing object.
126   *
127   * @param value
128   *           the remarks value to set, or {@code null} to clear
129   */
130  public void setRemarks(@Nullable MarkupMultiline value) {
131    _remarks = value;
132  }
133
134  @Override
135  public String toString() {
136    return ObjectUtils.notNull(new ReflectionToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).toString());
137  }
138}