ArtifactLocation.java

package org.schemastore.json.sarif.x210;

import gov.nist.secauto.metaschema.core.datatype.adapter.IntegerAdapter;
import gov.nist.secauto.metaschema.core.datatype.adapter.UriReferenceAdapter;
import gov.nist.secauto.metaschema.core.model.IBoundObject;
import gov.nist.secauto.metaschema.core.model.IMetaschemaData;
import gov.nist.secauto.metaschema.core.model.constraint.IConstraint;
import gov.nist.secauto.metaschema.databind.model.annotations.BoundAssembly;
import gov.nist.secauto.metaschema.databind.model.annotations.BoundField;
import gov.nist.secauto.metaschema.databind.model.annotations.Expect;
import gov.nist.secauto.metaschema.databind.model.annotations.MetaschemaAssembly;
import gov.nist.secauto.metaschema.databind.model.annotations.ValueConstraints;
import java.lang.Override;
import java.lang.String;
import java.math.BigInteger;
import java.net.URI;
import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

/**
 * Specifies the location of an artifact.
 */
@MetaschemaAssembly(
    formalName = "Artifact Location",
    description = "Specifies the location of an artifact.",
    name = "artifactLocation",
    moduleClass = SarifModule.class
)
public class ArtifactLocation implements IBoundObject {
  private final IMetaschemaData __metaschemaData;

  @BoundField(
      formalName = "URI",
      description = "A valid relative or absolute URI.",
      useName = "uri",
      typeAdapter = UriReferenceAdapter.class
  )
  private URI _uri;

  @BoundField(
      formalName = "Index",
      description = "The index within the run artifacts array of the artifact object associated with the artifact location.",
      useName = "index",
      defaultValue = "-1",
      typeAdapter = IntegerAdapter.class,
      valueConstraints = @ValueConstraints(expect = @Expect(level = IConstraint.Level.ERROR, test = "@id >= -1", message = "The index '{ . }' is not greater than or equal to '-1'."))
  )
  private BigInteger _index;

  @BoundAssembly(
      formalName = "Description",
      description = "A short description of the artifact location.",
      useName = "description"
  )
  private Message _description;

  public ArtifactLocation() {
    this(null);
  }

  public ArtifactLocation(IMetaschemaData data) {
    this.__metaschemaData = data;
  }

  @Override
  public IMetaschemaData getMetaschemaData() {
    return __metaschemaData;
  }

  public URI getUri() {
    return _uri;
  }

  public void setUri(URI value) {
    _uri = value;
  }

  public BigInteger getIndex() {
    return _index;
  }

  public void setIndex(BigInteger value) {
    _index = value;
  }

  public Message getDescription() {
    return _description;
  }

  public void setDescription(Message value) {
    _description = value;
  }

  @Override
  public String toString() {
    return new ReflectionToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).toString();
  }
}