001package org.schemastore.json.sarif.x210; 002 003import gov.nist.secauto.metaschema.core.datatype.adapter.IntegerAdapter; 004import gov.nist.secauto.metaschema.core.datatype.adapter.UriReferenceAdapter; 005import gov.nist.secauto.metaschema.core.model.IBoundObject; 006import gov.nist.secauto.metaschema.core.model.IMetaschemaData; 007import gov.nist.secauto.metaschema.core.model.constraint.IConstraint; 008import gov.nist.secauto.metaschema.databind.model.annotations.BoundAssembly; 009import gov.nist.secauto.metaschema.databind.model.annotations.BoundField; 010import gov.nist.secauto.metaschema.databind.model.annotations.Expect; 011import gov.nist.secauto.metaschema.databind.model.annotations.MetaschemaAssembly; 012import gov.nist.secauto.metaschema.databind.model.annotations.ValueConstraints; 013import java.lang.Override; 014import java.lang.String; 015import java.math.BigInteger; 016import java.net.URI; 017import org.apache.commons.lang3.builder.ReflectionToStringBuilder; 018import org.apache.commons.lang3.builder.ToStringStyle; 019 020/** 021 * Specifies the location of an artifact. 022 */ 023@MetaschemaAssembly( 024 formalName = "Artifact Location", 025 description = "Specifies the location of an artifact.", 026 name = "artifactLocation", 027 moduleClass = SarifModule.class 028) 029public class ArtifactLocation implements IBoundObject { 030 private final IMetaschemaData __metaschemaData; 031 032 @BoundField( 033 formalName = "URI", 034 description = "A valid relative or absolute URI.", 035 useName = "uri", 036 typeAdapter = UriReferenceAdapter.class 037 ) 038 private URI _uri; 039 040 @BoundField( 041 formalName = "Index", 042 description = "The index within the run artifacts array of the artifact object associated with the artifact location.", 043 useName = "index", 044 defaultValue = "-1", 045 typeAdapter = IntegerAdapter.class, 046 valueConstraints = @ValueConstraints(expect = @Expect(level = IConstraint.Level.ERROR, test = "@id >= -1", message = "The index '{ . }' is not greater than or equal to '-1'.")) 047 ) 048 private BigInteger _index; 049 050 @BoundAssembly( 051 formalName = "Description", 052 description = "A short description of the artifact location.", 053 useName = "description" 054 ) 055 private Message _description; 056 057 public ArtifactLocation() { 058 this(null); 059 } 060 061 public ArtifactLocation(IMetaschemaData data) { 062 this.__metaschemaData = data; 063 } 064 065 @Override 066 public IMetaschemaData getMetaschemaData() { 067 return __metaschemaData; 068 } 069 070 public URI getUri() { 071 return _uri; 072 } 073 074 public void setUri(URI value) { 075 _uri = value; 076 } 077 078 public BigInteger getIndex() { 079 return _index; 080 } 081 082 public void setIndex(BigInteger value) { 083 _index = value; 084 } 085 086 public Message getDescription() { 087 return _description; 088 } 089 090 public void setDescription(Message value) { 091 _description = value; 092 } 093 094 @Override 095 public String toString() { 096 return new ReflectionToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).toString(); 097 } 098}