-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNodeKind.java
More file actions
77 lines (70 loc) · 2.12 KB
/
Copy pathNodeKind.java
File metadata and controls
77 lines (70 loc) · 2.12 KB
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
package io.github.randomcodespace.iq.model;
/**
* Types of nodes in the Code IQ graph.
* Mirrors the 32 node kinds from the Python implementation.
*/
public enum NodeKind {
MODULE("module"),
PACKAGE("package"),
CLASS("class"),
METHOD("method"),
ENDPOINT("endpoint"),
ENTITY("entity"),
REPOSITORY("repository"),
QUERY("query"),
MIGRATION("migration"),
TOPIC("topic"),
QUEUE("queue"),
EVENT("event"),
RMI_INTERFACE("rmi_interface"),
CONFIG_FILE("config_file"),
CONFIG_KEY("config_key"),
WEBSOCKET_ENDPOINT("websocket_endpoint"),
INTERFACE("interface"),
ABSTRACT_CLASS("abstract_class"),
ENUM("enum"),
ANNOTATION_TYPE("annotation_type"),
PROTOCOL_MESSAGE("protocol_message"),
CONFIG_DEFINITION("config_definition"),
DATABASE_CONNECTION("database_connection"),
AZURE_RESOURCE("azure_resource"),
AZURE_FUNCTION("azure_function"),
MESSAGE_QUEUE("message_queue"),
INFRA_RESOURCE("infra_resource"),
COMPONENT("component"),
GUARD("guard"),
MIDDLEWARE("middleware"),
HOOK("hook"),
SERVICE("service"),
EXTERNAL("external"),
SQL_ENTITY("sql_entity");
private final String value;
private static final java.util.Map<String, NodeKind> BY_VALUE;
static {
java.util.Map<String, NodeKind> map = new java.util.HashMap<>();
for (NodeKind kind : values()) {
map.put(kind.value, kind);
}
BY_VALUE = java.util.Collections.unmodifiableMap(map);
}
NodeKind(String value) {
this.value = value;
}
public String getValue() {
return value;
}
/**
* Look up a NodeKind by its string value (O(1) via static map).
*
* @param value the lowercase string value (e.g. "module", "rmi_interface")
* @return the matching NodeKind
* @throws IllegalArgumentException if no match found
*/
public static NodeKind fromValue(String value) {
NodeKind kind = BY_VALUE.get(value);
if (kind == null) {
throw new IllegalArgumentException("Unknown NodeKind value: " + value);
}
return kind;
}
}