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

How to use
ModelASTNamedArgumentList
in
org.jenkinsci.plugins.pipeline.modeldefinition.ast

Best Java code snippets using org.jenkinsci.plugins.pipeline.modeldefinition.ast.ModelASTNamedArgumentList (Showing top 13 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
List l =
  • Codota Iconnew LinkedList()
  • Codota IconCollections.emptyList()
  • Codota Iconnew ArrayList()
  • Smart code suggestions by Codota
}
origin: jenkinsci/pipeline-model-definition-plugin

@Override
public boolean equals(Object o) {
  if (this == o) {
    return true;
  }
  if (o == null || getClass() != o.getClass()) {
    return false;
  }
  if (!super.equals(o)) {
    return false;
  }
  ModelASTNamedArgumentList that = (ModelASTNamedArgumentList) o;
  return getArguments() != null ? getArguments().equals(that.getArguments()) : that.getArguments() == null;
}
origin: jenkinsci/pipeline-model-definition-plugin

public ModelASTValue valueForName(@Nonnull String keyName) {
  if (containsKeyName(keyName)) {
    return arguments.get(keyForName(keyName));
  }
  return null;
}
origin: jenkinsci/pipeline-model-definition-plugin

protected ModelASTValue getSingleValue() {
  if (getArgs() instanceof ModelASTSingleArgument) {
    return ((ModelASTSingleArgument) getArgs()).getValue();
  } else if (getArgs() instanceof ModelASTNamedArgumentList) {
    ModelASTNamedArgumentList namedArgs = (ModelASTNamedArgumentList) getArgs();
    if (namedArgs.getArguments().size() == 1 && namedArgs.containsKeyName("scriptBlock")) {
      return namedArgs.valueForName("scriptBlock");
    }
  }
  return null;
}
origin: jenkinsci/pipeline-model-definition-plugin

if (firstStep.getArgs() instanceof ModelASTSingleArgument) {
  val = ((ModelASTSingleArgument) firstStep.getArgs()).getValue();
} else if (firstStep.getArgs() instanceof ModelASTNamedArgumentList && ((ModelASTNamedArgumentList) firstStep.getArgs()).getArguments().size() == 1) {
  val = ((ModelASTNamedArgumentList) firstStep.getArgs()).valueForName("message");
if (scriptStep.getArgs() instanceof ModelASTSingleArgument) {
  scriptVal = ((ModelASTSingleArgument) scriptStep.getArgs()).getValue();
} else if (scriptStep.getArgs() instanceof ModelASTNamedArgumentList && ((ModelASTNamedArgumentList) scriptStep.getArgs()).getArguments().size() == 1) {
  scriptVal = ((ModelASTNamedArgumentList) scriptStep.getArgs()).valueForName("scriptBlock");
origin: jenkinsci/pipeline-model-definition-plugin

  private String getPatternArgument(ModelASTArgumentList args) {
    if (args instanceof ModelASTSingleArgument) {
      return (String) ((ModelASTSingleArgument) args).getValue().getValue();
    } else if (args instanceof ModelASTPositionalArgumentList) {
      final List<ModelASTValue> arguments = ((ModelASTPositionalArgumentList) args).getArguments();
      if (!arguments.isEmpty()) {
        return (String) arguments.get(0).getValue();
      }
    } else if (args instanceof ModelASTNamedArgumentList) {
      return (String) ((ModelASTNamedArgumentList) args).argListToMap().get("pattern");
    }

    return null;
  }
}
origin: org.jenkinsci.plugins/pipeline-model-api

protected ModelASTValue getSingleValue() {
  if (getArgs() instanceof ModelASTSingleArgument) {
    return ((ModelASTSingleArgument) getArgs()).getValue();
  } else if (getArgs() instanceof ModelASTNamedArgumentList) {
    ModelASTNamedArgumentList namedArgs = (ModelASTNamedArgumentList) getArgs();
    if (namedArgs.getArguments().size() == 1 && namedArgs.containsKeyName("scriptBlock")) {
      return namedArgs.valueForName("scriptBlock");
    }
  }
  return null;
}
origin: org.jenkinsci.plugins/pipeline-model-api

@Override
public String toGroovy() {
  // Default to using whatever the original args structure is.
  ModelASTArgumentList argList = args;
  // If the args aren't null and they're a named list...
  if (args != null && args instanceof ModelASTNamedArgumentList) {
    ModelASTNamedArgumentList namedArgs = (ModelASTNamedArgumentList) args;
    // If the named list is exactly 1 long...
    if (namedArgs.getArguments().size() == 1) {
      DescriptorLookupCache lookup = DescriptorLookupCache.getPublicCache();
      Descriptor<? extends Describable> desc = lookup.lookupStepFirstThenFunction(name);
      DescribableModel<? extends Describable> model = lookup.modelForStepFirstThenFunction(name);
      // If we can lookup the model for this step or function...
      if (model != null) {
        DescribableParameter p = model.getSoleRequiredParameter();
        // If it's got a sole required parameter, that parameter is the key in our named list, and it doesn't
        // take a closure...
        if (p != null && namedArgs.containsKeyName(p.getName()) && !lookup.stepTakesClosure(desc)) {
          ModelASTValue value = namedArgs.valueForName(p.getName());
          // Set the arg list to instead be a ModelASTSingleArgument of that value.
          argList = new ModelASTSingleArgument(null);
          ((ModelASTSingleArgument) argList).setValue(value);
        }
      }
    }
  }
  return withOrWithoutParens(argList);
}
origin: jenkinsci/pipeline-model-definition-plugin

  @Override
  public int hashCode() {
    int result = super.hashCode();
    result = 31 * result + (getArguments() != null ? getArguments().hashCode() : 0);
    return result;
  }
}
origin: org.jenkinsci.plugins/pipeline-model-api

