@Override protected List<DynamicOption> getDynamicOptions(State state) throws Exception { if (state == null) { return Collections.emptyList(); } List<DynamicOption> options = new ArrayList<>(); for (Entry<String, FeatureParameterSpec> entry : getSpec(state, getId()).getSpec().getParams().entrySet()) { DynamicOption dyn = new DynamicOption(entry.getKey(), !entry.getValue().isNillable() && !entry.getValue().hasDefaultValue()); String defValue = entry.getValue().getDefaultValue(); if (defValue != null) { dyn.setDefaultValue(defValue.toString()); } options.add(dyn); } return options; }
ResolvedFeatureParam(FeatureParameterSpec spec, FeatureParameterType type) throws ProvisioningException { this.spec = spec; this.type = type; if(spec.hasDefaultValue()) { defaultValue = type.fromString(spec.getDefaultValue()); } else { defaultValue = type.getDefaultValue(); } if(spec.isFeatureId() && type.isCollection()) { throw new ProvisioningException("Feature ID parameter cannot be of a collection type"); } } }
ids.put(opt, value); } else if (!value.equals(p.getDefaultValue())) { params.put(opt, value);
public static Builder builder(FeatureParameterSpec param) { Builder builder = new Builder(param.getName()); builder.setDefaultValue(param.getDefaultValue()); if (param.isFeatureId()) { builder.setFeatureId(); } if(param.isNillable()) { builder.setNillable(); } builder.setType(param.getType()); return builder; }
builder.append(tab + tab + "description : " + "no description available").append(Config.getLineSeparator()); builder.append(tab + tab + "type : " + param.getType()).append(Config.getLineSeparator()); builder.append(tab + tab + "default-value: " + param.getDefaultValue()).append(Config.getLineSeparator()); builder.append(tab + tab + "nillable : " + param.isNillable()).append(Config.getLineSeparator()); session.print(builder.toString()); builder.append(tab + tab + "description : " + "no description available").append(Config.getLineSeparator()); builder.append(tab + tab + "type : " + param.getType()).append(Config.getLineSeparator()); builder.append(tab + tab + "default-value: " + param.getDefaultValue()).append(Config.getLineSeparator()); builder.append(tab + tab + "nillable : " + param.isNillable()).append(Config.getLineSeparator()); session.println(builder.toString());
final FeatureParameterSpec pSpec = fSpec.getParam(paramName); if(!actualParams.remove(paramName)) { if(pSpec.isNillable() && pSpec.hasDefaultValue() && !Constants.GLN_UNDEFINED.equals(pSpec.getDefaultValue())) { config.unsetParam(paramName); final String originalValue = original.getConfigParam(paramName); if(actualValue != null) { if(!pSpec.isFeatureId() && !actualValue.equals(originalValue) && !actualValue.equals(pSpec.getDefaultValue())) { config.setParam(paramName, actualValue); if(pSpec.hasDefaultValue() && !Constants.GLN_UNDEFINED.equals(pSpec.getDefaultValue())) { config.unsetParam(paramName);
addAttribute(paramE, Attribute.DEFAULT, paramSpec.getDefaultValue());