The intent of a minor extension is to streamline the documentation
facilities,
this time for the KnowledgBuilderOptionsKonfiguration. Most is in place,
viz.
<T extends SingleValueKnowledgeBuilderOption
<file:///extra/drools-5.1.1/javadoc/stable/drools-api/org/drools/builder/conf/SingleValueKnowledgeBuilderOption.html>>
T *getOption*(Class
<
http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Class.html><T>
option)
<T extends MultiValueKnowledgeBuilderOption
<file:///extra/drools-5.1.1/javadoc/stable/drools-api/org/drools/builder/conf/MultiValueKnowledgeBuilderOption.html>>
T *getOption*(Class
<
http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Class.html><T>
option,
String
<
http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html> key)
But there is no way of obtaining the full set of a
MultiValueKnowledgeBuilderOption.
So I propose to add the simple
public <T extends MultiValueKnowledgeBuilderOption> Set<String>
getOptionKeys( Class<T> option );
which will let you retrieve them all with the 2nd method above.
for( String key: config.getOptionKeys(AccumulateFunctionOption.class
) ){
System.out.println( key + "->" +
config.getOption(AccumulateFunctionOption.class, key).getClass().getName()
);
}
collectList->org.drools.builder.conf.AccumulateFunctionOption
max->org.drools.builder.conf.AccumulateFunctionOption
count->org.drools.builder.conf.AccumulateFunctionOption
maximum->org.drools.builder.conf.AccumulateFunctionOption
sum->org.drools.builder.conf.AccumulateFunctionOption
avg->org.drools.builder.conf.AccumulateFunctionOption
average->org.drools.builder.conf.AccumulateFunctionOption
collectSet->org.drools.builder.conf.AccumulateFunctionOption
This doesn't unhide anything, does it? Any objections?
-W