Polishing, javadoc. . .
This commit is contained in:
@@ -89,24 +89,14 @@ public abstract class AbstractComposableFunctionRegistry
|
||||
return this.doLookup(type, functionDefinitionName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setApplicationEventPublisher(
|
||||
ApplicationEventPublisher applicationEventPublisher) {
|
||||
this.applicationEventPublisher = applicationEventPublisher;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setEnvironment(Environment environment) {
|
||||
this.environment = environment;
|
||||
}
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
@Override
|
||||
public Set<String> getNames(Class<?> type) {
|
||||
if (type == null) { //perhaps some synchronization
|
||||
Set<String> names = new HashSet<>(suppliers.keySet());
|
||||
names.addAll(functions.keySet());
|
||||
names.addAll(consumers.keySet());
|
||||
return names;
|
||||
if (type == null) {
|
||||
return new HashSet<String>(getSupplierNames()) {{
|
||||
addAll(getConsumerNames());
|
||||
addAll(getFunctionNames());
|
||||
} };
|
||||
}
|
||||
if (Supplier.class.isAssignableFrom(type)) {
|
||||
return this.getSupplierNames();
|
||||
@@ -120,14 +110,26 @@ public abstract class AbstractComposableFunctionRegistry
|
||||
return Collections.emptySet();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the names of available Suppliers.
|
||||
* @return immutable {@link Set} of available {@link Supplier} names.
|
||||
*/
|
||||
public Set<String> getSupplierNames() {
|
||||
return this.suppliers.keySet();
|
||||
return Collections.unmodifiableSet(this.suppliers.keySet());
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the names of available Functions.
|
||||
* @return immutable {@link Set} of available {@link Function} names.
|
||||
*/
|
||||
public Set<String> getFunctionNames() {
|
||||
return this.functions.keySet();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the names of available Consumers.
|
||||
* @return immutable {@link Set} of available {@link Consumer} names.
|
||||
*/
|
||||
public Set<String> getConsumerNames() {
|
||||
return this.consumers.keySet();
|
||||
}
|
||||
@@ -167,6 +169,17 @@ public abstract class AbstractComposableFunctionRegistry
|
||||
return this.names.containsKey(function) ? this.names.get(function) : null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setApplicationEventPublisher(
|
||||
ApplicationEventPublisher applicationEventPublisher) {
|
||||
this.applicationEventPublisher = applicationEventPublisher;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setEnvironment(Environment environment) {
|
||||
this.environment = environment;
|
||||
}
|
||||
|
||||
protected void wrap(FunctionRegistration<?> registration, String key) {
|
||||
Object target = registration.getTarget();
|
||||
this.addName(target, key);
|
||||
|
||||
@@ -96,7 +96,6 @@ public class ContextFunctionCatalogAutoConfiguration {
|
||||
|
||||
private ConfigurableListableBeanFactory beanFactory;
|
||||
|
||||
//@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public FunctionRegistration<?> getRegistration(Object function) {
|
||||
String functionName = this.lookupFunctionName(function);
|
||||
|
||||
Reference in New Issue
Block a user