Package jenkins.model

Class TransientActionFactory<T>

    • Constructor Detail

      • TransientActionFactory

        public TransientActionFactory()
    • Method Detail

      • type

        public abstract Class<T> type()
        The type of object this factory cares about. Declared separately, rather than by having createFor(T) do a check-cast, so that method bodies are not loaded until actually needed.
        Returns:
        the type of TransientActionFactory
      • actionType

        public Class<? extends Action> actionType()
        A supertype of any actions this factory might produce. Defined so that factories which produce irrelevant actions need not be consulted by, e.g., Actionable.getAction(Class). For historical reasons this defaults to Action itself. If your implementation was returning multiple disparate kinds of actions, it is best to split it into two factories.

        If an API defines a abstract Action subtype and you are providing a concrete implementation, you may return the API type here to delay class loading.

        Returns:
        a bound for the result of createFor(T)
        Since:
        2.34
      • createFor

        @NonNull
        public abstract Collection<? extends Action> createFor​(@NonNull
                                                               T target)
        Creates actions for a given object. This may be called frequently for the same object, so if your implementation is expensive, do your own caching.
        Parameters:
        target - an actionable object
        Returns:
        a possible empty set of actions (typically either using Collections.emptySet() or Collections.singleton(T))