static JmxConfig from ( Config config ) { try { ObjectName query = new ObjectName ( config . getString ( "query" ) ) ; List < JmxMeasurementConfig > ms = new ArrayList <> ( ) ; for ( Config cfg : config . getConfigList ( "measurements" ) ) { ms . add ( JmxMeasurementConfig . from ( cfg ) ) ; } return new JmxConfig ( query , ms ) ; } catch ( Exception e ) { throw new IllegalArgumentException ( "invalid mapping config" , e ) ; } }
Create a new instance from the Typesafe Config object .