public ViewInstanceEntity getInstanceDefinition(String instanceName) {
    for (ViewInstanceEntity viewInstanceEntity : instances) {
      if (viewInstanceEntity.getName().equals(instanceName)) {
        return viewInstanceEntity;
      }
    }
    return null;
  }
Get an instance definition for the given name.

@param instanceName  the instance name

@return the instance definition
ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ViewEntity.java