Tabnine Logo
ModelASTValue.getValue
Code IndexAdd Tabnine to your IDE (free)

How to use
getValue
method
in
org.jenkinsci.plugins.pipeline.modeldefinition.ast.ModelASTValue

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

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;
  }
  ModelASTValue that = (ModelASTValue) o;
  return getValue() != null ? getValue().equals(that.getValue()) : that.getValue() == null;
}
origin: jenkinsci/pipeline-model-definition-plugin

@Override
public Map<String,?> argListToMap() {
  List<Object> argList = new ArrayList<>();
  for (ModelASTValue v : arguments) {
    argList.add(v.getValue());
  }
  return Collections.singletonMap(UninstantiatedDescribable.ANONYMOUS_KEY, 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;
  }
  ModelASTValue that = (ModelASTValue) o;
  return getValue() != null ? getValue().equals(that.getValue()) : that.getValue() == null;
}
origin: jenkinsci/pipeline-model-definition-plugin

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

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

@Override
public Map<String,?> argListToMap() {
  List<Object> argList = new ArrayList<>();
  for (ModelASTValue v : arguments) {
    argList.add(v.getValue());
  }
  return Collections.singletonMap(UninstantiatedDescribable.ANONYMOUS_KEY, argList);
}
origin: jenkinsci/pipeline-model-definition-plugin

@Override
public Map<String,?> argListToMap() {
  Map<String,Object> m = new LinkedHashMap<>();
  for (Map.Entry<ModelASTKey,ModelASTValue> entry : arguments.entrySet()) {
    m.put(entry.getKey().getKey(), entry.getValue().getValue());
  }
  return m;
}
origin: org.jenkinsci.plugins/pipeline-model-api

@Override
public Map<String,?> argListToMap() {
  Map<String,Object> m = new LinkedHashMap<>();
  for (Map.Entry<ModelASTKey,ModelASTValue> entry : arguments.entrySet()) {
    m.put(entry.getKey().getKey(), entry.getValue().getValue());
  }
  return m;
}
origin: jenkinsci/pipeline-model-definition-plugin

@Override
public Map<String,?> argListToMap() {
  return Collections.singletonMap(UninstantiatedDescribable.ANONYMOUS_KEY,
      getValue().getValue());
}
origin: org.jenkinsci.plugins/pipeline-model-api

@Override
public Map<String,?> argListToMap() {
  return Collections.singletonMap(UninstantiatedDescribable.ANONYMOUS_KEY,
      getValue().getValue());
}
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: jenkinsci/pipeline-model-definition-plugin

private boolean isEmptyStringLabelAgent() {
  if (agentType.getKey().equals("label") || agentType.getKey().equals("node")) {
    if (variables instanceof ModelASTValue && "".equals(((ModelASTValue) variables).getValue())) {
      return true;
    }
    if (variables instanceof ModelASTClosureMap) {
      Map<ModelASTKey, ModelASTMethodArg> vars = ((ModelASTClosureMap) variables).getVariables();
      // Don't actually switch to "agent any" if there are any additional options besides the label.
      if (vars.size() == 1) {
        for (Map.Entry<ModelASTKey,ModelASTMethodArg> entry : vars.entrySet()) {
          if (entry.getKey().getKey().equals("label")) {
            ModelASTMethodArg argValue = entry.getValue();
            if (argValue instanceof ModelASTValue && ((ModelASTValue) argValue).getValue().equals("")) {
              return true;
            }
          }
        }
      }
    }
  }
  return false;
}
origin: jenkinsci/pipeline-model-definition-plugin

public String codeBlockAsString() {
  if (getArgs() == null) {
    return null;
  } else if (isLiteralSingleArg()) {
    Object v = getSingleValue().getValue();
    if (v instanceof String) {
      List<String> retList = new ArrayList<>();
      for (String s : v.toString().split("\\r?\\n")) {
        retList.add(s.trim());
      }
      return StringUtils.join(retList, "\n");
    } else {
      return v.toString();
    }
  } else {
    return getArgs().toGroovy();
  }
}
origin: org.jenkinsci.plugins/pipeline-model-api

