Class RebuildParameterFilter
- java.lang.Object
-
- hudson.plugins.project_inheritance.projects.rebuild.RebuildParameterFilter
-
- All Implemented Interfaces:
ExtensionPoint
public abstract class RebuildParameterFilter extends Object implements ExtensionPoint
This extension point allows you, to specify whether a given parameter should be included in a rebuild of a job, or not.It can be used to remove automatically generated parameters, so that the rebuild can progress safely.
Each
RebuildParameterFilter
is called for each parameter of the previous build, that is about to be rebuilt. If any filter returns false when queried forisParameterAllowed(ParameterValue)
, the value is not copied into the new build.Do note, that the parameter may still be present -- only that in these cases the default value from the project will be used, as if there were no value from the previous build.
Also do note, that the current rebuild implementation filters out all parameters, that are not
StringParameterValue
s (or subclasses). This is not guaranteed though, which is why this class accepts genericParameterValue
s.- Author:
- Martin Schroeder
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
-
Constructor Summary
Constructors Constructor Description RebuildParameterFilter()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static List<RebuildParameterFilter>
all()
abstract boolean
isParameterAllowed(ParameterValue value)
Check if the given parameter value is permitted to be used in a rebuild.static boolean
isParameterAllowedByAll(ParameterValue val)
Wrapper aroundisParameterAllowed(ParameterValue)
that loops over all filters return byall()
.
-
-
-
Method Detail
-
isParameterAllowed
public abstract boolean isParameterAllowed(ParameterValue value)
Check if the given parameter value is permitted to be used in a rebuild.As soon as one
RebuildParameterFilter
denies a value, it is ignored when generating rebuilds.Do note, that the parameter may still be added to the next build, if the project itself defines it. All that is removed, is the user-defined value of the parameter from the previous build.
- Parameters:
value
- the value to verify.- Returns:
- true, if the parameter is permitted to be used in a rebuild. False otherwise.
-
isParameterAllowedByAll
public static boolean isParameterAllowedByAll(ParameterValue val)
Wrapper aroundisParameterAllowed(ParameterValue)
that loops over all filters return byall()
.- Parameters:
val
- the value to verify.- Returns:
- true, if the parameter is permitted to be used in a rebuild. False otherwise.
-
all
public static List<RebuildParameterFilter> all()
-
-