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 this system's authorization boundary, optionally supplemented by diagrams that illustrate the authorization boundary. 028 */ 029@MetaschemaAssembly( 030 formalName = "Authorization Boundary", 031 description = "A description of this system's authorization boundary, optionally supplemented by diagrams that illustrate the authorization boundary.", 032 name = "authorization-boundary", 033 moduleClass = OscalSspModule.class, 034 modelConstraints = @AssemblyConstraints(unique = @IsUnique(id = "oscal-unique-ssp-authorization-boundary-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 AuthorizationBoundary implements IBoundObject { 037 private final IMetaschemaData __metaschemaData; 038 039 /** 040 * A summary of the system's authorization boundary. 041 */ 042 @BoundField( 043 formalName = "Authorization Boundary Description", 044 description = "A summary of the system's authorization boundary.", 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 remarks = "A visual depiction of the system's authorization boundary.", 083 maxOccurs = -1, 084 groupAs = @GroupAs(name = "diagrams", inJson = JsonGroupAsBehavior.LIST) 085 ) 086 private List<Diagram> _diagrams; 087 088 /** 089 * Additional commentary about the containing object. 090 */ 091 @BoundField( 092 formalName = "Remarks", 093 description = "Additional commentary about the containing object.", 094 useName = "remarks", 095 typeAdapter = MarkupMultilineAdapter.class 096 ) 097 private MarkupMultiline _remarks; 098 099 /** 100 * Constructs a new {@code dev.metaschema.oscal.lib.model.AuthorizationBoundary} instance with no metadata. 101 */ 102 public AuthorizationBoundary() { 103 this(null); 104 } 105 106 /** 107 * Constructs a new {@code dev.metaschema.oscal.lib.model.AuthorizationBoundary} instance with the specified metadata. 108 * 109 * @param data 110 * the metaschema data, or {@code null} if none 111 */ 112 public AuthorizationBoundary(IMetaschemaData data) { 113 this.__metaschemaData = data; 114 } 115 116 @Override 117 public IMetaschemaData getMetaschemaData() { 118 return __metaschemaData; 119 } 120 121 /** 122 * Get the "{@literal Authorization Boundary Description}". 123 * 124 * <p> 125 * A summary of the system's authorization boundary. 126 * 127 * @return the description value 128 */ 129 @NonNull 130 public MarkupMultiline getDescription() { 131 return _description; 132 } 133 134 /** 135 * Set the "{@literal Authorization Boundary Description}". 136 * 137 * <p> 138 * A summary of the system's authorization boundary. 139 * 140 * @param value 141 * the description value to set 142 */ 143 public void setDescription(@NonNull MarkupMultiline value) { 144 _description = value; 145 } 146 147 /** 148 * Get the "{@literal Property}". 149 * 150 * <p> 151 * An attribute, characteristic, or quality of the containing object expressed as a namespace qualified name/value pair. 152 * 153 * @return the prop value 154 */ 155 @NonNull 156 public List<Property> getProps() { 157 if (_props == null) { 158 _props = new LinkedList<>(); 159 } 160 return ObjectUtils.notNull(_props); 161 } 162 163 /** 164 * Set the "{@literal Property}". 165 * 166 * <p> 167 * An attribute, characteristic, or quality of the containing object expressed as a namespace qualified name/value pair. 168 * 169 * @param value 170 * the prop value to set 171 */ 172 public void setProps(@NonNull List<Property> value) { 173 _props = value; 174 } 175 176 /** 177 * Add a new {@link Property} item to the underlying collection. 178 * @param item the item to add 179 * @return {@code true} 180 */ 181 public boolean addProp(Property item) { 182 Property value = ObjectUtils.requireNonNull(item,"item cannot be null"); 183 if (_props == null) { 184 _props = new LinkedList<>(); 185 } 186 return _props.add(value); 187 } 188 189 /** 190 * Remove the first matching {@link Property} item from the underlying collection. 191 * @param item the item to remove 192 * @return {@code true} if the item was removed or {@code false} otherwise 193 */ 194 public boolean removeProp(Property item) { 195 Property value = ObjectUtils.requireNonNull(item,"item cannot be null"); 196 return _props != null && _props.remove(value); 197 } 198 199 /** 200 * Get the "{@literal Link}". 201 * 202 * <p> 203 * A reference to a local or remote resource, that has a specific relation to the containing object. 204 * 205 * @return the link value 206 */ 207 @NonNull 208 public List<Link> getLinks() { 209 if (_links == null) { 210 _links = new LinkedList<>(); 211 } 212 return ObjectUtils.notNull(_links); 213 } 214 215 /** 216 * Set the "{@literal Link}". 217 * 218 * <p> 219 * A reference to a local or remote resource, that has a specific relation to the containing object. 220 * 221 * @param value 222 * the link value to set 223 */ 224 public void setLinks(@NonNull List<Link> value) { 225 _links = value; 226 } 227 228 /** 229 * Add a new {@link Link} item to the underlying collection. 230 * @param item the item to add 231 * @return {@code true} 232 */ 233 public boolean addLink(Link item) { 234 Link value = ObjectUtils.requireNonNull(item,"item cannot be null"); 235 if (_links == null) { 236 _links = new LinkedList<>(); 237 } 238 return _links.add(value); 239 } 240 241 /** 242 * Remove the first matching {@link Link} item from the underlying collection. 243 * @param item the item to remove 244 * @return {@code true} if the item was removed or {@code false} otherwise 245 */ 246 public boolean removeLink(Link item) { 247 Link value = ObjectUtils.requireNonNull(item,"item cannot be null"); 248 return _links != null && _links.remove(value); 249 } 250 251 /** 252 * Get the "{@literal Diagram}". 253 * 254 * <p> 255 * A graphic that provides a visual representation the system, or some aspect of it. 256 * 257 * @return the diagram value 258 */ 259 @NonNull 260 public List<Diagram> getDiagrams() { 261 if (_diagrams == null) { 262 _diagrams = new LinkedList<>(); 263 } 264 return ObjectUtils.notNull(_diagrams); 265 } 266 267 /** 268 * Set the "{@literal Diagram}". 269 * 270 * <p> 271 * A graphic that provides a visual representation the system, or some aspect of it. 272 * 273 * @param value 274 * the diagram value to set 275 */ 276 public void setDiagrams(@NonNull List<Diagram> value) { 277 _diagrams = value; 278 } 279 280 /** 281 * Add a new {@link Diagram} item to the underlying collection. 282 * @param item the item to add 283 * @return {@code true} 284 */ 285 public boolean addDiagram(Diagram item) { 286 Diagram value = ObjectUtils.requireNonNull(item,"item cannot be null"); 287 if (_diagrams == null) { 288 _diagrams = new LinkedList<>(); 289 } 290 return _diagrams.add(value); 291 } 292 293 /** 294 * Remove the first matching {@link Diagram} item from the underlying collection. 295 * @param item the item to remove 296 * @return {@code true} if the item was removed or {@code false} otherwise 297 */ 298 public boolean removeDiagram(Diagram item) { 299 Diagram value = ObjectUtils.requireNonNull(item,"item cannot be null"); 300 return _diagrams != null && _diagrams.remove(value); 301 } 302 303 /** 304 * Get the "{@literal Remarks}". 305 * 306 * <p> 307 * Additional commentary about the containing object. 308 * 309 * @return the remarks value, or {@code null} if not set 310 */ 311 @Nullable 312 public MarkupMultiline getRemarks() { 313 return _remarks; 314 } 315 316 /** 317 * Set the "{@literal Remarks}". 318 * 319 * <p> 320 * Additional commentary about the containing object. 321 * 322 * @param value 323 * the remarks value to set, or {@code null} to clear 324 */ 325 public void setRemarks(@Nullable MarkupMultiline value) { 326 _remarks = value; 327 } 328 329 @Override 330 public String toString() { 331 return ObjectUtils.notNull(new ReflectionToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).toString()); 332 } 333}