summaryrefslogtreecommitdiff
path: root/src/test/java/cuchaz/enigma/TestEntryFactory.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/java/cuchaz/enigma/TestEntryFactory.java')
-rw-r--r--src/test/java/cuchaz/enigma/TestEntryFactory.java49
1 files changed, 0 insertions, 49 deletions
diff --git a/src/test/java/cuchaz/enigma/TestEntryFactory.java b/src/test/java/cuchaz/enigma/TestEntryFactory.java
deleted file mode 100644
index 9e1425a..0000000
--- a/src/test/java/cuchaz/enigma/TestEntryFactory.java
+++ /dev/null
@@ -1,49 +0,0 @@
1/*******************************************************************************
2 * Copyright (c) 2015 Jeff Martin.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the GNU Lesser General Public
5 * License v3.0 which accompanies this distribution, and is available at
6 * http://www.gnu.org/licenses/lgpl.html
7 *
8 * Contributors:
9 * Jeff Martin - initial API and implementation
10 ******************************************************************************/
11
12package cuchaz.enigma;
13
14import cuchaz.enigma.analysis.EntryReference;
15import cuchaz.enigma.translation.representation.*;
16import cuchaz.enigma.translation.representation.entry.ClassEntry;
17import cuchaz.enigma.translation.representation.entry.FieldEntry;
18import cuchaz.enigma.translation.representation.entry.MethodEntry;
19
20public class TestEntryFactory {
21
22 public static ClassEntry newClass(String name) {
23 return new ClassEntry(name);
24 }
25
26 public static FieldEntry newField(String className, String fieldName, String fieldType) {
27 return newField(newClass(className), fieldName, fieldType);
28 }
29
30 public static FieldEntry newField(ClassEntry classEntry, String fieldName, String fieldType) {
31 return new FieldEntry(classEntry, fieldName, new TypeDescriptor(fieldType));
32 }
33
34 public static MethodEntry newMethod(String className, String methodName, String methodSignature) {
35 return newMethod(newClass(className), methodName, methodSignature);
36 }
37
38 public static MethodEntry newMethod(ClassEntry classEntry, String methodName, String methodSignature) {
39 return new MethodEntry(classEntry, methodName, new MethodDescriptor(methodSignature));
40 }
41
42 public static EntryReference<FieldEntry, MethodEntry> newFieldReferenceByMethod(FieldEntry fieldEntry, String callerClassName, String callerName, String callerSignature) {
43 return new EntryReference<>(fieldEntry, "", newMethod(callerClassName, callerName, callerSignature));
44 }
45
46 public static EntryReference<MethodEntry, MethodEntry> newBehaviorReferenceByMethod(MethodEntry methodEntry, String callerClassName, String callerName, String callerSignature) {
47 return new EntryReference<>(methodEntry, "", newMethod(callerClassName, callerName, callerSignature));
48 }
49}