diff options
| author | 2018-07-18 13:46:00 +0100 | |
|---|---|---|
| committer | 2018-07-18 13:46:00 +0100 | |
| commit | 1ebe691c12f68beea378b133ddc4bcbde7f3f795 (patch) | |
| tree | fb051d9fde5644bd144a7e9d7bcecc70a256359c /src/main/java/cuchaz/enigma/mapping/FieldEntry.java | |
| parent | Recursively rebuild method names (diff) | |
| parent | Update version number (diff) | |
| download | enigma-fork-1ebe691c12f68beea378b133ddc4bcbde7f3f795.tar.gz enigma-fork-1ebe691c12f68beea378b133ddc4bcbde7f3f795.tar.xz enigma-fork-1ebe691c12f68beea378b133ddc4bcbde7f3f795.zip | |
Merge pull request #62 from OpenModLoader/asm
ASM based class translator
Diffstat (limited to 'src/main/java/cuchaz/enigma/mapping/FieldEntry.java')
| -rw-r--r-- | src/main/java/cuchaz/enigma/mapping/FieldEntry.java | 87 |
1 files changed, 0 insertions, 87 deletions
diff --git a/src/main/java/cuchaz/enigma/mapping/FieldEntry.java b/src/main/java/cuchaz/enigma/mapping/FieldEntry.java deleted file mode 100644 index 0f1f506..0000000 --- a/src/main/java/cuchaz/enigma/mapping/FieldEntry.java +++ /dev/null | |||
| @@ -1,87 +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 | * <p> | ||
| 8 | * Contributors: | ||
| 9 | * Jeff Martin - initial API and implementation | ||
| 10 | ******************************************************************************/ | ||
| 11 | |||
| 12 | package cuchaz.enigma.mapping; | ||
| 13 | |||
| 14 | import cuchaz.enigma.utils.Utils; | ||
| 15 | |||
| 16 | public class FieldEntry implements Entry { | ||
| 17 | |||
| 18 | private ClassEntry classEntry; | ||
| 19 | private String name; | ||
| 20 | private Type type; | ||
| 21 | |||
| 22 | // NOTE: this argument order is important for the MethodReader/MethodWriter | ||
| 23 | public FieldEntry(ClassEntry classEntry, String name, Type type) { | ||
| 24 | if (classEntry == null) { | ||
| 25 | throw new IllegalArgumentException("Class cannot be null!"); | ||
| 26 | } | ||
| 27 | if (name == null) { | ||
| 28 | throw new IllegalArgumentException("Field name cannot be null!"); | ||
| 29 | } | ||
| 30 | if (type == null) { | ||
| 31 | throw new IllegalArgumentException("Field type cannot be null!"); | ||
| 32 | } | ||
| 33 | |||
| 34 | this.classEntry = classEntry; | ||
| 35 | this.name = name; | ||
| 36 | this.type = type; | ||
| 37 | } | ||
| 38 | |||
| 39 | public FieldEntry(FieldEntry other, ClassEntry newClassEntry) { | ||
| 40 | this.classEntry = newClassEntry; | ||
| 41 | this.name = other.name; | ||
| 42 | this.type = other.type; | ||
| 43 | } | ||
| 44 | |||
| 45 | @Override | ||
| 46 | public ClassEntry getClassEntry() { | ||
| 47 | return this.classEntry; | ||
| 48 | } | ||
| 49 | |||
| 50 | @Override | ||
| 51 | public String getName() { | ||
| 52 | return this.name; | ||
| 53 | } | ||
| 54 | |||
| 55 | @Override | ||
| 56 | public String getClassName() { | ||
| 57 | return this.classEntry.getName(); | ||
| 58 | } | ||
| 59 | |||
| 60 | public Type getType() { | ||
| 61 | return this.type; | ||
| 62 | } | ||
| 63 | |||
| 64 | @Override | ||
| 65 | public FieldEntry cloneToNewClass(ClassEntry classEntry) { | ||
| 66 | return new FieldEntry(this, classEntry); | ||
| 67 | } | ||
| 68 | |||
| 69 | @Override | ||
| 70 | public int hashCode() { | ||
| 71 | return Utils.combineHashesOrdered(this.classEntry, this.name, this.type); | ||
| 72 | } | ||
| 73 | |||
| 74 | @Override | ||
| 75 | public boolean equals(Object other) { | ||
| 76 | return other instanceof FieldEntry && equals((FieldEntry) other); | ||
| 77 | } | ||
| 78 | |||
| 79 | public boolean equals(FieldEntry other) { | ||
| 80 | return this.classEntry.equals(other.classEntry) && this.name.equals(other.name) && this.type.equals(other.type); | ||
| 81 | } | ||
| 82 | |||
| 83 | @Override | ||
| 84 | public String toString() { | ||
| 85 | return this.classEntry.getName() + "." + this.name + ":" + this.type; | ||
| 86 | } | ||
| 87 | } | ||