GH-1601 Ensured type information propagation in AbstractExtendedBindingProperties
Made getBindings() method abstract forcing an implementation at the sub-class level, hence propagation of type information to metadata Resolves #1601
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
|
||||
package org.springframework.cloud.stream.binder;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -47,9 +48,7 @@ public abstract class AbstractExtendedBindingProperties<C, P, T extends BinderSp
|
||||
|
||||
private ConfigurableApplicationContext applicationContext = new GenericApplicationContext();
|
||||
|
||||
public Map<String, T> getBindings() {
|
||||
return this.bindings;
|
||||
}
|
||||
public abstract Map<String, T> getBindings();
|
||||
|
||||
public void setBindings(Map<String, T> bindings) {
|
||||
this.bindings.putAll(bindings);
|
||||
@@ -101,4 +100,8 @@ public abstract class AbstractExtendedBindingProperties<C, P, T extends BinderSp
|
||||
this.bindings.put(binding, extendedBindingPropertiesTarget);
|
||||
}
|
||||
|
||||
protected Map<String, T> doGetBindings() {
|
||||
return Collections.unmodifiableMap(this.bindings);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -16,6 +16,8 @@
|
||||
|
||||
package org.springframework.cloud.stream.utils;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.cloud.stream.binder.AbstractExtendedBindingProperties;
|
||||
import org.springframework.cloud.stream.binder.BinderSpecificPropertiesProvider;
|
||||
@@ -34,6 +36,10 @@ public class FooExtendedBindingProperties extends
|
||||
return DEFAULTS_PREFIX;
|
||||
}
|
||||
|
||||
public Map<String, FooBindingProperties> getBindings() {
|
||||
return this.doGetBindings();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<? extends BinderSpecificPropertiesProvider> getExtendedPropertiesEntryClass() {
|
||||
return FooBindingProperties.class;
|
||||
|
||||
Reference in New Issue
Block a user