Tabnine Logo
InputDirective
Code IndexAdd Tabnine 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)

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
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • findViewById (Activity)
  • getApplicationContext (Context)
  • Kernel (java.awt.image)
  • EOFException (java.io)
    Thrown when a program encounters the end of a file or stream during an input operation.
  • FileReader (java.io)
    A specialized Reader that reads from a file in the file system. All read requests made by calling me
  • Callable (java.util.concurrent)
    A task that returns a result and may throw an exception. Implementors define a single method with no
  • AtomicInteger (java.util.concurrent.atomic)
    An int value that may be updated atomically. See the java.util.concurrent.atomic package specificati
  • Response (javax.ws.rs.core)
    Defines the contract between a returned instance and the runtime when an application needs to provid
  • From CI to AI: The AI layer in your organization
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now