public String codeBlockAsString() {
  if (getArgs() == null) {
    return null;
  } else if (isLiteralSingleArg()) {
    Object v = getSingleValue().getValue();
    if (v instanceof String) {
      List<String> retList = new ArrayList<>();
      for (String s : v.toString().split("\\r?\\n")) {
        retList.add(s.trim());
      }
      return StringUtils.join(retList, "\n");
    } else {
      return v.toString();
    }
  } else {
    return getArgs().toGroovy();
  }
}
origin: jenkinsci/pipeline-model-definition-plugin

  @Override
  @CheckForNull
  public String validateElement(@Nonnull ModelASTOption option, @CheckForNull FlowExecution execution) {
    if (option.getName() != null && option.getName().equals("preserveStashes")) {
      for (ModelASTMethodArg arg : option.getArgs()) {
        if (arg instanceof ModelASTKeyValueOrMethodCallPair) {
          ModelASTKeyValueOrMethodCallPair namedArg = (ModelASTKeyValueOrMethodCallPair)arg;
          if (namedArg.getKey().getKey().equals("buildCount")) {
            if (namedArg.getValue() instanceof ModelASTValue && ((ModelASTValue)namedArg.getValue()).getValue() instanceof Integer) {
              Integer v = (Integer)((ModelASTValue)namedArg.getValue()).getValue();
              if (v < 1 || v > MAX_SAVED_STASHES) {
                return Messages.PreserveStashesJobProperty_ValidatorImpl_InvalidBuildCount(MAX_SAVED_STASHES);
              }
            }
          }
        }
      }
    }
    return null;
  }
}
origin: jenkinsci/pipeline-model-definition-plugin

@Override
public JSONObject toJSON() {
  return new JSONObject()
    .accumulate("isLiteral", isLiteral())
    .accumulate("value", getValue());
}
origin: org.jenkinsci.plugins/pipeline-model-api

@Override
public JSONObject toJSON() {
  return new JSONObject()
    .accumulate("isLiteral", isLiteral())
    .accumulate("value", getValue());
}
origin: jenkinsci/pipeline-model-definition-plugin

Object realVal = val.getValue();
origin: jenkinsci/pipeline-model-definition-plugin

assertEquals("First branch", val.getValue());
org.jenkinsci.plugins.pipeline.modeldefinition.astModelASTValuegetValue

Javadoc

Returns a value or an expression that represents this value. This model is used at the compile time, so it's not always possible to obtain the actual value. Imagine something like secret('12345')or even pow(2,10). In case the value is an expression, this method returns a string represntation suitable for the editor. For example, if the value is foobar(x), we want the editor to show "${foobar(x)}"

Popular methods of ModelASTValue

  • equals
  • getSourceLocation
  • hashCode
  • isLiteral
    If the value can be determined without side-effect at AST parsing time, this method returns true, an
  • removeSourceLocation
  • toGroovy
  • toJSON
  • validate

Popular in Java

  • Running tasks concurrently on multiple threads
  • scheduleAtFixedRate (Timer)
  • putExtra (Intent)
  • addToBackStack (FragmentTransaction)
  • VirtualMachine (com.sun.tools.attach)
    A Java virtual machine. A VirtualMachine represents a Java virtual machine to which this Java vir
  • FileWriter (java.io)
    A specialized Writer that writes to a file in the file system. All write requests made by calling me
  • DecimalFormat (java.text)
    A concrete subclass of NumberFormat that formats decimal numbers. It has a variety of features desig
  • ConcurrentHashMap (java.util.concurrent)
    A plug-in replacement for JDK1.5 java.util.concurrent.ConcurrentHashMap. This version is based on or
  • ExecutorService (java.util.concurrent)
    An Executor that provides methods to manage termination and methods that can produce a Future for tr
  • JOptionPane (javax.swing)
  • PhpStorm for WordPress
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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