org.chromium.sdk/src/org/chromium/sdk/internal/tools/v8/request/V8MessageType.java
equal
deleted
inserted
replaced
|
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
|
2 // Use of this source code is governed by a BSD-style license that can be |
|
3 // found in the LICENSE file. |
|
4 |
|
5 package org.chromium.sdk.internal.tools.v8.request; |
|
6 |
|
7 import java.util.HashMap; |
|
8 import java.util.Map; |
|
9 |
|
10 /** |
|
11 * Known V8 debugger protocol message types. |
|
12 */ |
|
13 public enum V8MessageType { |
|
14 |
|
15 REQUEST("request"), |
|
16 RESPONSE("response"), |
|
17 EVENT("event"), |
|
18 ; |
|
19 |
|
20 private static final Map<String, V8MessageType> map = new HashMap<String, V8MessageType>(); |
|
21 |
|
22 static { |
|
23 for (V8MessageType type : values()) { |
|
24 map.put(type.value, type); |
|
25 } |
|
26 } |
|
27 |
|
28 public final String value; |
|
29 |
|
30 private V8MessageType(String value) { |
|
31 this.value = value; |
|
32 } |
|
33 |
|
34 public static V8MessageType forString(String value) { |
|
35 if (value == null) { |
|
36 return null; |
|
37 } |
|
38 return map.get(value); |
|
39 } |
|
40 } |