mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-03 07:05:55 +00:00
Add convenient method for checking if object is MatrixProject
This is useful for jelly pages where instanceof operator doesn't work.
This commit is contained in:
1 parent
184b4a9a21
commit
4f2626aaac
1 file changed
+5
@@ -28,6 +28,7 @@ package hudson;
|
||||
import hudson.cli.CLICommand;
|
||||
import hudson.console.ConsoleAnnotationDescriptor;
|
||||
import hudson.console.ConsoleAnnotatorFactory;
|
||||
import hudson.matrix.MatrixProject;
|
||||
import hudson.model.AbstractProject;
|
||||
import hudson.model.Action;
|
||||
import hudson.model.Describable;
|
||||
@@ -187,6 +188,10 @@ public class Functions {
|
||||
public static boolean isModelWithChildren(Object o) {
|
||||
return o instanceof ModelObjectWithChildren;
|
||||
}
|
||||
|
||||
public static boolean isMatrixProject(Object o) {
|
||||
return o instanceof MatrixProject;
|
||||
}
|
||||
|
||||
public static String xsDate(Calendar cal) {
|
||||
return Util.XS_DATETIME_FORMATTER.format(cal.getTime());
|
||||
|
||||
Reference in new issue
Block a user