Class Substitution

java.lang.Object
hudson.model.AbstractDescribableImpl<Substitution>
io.jenkins.plugins.configsplice.Substitution
All Implemented Interfaces:
Describable<Substitution>

public class Substitution extends AbstractDescribableImpl<Substitution>
One replacement: a property path plus exactly one source of the new value (SRS section 4.5).

Only path is mandatory in the constructor; everything else is a DataBoundSetter, which is what keeps the Pipeline map syntax optional per field and lets new options be added later without breaking existing scripts.

  • Constructor Details

    • Substitution

      @DataBoundConstructor public Substitution(@NonNull String path)
  • Method Details

    • getPath

      @NonNull public String getPath()
    • getValue

      @CheckForNull public String getValue()
    • setValue

      @DataBoundSetter public void setValue(@CheckForNull String value)
      A literal replacement.

      Uses Util.fixEmpty(java.lang.String) rather than fixEmptyAndTrim: a literal is written into the user's configuration file verbatim, so trimming it here would silently alter data. Only a genuinely empty submission becomes "not supplied".

    • getCredentialsId

      @CheckForNull public String getCredentialsId()
    • setCredentialsId

      @DataBoundSetter public void setCredentialsId(@CheckForNull String credentialsId)
      A Secret Text credential ID.

      Trimmed, unlike setValue(java.lang.String): an identifier with surrounding whitespace is always a paste accident, never intent.

      Both setters normalise an untouched form field to null. An HTML text input always submits a string, so a field nobody filled in arrives as "" rather than absent, and DescribableModel only omits values equal to the declared default — leaving the Snippet Generator to emit noise such as credentialsId: ''.

    • getType

      @NonNull public String getType()
    • setType

      @DataBoundSetter public void setType(@CheckForNull String type)