diff options
Diffstat (limited to 'src/main/java/cuchaz/enigma/mapping/MethodDefEntry.java')
| -rw-r--r-- | src/main/java/cuchaz/enigma/mapping/MethodDefEntry.java | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/main/java/cuchaz/enigma/mapping/MethodDefEntry.java b/src/main/java/cuchaz/enigma/mapping/MethodDefEntry.java new file mode 100644 index 0000000..d6a160d --- /dev/null +++ b/src/main/java/cuchaz/enigma/mapping/MethodDefEntry.java | |||
| @@ -0,0 +1,35 @@ | |||
| 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 com.google.common.base.Preconditions; | ||
| 15 | import cuchaz.enigma.bytecode.AccessFlags; | ||
| 16 | |||
| 17 | public class MethodDefEntry extends MethodEntry { | ||
| 18 | |||
| 19 | private final AccessFlags access; | ||
| 20 | |||
| 21 | public MethodDefEntry(ClassEntry classEntry, String name, MethodDescriptor descriptor, AccessFlags access) { | ||
| 22 | super(classEntry, name, descriptor); | ||
| 23 | Preconditions.checkNotNull(access, "Method access cannot be null"); | ||
| 24 | this.access = access; | ||
| 25 | } | ||
| 26 | |||
| 27 | public AccessFlags getAccess() { | ||
| 28 | return access; | ||
| 29 | } | ||
| 30 | |||
| 31 | @Override | ||
| 32 | public MethodDefEntry updateOwnership(ClassEntry classEntry) { | ||
| 33 | return new MethodDefEntry(new ClassEntry(classEntry.getName()), name, descriptor, access); | ||
| 34 | } | ||
| 35 | } | ||