mirror of
https://github.com/scm-manager/scm-manager.git
synced 2026-02-07 15:19:15 +01:00
added generics to ConfigChangeListener
This commit is contained in:
@@ -37,8 +37,10 @@ package sonia.scm;
|
||||
* Callback listener for setting properties that are changed.
|
||||
*
|
||||
* @author Sebastian Sdorra
|
||||
*
|
||||
* @param <T> the type of configuration.
|
||||
*/
|
||||
public interface ConfigChangedListener
|
||||
public interface ConfigChangedListener<T>
|
||||
{
|
||||
|
||||
/**
|
||||
@@ -48,5 +50,5 @@ public interface ConfigChangedListener
|
||||
*
|
||||
* @param config - the changed configuration object
|
||||
*/
|
||||
public void configChanged(Object config);
|
||||
public void configChanged(T config);
|
||||
}
|
||||
|
||||
@@ -68,7 +68,8 @@ import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
|
||||
@Singleton
|
||||
@XmlRootElement(name = "scm-config")
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
public class ScmConfiguration implements ListenerSupport<ConfigChangedListener>
|
||||
public class ScmConfiguration
|
||||
implements ListenerSupport<ConfigChangedListener<ScmConfiguration>>
|
||||
{
|
||||
|
||||
/** Default JavaScript date format */
|
||||
@@ -100,7 +101,7 @@ public class ScmConfiguration implements ListenerSupport<ConfigChangedListener>
|
||||
* @param listener
|
||||
*/
|
||||
@Override
|
||||
public void addListener(ConfigChangedListener listener)
|
||||
public void addListener(ConfigChangedListener<ScmConfiguration> listener)
|
||||
{
|
||||
listeners.add(listener);
|
||||
}
|
||||
@@ -113,7 +114,8 @@ public class ScmConfiguration implements ListenerSupport<ConfigChangedListener>
|
||||
* @param listeners
|
||||
*/
|
||||
@Override
|
||||
public void addListeners(Collection<ConfigChangedListener> listeners)
|
||||
public void addListeners(
|
||||
Collection<ConfigChangedListener<ScmConfiguration>> listeners)
|
||||
{
|
||||
listeners.addAll(listeners);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user