private static < L > void populateMetricTypesForResourceType ( ResourceType . Builder < ? , L > resourceTypeBuilder , TypeSets . Builder < L > typeSetsBuilder ) { Map < Name , TypeSet < MetricType < L > > > metricTypeSets = typeSetsBuilder . getMetricTypeSets ( ) ; List < Name > metricSetNames = resourceTypeBuilder . getMetricSetNames ( ) ; for ( Name metricSetName : metricSetNames ) { TypeSet < MetricType < L >> metricSet = metricTypeSets . get ( metricSetName ) ; if ( metricSet != null && metricSet . isEnabled ( ) ) { resourceTypeBuilder . metricTypes ( metricSet . getTypeMap ( ) . values ( ) ) ; } } }
Given a resource type builder this will fill in its metric types .