Skip to content

Commit

Permalink
Update DetailFactory.java
Browse files Browse the repository at this point in the history
  • Loading branch information
janfaracik committed Jan 9, 2025
1 parent 4deafbd commit 1a7bd33
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion core/src/main/java/jenkins/model/DetailFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,16 @@
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

import hudson.model.Actionable;
import org.kohsuke.accmod.Restricted;
import org.kohsuke.accmod.restrictions.NoExternalUse;

/**
* Allows you to add multiple details to a Run at once.
* @param <T> the type of object to add to; typically an {@link Actionable} subtype
* @since TODO
*/
public abstract class DetailFactory<T> implements ExtensionPoint {

public abstract Class<T> type();
Expand All @@ -42,7 +49,7 @@ public abstract class DetailFactory<T> implements ExtensionPoint {
@Restricted(NoExternalUse.class)
public static <T> Iterable<DetailFactory<T>> factoriesFor(Class<T> type) {
List<DetailFactory<T>> result = new ArrayList<>();
for (DetailFactory wf : ExtensionList.lookup(DetailFactory.class)) {
for (DetailFactory<T> wf : ExtensionList.lookup(DetailFactory.class)) {
if (wf.type().isAssignableFrom(type)) {
result.add(wf);
}
Expand Down

0 comments on commit 1a7bd33

Please sign in to comment.