Package org.apache.commons.net.telnet

# Class TelnetCommand

java.lang.Object
org.apache.commons.net.telnet.TelnetCommand

public final class TelnetCommand extends Object
The TelnetCommand class cannot be instantiated and only serves as a storehouse for Telnet command constants.

See Also:
  - `Telnet`
  - `TelnetClient`

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final int`
  `ABORT`
  Abort code.
  `static final int`
  `AO`
  Abort Output code.
  `static final int`
  `AYT`
  Are You There code.
  `static final int`
  `BREAK`
  Break code.
  `static final int`
  `DM`
  Data mark code.
  `static final int`
  `DO`
  Request to use option code.
  `static final int`
  `DONT`
  Don't use option code.
  `static final int`
  `EC`
  Erase Character code.
  `static final int`
  `EL`
  Erase Line code.
  `static final int`
  `EOF`
  End of file code.
  `static final int`
  `EOR`
  End of record code.
  `static final int`
  `GA`
  Go Ahead code.
  `static final int`
  `IAC`
  Interpret As Command code.
  `static final int`
  `IP`
  Interrupt Process code.
  `static final int`
  `MAX_COMMAND_VALUE`
  The maximum value a command code can have.
  `static final int`
  `NOP`
  No Operation code.
  `static final int`
  `SB`
  Start subnegotiation code.
  `static final int`
  `SE`
  End subnegotiation code.
  `static final int`
  `SUSP`
  Suspend process code.
  `static final int`
  `SYNCH`
  Synchronize code.
  `static final int`
  `WILL`
  Agree to use option code.
  `static final int`
  `WONT`
  Refuse to use option code.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static String`
  `getCommand(int code)`
  Gets the string representation of the Telnet protocol command corresponding to the given command code.
  `static boolean`
  `isValidCommand(int code)`
  Tests if a given command code is valid.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### MAX_COMMAND_VALUE

    public static final int MAX_COMMAND_VALUE
    The maximum value a command code can have. This value is 255.
    See Also:
      - Constant Field Values

  - ### IAC

    public static final int IAC
    Interpret As Command code. Value is 255 according to RFC 854.
    See Also:
      - Constant Field Values

  - ### DONT

    public static final int DONT
    Don't use option code. Value is 254 according to RFC 854.
    See Also:
      - Constant Field Values

  - ### DO

    public static final int DO
    Request to use option code. Value is 253 according to RFC 854.
    See Also:
      - Constant Field Values

  - ### WONT

    public static final int WONT
    Refuse to use option code. Value is 252 according to RFC 854.
    See Also:
      - Constant Field Values

  - ### WILL

    public static final int WILL
    Agree to use option code. Value is 251 according to RFC 854.
    See Also:
      - Constant Field Values

  - ### SB

    public static final int SB
    Start subnegotiation code. Value is 250 according to RFC 854.
    See Also:
      - Constant Field Values

  - ### GA

    public static final int GA
    Go Ahead code. Value is 249 according to RFC 854.
    See Also:
      - Constant Field Values

  - ### EL

    public static final int EL
    Erase Line code. Value is 248 according to RFC 854.
    See Also:
      - Constant Field Values

  - ### EC

    public static final int EC
    Erase Character code. Value is 247 according to RFC 854.
    See Also:
      - Constant Field Values

  - ### AYT

    public static final int AYT
    Are You There code. Value is 246 according to RFC 854.
    See Also:
      - Constant Field Values

  - ### AO

    public static final int AO
    Abort Output code. Value is 245 according to RFC 854.
    See Also:
      - Constant Field Values

  - ### IP

    public static final int IP
    Interrupt Process code. Value is 244 according to RFC 854.
    See Also:
      - Constant Field Values

  - ### BREAK

    public static final int BREAK
    Break code. Value is 243 according to RFC 854.
    See Also:
      - Constant Field Values

  - ### DM

    public static final int DM
    Data mark code. Value is 242 according to RFC 854.
    See Also:
      - Constant Field Values

  - ### NOP

    public static final int NOP
    No Operation code. Value is 241 according to RFC 854.
    See Also:
      - Constant Field Values

  - ### SE

    public static final int SE
    End subnegotiation code. Value is 240 according to RFC 854.
    See Also:
      - Constant Field Values

  - ### EOR

    public static final int EOR
    End of record code. Value is 239.
    See Also:
      - Constant Field Values

  - ### ABORT

    public static final int ABORT
    Abort code. Value is 238.
    See Also:
      - Constant Field Values

  - ### SUSP

    public static final int SUSP
    Suspend process code. Value is 237.
    See Also:
      - Constant Field Values

  - ### EOF

    public static final int EOF
    End of file code. Value is 236.
    See Also:
      - Constant Field Values

  - ### SYNCH

    public static final int SYNCH
    Synchronize code. Value is 242.
    See Also:
      - Constant Field Values

- ## Method Details

  - ### getCommand

    public static String getCommand(int code)
    Gets the string representation of the Telnet protocol command corresponding to the given command code.
    Parameters:
      `code` - The command code of the Telnet protocol command.
    Returns:
      The string representation of the Telnet protocol command.

  - ### isValidCommand

    public static boolean isValidCommand(int code)
    Tests if a given command code is valid. Returns true if valid, false if not.
    Parameters:
      `code` - The command code to test.
    Returns:
      True if the command code is valid, false if not.