@Override public FeatureConfig addConfigItem(ConfigItem item) { items = CollectionUtils.add(items, item); return this; }
public Builder addToValueSet(String... value) { if (value.length > 0) { for (String v : value) { this.valueSet = CollectionUtils.add(valueSet, v); } } return this; }
public FeaturePackCreator addFeaturePack(FeaturePackBuilder fp) { fps = CollectionUtils.add(fps, fp); return this; }
public ProvisionedConfigBuilder addFeature(ProvisionedFeature feature) { features = CollectionUtils.add(features, feature); return this; }
public FeaturePackInstaller includeConfig(ConfigurationId configId) { includedConfigs = CollectionUtils.add(includedConfigs, configId); return this; }
public FeaturePackInstaller includePackage(String packageName) { includedPackages = CollectionUtils.add(includedPackages, packageName); return this; }
public FeaturePackInstaller excludePackage(String packageName) { excludedPackages = CollectionUtils.add(excludedPackages, packageName); return this; }
public FeaturePackInstaller includeConfig(ConfigurationId configId) { includedConfigs = CollectionUtils.add(includedConfigs, configId); return this; }
public FeaturePackInstaller includePackage(String packageName) { includedPackages = CollectionUtils.add(includedPackages, packageName); return this; }
@SuppressWarnings("unchecked") public B excludeDefaultConfig(ConfigId configId) { excludedConfigs = CollectionUtils.add(excludedConfigs, configId); return (B) this; }
public FeaturePackBuilder addClassToPlugin(Class<?> cls) { if(classes.contains(cls)) { return this; } classes = CollectionUtils.add(classes, cls); return this; }
@SuppressWarnings("unchecked") public B includeConfigModel(String name) throws ProvisioningDescriptionException { if(excludedModels.containsKey(name)) { throw new ProvisioningDescriptionException("Model " + name + " has been excluded"); } includedModels = CollectionUtils.add(includedModels, name); return (B) this; }
@SuppressWarnings("unchecked") public B includeDefaultConfig(ConfigId configId) throws ProvisioningDescriptionException { if(includedConfigs.contains(configId)) { throw new ProvisioningDescriptionException("Config model with id " + configId + " has already been included into the configuration"); } includedConfigs = CollectionUtils.add(includedConfigs, configId); return (B) this; }
public ProvisioningPlan uninstall(ProducerSpec producer) throws ProvisioningDescriptionException { if(install.containsKey(producer) || updates.containsKey(producer)) { throw new ProvisioningDescriptionException(producer + " has already been added to the plan"); } uninstall = CollectionUtils.add(uninstall, producer); return this; }
@Override public void addChild(FormatContentHandler childHandler) throws FormatParsingException { list = CollectionUtils.add(list, childHandler.getContent()); }
@SuppressWarnings("unchecked") public B excludeSpec(String spec) throws ProvisioningDescriptionException { final SpecId specId = SpecId.fromString(spec); if(includedSpecs.contains(specId)) { throw new ProvisioningDescriptionException(specId + " spec has been inplicitly excluded"); } excludedSpecs = CollectionUtils.add(excludedSpecs, specId); return (B) this; }
public FeatureConfig unsetParam(String name) { unsetParams = CollectionUtils.add(unsetParams, name); params = CollectionUtils.remove(params, name); if(!resetParams.isEmpty()) { resetParams = CollectionUtils.remove(resetParams, name); } return this; }
public FeatureConfig resetParam(String name) { resetParams = CollectionUtils.add(resetParams, name); params = CollectionUtils.remove(params, name); if(!unsetParams.isEmpty()) { unsetParams = CollectionUtils.remove(unsetParams, name); } return this; }
private Set<ResolvedSpecId> resolveSpecIds(Set<ResolvedSpecId> resolvedIds, Set<SpecId> specs) throws ProvisioningException { for (SpecId specId : specs) { resolvedIds = CollectionUtils.add(resolvedIds, getFeatureSpec(specId.getName()).id); } return resolvedIds; }
private Set<ResolvedFeatureId> resolveExcludedIds(Set<ResolvedFeatureId> resolvedIds, Map<FeatureId, String> features) throws ProvisioningException { for (Map.Entry<FeatureId, String> excluded : features.entrySet()) { final FeatureId excludedId = excluded.getKey(); final ResolvedFeatureSpec resolvedSpec = getFeatureSpec(excludedId.getSpec().getName()); if(parentFeature != null) { resolvedIds = CollectionUtils.add(resolvedIds, resolvedSpec.resolveIdFromForeignKey(parentFeature.id, excluded.getValue(), excludedId.getParams())); } else { resolvedIds = CollectionUtils.add(resolvedIds, resolvedSpec.resolveFeatureId(excludedId.getParams())); } } return resolvedIds; }