public ViewInstanceDataEntity getInstanceData(String key) {
    String user = getCurrentUserName();

    for (ViewInstanceDataEntity viewInstanceDataEntity : data) {
      if (viewInstanceDataEntity.getName().equals(key) &&
        viewInstanceDataEntity.getUser().equals(user)) {
        return viewInstanceDataEntity;
      }
    }
    return null;
  }
Get the instance data entity for the given key.

@param key the key
@return the instance data entity associated with the given key
ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ViewInstanceEntity.java