Codota Logo
InputDirective
Code IndexAdd Codota to your IDE (free)

How to use
InputDirective
in
org.jenkinsci.plugins.pipeline.modeldefinition.generator

Best Java code snippets using org.jenkinsci.plugins.pipeline.modeldefinition.generator.InputDirective (Showing top 3 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Dictionary d =
  • Codota Iconnew Hashtable()
  • Codota IconBundle bundle;bundle.getHeaders()
  • Codota Iconnew Properties()
  • Smart code suggestions by Codota
}
origin: jenkinsci/pipeline-model-definition-plugin

@Override
@Nonnull
public String toGroovy(@Nonnull InputDirective directive) {
  if (directive.getMessage() != null) {
    StringBuilder result = new StringBuilder("input {\n");
    result.append("message ").append(Snippetizer.object2Groovy(directive.getMessage())).append("\n");
    if (!StringUtils.isEmpty(directive.getId())) {
      result.append("id ").append(Snippetizer.object2Groovy(directive.getId())).append("\n");
    if (!StringUtils.isEmpty(directive.getOk())) {
      result.append("ok ").append(Snippetizer.object2Groovy(directive.getOk())).append("\n");
    if (!StringUtils.isEmpty(directive.getSubmitter())) {
      result.append("submitter ").append(Snippetizer.object2Groovy(directive.getSubmitter())).append("\n");
    if (!StringUtils.isEmpty(directive.getSubmitterParameter())) {
      result.append("submitterParameter ").append(Snippetizer.object2Groovy(directive.getSubmitterParameter())).append("\n");
    if (!directive.getParameters().isEmpty()) {
      result.append("parameters {\n");
      for (ParameterDefinition p : directive.getParameters()) {
        result.append(Snippetizer.object2Groovy(UninstantiatedDescribable.from(p))).append("\n");
origin: jenkinsci/pipeline-model-definition-plugin

@Test
public void fullInput() throws Exception {
  InputDirective input = new InputDirective("hello");
  input.setId("banana");
  input.setOk("Yeah, do it");
  input.setSubmitter("bob");
  input.setSubmitterParameter("subParam");
  List<ParameterDefinition> params = new ArrayList<>();
  params.add(new StringParameterDefinition("aString", "steve", "Hey, a string"));
  params.add(new BooleanParameterDefinition("aBool", true, "A boolean now"));
  input.setParameters(params);
  assertGenerateDirective(input,
      "input {\n" +
          "  message 'hello'\n" +
          "  id 'banana'\n" +
          "  ok 'Yeah, do it'\n" +
          "  submitter 'bob'\n" +
          "  submitterParameter 'subParam'\n" +
          "  parameters {\n" +
          // StringParameterDefinition added trim field in 2.90
          "    string defaultValue: 'steve', description: 'Hey, a string', name: 'aString'" + trimParamOrEmpty() + "\n" +
          "    booleanParam defaultValue: true, description: 'A boolean now', name: 'aBool'\n" +
          "  }\n" +
          "}");
}
origin: jenkinsci/pipeline-model-definition-plugin

@Test
public void simpleInput() throws Exception {
  InputDirective input = new InputDirective("hello");
  assertGenerateDirective(input,
      "input {\n" +
          "  message 'hello'\n" +
          "}");
}
org.jenkinsci.plugins.pipeline.modeldefinition.generatorInputDirective

Most used methods

  • <init>
  • getId
  • getMessage
  • getOk
  • getParameters
  • getSubmitter
  • getSubmitterParameter
  • setId
  • setOk
  • setParameters
  • setSubmitter
  • setSubmitterParameter
  • setSubmitter,
  • setSubmitterParameter

Popular in Java

  • Updating database using SQL prepared statement
  • scheduleAtFixedRate (Timer)
  • onRequestPermissionsResult (Fragment)
  • notifyDataSetChanged (ArrayAdapter)
  • URLConnection (java.net)
    The abstract class URLConnection is the superclass of all classes that represent a communications li
  • URLEncoder (java.net)
    This class is used to encode a string using the format required by application/x-www-form-urlencoded
  • DecimalFormat (java.text)
    DecimalFormat is a concrete subclass ofNumberFormat that formats decimal numbers. It has a variety o
  • UUID (java.util)
    UUID is an immutable representation of a 128-bit universally unique identifier (UUID). There are mul
  • JarFile (java.util.jar)
    JarFile is used to read jar entries and their associated data from jar files.
  • Logger (org.apache.log4j)
    This is the central class in the log4j package. Most logging operations, except configuration, are d
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now