public static Map<String, Object> getProperties(Resource resource) {
    Map<String, Object> properties = new HashMap<>();

    Map<String, Map<String, Object>> categories = resource.getPropertiesMap();

    for (Map.Entry<String, Map<String, Object>> categoryEntry : categories.entrySet()) {
      for (Map.Entry<String, Object>  propertyEntry : categoryEntry.getValue().entrySet()) {
        properties.put(getPropertyId(categoryEntry.getKey(), propertyEntry.getKey()), propertyEntry.getValue());
      }
    }
    return properties;
  }
Get a map of all the property values keyed by property id for the given resource.

@param resource  the resource

@return the map of properties for the given resource
ambari-server/src/main/java/org/apache/ambari/server/controller/utilities/PropertyHelper.java