@Override
  public String toString() {
    StringBuilder sb = new StringBuilder("Stack name:" + name + "\nversion:" +
      version + "\nactive:" + active + " \nvalid:" + isValid());
    if (services != null) {
      sb.append("\n\t\tService:");
      for (ServiceInfo service : services) {
        sb.append("\t\t");
        sb.append(service);
      }
    }

    if (repositories != null) {
      sb.append("\n\t\tRepositories:");
      for (RepositoryInfo repository : repositories) {
        sb.append("\t\t");
        sb.append(repository);
      }
    }

    return sb.toString();
  }
Set all types and associated attributes.  Any previously existing types and
attributes are removed prior to setting the new values.

@param types map of type attributes
ambari-server/src/main/java/org/apache/ambari/server/state/StackInfo.java