public ModelASTValue valueForName(@Nonnull String keyName) {
  if (containsKeyName(keyName)) {
    return arguments.get(keyForName(keyName));
  }
  return null;
}
origin: jenkinsci/pipeline-model-definition-plugin

@Override
public String toGroovy() {
  // Default to using whatever the original args structure is.
  ModelASTArgumentList argList = args;
  // If the args aren't null and they're a named list...
  if (args != null && args instanceof ModelASTNamedArgumentList) {
    ModelASTNamedArgumentList namedArgs = (ModelASTNamedArgumentList) args;
    // If the named list is exactly 1 long...
    if (namedArgs.getArguments().size() == 1) {
      DescriptorLookupCache lookup = DescriptorLookupCache.getPublicCache();
      Descriptor<? extends Describable> desc = lookup.lookupStepFirstThenFunction(name);
      DescribableModel<? extends Describable> model = lookup.modelForStepFirstThenFunction(name);
      // If we can lookup the model for this step or function...
      if (model != null) {
        DescribableParameter p = model.getSoleRequiredParameter();
        // If it's got a sole required parameter, that parameter is the key in our named list, and it doesn't
        // take a closure...
        if (p != null && namedArgs.containsKeyName(p.getName()) && !lookup.stepTakesClosure(desc)) {
          ModelASTValue value = namedArgs.valueForName(p.getName());
          // Set the arg list to instead be a ModelASTSingleArgument of that value.
          argList = new ModelASTSingleArgument(null);
          ((ModelASTSingleArgument) argList).setValue(value);
        }
      }
    }
  }
  return withOrWithoutParens(argList);
}
origin: org.jenkinsci.plugins/pipeline-model-api

@Override
public boolean equals(Object o) {
  if (this == o) {
    return true;
  }
  if (o == null || getClass() != o.getClass()) {
    return false;
  }
  if (!super.equals(o)) {
    return false;
  }
  ModelASTNamedArgumentList that = (ModelASTNamedArgumentList) o;
  return getArguments() != null ? getArguments().equals(that.getArguments()) : that.getArguments() == null;
}
origin: org.jenkinsci.plugins/pipeline-model-api

  @Override
  public int hashCode() {
    int result = super.hashCode();
    result = 31 * result + (getArguments() != null ? getArguments().hashCode() : 0);
    return result;
  }
}
origin: jenkinsci/pipeline-model-definition-plugin

for (ModelASTKey k : args.getArguments().keySet()) {
  if (k.getKey().equals("healthScaleFactor")) {
    val = args.getArguments().get(k);
org.jenkinsci.plugins.pipeline.modeldefinition.astModelASTNamedArgumentList

Javadoc

Represents the named parameters for a step in a map of ModelASTKeys and ModelASTValues.

Most used methods

  • getArguments
  • valueForName
  • argListToMap
  • containsKeyName
    Checks if a given key name is present.
  • keyForName

Popular in Java

  • Making http post requests using okhttp
  • notifyDataSetChanged (ArrayAdapter)
  • setContentView (Activity)
  • getExternalFilesDir (Context)
  • Rectangle (java.awt)
    A Rectangle specifies an area in a coordinate space that is enclosed by the Rectangle object's top-
  • FileWriter (java.io)
    Convenience class for writing character files. The constructors of this class assume that the defaul
  • OutputStream (java.io)
    A writable sink for bytes.Most clients will use output streams that write data to the file system (
  • HttpURLConnection (java.net)
    An URLConnection for HTTP (RFC 2616 [http://tools.ietf.org/html/rfc2616]) used to send and receive d
  • Callable (java.util.concurrent)
    A task that returns a result and may throw an exception. Implementors define a single method with no
  • XPath (javax.xml.xpath)
    XPath provides access to the XPath evaluation environment and expressions. Evaluation of XPath Expr
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