@@ -47,4 +47,12 @@ public interface FunctionCatalog {
|
||||
|
||||
Set<String> getNames(Class<?> type);
|
||||
|
||||
/**
|
||||
* Return the count of functions registered in this catalog
|
||||
* @return the count of functions registered in this catalog
|
||||
*/
|
||||
default int size() {
|
||||
throw new UnsupportedOperationException("This instance of FunctionCatalog does not support this operation");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -169,6 +169,13 @@ public class ContextFunctionCatalogAutoConfiguration {
|
||||
return Collections.emptySet();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int size() {
|
||||
return this.processor.getSuppliers().size() +
|
||||
this.processor.getFunctions().size() +
|
||||
this.processor.getConsumers().size();
|
||||
}
|
||||
|
||||
public BeanFactoryFunctionCatalog(ContextFunctionRegistry processor) {
|
||||
this.processor = processor;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user