java.lang.Object
com.synopsys.arc.jenkins.plugins.rolestrategy.Macro

public class Macro extends Object
Macro representation for roles and users. Implements following format: @macroId[:index][(parameter1, parameter2, ...)],
  • macroId - name of the macro. Supports alphanumeric symbols
  • index - optional integer, which allow to duplicate macro calls
  • parameters - optional set of strings. each parameter should be string without quotes
TODO: Macro parameters (ex, multiple usage of macro)
Since:
2.1.0
Author:
Oleg Nenashev, Synopsys Inc.
  • Field Details

  • Constructor Details

    • Macro

      public Macro(String name, Integer index, String[] parameters)
      Create new Macro.
      Parameters:
      name - Name of Macro
      index - Index of Macro
      parameters - List of Parameters
  • Method Details

    • getName

      public String getName()
      Get name of the macro.
      Returns:
      Name of the macro (without prefix)
    • getDisplayName

      public String getDisplayName()
    • getIndex

      public int getIndex()
    • hasIndex

      public boolean hasIndex()
    • getParameters

      public String[] getParameters()
    • hasParameters

      public boolean hasParameters()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • isMacro

      public static boolean isMacro(Role role)
      Check if role is a macro.
      Parameters:
      role - Role to be checked
      Returns:
      true if role meets macro criteria
    • isMacro

      public static boolean isMacro(String macroString)
    • Parse

      @Deprecated public static Macro Parse(String macroString) throws MacroException
      Deprecated.
      Parse Macro.
      Throws:
      MacroException
    • parse

      public static Macro parse(String macroString) throws MacroException
      Parse macro from string.
      Parameters:
      macroString - - macro string
      Returns:
      Macro instance
      Throws:
      MacroException - - Parse error
      Since:
      2.3.0