changeset 1002:43f0378228df

Missed Task class
author Devel 2
date Fri, 04 Oct 2019 12:50:51 +0200
parents 7402a22cba53
children a7c986455443
files stress-tester/src/main/java/com/passus/st/emitter/Task.java
diffstat 1 files changed, 30 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stress-tester/src/main/java/com/passus/st/emitter/Task.java	Fri Oct 04 12:50:51 2019 +0200
@@ -0,0 +1,30 @@
+package com.passus.st.emitter;
+
+public class Task {
+
+    public static final int CONNECT = 1;
+    public static final int READ = 2;
+    public static final int FLUSH = 3;
+    public static final int CLOSE = 4;
+
+    public final int code;
+
+    public Task(int code) {
+        this.code = code;
+    }
+
+    public String codeString() {
+        switch (code) {
+            case CONNECT:
+                return "Connect";
+            case READ:
+                return "Read";
+            case FLUSH:
+                return "Flush";
+            case CLOSE:
+                return "Close";
+            default:
+                throw new Error("Invalid task code.");
+        }
+    }
+}