001package org.hl7.fhir.r5.utils.structuremap;
002
003import org.hl7.fhir.r5.model.Base;
004import org.hl7.fhir.r5.model.PrimitiveType;
005
006public class Variable {
007  private VariableMode mode;
008  private String name;
009  private Base object;
010
011  public Variable(VariableMode mode, String name, Base object) {
012    super();
013    this.mode = mode;
014    this.name = name;
015    this.object = object;
016  }
017
018  public VariableMode getMode() {
019    return mode;
020  }
021
022  public String getName() {
023    return name;
024  }
025
026  public Base getObject() {
027    return object;
028  }
029
030  public String summary() {
031    if (object == null)
032      return null;
033    else if (object instanceof PrimitiveType)
034      return name + ": \"" + ((PrimitiveType) object).asStringValue() + '"';
035    else
036      return name + ": (" + object.fhirType() + ")";
037  }
038}