001// Generated from: ../../../../../../../../oscal/src/metaschema/oscal_metadata_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.adapter.TokenAdapter;
007import dev.metaschema.core.datatype.adapter.UriAdapter;
008import dev.metaschema.core.datatype.adapter.UuidAdapter;
009import dev.metaschema.core.datatype.markup.MarkupMultiline;
010import dev.metaschema.core.datatype.markup.MarkupMultilineAdapter;
011import dev.metaschema.core.model.IBoundObject;
012import dev.metaschema.core.model.IMetaschemaData;
013import dev.metaschema.core.model.constraint.IConstraint;
014import dev.metaschema.core.util.ObjectUtils;
015import dev.metaschema.databind.model.annotations.AllowedValue;
016import dev.metaschema.databind.model.annotations.AllowedValues;
017import dev.metaschema.databind.model.annotations.BoundField;
018import dev.metaschema.databind.model.annotations.BoundFlag;
019import dev.metaschema.databind.model.annotations.MetaschemaAssembly;
020import dev.metaschema.databind.model.annotations.ValueConstraints;
021import dev.metaschema.oscal.lib.model.metadata.AbstractProperty;
022import edu.umd.cs.findbugs.annotations.NonNull;
023import edu.umd.cs.findbugs.annotations.Nullable;
024import java.net.URI;
025import java.util.UUID;
026import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
027import org.apache.commons.lang3.builder.ToStringStyle;
028
029/**
030 * An attribute, characteristic, or quality of the containing object expressed as a namespace qualified name/value pair.
031 */
032@MetaschemaAssembly(
033    formalName = "Property",
034    description = "An attribute, characteristic, or quality of the containing object expressed as a namespace qualified name/value pair.",
035    name = "property",
036    moduleClass = OscalMetadataModule.class,
037    remarks = "Properties permit the deployment and management of arbitrary controlled values, within OSCAL objects. A property can be included for any purpose useful to an application or implementation. Typically, properties will be used to sort, filter, select, order, and arrange OSCAL content objects, to relate OSCAL objects to one another, or to associate an OSCAL object to class hierarchies, taxonomies, or external authorities. Thus, the lexical composition of properties may be constrained by external processes to ensure consistency.\n"
038            + "\n"
039            + "Property allows for associated remarks that describe why the specific property value was applied to the containing object, or the significance of the value in the context of the containing object.",
040    valueConstraints = @ValueConstraints(allowedValues = @AllowedValues(id = "oscal-metadata-prop-name-values", level = IConstraint.Level.ERROR, target = ".[has-oscal-namespace('http://csrc.nist.gov/ns/oscal')]/@name", values = @AllowedValue(value = "marking", description = "A label or descriptor that is tied to a sensitivity or classification marking system. An optional class can be used to define the specific marking system used for the associated value.")))
041)
042public class Property extends AbstractProperty implements IBoundObject {
043  private final IMetaschemaData __metaschemaData;
044
045  /**
046   * A textual label, within a namespace, that identifies a specific attribute, characteristic, or quality of the property's containing object.
047   */
048  @BoundFlag(
049      formalName = "Property Name",
050      description = "A textual label, within a namespace, that identifies a specific attribute, characteristic, or quality of the property's containing object.",
051      name = "name",
052      required = true,
053      typeAdapter = TokenAdapter.class
054  )
055  private String _name;
056
057  /**
058   * A unique identifier for a property.
059   */
060  @BoundFlag(
061      formalName = "Property Universally Unique Identifier",
062      description = "A unique identifier for a property.",
063      name = "uuid",
064      typeAdapter = UuidAdapter.class
065  )
066  private UUID _uuid;
067
068  /**
069   * A namespace qualifying the property's name. This allows different organizations to associate distinct semantics with the same name.
070   */
071  @BoundFlag(
072      formalName = "Property Namespace",
073      description = "A namespace qualifying the property's name. This allows different organizations to associate distinct semantics with the same name.",
074      name = "ns",
075      defaultValue = "http://csrc.nist.gov/ns/oscal",
076      typeAdapter = UriAdapter.class,
077      remarks = "This value must be an [absolute URI](https://pages.nist.gov/OSCAL/concepts/uri-use/#absolute-uri) that serves as a [naming system identifier](https://pages.nist.gov/OSCAL/concepts/uri-use/#use-as-a-naming-system-identifier).\n"
078              + "\n"
079              + "When a `ns` is not provided, its value should be assumed to be `http://csrc.nist.gov/ns/oscal` and the name should be a name defined by the associated OSCAL model."
080  )
081  private URI _ns;
082
083  /**
084   * Indicates the value of the attribute, characteristic, or quality.
085   */
086  @BoundFlag(
087      formalName = "Property Value",
088      description = "Indicates the value of the attribute, characteristic, or quality.",
089      name = "value",
090      required = true,
091      typeAdapter = StringAdapter.class
092  )
093  private String _value;
094
095  /**
096   * A textual label that provides a sub-type or characterization of the property's <code>name</code>.
097   */
098  @BoundFlag(
099      formalName = "Property Class",
100      description = "A textual label that provides a sub-type or characterization of the property's `name`.",
101      name = "class",
102      typeAdapter = TokenAdapter.class,
103      remarks = "This can be used to further distinguish or discriminate between the semantics of multiple properties of the same object with the same `name` and `ns`, or to group properties into categories.\n"
104              + "\n"
105              + "A `class` can be used in validation rules to express extra constraints over named items of a specific `class` value. It is available for grouping, but unlike `group` is not expected specifically to designate any group membership as such."
106  )
107  private String _clazz;
108
109  /**
110   * An identifier for relating distinct sets of properties.
111   */
112  @BoundFlag(
113      formalName = "Property Group",
114      description = "An identifier for relating distinct sets of properties.",
115      name = "group",
116      typeAdapter = TokenAdapter.class,
117      remarks = "Different sets of properties may relate to separate contexts. Declare a group on a property to associate it with one or more other properties in a given context."
118  )
119  private String _group;
120
121  /**
122   * Additional commentary about the containing object.
123   */
124  @BoundField(
125      formalName = "Remarks",
126      description = "Additional commentary about the containing object.",
127      useName = "remarks",
128      typeAdapter = MarkupMultilineAdapter.class
129  )
130  private MarkupMultiline _remarks;
131
132  /**
133   * Constructs a new {@code dev.metaschema.oscal.lib.model.Property} instance with no metadata.
134   */
135  public Property() {
136    this(null);
137  }
138
139  /**
140   * Constructs a new {@code dev.metaschema.oscal.lib.model.Property} instance with the specified metadata.
141   *
142   * @param data
143   *           the metaschema data, or {@code null} if none
144   */
145  public Property(IMetaschemaData data) {
146    this.__metaschemaData = data;
147  }
148
149  @Override
150  public IMetaschemaData getMetaschemaData() {
151    return __metaschemaData;
152  }
153
154  /**
155   * Get the "{@literal Property Name}".
156   *
157   * <p>
158   * A textual label, within a namespace, that identifies a specific attribute, characteristic, or quality of the property's containing object.
159   *
160   * @return the name value
161   */
162  @NonNull
163  public String getName() {
164    return _name;
165  }
166
167  /**
168   * Set the "{@literal Property Name}".
169   *
170   * <p>
171   * A textual label, within a namespace, that identifies a specific attribute, characteristic, or quality of the property's containing object.
172   *
173   * @param value
174   *           the name value to set
175   */
176  public void setName(@NonNull String value) {
177    _name = value;
178  }
179
180  /**
181   * Get the "{@literal Property Universally Unique Identifier}".
182   *
183   * <p>
184   * A unique identifier for a property.
185   *
186   * @return the uuid value, or {@code null} if not set
187   */
188  @Nullable
189  public UUID getUuid() {
190    return _uuid;
191  }
192
193  /**
194   * Set the "{@literal Property Universally Unique Identifier}".
195   *
196   * <p>
197   * A unique identifier for a property.
198   *
199   * @param value
200   *           the uuid value to set, or {@code null} to clear
201   */
202  public void setUuid(@Nullable UUID value) {
203    _uuid = value;
204  }
205
206  /**
207   * Get the "{@literal Property Namespace}".
208   *
209   * <p>
210   * A namespace qualifying the property's name. This allows different organizations to associate distinct semantics with the same name.
211   *
212   * @return the ns value, or {@code null} if not set
213   */
214  @Nullable
215  public URI getNs() {
216    return _ns;
217  }
218
219  /**
220   * Set the "{@literal Property Namespace}".
221   *
222   * <p>
223   * A namespace qualifying the property's name. This allows different organizations to associate distinct semantics with the same name.
224   *
225   * @param value
226   *           the ns value to set, or {@code null} to clear
227   */
228  public void setNs(@Nullable URI value) {
229    _ns = value;
230  }
231
232  /**
233   * Get the "{@literal Property Value}".
234   *
235   * <p>
236   * Indicates the value of the attribute, characteristic, or quality.
237   *
238   * @return the value value
239   */
240  @NonNull
241  public String getValue() {
242    return _value;
243  }
244
245  /**
246   * Set the "{@literal Property Value}".
247   *
248   * <p>
249   * Indicates the value of the attribute, characteristic, or quality.
250   *
251   * @param value
252   *           the value value to set
253   */
254  public void setValue(@NonNull String value) {
255    _value = value;
256  }
257
258  /**
259   * Get the "{@literal Property Class}".
260   *
261   * <p>
262   * A textual label that provides a sub-type or characterization of the property's <code>name</code>.
263   *
264   * @return the class value, or {@code null} if not set
265   */
266  @Nullable
267  public String getClazz() {
268    return _clazz;
269  }
270
271  /**
272   * Set the "{@literal Property Class}".
273   *
274   * <p>
275   * A textual label that provides a sub-type or characterization of the property's <code>name</code>.
276   *
277   * @param value
278   *           the class value to set, or {@code null} to clear
279   */
280  public void setClazz(@Nullable String value) {
281    _clazz = value;
282  }
283
284  /**
285   * Get the "{@literal Property Group}".
286   *
287   * <p>
288   * An identifier for relating distinct sets of properties.
289   *
290   * @return the group value, or {@code null} if not set
291   */
292  @Nullable
293  public String getGroup() {
294    return _group;
295  }
296
297  /**
298   * Set the "{@literal Property Group}".
299   *
300   * <p>
301   * An identifier for relating distinct sets of properties.
302   *
303   * @param value
304   *           the group value to set, or {@code null} to clear
305   */
306  public void setGroup(@Nullable String value) {
307    _group = value;
308  }
309
310  /**
311   * Get the "{@literal Remarks}".
312   *
313   * <p>
314   * Additional commentary about the containing object.
315   *
316   * @return the remarks value, or {@code null} if not set
317   */
318  @Nullable
319  public MarkupMultiline getRemarks() {
320    return _remarks;
321  }
322
323  /**
324   * Set the "{@literal Remarks}".
325   *
326   * <p>
327   * Additional commentary about the containing object.
328   *
329   * @param value
330   *           the remarks value to set, or {@code null} to clear
331   */
332  public void setRemarks(@Nullable MarkupMultiline value) {
333    _remarks = value;
334  }
335
336  @Override
337  public String toString() {
338    return ObjectUtils.notNull(new ReflectionToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).toString());
339  }
340}