Example #1
0
  /**
   * Returns the attributes of the element as unmodifable collection. The collection can be safely
   * stored as it is guaranteed to never change. (However, no assumptions are made about the
   * contents inside the collection.)
   *
   * @return the unmodifiable attribute collection
   */
  public ReportAttributeMap<Object> getAttributes() {
    if (cachedAttributes != null) {
      if (cachedAttributes.getChangeTracker() == attributes.getChangeTracker()) {
        return cachedAttributes;
      }
    }

    cachedAttributes = attributes.createUnmodifiableMap();
    return cachedAttributes;
  }