protected String getResourceTypeFromResources(Set<Resource> resources) {
    String resType = null;
    if (resources != null) {
      Iterator<Resource> itr = resources.iterator();
      if (itr.hasNext()) {
        // Pick the 1st resource, as the passed in resources will have same Type,
        // in a given call.
        Resource res = itr.next();
        if (res != null) {
          resType = res.getType().toString();
        }
      }
    }
    return resType;
  }
Retrieves passed-in Resource's Type

@param resources Set of Resources.
@return Type of resource from the Set.
ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AbstractPropertyProvider.java