diff options
Diffstat (limited to 'src/main/java/cuchaz/enigma/mapping/MethodMapping.java')
| -rw-r--r-- | src/main/java/cuchaz/enigma/mapping/MethodMapping.java | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/src/main/java/cuchaz/enigma/mapping/MethodMapping.java b/src/main/java/cuchaz/enigma/mapping/MethodMapping.java index 99b9c88..455ff6b 100644 --- a/src/main/java/cuchaz/enigma/mapping/MethodMapping.java +++ b/src/main/java/cuchaz/enigma/mapping/MethodMapping.java | |||
| @@ -22,12 +22,17 @@ public class MethodMapping implements Comparable<MethodMapping>, MemberMapping<B | |||
| 22 | private String deobfName; | 22 | private String deobfName; |
| 23 | private Signature obfSignature; | 23 | private Signature obfSignature; |
| 24 | private Map<Integer, ArgumentMapping> arguments; | 24 | private Map<Integer, ArgumentMapping> arguments; |
| 25 | private Mappings.EntryModifier modifier; | ||
| 25 | 26 | ||
| 26 | public MethodMapping(String obfName, Signature obfSignature) { | 27 | public MethodMapping(String obfName, Signature obfSignature) { |
| 27 | this(obfName, obfSignature, null); | 28 | this(obfName, obfSignature, null,Mappings.EntryModifier.UNCHANGED); |
| 28 | } | 29 | } |
| 29 | 30 | ||
| 30 | public MethodMapping(String obfName, Signature obfSignature, String deobfName) { | 31 | public MethodMapping(String obfName, Signature obfSignature, String deobfName) { |
| 32 | this(obfName, obfSignature, deobfName, Mappings.EntryModifier.UNCHANGED); | ||
| 33 | } | ||
| 34 | |||
| 35 | public MethodMapping(String obfName, Signature obfSignature, String deobfName, Mappings.EntryModifier modifier) { | ||
| 31 | if (obfName == null) { | 36 | if (obfName == null) { |
| 32 | throw new IllegalArgumentException("obf name cannot be null!"); | 37 | throw new IllegalArgumentException("obf name cannot be null!"); |
| 33 | } | 38 | } |
| @@ -38,11 +43,13 @@ public class MethodMapping implements Comparable<MethodMapping>, MemberMapping<B | |||
| 38 | this.deobfName = NameValidator.validateMethodName(deobfName); | 43 | this.deobfName = NameValidator.validateMethodName(deobfName); |
| 39 | this.obfSignature = obfSignature; | 44 | this.obfSignature = obfSignature; |
| 40 | this.arguments = Maps.newTreeMap(); | 45 | this.arguments = Maps.newTreeMap(); |
| 46 | this.modifier = modifier; | ||
| 41 | } | 47 | } |
| 42 | 48 | ||
| 43 | public MethodMapping(MethodMapping other, ClassNameReplacer obfClassNameReplacer) { | 49 | public MethodMapping(MethodMapping other, ClassNameReplacer obfClassNameReplacer) { |
| 44 | this.obfName = other.obfName; | 50 | this.obfName = other.obfName; |
| 45 | this.deobfName = other.deobfName; | 51 | this.deobfName = other.deobfName; |
| 52 | this.modifier = other.modifier; | ||
| 46 | this.obfSignature = new Signature(other.obfSignature, obfClassNameReplacer); | 53 | this.obfSignature = new Signature(other.obfSignature, obfClassNameReplacer); |
| 47 | this.arguments = Maps.newTreeMap(); | 54 | this.arguments = Maps.newTreeMap(); |
| 48 | for (Map.Entry<Integer,ArgumentMapping> entry : other.arguments.entrySet()) { | 55 | for (Map.Entry<Integer,ArgumentMapping> entry : other.arguments.entrySet()) { |
| @@ -187,4 +194,14 @@ public class MethodMapping implements Comparable<MethodMapping>, MemberMapping<B | |||
| 187 | return new MethodEntry(classEntry, this.obfName, this.obfSignature); | 194 | return new MethodEntry(classEntry, this.obfName, this.obfSignature); |
| 188 | } | 195 | } |
| 189 | } | 196 | } |
| 197 | |||
| 198 | public Mappings.EntryModifier getModifier() | ||
| 199 | { | ||
| 200 | return modifier; | ||
| 201 | } | ||
| 202 | |||
| 203 | public void setModifier(Mappings.EntryModifier modifier) | ||
| 204 | { | ||
| 205 | this.modifier = modifier; | ||
| 206 | } | ||
| 190 | } | 207 | } |