Class CmdBuilder

java.lang.Object
org.basex.core.parse.CmdBuilder

public final class CmdBuilder extends Object
This class simplifies the composition of the string representation of a database command.
Author:
BaseX Team 2005-21, BSD License, Christian Gruen
  • Constructor Details

    • CmdBuilder

      public CmdBuilder(Command cmd, boolean conf)
      Constructor.
      Parameters:
      cmd - command
      conf - confidential flag
  • Method Details

    • init

      public CmdBuilder init()
      Initializes the builder with the class name of the command in upper case.
      Returns:
      self instance
    • init

      public CmdBuilder init(String string)
      Initializes the builder with the specified string.
      Parameters:
      string - command string
      Returns:
      self instance
    • args

      public CmdBuilder args()
      Returns a string representation of all arguments.
      Returns:
      self instance
    • add

      public CmdBuilder add(int arg)
      Adds the specified argument unchanged.
      Parameters:
      arg - argument index
      Returns:
      self instance
    • conf

      public boolean conf()
      Returns the confidential flag.
      Returns:
      flag
    • arg

      public CmdBuilder arg(int arg)
      Adds the specified argument.
      Parameters:
      arg - argument index
      Returns:
      self instance
    • arg

      public CmdBuilder arg(String key, int arg)
      Adds an argument with an optional prefix.
      Parameters:
      key - optional keyword prefix
      arg - argument index
      Returns:
      self instance
    • arg

      public CmdBuilder arg(String key, String arg)
      Adds an argument with an optional prefix.
      Parameters:
      key - optional keyword prefix
      arg - argument string
      Returns:
      self instance
    • toString

      public String toString()
      Overrides:
      toString in class Object