diff options
| author | 2017-03-08 08:17:04 +0100 | |
|---|---|---|
| committer | 2017-03-08 08:17:04 +0100 | |
| commit | 6e464ea251cab63c776ece0b2a356f1498ffa294 (patch) | |
| tree | 5ed30c03f5ac4cd2d6877874f5ede576049954f7 /src/test/java/cuchaz/enigma/TestEntryFactory.java | |
| parent | Drop unix case style and implement hashCode when equals is overrided (diff) | |
| download | enigma-fork-6e464ea251cab63c776ece0b2a356f1498ffa294.tar.gz enigma-fork-6e464ea251cab63c776ece0b2a356f1498ffa294.tar.xz enigma-fork-6e464ea251cab63c776ece0b2a356f1498ffa294.zip | |
Follow Fabric guidelines
Diffstat (limited to 'src/test/java/cuchaz/enigma/TestEntryFactory.java')
| -rw-r--r-- | src/test/java/cuchaz/enigma/TestEntryFactory.java | 49 |
1 files changed, 22 insertions, 27 deletions
diff --git a/src/test/java/cuchaz/enigma/TestEntryFactory.java b/src/test/java/cuchaz/enigma/TestEntryFactory.java index 4aa773b..1c527f5 100644 --- a/src/test/java/cuchaz/enigma/TestEntryFactory.java +++ b/src/test/java/cuchaz/enigma/TestEntryFactory.java | |||
| @@ -4,64 +4,59 @@ | |||
| 4 | * are made available under the terms of the GNU Lesser General Public | 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 | 5 | * License v3.0 which accompanies this distribution, and is available at |
| 6 | * http://www.gnu.org/licenses/lgpl.html | 6 | * http://www.gnu.org/licenses/lgpl.html |
| 7 | * | 7 | * |
| 8 | * Contributors: | 8 | * Contributors: |
| 9 | * Jeff Martin - initial API and implementation | 9 | * Jeff Martin - initial API and implementation |
| 10 | ******************************************************************************/ | 10 | ******************************************************************************/ |
| 11 | |||
| 11 | package cuchaz.enigma; | 12 | package cuchaz.enigma; |
| 12 | 13 | ||
| 13 | import cuchaz.enigma.analysis.EntryReference; | 14 | import cuchaz.enigma.analysis.EntryReference; |
| 14 | import cuchaz.enigma.mapping.BehaviorEntry; | 15 | import cuchaz.enigma.mapping.*; |
| 15 | import cuchaz.enigma.mapping.ClassEntry; | ||
| 16 | import cuchaz.enigma.mapping.ConstructorEntry; | ||
| 17 | import cuchaz.enigma.mapping.FieldEntry; | ||
| 18 | import cuchaz.enigma.mapping.MethodEntry; | ||
| 19 | import cuchaz.enigma.mapping.Signature; | ||
| 20 | import cuchaz.enigma.mapping.Type; | ||
| 21 | 16 | ||
| 22 | public class TestEntryFactory { | 17 | public class TestEntryFactory { |
| 23 | 18 | ||
| 24 | public static ClassEntry newClass(String name) { | 19 | public static ClassEntry newClass(String name) { |
| 25 | return new ClassEntry(name); | 20 | return new ClassEntry(name); |
| 26 | } | 21 | } |
| 27 | 22 | ||
| 28 | public static FieldEntry newField(String className, String fieldName, String fieldType) { | 23 | public static FieldEntry newField(String className, String fieldName, String fieldType) { |
| 29 | return newField(newClass(className), fieldName, fieldType); | 24 | return newField(newClass(className), fieldName, fieldType); |
| 30 | } | 25 | } |
| 31 | 26 | ||
| 32 | public static FieldEntry newField(ClassEntry classEntry, String fieldName, String fieldType) { | 27 | public static FieldEntry newField(ClassEntry classEntry, String fieldName, String fieldType) { |
| 33 | return new FieldEntry(classEntry, fieldName, new Type(fieldType)); | 28 | return new FieldEntry(classEntry, fieldName, new Type(fieldType)); |
| 34 | } | 29 | } |
| 35 | 30 | ||
| 36 | public static MethodEntry newMethod(String className, String methodName, String methodSignature) { | 31 | public static MethodEntry newMethod(String className, String methodName, String methodSignature) { |
| 37 | return newMethod(newClass(className), methodName, methodSignature); | 32 | return newMethod(newClass(className), methodName, methodSignature); |
| 38 | } | 33 | } |
| 39 | 34 | ||
| 40 | public static MethodEntry newMethod(ClassEntry classEntry, String methodName, String methodSignature) { | 35 | public static MethodEntry newMethod(ClassEntry classEntry, String methodName, String methodSignature) { |
| 41 | return new MethodEntry(classEntry, methodName, new Signature(methodSignature)); | 36 | return new MethodEntry(classEntry, methodName, new Signature(methodSignature)); |
| 42 | } | 37 | } |
| 43 | 38 | ||
| 44 | public static ConstructorEntry newConstructor(String className, String signature) { | 39 | public static ConstructorEntry newConstructor(String className, String signature) { |
| 45 | return newConstructor(newClass(className), signature); | 40 | return newConstructor(newClass(className), signature); |
| 46 | } | 41 | } |
| 47 | 42 | ||
| 48 | public static ConstructorEntry newConstructor(ClassEntry classEntry, String signature) { | 43 | public static ConstructorEntry newConstructor(ClassEntry classEntry, String signature) { |
| 49 | return new ConstructorEntry(classEntry, new Signature(signature)); | 44 | return new ConstructorEntry(classEntry, new Signature(signature)); |
| 50 | } | 45 | } |
| 51 | 46 | ||
| 52 | public static EntryReference<FieldEntry,BehaviorEntry> newFieldReferenceByMethod(FieldEntry fieldEntry, String callerClassName, String callerName, String callerSignature) { | 47 | public static EntryReference<FieldEntry, BehaviorEntry> newFieldReferenceByMethod(FieldEntry fieldEntry, String callerClassName, String callerName, String callerSignature) { |
| 53 | return new EntryReference<FieldEntry,BehaviorEntry>(fieldEntry, "", newMethod(callerClassName, callerName, callerSignature)); | 48 | return new EntryReference<FieldEntry, BehaviorEntry>(fieldEntry, "", newMethod(callerClassName, callerName, callerSignature)); |
| 54 | } | 49 | } |
| 55 | 50 | ||
| 56 | public static EntryReference<FieldEntry,BehaviorEntry> newFieldReferenceByConstructor(FieldEntry fieldEntry, String callerClassName, String callerSignature) { | 51 | public static EntryReference<FieldEntry, BehaviorEntry> newFieldReferenceByConstructor(FieldEntry fieldEntry, String callerClassName, String callerSignature) { |
| 57 | return new EntryReference<FieldEntry,BehaviorEntry>(fieldEntry, "", newConstructor(callerClassName, callerSignature)); | 52 | return new EntryReference<FieldEntry, BehaviorEntry>(fieldEntry, "", newConstructor(callerClassName, callerSignature)); |
| 58 | } | 53 | } |
| 59 | 54 | ||
| 60 | public static EntryReference<BehaviorEntry,BehaviorEntry> newBehaviorReferenceByMethod(BehaviorEntry behaviorEntry, String callerClassName, String callerName, String callerSignature) { | 55 | public static EntryReference<BehaviorEntry, BehaviorEntry> newBehaviorReferenceByMethod(BehaviorEntry behaviorEntry, String callerClassName, String callerName, String callerSignature) { |
| 61 | return new EntryReference<BehaviorEntry,BehaviorEntry>(behaviorEntry, "", newMethod(callerClassName, callerName, callerSignature)); | 56 | return new EntryReference<BehaviorEntry, BehaviorEntry>(behaviorEntry, "", newMethod(callerClassName, callerName, callerSignature)); |
| 62 | } | 57 | } |
| 63 | 58 | ||
| 64 | public static EntryReference<BehaviorEntry,BehaviorEntry> newBehaviorReferenceByConstructor(BehaviorEntry behaviorEntry, String callerClassName, String callerSignature) { | 59 | public static EntryReference<BehaviorEntry, BehaviorEntry> newBehaviorReferenceByConstructor(BehaviorEntry behaviorEntry, String callerClassName, String callerSignature) { |
| 65 | return new EntryReference<BehaviorEntry,BehaviorEntry>(behaviorEntry, "", newConstructor(callerClassName, callerSignature)); | 60 | return new EntryReference<BehaviorEntry, BehaviorEntry>(behaviorEntry, "", newConstructor(callerClassName, callerSignature)); |
| 66 | } | 61 | } |
| 67 | } | 62 | } |