Location.java

package org.schemastore.json.sarif.x210;

import gov.nist.secauto.metaschema.core.datatype.adapter.IntegerAdapter;
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.BoundFlag;
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 org.apache.commons.lang3.builder.ReflectionToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

/**
 * A location within a programming artifact.
 */
@MetaschemaAssembly(
    formalName = "Location",
    description = "A location within a programming artifact.",
    name = "location",
    moduleClass = SarifModule.class,
    valueConstraints = @ValueConstraints(expect = @Expect(level = IConstraint.Level.ERROR, test = "@id >= -1", message = "The id '{ . }' is not greater than or equal to '-1'."))
)
public class Location implements IBoundObject {
  private final IMetaschemaData __metaschemaData;

  /**
   * "A value that distinguishes this location from all other locations within a single result object."
   */
  @BoundFlag(
      formalName = "Location Identifier",
      description = "A value that distinguishes this location from all other locations within a single result object.",
      name = "id",
      defaultValue = "-1",
      typeAdapter = IntegerAdapter.class
  )
  private BigInteger _id;

  @BoundAssembly(
      formalName = "Physical Location",
      description = "A physical location relevant to a result. Specifies a reference to a programming artifact together with a range of bytes or characters within that artifact.",
      useName = "physicalLocation"
  )
  private PhysicalLocation _physicalLocation;

  @BoundAssembly(
      formalName = "Logical Location",
      description = "The logical locations associated with the result.",
      useName = "logicalLocation"
  )
  private LogicalLocation _logicalLocation;

  @BoundAssembly(
      formalName = "Location Message",
      description = "A message relevant to the location.",
      useName = "message"
  )
  private Message _message;

  public Location() {
    this(null);
  }

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

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

  public BigInteger getId() {
    return _id;
  }

  public void setId(BigInteger value) {
    _id = value;
  }

  public PhysicalLocation getPhysicalLocation() {
    return _physicalLocation;
  }

  public void setPhysicalLocation(PhysicalLocation value) {
    _physicalLocation = value;
  }

  public LogicalLocation getLogicalLocation() {
    return _logicalLocation;
  }

  public void setLogicalLocation(LogicalLocation value) {
    _logicalLocation = value;
  }

  public Message getMessage() {
    return _message;
  }

  public void setMessage(Message value) {
    _message = value;
  }

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