001// Generated from: ../../../../../../../../oscal/src/metaschema/oscal_assessment-common_metaschema.xml
002// Do not edit - changes will be lost when regenerated.
003package dev.metaschema.oscal.lib.model;
004
005import dev.metaschema.core.datatype.adapter.TokenAdapter;
006import dev.metaschema.core.datatype.adapter.UuidAdapter;
007import dev.metaschema.core.model.IBoundObject;
008import dev.metaschema.core.model.IMetaschemaData;
009import dev.metaschema.core.util.ObjectUtils;
010import dev.metaschema.databind.model.annotations.BoundFlag;
011import dev.metaschema.databind.model.annotations.MetaschemaAssembly;
012import edu.umd.cs.findbugs.annotations.NonNull;
013import edu.umd.cs.findbugs.annotations.Nullable;
014import java.util.UUID;
015import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
016import org.apache.commons.lang3.builder.ToStringStyle;
017
018/**
019 * Used to indicate who created a log entry in what role.
020 */
021@MetaschemaAssembly(
022    formalName = "Logged By",
023    description = "Used to indicate who created a log entry in what role.",
024    name = "logged-by",
025    moduleClass = OscalAssessmentCommonModule.class
026)
027public class LoggedBy implements IBoundObject {
028  private final IMetaschemaData __metaschemaData;
029
030  /**
031   * A <a href="https://pages.nist.gov/OSCAL/concepts/identifier-use/#machine-oriented">machine-oriented</a> identifier reference to the party who is making the log entry.
032   */
033  @BoundFlag(
034      formalName = "Party UUID Reference",
035      description = "A [machine-oriented](https://pages.nist.gov/OSCAL/concepts/identifier-use/#machine-oriented) identifier reference to the party who is making the log entry.",
036      name = "party-uuid",
037      required = true,
038      typeAdapter = UuidAdapter.class
039  )
040  private UUID _partyUuid;
041
042  /**
043   * A point to the role-id of the role in which the party is making the log entry.
044   */
045  @BoundFlag(
046      formalName = "Actor Role",
047      description = "A point to the role-id of the role in which the party is making the log entry.",
048      name = "role-id",
049      typeAdapter = TokenAdapter.class
050  )
051  private String _roleId;
052
053  /**
054   * Constructs a new {@code dev.metaschema.oscal.lib.model.LoggedBy} instance with no metadata.
055   */
056  public LoggedBy() {
057    this(null);
058  }
059
060  /**
061   * Constructs a new {@code dev.metaschema.oscal.lib.model.LoggedBy} instance with the specified metadata.
062   *
063   * @param data
064   *           the metaschema data, or {@code null} if none
065   */
066  public LoggedBy(IMetaschemaData data) {
067    this.__metaschemaData = data;
068  }
069
070  @Override
071  public IMetaschemaData getMetaschemaData() {
072    return __metaschemaData;
073  }
074
075  /**
076   * Get the "{@literal Party UUID Reference}".
077   *
078   * <p>
079   * A <a href="https://pages.nist.gov/OSCAL/concepts/identifier-use/#machine-oriented">machine-oriented</a> identifier reference to the party who is making the log entry.
080   *
081   * @return the party-uuid value
082   */
083  @NonNull
084  public UUID getPartyUuid() {
085    return _partyUuid;
086  }
087
088  /**
089   * Set the "{@literal Party UUID Reference}".
090   *
091   * <p>
092   * A <a href="https://pages.nist.gov/OSCAL/concepts/identifier-use/#machine-oriented">machine-oriented</a> identifier reference to the party who is making the log entry.
093   *
094   * @param value
095   *           the party-uuid value to set
096   */
097  public void setPartyUuid(@NonNull UUID value) {
098    _partyUuid = value;
099  }
100
101  /**
102   * Get the "{@literal Actor Role}".
103   *
104   * <p>
105   * A point to the role-id of the role in which the party is making the log entry.
106   *
107   * @return the role-id value, or {@code null} if not set
108   */
109  @Nullable
110  public String getRoleId() {
111    return _roleId;
112  }
113
114  /**
115   * Set the "{@literal Actor Role}".
116   *
117   * <p>
118   * A point to the role-id of the role in which the party is making the log entry.
119   *
120   * @param value
121   *           the role-id value to set, or {@code null} to clear
122   */
123  public void setRoleId(@Nullable String value) {
124    _roleId = value;
125  }
126
127  @Override
128  public String toString() {
129    return ObjectUtils.notNull(new ReflectionToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).toString());
130  }
131}