001package com.example.metaschema;
002
003import gov.nist.secauto.metaschema.core.datatype.adapter.NonNegativeIntegerAdapter;
004import gov.nist.secauto.metaschema.core.datatype.adapter.TokenAdapter;
005import gov.nist.secauto.metaschema.core.model.IBoundObject;
006import gov.nist.secauto.metaschema.core.model.IMetaschemaData;
007import gov.nist.secauto.metaschema.databind.model.annotations.BoundFieldValue;
008import gov.nist.secauto.metaschema.databind.model.annotations.BoundFlag;
009import gov.nist.secauto.metaschema.databind.model.annotations.MetaschemaField;
010import java.lang.Override;
011import java.lang.String;
012import java.math.BigInteger;
013import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
014import org.apache.commons.lang3.builder.ToStringStyle;
015
016/**
017 * Allows the name of the definition to be overridden.
018 */
019@MetaschemaField(
020    formalName = "Use Name",
021    description = "Allows the name of the definition to be overridden.",
022    name = "use-name",
023    moduleClass = MetaschemaModelModule.class
024)
025public class UseName implements IBoundObject {
026  private final IMetaschemaData __metaschemaData;
027
028  /**
029   * "Used for binary formats instead of the textual name."
030   */
031  @BoundFlag(
032      formalName = "Numeric Index",
033      description = "Used for binary formats instead of the textual name.",
034      name = "index",
035      typeAdapter = NonNegativeIntegerAdapter.class
036  )
037  private BigInteger _index;
038
039  @BoundFieldValue(
040      valueKeyName = "name",
041      typeAdapter = TokenAdapter.class
042  )
043  private String _name;
044
045  public UseName() {
046    this(null);
047  }
048
049  public UseName(IMetaschemaData data) {
050    this.__metaschemaData = data;
051  }
052
053  @Override
054  public IMetaschemaData getMetaschemaData() {
055    return __metaschemaData;
056  }
057
058  public BigInteger getIndex() {
059    return _index;
060  }
061
062  public void setIndex(BigInteger value) {
063    _index = value;
064  }
065
066  public String getName() {
067    return _name;
068  }
069
070  public void setName(String value) {
071    _name = value;
072  }
073
074  @Override
075  public String toString() {
076    return new ReflectionToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).toString();
077  }
078}