private static ViewInstanceDataEntity getInstanceData(ViewInstanceEntity instanceDefinition, String user, String key) {
    for (ViewInstanceDataEntity viewInstanceDataEntity : instanceDefinition.getData()) {
      if (viewInstanceDataEntity.getName().equals(key) &&
          viewInstanceDataEntity.getUser().equals(user)) {
        return viewInstanceDataEntity;
      }
    }
    return null;
  }
Get the instance data entity for the given key and user.

@param user owner of the data
@param key the key
@return the instance data entity associated with the given key and user
ambari-server/src/main/java/org/apache/ambari/server/view/ViewDataMigrationContextImpl.java