-
-
Notifications
You must be signed in to change notification settings - Fork 44
/
Mappings.java
35 lines (27 loc) · 1.14 KB
/
Mappings.java
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
package nallar.tickthreading.mappings;
import java.util.ArrayList;
import java.util.List;
public abstract class Mappings {
@SuppressWarnings("unchecked")
public List<?> map(List<?> things) {
List mappedThings = new ArrayList();
for (Object thing : things) {
if (thing instanceof MethodDescription) {
mappedThings.add(map((MethodDescription) thing));
} else if (thing instanceof ClassDescription) {
mappedThings.add(map((ClassDescription) thing));
} else if (thing instanceof FieldDescription) {
mappedThings.add(map((FieldDescription) thing));
} else {
throw new IllegalArgumentException("Must be mappable: " + thing + "isn't!");
}
}
return mappedThings;
}
public abstract MethodDescription map(MethodDescription methodDescription);
public abstract ClassDescription map(ClassDescription classDescription);
public abstract FieldDescription map(FieldDescription fieldDescription);
public abstract MethodDescription rmap(MethodDescription methodDescription);
public abstract String obfuscate(String code);
public abstract String shortClassNameToFullClassName(String shortName);
}