提交 c21b209b 编写于 作者: J Jesse Glick

[JENKINS-18224] Relaxing type parameter restriction on TransientActionFactory...

[JENKINS-18224] Relaxing type parameter restriction on TransientActionFactory since useful mixin interfaces like Item do not extend Actionable.
上级 0f7b144f
......@@ -97,7 +97,7 @@ public abstract class Actionable extends AbstractModelObject implements ModelObj
}
return Collections.unmodifiableList(_actions);
}
private <T extends Actionable> Collection<? extends Action> createFor(TransientActionFactory<T> taf) {
private <T> Collection<? extends Action> createFor(TransientActionFactory<T> taf) {
return taf.createFor(taf.type().cast(this));
}
......
......@@ -26,15 +26,18 @@ package jenkins.model;
import hudson.model.Action;
import hudson.model.Actionable;
import hudson.model.TopLevelItem;
import java.util.Collection;
import javax.annotation.Nonnull;
/**
* Allows you to add actions to any kind of {@link Actionable} at once.
* Allows you to add actions to any kind of object at once.
* @param <T> the type of object to add to; typically an {@link Actionable} subtype,
* but may specify a type such as {@link TopLevelItem} most of whose implementations are in fact {@link Actionable}
* @see Actionable#getAllActions
* @since 1.548
*/
public abstract class TransientActionFactory<T extends Actionable> {
public abstract class TransientActionFactory<T> {
/**
* The type of object this factory cares about.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册