Class Parameters

java.lang.Object
tv.hd3g.processlauncher.cmdline.SimpleParameters
tv.hd3g.processlauncher.cmdline.Parameters

public class Parameters extends SimpleParameters
  • Constructor Details

    • Parameters

      public Parameters()
      Use "<%" and "%>" by default
  • Method Details

    • of

      public static Parameters of(String... parameters)
      Parameters:
      parameters - add each entry without alter it. Use "<%" and "%>" by default
    • of

      public static Parameters of(Collection<String> parameters)
      Parameters:
      parameters - add each entry without alter it. Use "<%" and "%>" by default
    • bulk

      public static Parameters bulk(String... bulkParameters)
      Parameters:
      parameters - add each entry with addBulkParameters Use "<%" and "%>" by default
    • bulk

      public static Parameters bulk(Collection<String> bulkParameters)
      Parameters:
      parameters - add each entry with addBulkParameters Use "<%" and "%>" by default
    • tagVar

      public String tagVar(String varName)
    • setVarTags

      public Parameters setVarTags(String startVarTag, String endVarTag)
    • transfertThisConfigurationTo

      public Parameters transfertThisConfigurationTo(Parameters newInstance)
      Don't touch to current parameters, only parameterKeysStartsWith, startVarTag, endVarTag.
    • getEndVarTag

      public String getEndVarTag()
      Returns:
      like "%>"
    • getStartVarTag

      public String getStartVarTag()
      Returns:
      like "<%"
    • isTaggedParameter

      public boolean isTaggedParameter(String param)
      Parameters:
      param - like
      Returns:
      true if like "<%myvar%>"
    • extractVarNameFromTaggedParameter

      public String extractVarNameFromTaggedParameter(String param)
      Parameters:
      param - like <%myvar%>
      Returns:
      like "myvar" or null if param is not a valid variable of if it's empty.
    • addVariable

      public String addVariable(String varName)
      Returns:
      varName
    • duplicate

      public Parameters duplicate()
    • injectParamsAroundVariable

      public boolean injectParamsAroundVariable(String varName, Collection<String> addBefore, Collection<String> addAfter)
      Returns:
      true if the update is done
    • removeVariables

      public Parameters removeVariables(boolean removeParamsIfNoVarToInject)
      Parameters:
      removeParamsIfNoVarToInject - if true, for "-a -b ? -d" -> "-a -d", else "-a -b -d"
      Returns:
      this
    • injectVariables

      public Parameters injectVariables(Map<String,Parameters> varsToInject, boolean removeParamsIfNoVarToInject)
      Parameters:
      removeParamsIfNoVarToInject - if true, for "-a -b ? -d" -> "-a -d", else "-a -b -d"
      Returns:
      this
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class SimpleParameters
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class SimpleParameters