Class Substitution

java.lang.Object
io.clientcore.annotation.processor.models.Substitution

public class Substitution extends Object
A Substitution is a value that can be used to replace placeholder values in a URL. Placeholders look like: "http://{host}.com/{fileName}.html", where "{host}" and "{fileName}" are the placeholders.
  • Constructor Details

    • Substitution

      public Substitution(String parameterName, String parameterVariableName)
      Create a new Substitution.
      Parameters:
      parameterName - The name that is used between curly quotes as a placeholder in the target URL.
      parameterVariableName - The name of the variable that will be used to replace the placeholder in the target
    • Substitution

      public Substitution(String parameterName, String parameterVariableName, boolean shouldEncode)
      Create a new Substitution.
      Parameters:
      parameterName - The name that is used between curly quotes as a placeholder in the target URL.
      parameterVariableName - The name of the variable that will be used to replace the placeholder in the target
      shouldEncode - Whether the value from the method's argument should be encoded when the substitution is taking place.
  • Method Details

    • getParameterName

      public String getParameterName()
      Get the placeholder's name.
      Returns:
      The name of the placeholder.
    • getParameterVariableName

      public String getParameterVariableName()
      Get the variable name that will be used to replace the placeholder in the target URL.
      Returns:
      The name of the variable that will be used to replace the placeholder in the target URL.
    • shouldEncode

      public boolean shouldEncode()
      Whether the replacement value from the method argument needs to be encoded when the substitution is taking place.
      Returns:
      Whether the replacement value from the method argument needs to be encoded when the substitution is taking place.