Class Template

java.lang.Object
org.nwolfhub.easycli.model.Template

public class Template extends Object
  • Field Details

  • Constructor Details

    • Template

      public Template()
    • Template

      public Template(String name, String prefix, String postfix)
  • Method Details

    • getName

      public String getName()
    • setName

      public Template setName(String name)
      sets a name for the template that can be used later to use it in EasyCLI
      Parameters:
      name - - name of a template
    • getPrefix

      public String getPrefix()
      Retrieves the prefix value.
      Returns:
      the prefix value as a String.
    • setPrefix

      public Template setPrefix(String prefix)
      Sets the prefix value. Prefix will be added before the text
      Parameters:
      prefix - the prefix value to be set as a String.
    • getPostfix

      public String getPostfix()
      Retrieves the postfix value.
      Returns:
      the postfix value as a String.
    • setPostfix

      public Template setPostfix(String postfix)
      Sets the postfix value. Postfix will be added after the text
      Parameters:
      postfix - the postfix value to be set as a String.
    • getBorder

      public Border getBorder()
    • setBorder

      public Template setBorder(Border border)
    • formatText

      public String formatText(String text, Level level)
      Applies all template rules to the text
      Parameters:
      text - - unedited text
      Returns:
      modified text
    • addVariable

      public Template addVariable(Variable v)
      Adds a new variable to the list of variables processed by the variable processor.
      Parameters:
      v - the variable to be added
    • removeVariable

      public Template removeVariable(int index)
      Removes the variable at the specified index from the list of variables processed by the variable processor.
      Parameters:
      index - the index of the variable to be removed
    • clearVariables

      public Template clearVariables()
      Clears all the variables in the list of variables processed by the variable processor.
    • getVariables

      public List<Variable> getVariables()
      Returns a list of all variables processed by the variable processor.
      Returns:
      a list of Variable objects