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.TokenAdapter; 006import dev.metaschema.core.datatype.adapter.UuidAdapter; 007import dev.metaschema.core.datatype.markup.MarkupMultiline; 008import dev.metaschema.core.datatype.markup.MarkupMultilineAdapter; 009import dev.metaschema.core.model.IBoundObject; 010import dev.metaschema.core.model.IMetaschemaData; 011import dev.metaschema.core.model.JsonGroupAsBehavior; 012import dev.metaschema.core.model.constraint.IConstraint; 013import dev.metaschema.core.util.ObjectUtils; 014import dev.metaschema.databind.model.annotations.AllowedValue; 015import dev.metaschema.databind.model.annotations.AllowedValues; 016import dev.metaschema.databind.model.annotations.AssemblyConstraints; 017import dev.metaschema.databind.model.annotations.BoundAssembly; 018import dev.metaschema.databind.model.annotations.BoundField; 019import dev.metaschema.databind.model.annotations.BoundFlag; 020import dev.metaschema.databind.model.annotations.GroupAs; 021import dev.metaschema.databind.model.annotations.HasCardinality; 022import dev.metaschema.databind.model.annotations.IndexHasKey; 023import dev.metaschema.databind.model.annotations.IsUnique; 024import dev.metaschema.databind.model.annotations.KeyField; 025import dev.metaschema.databind.model.annotations.MetaschemaAssembly; 026import dev.metaschema.databind.model.annotations.ValueConstraints; 027import edu.umd.cs.findbugs.annotations.NonNull; 028import edu.umd.cs.findbugs.annotations.Nullable; 029import java.util.LinkedList; 030import java.util.List; 031import java.util.UUID; 032import org.apache.commons.lang3.builder.ReflectionToStringBuilder; 033import org.apache.commons.lang3.builder.ToStringStyle; 034 035/** 036 * Describes how the system satisfies the requirements of an individual control. 037 */ 038@MetaschemaAssembly( 039 formalName = "Control-based Requirement", 040 description = "Describes how the system satisfies the requirements of an individual control.", 041 name = "implemented-requirement", 042 moduleClass = OscalSspModule.class, 043 remarks = "Use of `set-parameter` in this context, sets the parameter for the referenced control. Any `set-parameter` defined in a child context will override this value. If not overridden by a child, this value applies in the child context.", 044 valueConstraints = @ValueConstraints(allowedValues = {@AllowedValues(id = "oscal-implemented-requirement-statement-by-component-prop-name-values", level = IConstraint.Level.ERROR, target = "(.|statement|.//by-component)/prop[has-oscal-namespace('http://csrc.nist.gov/ns/oscal')]/@name", values = @AllowedValue(value = "control-origination", description = "Identifies the source of the implemented control. Any `control-origination` prop defined in a child context will override the parent value.")), @AllowedValues(id = "oscal-implemented-requirement-statement-by-component-prop-control-origination-values", level = IConstraint.Level.ERROR, target = "(.|statement|.//by-component)/prop[has-oscal-namespace('http://csrc.nist.gov/ns/oscal') and @name='control-origination']/@value", values = {@AllowedValue(value = "organization", description = "The control is implemented by the organization owning the system, but is not specific to the system itself."), @AllowedValue(value = "system-specific", description = "The control is implemented specifically to this system."), @AllowedValue(value = "customer-configured", description = "The control is provided by the system, but must be configured by the customer."), @AllowedValue(value = "customer-provided", description = "The control must be implemented by the customer."), @AllowedValue(value = "inherited", description = "This control is inherited from an underlying system.")}), @AllowedValues(id = "oscal-implemented-requirement-responsible-role-id-values", level = IConstraint.Level.ERROR, target = "responsible-role/@role-id", allowOthers = true, values = {@AllowedValue(value = "asset-owner", description = "Accountable for ensuring the asset is managed in accordance with organizational policies and procedures."), @AllowedValue(value = "asset-administrator", description = "Responsible for administering a set of assets."), @AllowedValue(value = "security-operations", description = "Members of the security operations center (SOC)."), @AllowedValue(value = "network-operations", description = "Members of the network operations center (NOC)."), @AllowedValue(value = "incident-response", description = "Responsible for responding to an event that could lead to loss of, or disruption to, an organization's operations, services or functions."), @AllowedValue(value = "help-desk", description = "Responsible for providing information and support to users."), @AllowedValue(value = "configuration-management", description = "Responsible for the configuration management processes governing changes to the asset.")})}, indexHasKey = {@IndexHasKey(id = "oscal-implemented-requirement-index-metadata-role-id", level = IConstraint.Level.ERROR, target = "responsible-role|statement/responsible-role|.//by-component//responsible-role", indexName = "index-metadata-role-id", keyFields = @KeyField(target = "@role-id")), @IndexHasKey(id = "oscal-implemented-requirement-index-metadata-party-uuid", level = IConstraint.Level.ERROR, target = "responsible-role|statement/responsible-role|.//by-component//responsible-role", indexName = "index-metadata-party-uuid", keyFields = @KeyField(target = "party-uuid"))}), 045 modelConstraints = @AssemblyConstraints(unique = {@IsUnique(id = "oscal-unique-ssp-implemented-requirement-set-parameter", level = IConstraint.Level.ERROR, target = "set-parameter", keyFields = @KeyField(target = "@param-id"), remarks = "Since multiple `set-parameter` entries can be provided, each parameter must be set only once."), @IsUnique(id = "oscal-unique-ssp-implemented-requirement-responsible-role", level = IConstraint.Level.ERROR, target = "responsible-role", keyFields = @KeyField(target = "@role-id"), remarks = "Since `responsible-role` associates multiple `party-uuid` entries with a single `role-id`, each role-id must be referenced only once."), @IsUnique(id = "oscal-unique-ssp-implemented-requirement-statement", level = IConstraint.Level.ERROR, target = "statement", keyFields = @KeyField(target = "@statement-id"), remarks = "Since `statement` entries can be referenced using the statement's statement-id, each statement must be referenced only once."), @IsUnique(id = "oscal-unique-ssp-implemented-requirement-by-component", level = IConstraint.Level.ERROR, target = "by-component", keyFields = @KeyField(target = "@component-uuid"), remarks = "Since `by-component` can reference `component` entries using the component's uuid, each component must be referenced only once. This ensures that all implementation statements are contained in the same `by-component` entry.")}, cardinality = @HasCardinality(id = "oscal-implemented-requirement-by-component-cardinality", level = IConstraint.Level.ERROR, target = ".//by-component", minOccurs = 1)) 046) 047public class ImplementedRequirement implements IBoundObject { 048 private final IMetaschemaData __metaschemaData; 049 050 /** 051 * A <a href="https://pages.nist.gov/OSCAL/concepts/identifier-use/#machine-oriented">machine-oriented</a>, <a href="https://pages.nist.gov/OSCAL/concepts/identifier-use/#globally-unique">globally unique</a> identifier with <a href="https://pages.nist.gov/OSCAL/concepts/identifier-use/#cross-instance">cross-instance</a> scope that can be used to reference this control requirement elsewhere in <a href="https://pages.nist.gov/OSCAL/concepts/identifier-use/#ssp-identifiers">this or other OSCAL instances</a>. The locally defined <em>UUID</em> of the <code>control requirement</code> can be used to reference the data item locally or globally (e.g., in an imported OSCAL instance). This UUID should be assigned <a href="https://pages.nist.gov/OSCAL/concepts/identifier-use/#consistency">per-subject</a>, which means it should be consistently used to identify the same subject across revisions of the document. 052 */ 053 @BoundFlag( 054 formalName = "Control Requirement Universally Unique Identifier", 055 description = "A [machine-oriented](https://pages.nist.gov/OSCAL/concepts/identifier-use/#machine-oriented), [globally unique](https://pages.nist.gov/OSCAL/concepts/identifier-use/#globally-unique) identifier with [cross-instance](https://pages.nist.gov/OSCAL/concepts/identifier-use/#cross-instance) scope that can be used to reference this control requirement elsewhere in [this or other OSCAL instances](https://pages.nist.gov/OSCAL/concepts/identifier-use/#ssp-identifiers). The locally defined *UUID* of the `control requirement` can be used to reference the data item locally or globally (e.g., in an imported OSCAL instance). This UUID should be assigned [per-subject](https://pages.nist.gov/OSCAL/concepts/identifier-use/#consistency), which means it should be consistently used to identify the same subject across revisions of the document.", 056 name = "uuid", 057 required = true, 058 typeAdapter = UuidAdapter.class 059 ) 060 private UUID _uuid; 061 062 /** 063 * A reference to a control with a corresponding <code>id</code> value. When referencing an externally defined <code>control</code>, the <code>Control Identifier Reference</code> must be used in the context of the external / imported OSCAL instance (e.g., uri-reference). 064 */ 065 @BoundFlag( 066 formalName = "Control Identifier Reference", 067 description = "A reference to a control with a corresponding `id` value. When referencing an externally defined `control`, the `Control Identifier Reference` must be used in the context of the external / imported OSCAL instance (e.g., uri-reference).", 068 name = "control-id", 069 required = true, 070 typeAdapter = TokenAdapter.class 071 ) 072 private String _controlId; 073 074 /** 075 * An attribute, characteristic, or quality of the containing object expressed as a namespace qualified name/value pair. 076 */ 077 @BoundAssembly( 078 formalName = "Property", 079 description = "An attribute, characteristic, or quality of the containing object expressed as a namespace qualified name/value pair.", 080 useName = "prop", 081 maxOccurs = -1, 082 groupAs = @GroupAs(name = "props", inJson = JsonGroupAsBehavior.LIST) 083 ) 084 private List<Property> _props; 085 086 /** 087 * A reference to a local or remote resource, that has a specific relation to the containing object. 088 */ 089 @BoundAssembly( 090 formalName = "Link", 091 description = "A reference to a local or remote resource, that has a specific relation to the containing object.", 092 useName = "link", 093 maxOccurs = -1, 094 groupAs = @GroupAs(name = "links", inJson = JsonGroupAsBehavior.LIST) 095 ) 096 private List<Link> _links; 097 098 /** 099 * Identifies the parameter that will be set by the enclosed value. 100 */ 101 @BoundAssembly( 102 formalName = "Set Parameter Value", 103 description = "Identifies the parameter that will be set by the enclosed value.", 104 useName = "set-parameter", 105 maxOccurs = -1, 106 groupAs = @GroupAs(name = "set-parameters", inJson = JsonGroupAsBehavior.LIST) 107 ) 108 private List<SetParameter> _setParameters; 109 110 /** 111 * A reference to a role with responsibility for performing a function relative to the containing object, optionally associated with a set of persons and/or organizations that perform that role. 112 */ 113 @BoundAssembly( 114 formalName = "Responsible Role", 115 description = "A reference to a role with responsibility for performing a function relative to the containing object, optionally associated with a set of persons and/or organizations that perform that role.", 116 useName = "responsible-role", 117 maxOccurs = -1, 118 groupAs = @GroupAs(name = "responsible-roles", inJson = JsonGroupAsBehavior.LIST) 119 ) 120 private List<ResponsibleRole> _responsibleRoles; 121 122 /** 123 * Identifies which statements within a control are addressed. 124 */ 125 @BoundAssembly( 126 formalName = "Specific Control Statement", 127 description = "Identifies which statements within a control are addressed.", 128 useName = "statement", 129 maxOccurs = -1, 130 groupAs = @GroupAs(name = "statements", inJson = JsonGroupAsBehavior.LIST) 131 ) 132 private List<Statement> _statements; 133 134 /** 135 * Defines how the referenced component implements a set of controls. 136 */ 137 @BoundAssembly( 138 formalName = "Component Control Implementation", 139 description = "Defines how the referenced component implements a set of controls.", 140 useName = "by-component", 141 maxOccurs = -1, 142 groupAs = @GroupAs(name = "by-components", inJson = JsonGroupAsBehavior.LIST) 143 ) 144 private List<ByComponent> _byComponents; 145 146 /** 147 * Additional commentary about the containing object. 148 */ 149 @BoundField( 150 formalName = "Remarks", 151 description = "Additional commentary about the containing object.", 152 useName = "remarks", 153 typeAdapter = MarkupMultilineAdapter.class 154 ) 155 private MarkupMultiline _remarks; 156 157 /** 158 * Constructs a new {@code dev.metaschema.oscal.lib.model.ImplementedRequirement} instance with no metadata. 159 */ 160 public ImplementedRequirement() { 161 this(null); 162 } 163 164 /** 165 * Constructs a new {@code dev.metaschema.oscal.lib.model.ImplementedRequirement} instance with the specified metadata. 166 * 167 * @param data 168 * the metaschema data, or {@code null} if none 169 */ 170 public ImplementedRequirement(IMetaschemaData data) { 171 this.__metaschemaData = data; 172 } 173 174 @Override 175 public IMetaschemaData getMetaschemaData() { 176 return __metaschemaData; 177 } 178 179 /** 180 * Get the "{@literal Control Requirement Universally Unique Identifier}". 181 * 182 * <p> 183 * A <a href="https://pages.nist.gov/OSCAL/concepts/identifier-use/#machine-oriented">machine-oriented</a>, <a href="https://pages.nist.gov/OSCAL/concepts/identifier-use/#globally-unique">globally unique</a> identifier with <a href="https://pages.nist.gov/OSCAL/concepts/identifier-use/#cross-instance">cross-instance</a> scope that can be used to reference this control requirement elsewhere in <a href="https://pages.nist.gov/OSCAL/concepts/identifier-use/#ssp-identifiers">this or other OSCAL instances</a>. The locally defined <em>UUID</em> of the <code>control requirement</code> can be used to reference the data item locally or globally (e.g., in an imported OSCAL instance). This UUID should be assigned <a href="https://pages.nist.gov/OSCAL/concepts/identifier-use/#consistency">per-subject</a>, which means it should be consistently used to identify the same subject across revisions of the document. 184 * 185 * @return the uuid value 186 */ 187 @NonNull 188 public UUID getUuid() { 189 return _uuid; 190 } 191 192 /** 193 * Set the "{@literal Control Requirement Universally Unique Identifier}". 194 * 195 * <p> 196 * A <a href="https://pages.nist.gov/OSCAL/concepts/identifier-use/#machine-oriented">machine-oriented</a>, <a href="https://pages.nist.gov/OSCAL/concepts/identifier-use/#globally-unique">globally unique</a> identifier with <a href="https://pages.nist.gov/OSCAL/concepts/identifier-use/#cross-instance">cross-instance</a> scope that can be used to reference this control requirement elsewhere in <a href="https://pages.nist.gov/OSCAL/concepts/identifier-use/#ssp-identifiers">this or other OSCAL instances</a>. The locally defined <em>UUID</em> of the <code>control requirement</code> can be used to reference the data item locally or globally (e.g., in an imported OSCAL instance). This UUID should be assigned <a href="https://pages.nist.gov/OSCAL/concepts/identifier-use/#consistency">per-subject</a>, which means it should be consistently used to identify the same subject across revisions of the document. 197 * 198 * @param value 199 * the uuid value to set 200 */ 201 public void setUuid(@NonNull UUID value) { 202 _uuid = value; 203 } 204 205 /** 206 * Get the "{@literal Control Identifier Reference}". 207 * 208 * <p> 209 * A reference to a control with a corresponding <code>id</code> value. When referencing an externally defined <code>control</code>, the <code>Control Identifier Reference</code> must be used in the context of the external / imported OSCAL instance (e.g., uri-reference). 210 * 211 * @return the control-id value 212 */ 213 @NonNull 214 public String getControlId() { 215 return _controlId; 216 } 217 218 /** 219 * Set the "{@literal Control Identifier Reference}". 220 * 221 * <p> 222 * A reference to a control with a corresponding <code>id</code> value. When referencing an externally defined <code>control</code>, the <code>Control Identifier Reference</code> must be used in the context of the external / imported OSCAL instance (e.g., uri-reference). 223 * 224 * @param value 225 * the control-id value to set 226 */ 227 public void setControlId(@NonNull String value) { 228 _controlId = value; 229 } 230 231 /** 232 * Get the "{@literal Property}". 233 * 234 * <p> 235 * An attribute, characteristic, or quality of the containing object expressed as a namespace qualified name/value pair. 236 * 237 * @return the prop value 238 */ 239 @NonNull 240 public List<Property> getProps() { 241 if (_props == null) { 242 _props = new LinkedList<>(); 243 } 244 return ObjectUtils.notNull(_props); 245 } 246 247 /** 248 * Set the "{@literal Property}". 249 * 250 * <p> 251 * An attribute, characteristic, or quality of the containing object expressed as a namespace qualified name/value pair. 252 * 253 * @param value 254 * the prop value to set 255 */ 256 public void setProps(@NonNull List<Property> value) { 257 _props = value; 258 } 259 260 /** 261 * Add a new {@link Property} item to the underlying collection. 262 * @param item the item to add 263 * @return {@code true} 264 */ 265 public boolean addProp(Property item) { 266 Property value = ObjectUtils.requireNonNull(item,"item cannot be null"); 267 if (_props == null) { 268 _props = new LinkedList<>(); 269 } 270 return _props.add(value); 271 } 272 273 /** 274 * Remove the first matching {@link Property} item from the underlying collection. 275 * @param item the item to remove 276 * @return {@code true} if the item was removed or {@code false} otherwise 277 */ 278 public boolean removeProp(Property item) { 279 Property value = ObjectUtils.requireNonNull(item,"item cannot be null"); 280 return _props != null && _props.remove(value); 281 } 282 283 /** 284 * Get the "{@literal Link}". 285 * 286 * <p> 287 * A reference to a local or remote resource, that has a specific relation to the containing object. 288 * 289 * @return the link value 290 */ 291 @NonNull 292 public List<Link> getLinks() { 293 if (_links == null) { 294 _links = new LinkedList<>(); 295 } 296 return ObjectUtils.notNull(_links); 297 } 298 299 /** 300 * Set the "{@literal Link}". 301 * 302 * <p> 303 * A reference to a local or remote resource, that has a specific relation to the containing object. 304 * 305 * @param value 306 * the link value to set 307 */ 308 public void setLinks(@NonNull List<Link> value) { 309 _links = value; 310 } 311 312 /** 313 * Add a new {@link Link} item to the underlying collection. 314 * @param item the item to add 315 * @return {@code true} 316 */ 317 public boolean addLink(Link item) { 318 Link value = ObjectUtils.requireNonNull(item,"item cannot be null"); 319 if (_links == null) { 320 _links = new LinkedList<>(); 321 } 322 return _links.add(value); 323 } 324 325 /** 326 * Remove the first matching {@link Link} item from the underlying collection. 327 * @param item the item to remove 328 * @return {@code true} if the item was removed or {@code false} otherwise 329 */ 330 public boolean removeLink(Link item) { 331 Link value = ObjectUtils.requireNonNull(item,"item cannot be null"); 332 return _links != null && _links.remove(value); 333 } 334 335 /** 336 * Get the "{@literal Set Parameter Value}". 337 * 338 * <p> 339 * Identifies the parameter that will be set by the enclosed value. 340 * 341 * @return the set-parameter value 342 */ 343 @NonNull 344 public List<SetParameter> getSetParameters() { 345 if (_setParameters == null) { 346 _setParameters = new LinkedList<>(); 347 } 348 return ObjectUtils.notNull(_setParameters); 349 } 350 351 /** 352 * Set the "{@literal Set Parameter Value}". 353 * 354 * <p> 355 * Identifies the parameter that will be set by the enclosed value. 356 * 357 * @param value 358 * the set-parameter value to set 359 */ 360 public void setSetParameters(@NonNull List<SetParameter> value) { 361 _setParameters = value; 362 } 363 364 /** 365 * Add a new {@link SetParameter} item to the underlying collection. 366 * @param item the item to add 367 * @return {@code true} 368 */ 369 public boolean addSetParameter(SetParameter item) { 370 SetParameter value = ObjectUtils.requireNonNull(item,"item cannot be null"); 371 if (_setParameters == null) { 372 _setParameters = new LinkedList<>(); 373 } 374 return _setParameters.add(value); 375 } 376 377 /** 378 * Remove the first matching {@link SetParameter} item from the underlying collection. 379 * @param item the item to remove 380 * @return {@code true} if the item was removed or {@code false} otherwise 381 */ 382 public boolean removeSetParameter(SetParameter item) { 383 SetParameter value = ObjectUtils.requireNonNull(item,"item cannot be null"); 384 return _setParameters != null && _setParameters.remove(value); 385 } 386 387 /** 388 * Get the "{@literal Responsible Role}". 389 * 390 * <p> 391 * A reference to a role with responsibility for performing a function relative to the containing object, optionally associated with a set of persons and/or organizations that perform that role. 392 * 393 * @return the responsible-role value 394 */ 395 @NonNull 396 public List<ResponsibleRole> getResponsibleRoles() { 397 if (_responsibleRoles == null) { 398 _responsibleRoles = new LinkedList<>(); 399 } 400 return ObjectUtils.notNull(_responsibleRoles); 401 } 402 403 /** 404 * Set the "{@literal Responsible Role}". 405 * 406 * <p> 407 * A reference to a role with responsibility for performing a function relative to the containing object, optionally associated with a set of persons and/or organizations that perform that role. 408 * 409 * @param value 410 * the responsible-role value to set 411 */ 412 public void setResponsibleRoles(@NonNull List<ResponsibleRole> value) { 413 _responsibleRoles = value; 414 } 415 416 /** 417 * Add a new {@link ResponsibleRole} item to the underlying collection. 418 * @param item the item to add 419 * @return {@code true} 420 */ 421 public boolean addResponsibleRole(ResponsibleRole item) { 422 ResponsibleRole value = ObjectUtils.requireNonNull(item,"item cannot be null"); 423 if (_responsibleRoles == null) { 424 _responsibleRoles = new LinkedList<>(); 425 } 426 return _responsibleRoles.add(value); 427 } 428 429 /** 430 * Remove the first matching {@link ResponsibleRole} item from the underlying collection. 431 * @param item the item to remove 432 * @return {@code true} if the item was removed or {@code false} otherwise 433 */ 434 public boolean removeResponsibleRole(ResponsibleRole item) { 435 ResponsibleRole value = ObjectUtils.requireNonNull(item,"item cannot be null"); 436 return _responsibleRoles != null && _responsibleRoles.remove(value); 437 } 438 439 /** 440 * Get the "{@literal Specific Control Statement}". 441 * 442 * <p> 443 * Identifies which statements within a control are addressed. 444 * 445 * @return the statement value 446 */ 447 @NonNull 448 public List<Statement> getStatements() { 449 if (_statements == null) { 450 _statements = new LinkedList<>(); 451 } 452 return ObjectUtils.notNull(_statements); 453 } 454 455 /** 456 * Set the "{@literal Specific Control Statement}". 457 * 458 * <p> 459 * Identifies which statements within a control are addressed. 460 * 461 * @param value 462 * the statement value to set 463 */ 464 public void setStatements(@NonNull List<Statement> value) { 465 _statements = value; 466 } 467 468 /** 469 * Add a new {@link Statement} item to the underlying collection. 470 * @param item the item to add 471 * @return {@code true} 472 */ 473 public boolean addStatement(Statement item) { 474 Statement value = ObjectUtils.requireNonNull(item,"item cannot be null"); 475 if (_statements == null) { 476 _statements = new LinkedList<>(); 477 } 478 return _statements.add(value); 479 } 480 481 /** 482 * Remove the first matching {@link Statement} item from the underlying collection. 483 * @param item the item to remove 484 * @return {@code true} if the item was removed or {@code false} otherwise 485 */ 486 public boolean removeStatement(Statement item) { 487 Statement value = ObjectUtils.requireNonNull(item,"item cannot be null"); 488 return _statements != null && _statements.remove(value); 489 } 490 491 /** 492 * Get the "{@literal Component Control Implementation}". 493 * 494 * <p> 495 * Defines how the referenced component implements a set of controls. 496 * 497 * @return the by-component value 498 */ 499 @NonNull 500 public List<ByComponent> getByComponents() { 501 if (_byComponents == null) { 502 _byComponents = new LinkedList<>(); 503 } 504 return ObjectUtils.notNull(_byComponents); 505 } 506 507 /** 508 * Set the "{@literal Component Control Implementation}". 509 * 510 * <p> 511 * Defines how the referenced component implements a set of controls. 512 * 513 * @param value 514 * the by-component value to set 515 */ 516 public void setByComponents(@NonNull List<ByComponent> value) { 517 _byComponents = value; 518 } 519 520 /** 521 * Add a new {@link ByComponent} item to the underlying collection. 522 * @param item the item to add 523 * @return {@code true} 524 */ 525 public boolean addByComponent(ByComponent item) { 526 ByComponent value = ObjectUtils.requireNonNull(item,"item cannot be null"); 527 if (_byComponents == null) { 528 _byComponents = new LinkedList<>(); 529 } 530 return _byComponents.add(value); 531 } 532 533 /** 534 * Remove the first matching {@link ByComponent} item from the underlying collection. 535 * @param item the item to remove 536 * @return {@code true} if the item was removed or {@code false} otherwise 537 */ 538 public boolean removeByComponent(ByComponent item) { 539 ByComponent value = ObjectUtils.requireNonNull(item,"item cannot be null"); 540 return _byComponents != null && _byComponents.remove(value); 541 } 542 543 /** 544 * Get the "{@literal Remarks}". 545 * 546 * <p> 547 * Additional commentary about the containing object. 548 * 549 * @return the remarks value, or {@code null} if not set 550 */ 551 @Nullable 552 public MarkupMultiline getRemarks() { 553 return _remarks; 554 } 555 556 /** 557 * Set the "{@literal Remarks}". 558 * 559 * <p> 560 * Additional commentary about the containing object. 561 * 562 * @param value 563 * the remarks value to set, or {@code null} to clear 564 */ 565 public void setRemarks(@Nullable MarkupMultiline value) { 566 _remarks = value; 567 } 568 569 @Override 570 public String toString() { 571 return ObjectUtils.notNull(new ReflectionToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).toString()); 572 } 573}