@DataBoundConstructor public MultiSCM(List<SCM> scmList) throws IOException { scms.addAll(scmList); }
private static DescribableList<GhprbExtension, GhprbExtensionDescriptor> copyExtensions( DescribableList<GhprbExtension, GhprbExtensionDescriptor>... extensionsList ) { DescribableList<GhprbExtension, GhprbExtensionDescriptor> copiedList = new DescribableList<>(Saveable.NOOP); for (DescribableList<GhprbExtension, GhprbExtensionDescriptor> extensions : extensionsList) { copiedList.addAll(extensions); } return copiedList; }
/** * @param testDataPublishers Test data publishers. * * @since 1.2 */ @DataBoundSetter public final void setTestDataPublishers(@Nonnull List<TestDataPublisher> testDataPublishers) { this.testDataPublishers = new DescribableList<TestDataPublisher,Descriptor<TestDataPublisher>>(Saveable.NOOP); this.testDataPublishers.addAll(testDataPublishers); }
/** * @param testDataPublishers Test data publishers. * * @since 1.2 */ @DataBoundSetter public final void setTestDataPublishers(@Nonnull List<TestDataPublisher> testDataPublishers) { this.testDataPublishers = new DescribableList<TestDataPublisher,Descriptor<TestDataPublisher>>(Saveable.NOOP); this.testDataPublishers.addAll(testDataPublishers); }
@Override public DescribableList<Publisher, Descriptor<Publisher>> getPublishersList() { if (getParent().isAggregatorStyleBuild()) { return publishers; } DescribableList<Publisher, Descriptor<Publisher>> publishersList = new DescribableList<Publisher, Descriptor<Publisher>>(Saveable.NOOP); try { publishersList.addAll(createModulePublishers()); } catch (IOException e) { LOGGER.warning("Failed to load module publisher list"); } return publishersList; }
@Override public DescribableList<Publisher, Descriptor<Publisher>> getPublishersList() { if (getParent().isAggregatorStyleBuild()) { return publishers; } DescribableList<Publisher, Descriptor<Publisher>> publishersList = new DescribableList<Publisher, Descriptor<Publisher>>(Saveable.NOOP); try { publishersList.addAll(createModulePublishers()); } catch (IOException e) { LOGGER.warning("Failed to load module publisher list"); } return publishersList; }
@Override public DescribableList<Publisher, Descriptor<Publisher>> getPublishersList() { if (getParent().isAggregatorStyleBuild()) { return publishers; } DescribableList<Publisher, Descriptor<Publisher>> publishersList = new DescribableList<Publisher, Descriptor<Publisher>>(Saveable.NOOP); try { publishersList.addAll(createModulePublishers()); } catch (IOException e) { LOGGER.warning("Failed to load module publisher list"); } return publishersList; }
public static DescribableList<GhprbExtension, GhprbExtensionDescriptor> matchesAll( DescribableList<GhprbExtension, GhprbExtensionDescriptor> extensions, Class<?>... types ) { Predicate predicate = PredicateUtils.allPredicate(createPredicate(types)); DescribableList<GhprbExtension, GhprbExtensionDescriptor> copyExtensions = new DescribableList<>(Saveable.NOOP); copyExtensions.addAll(extensions); filterList(copyExtensions, predicate); return copyExtensions; }
public static DescribableList<GhprbExtension, GhprbExtensionDescriptor> matchesSome( DescribableList<GhprbExtension, GhprbExtensionDescriptor> extensions, Class<?>... types ) { Predicate predicate = PredicateUtils.anyPredicate(createPredicate(types)); DescribableList<GhprbExtension, GhprbExtensionDescriptor> copyExtensions = new DescribableList<>(Saveable.NOOP); copyExtensions.addAll(extensions); filterList(copyExtensions, predicate); return copyExtensions; }
public static <T extends GhprbExtension> T getGlobal(Class<T> clazz) { DescribableList<GhprbExtension, GhprbExtensionDescriptor> copyExtensions = new DescribableList<>(Saveable.NOOP); copyExtensions.addAll(GhprbTrigger.DESCRIPTOR.getExtensions()); filterList(copyExtensions, InstanceofPredicate.getInstance(clazz)); return copyExtensions.get(clazz); }
/** * Converts collection of propertyClass descriptors to {@link DescribableList} * * @param descriptors . * @param owner new owner for properties. * @param propertyClass projectProperty * @return {@link DescribableList} */ @SuppressWarnings("unchecked") public static <T extends Describable<T>, D extends Descriptor<T>, P extends IProjectProperty> DescribableList<T, D> convertToDescribableList(List<D> descriptors, Job owner, Class<P> propertyClass) { List<T> describableList = new CopyOnWriteArrayList<T>(); DescribableList<T, D> result = new DescribableList<T, D>(owner); for (Descriptor<T> descriptor : descriptors) { IProjectProperty<T> property = CascadingUtil.getProjectProperty(owner, descriptor.getJsonSafeClassName(), propertyClass); if (null != property.getValue()) { describableList.add(property.getValue()); } } try { owner.setAllowSave(false); result.addAll(describableList); owner.setAllowSave(true); } catch (IOException e) { LOGGER.log(Level.WARNING, "Failed to add list of describable elements", e); } return result; }
/** * Converts collection of propertyClass descriptors to * {@link DescribableList} * * @param descriptors . * @param owner new owner for properties. * @param propertyClass projectProperty * @return {@link DescribableList} */ @SuppressWarnings("unchecked") public static <T extends Describable<T>, D extends Descriptor<T>, P extends IProjectProperty> DescribableList<T, D> convertToDescribableList(List<D> descriptors, Job owner, Class<P> propertyClass) { List<T> describableList = new CopyOnWriteArrayList<T>(); DescribableList<T, D> result = new DescribableList<T, D>(owner); for (Descriptor<T> descriptor : descriptors) { IProjectProperty<T> property = CascadingUtil.getProjectProperty(owner, descriptor.getJsonSafeClassName(), propertyClass); if (null != property.getValue()) { describableList.add(property.getValue()); } } try { owner.setAllowSave(false); result.addAll(describableList); owner.setAllowSave(true); } catch (IOException e) { LOGGER.log(Level.WARNING, "Failed to add list of describable elements", e); } return result; } }
/** * Converts collection of propertyClass descriptors to {@link DescribableList} * * @param descriptors . * @param owner new owner for properties. * @param propertyClass projectProperty * @return {@link DescribableList} */ @SuppressWarnings("unchecked") public static <T extends Describable<T>, D extends Descriptor<T>, P extends IProjectProperty> DescribableList<T, D> convertToDescribableList(List<D> descriptors, Job owner, Class<P> propertyClass) { List<T> describableList = new CopyOnWriteArrayList<T>(); DescribableList<T, D> result = new DescribableList<T, D>(owner); for (Descriptor<T> descriptor : descriptors) { IProjectProperty<T> property = CascadingUtil.getProjectProperty(owner, descriptor.getJsonSafeClassName(), propertyClass); if (null != property.getValue()) { describableList.add(property.getValue()); } } try { owner.setAllowSave(false); result.addAll(describableList); owner.setAllowSave(true); } catch (IOException e) { LOGGER.log(Level.WARNING, "Failed to add list of describable elements", e); } return result; }
/** * Converts collection of propertyClass descriptors to {@link DescribableList} * * @param descriptors . * @param owner new owner for properties. * @param propertyClass projectProperty * @return {@link DescribableList} */ @SuppressWarnings("unchecked") public static <T extends Describable<T>, D extends Descriptor<T>, P extends IProjectProperty> DescribableList<T, D> convertToDescribableList(List<D> descriptors, Job owner, Class<P> propertyClass) { List<T> describableList = new CopyOnWriteArrayList<T>(); DescribableList<T, D> result = new DescribableList<T, D>(owner); for (Descriptor<T> descriptor : descriptors) { IProjectProperty<T> property = CascadingUtil.getProjectProperty(owner, descriptor.getJsonSafeClassName(), propertyClass); if (null != property.getValue()) { describableList.add(property.getValue()); } } try { owner.setAllowSave(false); result.addAll(describableList); owner.setAllowSave(true); } catch (IOException e) { LOGGER.log(Level.WARNING, "Failed to add list of describable elements", e); } return result; }