hudson.model.Job.removeProperty()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(6.5k)|赞(0)|评价(0)|浏览(131)

本文整理了Java中hudson.model.Job.removeProperty()方法的一些代码示例,展示了Job.removeProperty()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Job.removeProperty()方法的具体详情如下:
包路径:hudson.model.Job
类名称:Job
方法名:removeProperty

Job.removeProperty介绍

[英]Removes JobProperty
[中]删除JobProperty

代码示例

代码示例来源:origin: jenkinsci/jenkins

/**
 * Removes the property of the given type.
 *
 * @return
 *      The property that was just removed.
 * @since 1.279
 */
public <T extends JobProperty> T removeProperty(Class<T> clazz) throws IOException {
  for (JobProperty<? super JobT> p : properties) {
    if (clazz.isInstance(p)) {
      removeProperty(p);
      return clazz.cast(p);
    }
  }
  return null;
}

代码示例来源:origin: jenkinsci/jenkins

public synchronized void setBuildDiscarder(BuildDiscarder bd) throws IOException {
  try (BulkChange bc = new BulkChange(this)) {
    removeProperty(BuildDiscarderProperty.class);
    if (bd != null) {
      addProperty(new BuildDiscarderProperty(bd));
    }
    bc.commit();
  }
}

代码示例来源:origin: org.jenkins-ci.plugins/python-wrapper

public void superRemoveProperty(JobProperty<? super JobT> jobProp) throws IOException {
  super.removeProperty(jobProp);
}

代码示例来源:origin: org.jenkins-ci.plugins/python-wrapper

public <T extends JobProperty> T superRemoveProperty(Class<T> clazz) throws IOException {
  return super.removeProperty(clazz);
}

代码示例来源:origin: org.jenkins-ci.main/jenkins-core

/**
 * Removes the property of the given type.
 *
 * @return
 *      The property that was just removed.
 * @since 1.279
 */
public <T extends JobProperty> T removeProperty(Class<T> clazz) throws IOException {
  for (JobProperty<? super JobT> p : properties) {
    if (clazz.isInstance(p)) {
      removeProperty(p);
      return clazz.cast(p);
    }
  }
  return null;
}

代码示例来源:origin: org.jenkins-ci.plugins.workflow/workflow-job

@Override
public void removeProperty(JobProperty jobProperty) throws IOException {
  // Need to make sure we stop any triggers.
  if (jobProperty instanceof PipelineTriggersJobProperty) {
    ((PipelineTriggersJobProperty)jobProperty).stopTriggers();
  }
  super.removeProperty(jobProperty);
}

代码示例来源:origin: Argelbargel/gitlab-branch-source-plugin

private void updateProperties(Job<?, ?> job, String connectionName) {
    try {
      job.removeProperty(GitLabConnectionProperty.class);
      job.addProperty(new GitLabConnectionProperty(connectionName));
    } catch (IOException e) {
      LOGGER.warning("could not update gitlab-connection-property to job " + job.getName() + ": " + e.getMessage());
    }
  }
}

代码示例来源:origin: org.jvnet.hudson.main/hudson-core

/**
 * Removes the property of the given type.
 *
 * @return The property that was just removed.
 * @since 1.279
 */
public <T extends JobProperty> T removeProperty(Class<T> clazz) throws IOException {
  CopyOnWriteList<JobProperty<? super JobT>> sourceProperties;
  if (clazz.equals(ParametersDefinitionProperty.class)) {
    sourceProperties = CascadingUtil.getCopyOnWriteListProjectProperty(this,
      PARAMETERS_DEFINITION_JOB_PROPERTY_PROPERTY_NAME).getOriginalValue();
  } else if (clazz.equals(AuthorizationMatrixProperty.class)) {
    sourceProperties = properties;
  } else {
    sourceProperties = getCascadingJobProperties();
  }
  if (null != sourceProperties) {
    for (JobProperty<? super JobT> p : sourceProperties) {
      if (clazz.isInstance(p)) {
        removeProperty(p);
        return clazz.cast(p);
      }
    }
  }
  return null;
}

代码示例来源:origin: org.eclipse.hudson/hudson-core

/**
 * Removes the property of the given type.
 *
 * @return The property that was just removed.
 * @since 1.279
 */
