@Test public void testMaxThreadsConfiguration() { // setting the option using the type safe method config.setOption( MaxThreadsOption.get(5) ); // checking the type safe getOption() method assertEquals( MaxThreadsOption.get(5), config.getOption( MaxThreadsOption.class ) ); // checking the string based getProperty() method assertEquals( "5", config.getProperty( MaxThreadsOption.PROPERTY_NAME ) ); // setting the options using the string based setProperty() method config.setProperty( MaxThreadsOption.PROPERTY_NAME, "8" ); // checking the type safe getOption() method assertEquals( MaxThreadsOption.get(8), config.getOption( MaxThreadsOption.class ) ); // checking the string based getProperty() method assertEquals( "8", config.getProperty( MaxThreadsOption.PROPERTY_NAME ) ); }
/** * This is a factory method for this Max Threads configuration. * The factory method is a best practice for the case where the * actual object construction is changed in the future. * * @param threshold the maximum number of threads for partition evaluation * * @return the actual type safe max threads configuration. */ public static MaxThreadsOption get( int threshold ) { return new MaxThreadsOption( threshold ); }
return org.drools.conf.MaxThreadsOption.get(kieOption.getMaxThreads());
return MaxThreadsOption.get(legacyOption.getMaxThreads());