code: public Double getMetric(PlatformResourceType type, String name, ID metricToCollect) {
          switch (type) {
              case OPERATING_SYSTEM: {
                  return getOperatingSystemMetric(metricToCollect);
              }
              case MEMORY: {
                  return getMemoryMetric(metricToCollect);
              }
              case FILE_STORE: {
                  return getFileStoreMetric(name, metricToCollect);
              }
              case PROCESSOR: {
                  return getProcessorMetric(name, metricToCollect);
              }
              case POWER_SOURCE: {
                  return getPowerSourceMetric(name, metricToCollect);
              }
              default: {
                  throw new IllegalArgumentException(
                          "Platform resource [" + type + "][" + name + "] does not have metrics");
              }
          }
      }
docs: Given a platform resource type, a name, and a metric name, this will return that metric's value,
  or null if there is no resource that can be identified by the name and type.
  
  @param type identifies the platform resource whose metric is to be collected
  @param name name of the resource whose metric is to be collected
  @param metricToCollect the metric to collect
  @return the value of the metric, or null if there is no resource identified by the name