@SuppressWarnings("unchecked")
public <T extends JobProperty> T removeProperty(Class<T> clazz) throws IOException {
  CopyOnWriteList<JobProperty<? super JobT>> sourceProperties;
  if (clazz.equals(ParametersDefinitionProperty.class)) {
    sourceProperties = CascadingUtil.getCopyOnWriteListProjectProperty(this,
        PARAMETERS_DEFINITION_JOB_PROPERTY_PROPERTY_NAME).getOriginalValue();
  } else if (clazz.equals(AuthorizationMatrixProperty.class)) {
    sourceProperties = properties;
  } else {
    sourceProperties = getCascadingJobProperties();
  }
  if (null != sourceProperties) {
    for (JobProperty<? super JobT> p : sourceProperties) {
      if (clazz.isInstance(p)) {
        removeProperty(p);
        return clazz.cast(p);
      }
    }
  }
  return null;
}

代码示例来源:origin: hudson/hudson-2.x

/**
 * Removes the property of the given type.
 *
 * @return The property that was just removed.
 * @since 1.279
 */
public <T extends JobProperty> T removeProperty(Class<T> clazz) throws IOException {
  CopyOnWriteList<JobProperty<? super JobT>> sourceProperties;
  if (clazz.equals(ParametersDefinitionProperty.class)) {
    sourceProperties = CascadingUtil.getCopyOnWriteListProjectProperty(this,
      PARAMETERS_DEFINITION_JOB_PROPERTY_PROPERTY_NAME).getOriginalValue();
  } else if (clazz.equals(AuthorizationMatrixProperty.class)) {
    sourceProperties = properties;
  } else {
    sourceProperties = getCascadingJobProperties();
  }
  if (null != sourceProperties) {
    for (JobProperty<? super JobT> p : sourceProperties) {
      if (clazz.isInstance(p)) {
        removeProperty(p);
        return clazz.cast(p);
      }
    }
  }
  return null;
}

代码示例来源:origin: org.eclipse.hudson.main/hudson-core

/**
 * Removes the property of the given type.
 *
 * @return The property that was just removed.
 * @since 1.279
 */
@SuppressWarnings("unchecked")
public <T extends JobProperty> T removeProperty(Class<T> clazz) throws IOException {
  CopyOnWriteList<JobProperty<? super JobT>> sourceProperties;
  if (clazz.equals(ParametersDefinitionProperty.class)) {
    sourceProperties = CascadingUtil.getCopyOnWriteListProjectProperty(this,
      PARAMETERS_DEFINITION_JOB_PROPERTY_PROPERTY_NAME).getOriginalValue();
  } else if (clazz.equals(AuthorizationMatrixProperty.class)) {
    sourceProperties = properties;
  } else {
    sourceProperties = getCascadingJobProperties();
  }
  if (null != sourceProperties) {
    for (JobProperty<? super JobT> p : sourceProperties) {
      if (clazz.isInstance(p)) {
        removeProperty(p);
        return clazz.cast(p);
      }
    }
  }
  return null;
}

代码示例来源:origin: org.jenkins-ci.plugins/python-wrapper

@Override
public void removeProperty(JobProperty<? super JobT> jobProp) throws IOException {
  initPython();
  if (pexec.isImplemented(27)) {
    pexec.execPythonVoid("remove_property", jobProp);
  } else {
    super.removeProperty(jobProp);
  }
}

代码示例来源:origin: org.jenkins-ci.plugins/python-wrapper

@Override
public <T extends JobProperty> T removeProperty(Class<T> clazz) throws IOException {
  initPython();
  if (pexec.isImplemented(28)) {
    return (T) pexec.execPython("remove_property", clazz);
  } else {
    return super.removeProperty(clazz);
  }
}

代码示例来源:origin: org.jenkins-ci.main/jenkins-core

public synchronized void setBuildDiscarder(BuildDiscarder bd) throws IOException {
  try (BulkChange bc = new BulkChange(this)) {
    removeProperty(BuildDiscarderProperty.class);
    if (bd != null) {
      addProperty(new BuildDiscarderProperty(bd));
    }
    bc.commit();
  }
}

代码示例来源:origin: jenkinsci/workflow-multibranch-plugin

job.removeProperty(prop);
job.removeProperty(prop);

代码示例来源:origin: org.jenkins-ci.plugins.workflow/workflow-multibranch

job.removeProperty(prop);
job.removeProperty(prop);

相关文章

微信公众号

最新文章

更多

Job类方法