Java 类hudson.model.BooleanParameterValue 实例源码

项目:delivery-pipeline-plugin    文件:PromotionStatusProvider.java   
private void populatePromotionParameters(List<String> params, Object promotionObj) {
    final Promotion promotion = (Promotion) promotionObj;
    for (ParameterValue value : promotion.getParameterValues()) {
        if (value instanceof StringParameterValue) {
            if (StringUtils.isNotBlank(((StringParameterValue) value).value)) {
                params.add("<strong>" + value.getName() + "</strong>: " + ((StringParameterValue) value).value);
            }
        } else if (value instanceof FileParameterValue) {
            params.add("<strong>" + value.getName() + "</strong>: " + ((FileParameterValue) value).getLocation());
        } else if (value instanceof BooleanParameterValue) {
            if (((BooleanParameterValue) value).value) {
                params.add("<strong>" + value.getName() + "</strong>: "
                        + Boolean.toString(((BooleanParameterValue) value).value));
            }
        }
        // TODO: there are more types
    }
}
项目:flaky-test-handler-plugin    文件:DeflakeAction.java   
private static ParameterValue getBooleanParam(JSONObject formData, String paramName) {
  JSONObject paramObj = JSONObject.fromObject(formData.get(paramName));
  String name = paramObj.getString("name");
  FlakyTestResultAction.logger.log(Level.FINE,
      "Param: " + name + " with value: " + paramObj.getBoolean("value"));
  return new BooleanParameterValue(name, paramObj.getBoolean("value"));
}
项目:persistent-parameter-plugin    文件:PersistentBooleanParameterDefinition.java   
@Override
public ParameterDefinition copyWithDefaultValue(ParameterValue defaultValue)
{
  if(defaultValue instanceof BooleanParameterValue)
  {
    BooleanParameterValue value = (BooleanParameterValue)defaultValue;
    return new PersistentBooleanParameterDefinition(getName(), value.value, isSuccessfulOnly(), getDescription());
  }
  else
  {
    return this;
  }
}
项目:persistent-parameter-plugin    文件:PersistentBooleanParameterDefinition.java   
@Override
public ParameterValue createValue(StaplerRequest req, JSONObject jo)
{
  BooleanParameterValue value = req.bindJSON(BooleanParameterValue.class, jo);
  value.setDescription(getDescription());
  return value;
}
项目:persistent-parameter-plugin    文件:PersistentBooleanParameterDefinition.java   
public ParameterValue createValue(String value)
{
  return new BooleanParameterValue(getName(), Boolean.valueOf(value), getDescription());
}
项目:persistent-parameter-plugin    文件:PersistentBooleanParameterDefinition.java   
@Override
public BooleanParameterValue getDefaultParameterValue()
{
  return new BooleanParameterValue(getName(), isDefaultValue(), getDescription());
}