001package org.hl7.fhir.utilities.i18n.subtag;
002
003import lombok.Getter;
004import lombok.Setter;
005
006import java.util.ArrayList;
007import java.util.List;
008
009public abstract class Subtag {
010
011
012  @Getter @Setter
013  private String added;
014
015  @Getter @Setter
016  private String deprecated;
017
018  private List<String> descriptions = new ArrayList<>();
019
020  private List<String> comments = new ArrayList<>();
021
022  @Getter
023  private final String subtag;
024
025
026  protected Subtag(String subtag){
027    this.subtag = subtag;
028  }
029
030  protected boolean addDescription(String description) {
031    return descriptions.add(description);
032  }
033
034  public List<String> getDescriptions() {
035    return List.copyOf(descriptions);
036  }
037
038  protected boolean addComments(String comment) {
039    return comments.add(comment);
040  }
041
042  public List<String> getComments() {
043    return List.copyOf(comments);
044  }
045  
046  public String getDisplay() {
047    if (descriptions.size() == 0) {
048      return "";
049    } else {
050      return descriptions.get(0);
051    }
052  }
053}