diff options
| author | 2016-07-04 18:14:22 +1000 | |
|---|---|---|
| committer | 2016-07-04 18:14:22 +1000 | |
| commit | 59e189bef2b5e6d129fb7c2c988ed0b2130e36ac (patch) | |
| tree | 2b638e60905251de85a4917152d6fc39a4112194 /src/main/java/cuchaz/enigma/mapping/FieldEntry.java | |
| parent | Fixed Obf Class list order (diff) | |
| download | enigma-fork-59e189bef2b5e6d129fb7c2c988ed0b2130e36ac.tar.gz enigma-fork-59e189bef2b5e6d129fb7c2c988ed0b2130e36ac.tar.xz enigma-fork-59e189bef2b5e6d129fb7c2c988ed0b2130e36ac.zip | |
Reformat
Diffstat (limited to 'src/main/java/cuchaz/enigma/mapping/FieldEntry.java')
| -rw-r--r-- | src/main/java/cuchaz/enigma/mapping/FieldEntry.java | 46 |
1 files changed, 18 insertions, 28 deletions
diff --git a/src/main/java/cuchaz/enigma/mapping/FieldEntry.java b/src/main/java/cuchaz/enigma/mapping/FieldEntry.java index bebc504..9980e8e 100644 --- a/src/main/java/cuchaz/enigma/mapping/FieldEntry.java +++ b/src/main/java/cuchaz/enigma/mapping/FieldEntry.java | |||
| @@ -10,17 +10,13 @@ | |||
| 10 | ******************************************************************************/ | 10 | ******************************************************************************/ |
| 11 | package cuchaz.enigma.mapping; | 11 | package cuchaz.enigma.mapping; |
| 12 | 12 | ||
| 13 | import java.io.Serializable; | 13 | import cuchaz.enigma.utils.Utils; |
| 14 | 14 | ||
| 15 | import cuchaz.enigma.Util; | 15 | public class FieldEntry implements Entry { |
| 16 | 16 | ||
| 17 | public class FieldEntry implements Entry, Serializable { | 17 | private ClassEntry classEntry; |
| 18 | 18 | private String name; | |
| 19 | private static final long serialVersionUID = 3004663582802885451L; | 19 | private Type type; |
| 20 | |||
| 21 | private ClassEntry m_classEntry; | ||
| 22 | private String m_name; | ||
| 23 | private Type m_type; | ||
| 24 | 20 | ||
| 25 | // NOTE: this argument order is important for the MethodReader/MethodWriter | 21 | // NOTE: this argument order is important for the MethodReader/MethodWriter |
| 26 | public FieldEntry(ClassEntry classEntry, String name, Type type) { | 22 | public FieldEntry(ClassEntry classEntry, String name, Type type) { |
| @@ -34,38 +30,34 @@ public class FieldEntry implements Entry, Serializable { | |||
| 34 | throw new IllegalArgumentException("Field type cannot be null!"); | 30 | throw new IllegalArgumentException("Field type cannot be null!"); |
| 35 | } | 31 | } |
| 36 | 32 | ||
| 37 | m_classEntry = classEntry; | 33 | this.classEntry = classEntry; |
| 38 | m_name = name; | 34 | this.name = name; |
| 39 | m_type = type; | 35 | this.type = type; |
| 40 | } | ||
| 41 | |||
| 42 | public FieldEntry(FieldEntry other) { | ||
| 43 | this(other, new ClassEntry(other.m_classEntry)); | ||
| 44 | } | 36 | } |
| 45 | 37 | ||
| 46 | public FieldEntry(FieldEntry other, ClassEntry newClassEntry) { | 38 | public FieldEntry(FieldEntry other, ClassEntry newClassEntry) { |
| 47 | m_classEntry = newClassEntry; | 39 | this.classEntry = newClassEntry; |
| 48 | m_name = other.m_name; | 40 | this.name = other.name; |
| 49 | m_type = other.m_type; | 41 | this.type = other.type; |
| 50 | } | 42 | } |
| 51 | 43 | ||
| 52 | @Override | 44 | @Override |
| 53 | public ClassEntry getClassEntry() { | 45 | public ClassEntry getClassEntry() { |
| 54 | return m_classEntry; | 46 | return this.classEntry; |
| 55 | } | 47 | } |
| 56 | 48 | ||
| 57 | @Override | 49 | @Override |
| 58 | public String getName() { | 50 | public String getName() { |
| 59 | return m_name; | 51 | return this.name; |
| 60 | } | 52 | } |
| 61 | 53 | ||
| 62 | @Override | 54 | @Override |
| 63 | public String getClassName() { | 55 | public String getClassName() { |
| 64 | return m_classEntry.getName(); | 56 | return this.classEntry.getName(); |
| 65 | } | 57 | } |
| 66 | 58 | ||
| 67 | public Type getType() { | 59 | public Type getType() { |
| 68 | return m_type; | 60 | return this.type; |
| 69 | } | 61 | } |
| 70 | 62 | ||
| 71 | @Override | 63 | @Override |
| @@ -75,7 +67,7 @@ public class FieldEntry implements Entry, Serializable { | |||
| 75 | 67 | ||
| 76 | @Override | 68 | @Override |
| 77 | public int hashCode() { | 69 | public int hashCode() { |
| 78 | return Util.combineHashesOrdered(m_classEntry, m_name, m_type); | 70 | return Utils.combineHashesOrdered(this.classEntry, this.name, this.type); |
| 79 | } | 71 | } |
| 80 | 72 | ||
| 81 | @Override | 73 | @Override |
| @@ -84,13 +76,11 @@ public class FieldEntry implements Entry, Serializable { | |||
| 84 | } | 76 | } |
| 85 | 77 | ||
| 86 | public boolean equals(FieldEntry other) { | 78 | public boolean equals(FieldEntry other) { |
| 87 | return m_classEntry.equals(other.m_classEntry) | 79 | return this.classEntry.equals(other.classEntry) && this.name.equals(other.name) && this.type.equals(other.type); |
| 88 | && m_name.equals(other.m_name) | ||
| 89 | && m_type.equals(other.m_type); | ||
| 90 | } | 80 | } |
| 91 | 81 | ||
| 92 | @Override | 82 | @Override |
| 93 | public String toString() { | 83 | public String toString() { |
| 94 | return m_classEntry.getName() + "." + m_name + ":" + m_type; | 84 | return this.classEntry.getName() + "." + this.name + ":" + this.type; |
| 95 | } | 85 | } |
| 96 | } | 86 | } |