-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEdgeKind.java
More file actions
71 lines (64 loc) · 1.91 KB
/
Copy pathEdgeKind.java
File metadata and controls
71 lines (64 loc) · 1.91 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
package io.github.randomcodespace.iq.model;
/**
* Types of edges (relationships) in the Code IQ graph.
* Mirrors the 27 edge kinds from the Python implementation.
*/
public enum EdgeKind {
DEPENDS_ON("depends_on"),
IMPORTS("imports"),
EXTENDS("extends"),
IMPLEMENTS("implements"),
CALLS("calls"),
INJECTS("injects"),
EXPOSES("exposes"),
QUERIES("queries"),
MAPS_TO("maps_to"),
PRODUCES("produces"),
CONSUMES("consumes"),
PUBLISHES("publishes"),
LISTENS("listens"),
INVOKES_RMI("invokes_rmi"),
EXPORTS_RMI("exports_rmi"),
READS_CONFIG("reads_config"),
MIGRATES("migrates"),
CONTAINS("contains"),
DEFINES("defines"),
OVERRIDES("overrides"),
CONNECTS_TO("connects_to"),
TRIGGERS("triggers"),
PROVISIONS("provisions"),
SENDS_TO("sends_to"),
RECEIVES_FROM("receives_from"),
PROTECTS("protects"),
RENDERS("renders"),
REFERENCES_TABLE("references_table");
private final String value;
private static final java.util.Map<String, EdgeKind> BY_VALUE;
static {
java.util.Map<String, EdgeKind> map = new java.util.HashMap<>();
for (EdgeKind kind : values()) {
map.put(kind.value, kind);
}
BY_VALUE = java.util.Collections.unmodifiableMap(map);
}
EdgeKind(String value) {
this.value = value;
}
public String getValue() {
return value;
}
/**
* Look up an EdgeKind by its string value (O(1) via static map).
*
* @param value the lowercase string value (e.g. "depends_on", "invokes_rmi")
* @return the matching EdgeKind
* @throws IllegalArgumentException if no match found
*/
public static EdgeKind fromValue(String value) {
EdgeKind kind = BY_VALUE.get(value);
if (kind == null) {
throw new IllegalArgumentException("Unknown EdgeKind value: " + value);
}
return kind;
}
}