@SuppressWarnings("unchecked") public B removeExcludedFeature(FeatureId featureId) throws ProvisioningDescriptionException { excludedFeatures = CollectionUtils.remove(excludedFeatures, featureId); return (B) this; }
@SuppressWarnings("unchecked") public B removeUniverse(String name) throws ProvisioningDescriptionException { if(name == null) { defaultUniverse = null; return (B) this; } universeSpecs = CollectionUtils.remove(universeSpecs, name); return (B) this; }
public Builder removeOption(String name) { options = CollectionUtils.remove(options, name); return this; }
public String putParam(String name, String value) { final String prevValue = params.get(name); params = CollectionUtils.put(params, name, value); if(!unsetParams.isEmpty()) { unsetParams = CollectionUtils.remove(unsetParams, name); } if(!resetParams.isEmpty()) { resetParams = CollectionUtils.remove(resetParams, name); } return prevValue; }
@SuppressWarnings("unchecked") public B removeConfig(ConfigId id) throws ProvisioningDescriptionException { definedConfigs = CollectionUtils.remove(definedConfigs, id); // reset flag hasModelOnlyConfigs = false; for (ConfigModel cm : definedConfigs.values()) { hasModelOnlyConfigs |= cm.id.isModelOnly(); } return (B) this; }
@SuppressWarnings("unchecked") public B removeExcludedDefaultConfig(ConfigId configId) throws ProvisioningDescriptionException { if (!excludedConfigs.contains(configId)) { throw new ProvisioningDescriptionException("Config model with id " + configId + " is not excluded from the configuration"); } excludedConfigs = CollectionUtils.remove(excludedConfigs, configId); return (B) this; }
public Builder removePatch(FPID patchId) throws ProvisioningDescriptionException { final int size = patches.size(); patches = CollectionUtils.remove(patches, patchId); if(size == patches.size()) { throw new ProvisioningDescriptionException("Patch " + patchId + " was not configured for " + fpl); } return this; }
@SuppressWarnings("unchecked") public B removeIncludedDefaultConfig(ConfigId configId) throws ProvisioningDescriptionException { if (!includedConfigs.contains(configId)) { throw new ProvisioningDescriptionException("Config model with id " + configId + " is not included into the configuration"); } includedConfigs = CollectionUtils.remove(includedConfigs, configId); return (B) this; }
public Builder removeExcludedPackage(String pkg) throws ProvisioningDescriptionException { if (!excludedPackages.contains(pkg)) { throw new ProvisioningDescriptionException("Package " + pkg + " is not excluded from the configuration"); } excludedPackages = CollectionUtils.remove(excludedPackages, pkg); return this; }
public Builder removeIncludedPackage(String pkg) throws ProvisioningDescriptionException { if (!includedPackages.containsKey(pkg)) { throw new ProvisioningDescriptionException("Package " + pkg + " is not included into the configuration"); } includedPackages = CollectionUtils.remove(includedPackages, pkg); return this; }
void resetParam(String name) throws ProvisioningDescriptionException { if(!spec.xmlSpec.hasParam(name)) { throw new ProvisioningDescriptionException(Errors.unknownFeatureParameter(spec.id, name)); } if(id.params.containsKey(name)) { throw new ProvisioningDescriptionException(Errors.featureIdParameterCantBeReset(id, name)); } if(resetParams.contains(name)) { return; } if(unsetParams.contains(name)) { unsetParams = CollectionUtils.remove(unsetParams, name); } else { params.remove(name); } resetParams = CollectionUtils.add(resetParams, name); }
void unsetParam(String name, boolean overwrite) throws ProvisioningDescriptionException { if(!spec.xmlSpec.hasParam(name)) { throw new ProvisioningDescriptionException(Errors.unknownFeatureParameter(spec.id, name)); } if(id.params.containsKey(name)) { throw new ProvisioningDescriptionException(Errors.featureIdParameterCantBeUnset(id, name)); } if(unsetParams.contains(name)) { return; } if (resetParams.contains(name)) { if(!overwrite) { return; } resetParams = CollectionUtils.remove(resetParams, name); } else if (overwrite) { params.remove(name); } else if (params.containsKey(name)) { return; } unsetParams = CollectionUtils.add(unsetParams, name); }
@SuppressWarnings("unchecked") public B removeFeature(FeatureId id) throws ProvisioningDescriptionException { int index = -1; // Although that is a list, we have a single ConfigModel for a given ConfigId for (int i = 0; i < items.size(); i++) { ConfigItem ci = items.get(i); if (ci instanceof FeatureConfig) { FeatureConfig conf = (FeatureConfig) ci; if (conf.getSpecId().equals(id.getSpec())) { boolean eq = true; for (Entry<String, String> entry : id.getParams().entrySet()) { String val = conf.getParam(entry.getKey()); if (val == null || !val.equals(entry.getValue())) { eq = false; break; } } if (eq) { index = i; break; } } } } if (index == -1) { throw new ProvisioningDescriptionException("Feature " + id + " is not added"); } items = CollectionUtils.remove(items, index); return (B) this; }
@SuppressWarnings("unchecked") public B removeTransitiveDep(FPID fpid) throws ProvisioningException { final FeaturePackLocation fpl = resolveUniverseSpec(fpid.getLocation()); final ProducerSpec producer = fpl.getProducer(); final FeaturePackConfig fpDep = transitiveDeps.get(producer); if(fpDep == null) { throw new ProvisioningException(Errors.unknownFeaturePack(fpid)); } if(!fpDep.getLocation().equals(fpl)) { throw new ProvisioningException(Errors.unknownFeaturePack(fpid)); } if(transitiveDeps.size() == 1) { transitiveDeps = Collections.emptyMap(); return (B) this; } else { transitiveDeps = CollectionUtils.remove(transitiveDeps, producer); } updateOriginMappings(producer); return (B) this; }
if(existingOrigin != null) { if (!existingOrigin.equals(origin)) { fpDepsByOrigin = CollectionUtils.remove(fpDepsByOrigin, existingOrigin); producerOrigins = CollectionUtils.put(producerOrigins, producer, origin);
@SuppressWarnings("unchecked") public B removeFeaturePackDep(FeaturePackLocation fpl) throws ProvisioningException { fpl = resolveUniverseSpec(fpl); final ProducerSpec producer = fpl.getProducer(); final FeaturePackConfig fpDep = fpDeps.get(producer); if(fpDep == null) { throw new ProvisioningException(Errors.unknownFeaturePack(fpl.getFPID())); } if(!fpDep.getLocation().getFPID().equals(fpl.getFPID())) { throw new ProvisioningException(Errors.unknownFeaturePack(fpl.getFPID())); } if(fpDeps.size() == 1) { fpDeps = Collections.emptyMap(); } else { fpDeps = CollectionUtils.remove(fpDeps, producer); } updateOriginMappings(producer); return (B) this; }
originalWoIds = CollectionUtils.remove(originalWoIds, --i); } else if(featureCallback.added(feature)) { addedWoIds = CollectionUtils.add(addedWoIds, feature);