/** * Helper method to determine the template from a given item. * * @param item Item which includes a template. * @return If the item includes a template then the template will be returned. Otherwise <code> * null</code>. */ private DockerJobTemplateProperty getJobTemplate(Item item) { if (item.task instanceof Project) { Project<?, ?> project = (Project<?, ?>) item.task; if (project != null) { DockerJobProperty property = project.getProperty(DockerJobProperty.class); if (property != null) { return property.getDockerJobTemplate(); } } } return null; }