Class DescriptionAdapter

java.lang.Object
org.jline.console.impl.DescriptionAdapter

public final class DescriptionAdapter extends Object
Converts between old console description types and new shell description types.

Provides static methods for bidirectional conversion:

Since:
4.0
  • Method Details

    • toCmdDesc

      public static CmdDesc toCmdDesc(org.jline.shell.CommandDescription desc)
      Converts a new CommandDescription to an old CmdDesc.
      Parameters:
      desc - the command description, may be null
      Returns:
      the CmdDesc, or null if input is null
    • toCommandDescription

      public static org.jline.shell.CommandDescription toCommandDescription(CmdDesc cmdDesc)
      Converts an old CmdDesc to a new CommandDescription.
      Parameters:
      cmdDesc - the CmdDesc, may be null
      Returns:
      the CommandDescription, or null if input is null
    • toCmdLine

      public static CmdLine toCmdLine(org.jline.shell.CommandLine commandLine)
      Converts a new CommandLine to an old CmdLine.
      Parameters:
      commandLine - the command line, may be null
      Returns:
      the CmdLine, or null if input is null
    • toCommandLine

      public static org.jline.shell.CommandLine toCommandLine(CmdLine cmdLine)
      Converts an old CmdLine to a new CommandLine.
      Parameters:
      cmdLine - the CmdLine, may be null
      Returns:
      the CommandLine, or null if input is null
    • toArgDesc

      public static ArgDesc toArgDesc(org.jline.shell.ArgumentDescription arg)
      Converts a new ArgumentDescription to an old ArgDesc.
      Parameters:
      arg - the argument description, may be null
      Returns:
      the ArgDesc, or null if input is null
    • toArgumentDescription

      public static org.jline.shell.ArgumentDescription toArgumentDescription(ArgDesc argDesc)
      Converts an old ArgDesc to a new ArgumentDescription.
      Parameters:
      argDesc - the ArgDesc, may be null
      Returns:
      the ArgumentDescription, or null if input is null