001package org.schemastore.json.sarif.x210;
002
003import gov.nist.secauto.metaschema.core.datatype.adapter.IntegerAdapter;
004import gov.nist.secauto.metaschema.core.datatype.adapter.StringAdapter;
005import gov.nist.secauto.metaschema.core.datatype.adapter.UuidAdapter;
006import gov.nist.secauto.metaschema.core.model.IBoundObject;
007import gov.nist.secauto.metaschema.core.model.IMetaschemaData;
008import gov.nist.secauto.metaschema.core.model.constraint.IConstraint;
009import gov.nist.secauto.metaschema.databind.model.annotations.BoundField;
010import gov.nist.secauto.metaschema.databind.model.annotations.BoundFlag;
011import gov.nist.secauto.metaschema.databind.model.annotations.Expect;
012import gov.nist.secauto.metaschema.databind.model.annotations.MetaschemaAssembly;
013import gov.nist.secauto.metaschema.databind.model.annotations.ValueConstraints;
014import java.lang.Override;
015import java.lang.String;
016import java.math.BigInteger;
017import java.util.UUID;
018import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
019import org.apache.commons.lang3.builder.ToStringStyle;
020
021/**
022 * Information about how to locate a relevant reporting descriptor.
023 */
024@MetaschemaAssembly(
025    formalName = "Reporting Descriptor Reference",
026    description = "Information about how to locate a relevant reporting descriptor.",
027    name = "reportingDescriptorReference",
028    moduleClass = SarifModule.class,
029    valueConstraints = @ValueConstraints(expect = @Expect(level = IConstraint.Level.ERROR, test = "@id|@guid|index", message = "At least one id, guid, or index must be provided."))
030)
031public class ReportingDescriptorReference implements IBoundObject {
032  private final IMetaschemaData __metaschemaData;
033
034  /**
035   * "The id of the descriptor."
036   */
037  @BoundFlag(
038      formalName = "Reporting Descriptor Identifier",
039      description = "The id of the descriptor.",
040      name = "id",
041      required = true,
042      typeAdapter = StringAdapter.class
043  )
044  private String _id;
045
046  /**
047   * "A stable, unique identifier for the reporting descriptor."
048   */
049  @BoundFlag(
050      formalName = "Reporting Descriptor Unique Identifier",
051      description = "A stable, unique identifier for the reporting descriptor.",
052      name = "guid",
053      typeAdapter = UuidAdapter.class
054  )
055  private UUID _guid;
056
057  @BoundField(
058      formalName = "Index",
059      description = "The index into an array of descriptors in toolComponent.ruleDescriptors, toolComponent.notificationDescriptors, or toolComponent.taxonomyDescriptors, depending on context.",
060      useName = "index",
061      defaultValue = "-1",
062      typeAdapter = IntegerAdapter.class
063  )
064  private BigInteger _index;
065
066  public ReportingDescriptorReference() {
067    this(null);
068  }
069
070  public ReportingDescriptorReference(IMetaschemaData data) {
071    this.__metaschemaData = data;
072  }
073
074  @Override
075  public IMetaschemaData getMetaschemaData() {
076    return __metaschemaData;
077  }
078
079  public String getId() {
080    return _id;
081  }
082
083  public void setId(String value) {
084    _id = value;
085  }
086
087  public UUID getGuid() {
088    return _guid;
089  }
090
091  public void setGuid(UUID value) {
092    _guid = value;
093  }
094
095  public BigInteger getIndex() {
096    return _index;
097  }
098
099  public void setIndex(BigInteger value) {
100    _index = value;
101  }
102
103  @Override
104  public String toString() {
105    return new ReflectionToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).toString();
106  }
107}