summaryrefslogtreecommitdiff
path: root/python/pydevSrc/com/jetbrains/python/debugger/pydev/AbstractThreadCommand.java
blob: 690d893bb27403eec0d4769eff599363386f4229 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
package com.jetbrains.python.debugger.pydev;


public abstract class AbstractThreadCommand<T> extends AbstractCommand<T> {
  private final String myThreadId;

  protected AbstractThreadCommand(final RemoteDebugger debugger, final int commandCode, final String threadId) {
    super(debugger, commandCode);
    myThreadId = threadId;
  }

  @Override
  protected void buildPayload(Payload payload) {
    payload.add(myThreadId);
  }

  public static boolean isThreadCommand(int command) {
    return command == CREATE_THREAD ||
           command == KILL_THREAD ||
           command == RESUME_THREAD ||
           command == SUSPEND_THREAD;
  }

  public String getThreadId() {
    return myThreadId;
  }

}