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.markup.MarkupMultiline; 006import dev.metaschema.core.datatype.markup.MarkupMultilineAdapter; 007import dev.metaschema.core.model.IBoundObject; 008import dev.metaschema.core.model.IMetaschemaData; 009import dev.metaschema.core.model.JsonGroupAsBehavior; 010import dev.metaschema.core.model.constraint.IConstraint; 011import dev.metaschema.core.util.ObjectUtils; 012import dev.metaschema.databind.model.annotations.AssemblyConstraints; 013import dev.metaschema.databind.model.annotations.BoundAssembly; 014import dev.metaschema.databind.model.annotations.BoundField; 015import dev.metaschema.databind.model.annotations.GroupAs; 016import dev.metaschema.databind.model.annotations.IsUnique; 017import dev.metaschema.databind.model.annotations.KeyField; 018import dev.metaschema.databind.model.annotations.MetaschemaAssembly; 019import edu.umd.cs.findbugs.annotations.NonNull; 020import edu.umd.cs.findbugs.annotations.Nullable; 021import java.util.LinkedList; 022import java.util.List; 023import org.apache.commons.lang3.builder.ReflectionToStringBuilder; 024import org.apache.commons.lang3.builder.ToStringStyle; 025 026/** 027 * A description of the logical flow of information within the system and across its boundaries, optionally supplemented by diagrams that illustrate these flows. 028 */ 029@MetaschemaAssembly( 030 formalName = "Data Flow", 031 description = "A description of the logical flow of information within the system and across its boundaries, optionally supplemented by diagrams that illustrate these flows.", 032 name = "data-flow", 033 moduleClass = OscalSspModule.class, 034 modelConstraints = @AssemblyConstraints(unique = @IsUnique(id = "oscal-unique-ssp-data-flow-diagram", level = IConstraint.Level.ERROR, target = "diagram", keyFields = @KeyField(target = "@uuid"), remarks = "A given `uuid` must be assigned only once to a diagram.")) 035) 036public class DataFlow implements IBoundObject { 037 private final IMetaschemaData __metaschemaData; 038 039 /** 040 * A summary of the system's data flow. 041 */ 042 @BoundField( 043 formalName = "Data Flow Description", 044 description = "A summary of the system's data flow.", 045 useName = "description", 046 minOccurs = 1, 047 typeAdapter = MarkupMultilineAdapter.class 048 ) 049 private MarkupMultiline _description; 050 051 /** 052 * An attribute, characteristic, or quality of the containing object expressed as a namespace qualified name/value pair. 053 */ 054 @BoundAssembly( 055 formalName = "Property", 056 description = "An attribute, characteristic, or quality of the containing object expressed as a namespace qualified name/value pair.", 057 useName = "prop", 058 maxOccurs = -1, 059 groupAs = @GroupAs(name = "props", inJson = JsonGroupAsBehavior.LIST) 060 ) 061 private List<Property> _props; 062 063 /** 064 * A reference to a local or remote resource, that has a specific relation to the containing object. 065 */ 066 @BoundAssembly( 067 formalName = "Link", 068 description = "A reference to a local or remote resource, that has a specific relation to the containing object.", 069 useName = "link", 070 maxOccurs = -1, 071 groupAs = @GroupAs(name = "links", inJson = JsonGroupAsBehavior.LIST) 072 ) 073 private List<Link> _links; 074 075 /** 076 * A graphic that provides a visual representation the system, or some aspect of it. 077 */ 078 @BoundAssembly( 079 formalName = "Diagram", 080 description = "A graphic that provides a visual representation the system, or some aspect of it.", 081 useName = "diagram", 082 maxOccurs = -1, 083 groupAs = @GroupAs(name = "diagrams", inJson = JsonGroupAsBehavior.LIST) 084 ) 085 private List<Diagram> _diagrams; 086 087 /** 088 * Additional commentary about the containing object. 089 */ 090 @BoundField( 091 formalName = "Remarks", 092 description = "Additional commentary about the containing object.", 093 useName = "remarks", 094 typeAdapter = MarkupMultilineAdapter.class 095 ) 096 private MarkupMultiline _remarks; 097 098 /** 099 * Constructs a new {@code dev.metaschema.oscal.lib.model.DataFlow} instance with no metadata. 100 */ 101 public DataFlow() { 102 this(null); 103 } 104 105 /** 106 * Constructs a new {@code dev.metaschema.oscal.lib.model.DataFlow} instance with the specified metadata. 107 * 108 * @param data 109 * the metaschema data, or {@code null} if none 110 */ 111 public DataFlow(IMetaschemaData data) { 112 this.__metaschemaData = data; 113 } 114 115 @Override 116 public IMetaschemaData getMetaschemaData() { 117 return __metaschemaData; 118 } 119 120 /** 121 * Get the "{@literal Data Flow Description}". 122 * 123 * <p> 124 * A summary of the system's data flow. 125 * 126 * @return the description value 127 */ 128 @NonNull 129 public MarkupMultiline getDescription() { 130 return _description; 131 } 132 133 /** 134 * Set the "{@literal Data Flow Description}". 135 * 136 * <p> 137 * A summary of the system's data flow. 138 * 139 * @param value 140 * the description value to set 141 */ 142 public void setDescription(@NonNull MarkupMultiline value) { 143 _description = value; 144 } 145 146 /** 147 * Get the "{@literal Property}". 148 * 149 * <p> 150 * An attribute, characteristic, or quality of the containing object expressed as a namespace qualified name/value pair. 151 * 152 * @return the prop value 153 */ 154 @NonNull 155 public List<Property> getProps() { 156 if (_props == null) { 157 _props = new LinkedList<>(); 158 } 159 return ObjectUtils.notNull(_props); 160 } 161 162 /** 163 * Set the "{@literal Property}". 164 * 165 * <p> 166 * An attribute, characteristic, or quality of the containing object expressed as a namespace qualified name/value pair. 167 * 168 * @param value 169 * the prop value to set 170 */ 171 public void setProps(@NonNull List<Property> value) { 172 _props = value; 173 } 174 175 /** 176 * Add a new {@link Property} item to the underlying collection. 177 * @param item the item to add 178 * @return {@code true} 179 */ 180 public boolean addProp(Property item) { 181 Property value = ObjectUtils.requireNonNull(item,"item cannot be null"); 182 if (_props == null) { 183 _props = new LinkedList<>(); 184 } 185 return _props.add(value); 186 } 187 188 /** 189 * Remove the first matching {@link Property} item from the underlying collection. 190 * @param item the item to remove 191 * @return {@code true} if the item was removed or {@code false} otherwise 192 */ 193 public boolean removeProp(Property item) { 194 Property value = ObjectUtils.requireNonNull(item,"item cannot be null"); 195 return _props != null && _props.remove(value); 196 } 197 198 /** 199 * Get the "{@literal Link}". 200 * 201 * <p> 202 * A reference to a local or remote resource, that has a specific relation to the containing object. 203 * 204 * @return the link value 205 */ 206 @NonNull 207 public List<Link> getLinks() { 208 if (_links == null) { 209 _links = new LinkedList<>(); 210 } 211 return ObjectUtils.notNull(_links); 212 } 213 214 /** 215 * Set the "{@literal Link}". 216 * 217 * <p> 218 * A reference to a local or remote resource, that has a specific relation to the containing object. 219 * 220 * @param value 221 * the link value to set 222 */ 223 public void setLinks(@NonNull List<Link> value) { 224 _links = value; 225 } 226 227 /** 228 * Add a new {@link Link} item to the underlying collection. 229 * @param item the item to add 230 * @return {@code true} 231 */ 232 public boolean addLink(Link item) { 233 Link value = ObjectUtils.requireNonNull(item,"item cannot be null"); 234 if (_links == null) { 235 _links = new LinkedList<>(); 236 } 237 return _links.add(value); 238 } 239 240 /** 241 * Remove the first matching {@link Link} item from the underlying collection. 242 * @param item the item to remove 243 * @return {@code true} if the item was removed or {@code false} otherwise 244 */ 245 public boolean removeLink(Link item) { 246 Link value = ObjectUtils.requireNonNull(item,"item cannot be null"); 247 return _links != null && _links.remove(value); 248 } 249 250 /** 251 * Get the "{@literal Diagram}". 252 * 253 * <p> 254 * A graphic that provides a visual representation the system, or some aspect of it. 255 * 256 * @return the diagram value 257 */ 258 @NonNull 259 public List<Diagram> getDiagrams() { 260 if (_diagrams == null) { 261 _diagrams = new LinkedList<>(); 262 } 263 return ObjectUtils.notNull(_diagrams); 264 } 265 266 /** 267 * Set the "{@literal Diagram}". 268 * 269 * <p> 270 * A graphic that provides a visual representation the system, or some aspect of it. 271 * 272 * @param value 273 * the diagram value to set 274 */ 275 public void setDiagrams(@NonNull List<Diagram> value) { 276 _diagrams = value; 277 } 278 279 /** 280 * Add a new {@link Diagram} item to the underlying collection. 281 * @param item the item to add 282 * @return {@code true} 283 */ 284 public boolean addDiagram(Diagram item) { 285 Diagram value = ObjectUtils.requireNonNull(item,"item cannot be null"); 286 if (_diagrams == null) { 287 _diagrams = new LinkedList<>(); 288 } 289 return _diagrams.add(value); 290 } 291 292 /** 293 * Remove the first matching {@link Diagram} item from the underlying collection. 294 * @param item the item to remove 295 * @return {@code true} if the item was removed or {@code false} otherwise 296 */ 297 public boolean removeDiagram(Diagram item) { 298 Diagram value = ObjectUtils.requireNonNull(item,"item cannot be null"); 299 return _diagrams != null && _diagrams.remove(value); 300 } 301 302 /** 303 * Get the "{@literal Remarks}". 304 * 305 * <p> 306 * Additional commentary about the containing object. 307 * 308 * @return the remarks value, or {@code null} if not set 309 */ 310 @Nullable 311 public MarkupMultiline getRemarks() { 312 return _remarks; 313 } 314 315 /** 316 * Set the "{@literal Remarks}". 317 * 318 * <p> 319 * Additional commentary about the containing object. 320 * 321 * @param value 322 * the remarks value to set, or {@code null} to clear 323 */ 324 public void setRemarks(@Nullable MarkupMultiline value) { 325 _remarks = value; 326 } 327 328 @Override 329 public String toString() { 330 return ObjectUtils.notNull(new ReflectionToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).toString()); 331 } 332}