Package org.cadixdev.lorenz.impl.model
Class MethodMappingImpl
- java.lang.Object
-
- org.cadixdev.lorenz.impl.model.AbstractMappingImpl<M,P>
-
- org.cadixdev.lorenz.impl.model.AbstractMemberMappingImpl<MethodMapping,ClassMapping>
-
- org.cadixdev.lorenz.impl.model.MethodMappingImpl
-
- All Implemented Interfaces:
Mapping<MethodMapping,ClassMapping>,MemberMapping<MethodMapping,ClassMapping>,MethodMapping,Reversible<MethodMapping,ClassMapping>
public class MethodMappingImpl extends AbstractMemberMappingImpl<MethodMapping,ClassMapping> implements MethodMapping
A basic implementation ofMethodMapping.- Since:
- 0.2.0
-
-
Constructor Summary
Constructors Constructor Description MethodMappingImpl(ClassMapping parentClass, org.cadixdev.bombe.type.signature.MethodSignature signature, java.lang.String deobfuscatedName)Creates a new method mapping, from the given parameters.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.util.StringJoinerbuildToString()MethodParameterMappingcreateParameterMapping(int index, java.lang.String deobfuscatedName)Creates aMethodParameterMappingparented by this method, of the given integer index.booleanequals(java.lang.Object obj)java.util.Optional<MethodParameterMapping>getParameterMapping(int index)Gets aMethodParameterMapping, if present, of the given integer index.java.util.Collection<MethodParameterMapping>getParameterMappings()Gets an immutable view of all theMethodParameterMappings that belong to this method.org.cadixdev.bombe.type.signature.MethodSignaturegetSignature()Gets the signature of this method mapping.inthashCode()booleanhasParameterMapping(int index)Establishes whether the method mapping contains a parameter mapping of the integer index.-
Methods inherited from class org.cadixdev.lorenz.impl.model.AbstractMemberMappingImpl
getParent
-
Methods inherited from class org.cadixdev.lorenz.impl.model.AbstractMappingImpl
get, getDeobfuscatedName, getMappings, getObfuscatedName, hasDeobfuscatedName, set, setDeobfuscatedName, toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.cadixdev.lorenz.model.Mapping
get, getDeobfuscatedName, getMappings, getObfuscatedName, getOrCreate, getSimpleDeobfuscatedName, getSimpleObfuscatedName, hasDeobfuscatedName, set, setDeobfuscatedName
-
Methods inherited from interface org.cadixdev.lorenz.model.MemberMapping
getParent
-
Methods inherited from interface org.cadixdev.lorenz.model.MethodMapping
copy, getDeobfuscatedDescriptor, getDeobfuscatedSignature, getDescriptor, getFullDeobfuscatedName, getFullObfuscatedName, getObfuscatedDescriptor, getOrCreateParameterMapping, hasMappings, merge, reverse
-
-
-
-
Constructor Detail
-
MethodMappingImpl
public MethodMappingImpl(ClassMapping parentClass, org.cadixdev.bombe.type.signature.MethodSignature signature, java.lang.String deobfuscatedName)
Creates a new method mapping, from the given parameters.- Parameters:
parentClass- The class mapping, this mapping belongs tosignature- The signaturedeobfuscatedName- The de-obfuscated name
-
-
Method Detail
-
getSignature
public org.cadixdev.bombe.type.signature.MethodSignature getSignature()
Description copied from interface:MethodMappingGets the signature of this method mapping.- Specified by:
getSignaturein interfaceMethodMapping- Returns:
- The signature
-
getParameterMappings
public java.util.Collection<MethodParameterMapping> getParameterMappings()
Description copied from interface:MethodMappingGets an immutable view of all theMethodParameterMappings that belong to this method.- Specified by:
getParameterMappingsin interfaceMethodMapping- Returns:
- The parameter mappings
-
createParameterMapping
public MethodParameterMapping createParameterMapping(int index, java.lang.String deobfuscatedName)
Description copied from interface:MethodMappingCreates aMethodParameterMappingparented by this method, of the given integer index.- Specified by:
createParameterMappingin interfaceMethodMapping- Parameters:
index- The index of the parameterdeobfuscatedName- The de-obfuscated name to give the parameter- Returns:
- The parameter mapping
-
getParameterMapping
public java.util.Optional<MethodParameterMapping> getParameterMapping(int index)
Description copied from interface:MethodMappingGets aMethodParameterMapping, if present, of the given integer index.- Specified by:
getParameterMappingin interfaceMethodMapping- Parameters:
index- The index of the parameter- Returns:
- The parameter mapping, wrapped in an
Optional
-
hasParameterMapping
public boolean hasParameterMapping(int index)
Description copied from interface:MethodMappingEstablishes whether the method mapping contains a parameter mapping of the integer index.- Specified by:
hasParameterMappingin interfaceMethodMapping- Parameters:
index- The index of the parameter- Returns:
trueshould a parameter mapping of the given index exists in the method mapping;falseotherwise
-
buildToString
protected java.util.StringJoiner buildToString()
- Overrides:
buildToStringin classAbstractMappingImpl<MethodMapping,ClassMapping>
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classAbstractMemberMappingImpl<MethodMapping,ClassMapping>
-
hashCode
public int hashCode()
- Overrides:
hashCodein classAbstractMemberMappingImpl<MethodMapping,ClassMapping>
-
-