Interface MappingSetMergerHandler
-
public interface MappingSetMergerHandlerThis class is responsible for handling the individual merge conditions found in the default
MappingSetMerger. It may be simpler to override the default implementation of this class to handle any particular cases you wish to modify rather than overridingMappingSetMerger.All methods in this class are intended to create the base-mapping only. That is to say, for a merge of 2 class mappings, the method should merge only the name of said class and return it, not process the rest of the class's members. The
MappingSetMergerwill handle recursively calling individual mapping methods for the members.
Continuations and Duplicates:
This class distinguishes between the normal merge case and a duplicate merge case. A normal merge case is when theleftmapping mapsA -> Band therightmapping mapsB -> C. This can be thought of as a mapping chain, where the deobfuscated side of theleftmapping lines up with the obfuscated side of therightmapping. This is what is referred to as a continuation, since in this case therightmapping "continues" the chain. All of therightmappings in the normal merge methods are continuations.There also exists the possibility that the
rightmapping set will duplicate theleft. That means that theleftmapping mapsA -> B, and therightmapping mapsA -> C(orA -> Btoo, what matters is the obfuscated sides match). In this case the obfuscated side of theleftmapping matches the obfuscated side of the right mapping. This is what this class refers to as a duplicate mapping.The
mergeDuplicate*methods in this class have 2rightmapping parameters, one calledrightand the other calledrightContinuation. If the duplicate method is called that means a duplicate has already been detected, which is why therightmapping is nevernull. In this situation there is still a possibility of a continuation mapping existing in therightmapping set, however. Put another way, theleftmapping set may mapA -> B, and therightmapping set may map bothA -> CandB -> D(orB -> C, the left side is what matters here). If this situation occurs, then therightContinuationparameter will not benulland the handler implementation will need to handle this case. The default implementation just assumes the duplicatedrightmapping is the correct mapping and throws away therightContinuationmapping. Note that attempting to keep both will always fail (in the default case) because both would eventually resolve to the same obfuscated names.- Since:
- 0.5.4
- See Also:
MappingSetMerger- Implementation Requirements:
- In order to properly implement this interface extra care must be taken for the
addRightMethod()method. This method has a special case that no other method has in the standard merge case, which is that the obfuscated types of the method descriptor may be mapped to the deobfuscated types of the left side (which has no matching mapping in this case). In order to properly map this case you must also make a best-effort to map the obfuscated types of the descriptor to the obfuscated mappings of the left side. All handler methods have acontextparameter to help with these kinds of situations.
-
-
Method Summary
All Methods Static Methods Instance Methods Default Methods Modifier and Type Method Description default FieldMappingaddLeftFieldMapping(FieldMapping left, ClassMapping<?,?> target, MergeContext context)Handle the case where only the left mapping exists, creating the result in thetargetand returning it.default MergeResult<InnerClassMapping>addLeftInnerClassMapping(InnerClassMapping left, ClassMapping<?,?> target, MergeContext context)Handle the case where only the left inner class mapping exists, creating the result in thetargetand returning it.default MergeResult<MethodMapping>addLeftMethodMapping(MethodMapping left, ClassMapping<?,?> target, MergeContext context)Handle the case where only the left method mapping exists, creating the result in thetargetand returning it.default MethodParameterMappingaddLeftParameterMapping(MethodParameterMapping left, MethodMapping target, MergeContext context)Handle the case where only the left parameter mapping mapping exists, creating the result in thetargetand returning it.default MergeResult<TopLevelClassMapping>addLeftTopLevelClassMapping(TopLevelClassMapping left, MappingSet target, MergeContext context)Handle the case where only the left top level class mapping exists, creating the result in thetargetand returning it.default FieldMappingaddRightFieldMapping(FieldMapping right, ClassMapping<?,?> target, MergeContext context)Handle the case where only the right mapping exists, creating the result in thetargetand returning it.default MergeResult<InnerClassMapping>addRightInnerClassMapping(InnerClassMapping right, ClassMapping<?,?> target, MergeContext context)Handle the case where only the right inner class mapping exists, creating the result in thetargetand returning it.default MergeResult<MethodMapping>addRightMethodMapping(MethodMapping right, ClassMapping<?,?> target, MergeContext context)Handle the case where only the right method mapping exists, creating the result in thetargetand returning it.default MethodParameterMappingaddRightParameterMapping(MethodParameterMapping right, MethodMapping target, MergeContext context)Handle the case where only the right parameter mapping mapping exists, creating the result in thetargetand returning it.default MergeResult<TopLevelClassMapping>addRightTopLevelClassMapping(TopLevelClassMapping right, MappingSet target, MergeContext context)Handle the case where only the right top level class mapping exists, creating the result in thetargetand returning it.static MappingSetMergerHandlercreate()Create the default mapping set merger handler implementation.default FieldMappingmergeDuplicateFieldMappings(FieldMapping left, FieldMapping strictRightDuplicate, FieldMapping looseRightDuplicate, FieldMapping strictRightContinuation, FieldMapping looseRightContinuation, ClassMapping<?,?> target, MergeContext context)Merge 2 existing field mappings together who both refer to the same obfuscated name, creating the result in thetargetand returning it.default MergeResult<InnerClassMapping>mergeDuplicateInnerClassMappings(InnerClassMapping left, InnerClassMapping right, InnerClassMapping rightContinuation, ClassMapping<?,?> target, MergeContext context)Merge 2 existing inner class mappings together who both refer to the same obfuscated name, creating the result in thetargetand returning it.default MergeResult<MethodMapping>mergeDuplicateMethodMappings(MethodMapping left, MethodMapping strictRightDuplicate, MethodMapping looseRightDuplicate, MethodMapping strictRightContinuation, MethodMapping looseRightContinuation, ClassMapping<?,?> target, MergeContext context)Merge 2 or more existing method mappings together who all refer to the same obfuscated signature, creating the result in thetargetand returning it.default MergeResult<TopLevelClassMapping>mergeDuplicateTopLevelClassMappings(TopLevelClassMapping left, TopLevelClassMapping right, TopLevelClassMapping rightContinuation, MappingSet target, MergeContext context)Merge 2 existing top level class mappings together who both refer to the same obfuscated name, creating the result in thetargetand returning it.default FieldMappingmergeFieldMappings(FieldMapping left, FieldMapping strictRight, FieldMapping looseRight, ClassMapping<?,?> target, MergeContext context)Merge 2 existing fields together, creating the result in thetargetand returning it.default MergeResult<InnerClassMapping>mergeInnerClassMappings(InnerClassMapping left, InnerClassMapping right, ClassMapping<?,?> target, MergeContext context)Merge 2 existing inner classes together, creating the result in thetargetand returning it.default MergeResult<MethodMapping>mergeMethodMappings(MethodMapping left, MethodMapping strictRight, MethodMapping looseRight, ClassMapping<?,?> target, MergeContext context)Merge 2 or 3 existing method mappings together, creating the result in thetargetand returning it.default MethodParameterMappingmergeParameterMappings(MethodParameterMapping left, MethodParameterMapping right, MethodMapping target, MergeContext context)Merge 2 existing parameter mappings together, creating the result in thetargetand returning it.default MergeResult<TopLevelClassMapping>mergeTopLevelClassMappings(TopLevelClassMapping left, TopLevelClassMapping right, MappingSet target, MergeContext context)Merge 2 existing top level class mappings together, creating the result in thetargetand returning it.
-
-
-
Method Detail
-
create
static MappingSetMergerHandler create()
Create the default mapping set merger handler implementation.- Returns:
- The newly created mapping set merger handler.
- Since:
- 0.5.4
-
mergeTopLevelClassMappings
default MergeResult<TopLevelClassMapping> mergeTopLevelClassMappings(TopLevelClassMapping left, TopLevelClassMapping right, MappingSet target, MergeContext context)
Merge 2 existing top level class mappings together, creating the result in thetargetand returning it. This method should only map the name of the class, not any members.- Parameters:
left- The left top level class mapping, nevernull.right- The right top level class mapping, nevernull.target- The mapping set to create the new class mapping in, nevernull.context- TheMergeContextassociated with this merge operation, nevernull.- Returns:
- The new top level class mapping in a merge result. Pass
nullto theMergeResultif the mapping wasn't merged and should be removed.
-
mergeDuplicateTopLevelClassMappings
default MergeResult<TopLevelClassMapping> mergeDuplicateTopLevelClassMappings(TopLevelClassMapping left, TopLevelClassMapping right, TopLevelClassMapping rightContinuation, MappingSet target, MergeContext context)
Merge 2 existing top level class mappings together who both refer to the same obfuscated name, creating the result in thetargetand returning it. This method should only map the name of the class, not any members.- Parameters:
left- The left top level class mapping, nevernull.right- The right top level class mapping which duplicates the left mapping, nevernull.rightContinuation- The optional right top level class mapping which continues from the left mapping, can benull. For more information on continuation mappings, see the "Continuations and Duplicates" section inMappingSetMergerHandler.target- The mapping set to create the new class mapping in, nevernull.context- TheMergeContextassociated with this merge operation, nevernull.- Returns:
- The new top level class mapping in a merge result. Pass
nullto theMergeResultif the mapping wasn't merged and should be removed. - Implementation Note:
- The default implementation views the "right" mapping as the more up-to-date method, so this situation
is treated by delegating to
addRightTopLevelClassMapping().
-
addLeftTopLevelClassMapping
default MergeResult<TopLevelClassMapping> addLeftTopLevelClassMapping(TopLevelClassMapping left, MappingSet target, MergeContext context)
Handle the case where only the left top level class mapping exists, creating the result in thetargetand returning it. This method should only map the name of the class, not any members.- Parameters:
left- The left class mapping, nevernull.target- The mapping set to create the new class mapping in, nevernull.context- TheMergeContextassociated with this merge operation, nevernull.- Returns:
- The new top level class mapping in a merge result. Pass
nullto theMergeResultif the mapping wasn't merged and should be removed.
-
addRightTopLevelClassMapping
default MergeResult<TopLevelClassMapping> addRightTopLevelClassMapping(TopLevelClassMapping right, MappingSet target, MergeContext context)
Handle the case where only the right top level class mapping exists, creating the result in thetargetand returning it. This method should only map the name of the class, not any members.- Parameters:
right- The right top level class mapping, nevernull.target- The mapping top level set to create the new class mapping in, nevernull.context- TheMergeContextassociated with this merge operation, nevernull.- Returns:
- The new top level class mapping in a merge result. Pass
nullto theMergeResultif the mapping wasn't merged and should be removed.
-
mergeInnerClassMappings
default MergeResult<InnerClassMapping> mergeInnerClassMappings(InnerClassMapping left, InnerClassMapping right, ClassMapping<?,?> target, MergeContext context)
Merge 2 existing inner classes together, creating the result in thetargetand returning it. This method should only map the name of the class, not any members.- Parameters:
left- The left inner class mapping, nevernull.right- The right inner class mapping, nevernull.target- The class mapping to create the new inner class mapping in, nevernull.context- TheMergeContextassociated with this merge operation, nevernull.- Returns:
- The new inner class mapping in a merge result. Pass
nullto theMergeResultif the mapping wasn't merged and should be removed.
-
mergeDuplicateInnerClassMappings
default MergeResult<InnerClassMapping> mergeDuplicateInnerClassMappings(InnerClassMapping left, InnerClassMapping right, InnerClassMapping rightContinuation, ClassMapping<?,?> target, MergeContext context)
Merge 2 existing inner class mappings together who both refer to the same obfuscated name, creating the result in thetargetand returning it. This method should only map the name of the class, not any members.- Parameters:
left- The left inner class mapping, nevernull.right- The right inner class mapping, nevernull.rightContinuation- The optional right inner class mapping which continues from the left mapping, can benull. For more information on continuation mappings, see the "Continuations and Duplicates" section inMappingSetMergerHandler.target- The class mapping to create the new inner class mapping in, nevernull.context- TheMergeContextassociated with this merge operation, nevernull.- Returns:
- The new inner class mapping in a merge result. Pass
nullto theMergeResultif the mapping wasn't merged and should be removed. - Implementation Note:
- The default implementation views the "right" mapping as the more up-to-date method, so this situation
is treated by delegating to
addRightInnerClassMapping().
-
addLeftInnerClassMapping
default MergeResult<InnerClassMapping> addLeftInnerClassMapping(InnerClassMapping left, ClassMapping<?,?> target, MergeContext context)
Handle the case where only the left inner class mapping exists, creating the result in thetargetand returning it. This method should only map the name of the class, not any members.- Parameters:
left- The left class mapping, nevernull.target- The class mapping to create the new inner class mapping in, nevernull.context- TheMergeContextassociated with this merge operation, nevernull.- Returns:
- The new inner class mapping in a merge result. Pass
nullto theMergeResultif the mapping wasn't merged and should be removed.
-
addRightInnerClassMapping
default MergeResult<InnerClassMapping> addRightInnerClassMapping(InnerClassMapping right, ClassMapping<?,?> target, MergeContext context)
Handle the case where only the right inner class mapping exists, creating the result in thetargetand returning it. This method should only map the name of the class, not any members.- Parameters:
right- The right class mapping, nevernull.target- The class mapping to create the new inner class mapping in, nevernull.context- TheMergeContextassociated with this merge operation, nevernull.- Returns:
- The new inner class mapping in a merge result. Pass
nullto theMergeResultif the mapping wasn't merged and should be removed.
-
mergeFieldMappings
default FieldMapping mergeFieldMappings(FieldMapping left, FieldMapping strictRight, FieldMapping looseRight, ClassMapping<?,?> target, MergeContext context)
Merge 2 existing fields together, creating the result in the
targetand returning it.There are 2 possible ways a
rightfield mapping can continue aleftfield mapping:- The right field mapping's obfuscated signature matches the left field mapping's deobfuscated signature. This also includes the field type. This is the standard case.
- Only the right field mapping's obfuscated name matches the left method mapping's deobfuscated name, ignoring the type.
The first case is considered most correct and, and thus is considered the
strictmerge and is what maps to the parameter namedstrictRight. The second case is found only by widening the search past a typical merge, so it's considered theFieldMergeStrategy.LOOSEmerge and is what maps to the parameter namedlooseRight.Note: Both
strictRightandlooseRightmay be present together at the same time, but at least one will always be present.- Parameters:
left- The left field mapping, nevernull.strictRight- The best-fit right field mapping which continues from the left mapping, can benullif not present.looseRight- The slightly worse-fit right field mapping which continues from the left mapping, can benullif not present. Can only be present if the field merge strategy is set toFieldMergeStrategy.LOOSE.target- The class mapping to create the new field mapping in, nevernull.context- TheMergeContextassociated with this merge operation, nevernull.- Returns:
- The new field mapping. Return
nullif the mapping wasn't merged and should be removed. - Implementation Note:
- The
looseRightparameter will only be checked for and included if the field mapping merge strategy is set toFieldMergeStrategy.LOOSE. This is set viaMergeConfig. If the merge strategy is notloosethenlooseRightwill always benull.
-
mergeDuplicateFieldMappings
default FieldMapping mergeDuplicateFieldMappings(FieldMapping left, FieldMapping strictRightDuplicate, FieldMapping looseRightDuplicate, FieldMapping strictRightContinuation, FieldMapping looseRightContinuation, ClassMapping<?,?> target, MergeContext context)
Merge 2 existing field mappings together who both refer to the same obfuscated name, creating the result in the
targetand returning it.There are 2 possible ways a
rightfield mapping can duplicate aleftfield mapping:- The right field mapping's obfuscated signature matches the left field mapping's obfuscated signature. This also includes the field's type. This is the standard case.
- Only the right field mapping's obfuscated name matches the left field mapping's obfuscated name, ignoring the type.
The first case is considered most correct and, and thus is considered the
strictduplicate and is what maps to the parameter namedstrictRightDuplicate. The second case is found only by widening the search past a typical duplicate, so it's considered thelooseduplicate and is what maps to the parameter namedlooseRightDuplicate.There are 2 possible ways a
rightfield mapping can continue aleftfield mapping:- The right field mapping's obfuscated signature matches the left field mapping's deobfuscated signature. This also includes the field's type. This is the standard case.
- Only the right field mapping's obfuscated name matches the left field mapping's deobfuscated name, ignoring the type.
The first case is considered most correct and, and thus is considered the
strictcontinuation and is what maps to the parameter namedstrictRightContinuation. The second case is found only by widening the search past a typical merge, so it's considered theFieldMergeStrategy.LOOSEmerge and is what maps to the parameter namedlooseRightContinuation.Note: At least one of the two parameters
strictRightDuplicateorlooseRightDuplicatemust be present for this method to be called. They both can be present together at the same time. The 2 continuation parameters,strictRightContinuationandlooseRightContinuationmay also be present, either together or separate, but are not guaranteed.For more information on continuations, see the "Continuations and Duplicates" section in
MappingSetMergerHandler- Parameters:
left- The left field mapping, nevernull.strictRightDuplicate- The best-fit right field mapping which duplicates the left mapping, can benullif not present.looseRightDuplicate- The slightly worse-fit right field mapping which duplicates teh left mapping, can benullif not present. Can only be present if the field merge strategy is set toFieldMergeStrategy.LOOSE.strictRightContinuation- The optional best-fit right field mapping which continues from the left mapping, can benullif not present.looseRightContinuation- The optional sightly worse-fit right field mapping which continues from the right mapping, can benul if not present. Can only be present if the field merge strategy is set toFieldMergeStrategy.LOOSE.target- The class mapping to create the new field mapping in, nevernull.context- TheMergeContextassociated with this merge operation, nevernull.- Returns:
- The new field mapping. Return
nullif the mapping wasn't merged and should be removed. - Implementation Note:
The default implementation views the "right" mapping as the more up-to-date method, so this situation is treated by delegating to
addRightFieldMapping()whichever of the 2 duplicate parameters is present, checkingstrictRightDuplicatefirst as it is the preferred of the two.
The
looseRightDuplicateandlooseRightContinuationparameters will only be checked for and included if the field mapping merge strategy is set toFieldMergeStrategy.LOOSE. This is set viaMergeConfig. If the merge strategy is notloosethenlooseRightDuplicateandlooseRightContinuationwill always benull.
-
addLeftFieldMapping
default FieldMapping addLeftFieldMapping(FieldMapping left, ClassMapping<?,?> target, MergeContext context)
Handle the case where only the left mapping exists, creating the result in thetargetand returning it.- Parameters:
left- The left field mapping, nevernull.target- The class mapping to create the new field mapping in, nevernull.context- TheMergeContextassociated with this merge operation, nevernull.- Returns:
- The new field mapping. Return
nullif the mapping wasn't merged and should be removed.
-
addRightFieldMapping
default FieldMapping addRightFieldMapping(FieldMapping right, ClassMapping<?,?> target, MergeContext context)
Handle the case where only the right mapping exists, creating the result in thetargetand returning it.- Parameters:
right- The right field mapping, nevernull.target- The class mapping to create the new field mapping in, nevernull.context- TheMergeContextassociated with this merge operation, nevernull.- Returns:
- The new field mapping. Return
nullif the mapping wasn't merged and should be removed.
-
mergeMethodMappings
default MergeResult<MethodMapping> mergeMethodMappings(MethodMapping left, MethodMapping strictRight, MethodMapping looseRight, ClassMapping<?,?> target, MergeContext context)
Merge 2 or 3 existing method mappings together, creating the result in the
targetand returning it. This method should only map the name of the method, not any parameters.
There are 2 possible ways a
rightmethod mapping can continue aleftmethod mapping:- The right method mapping's obfuscated signature matches the left method mapping's deobfuscated signature. This is the standard case.
- The right method mapping's obfuscated name matches the left method mapping's deobfuscated name, but the right method mapping's obfuscated descriptor matches the left mapping's obfuscated descriptor.
The first case is considered most correct and, and thus is considered the
strictmerge and is what maps to the parameter namedstrictRight. The second case is found only by widening the search past a typical merge, so it's considered theloosemerge and is what maps to the parameter namedlooseRight.
Note: Both
strictRightandwiggleRightmay be present together at the same time, but at least one will always be present.- Parameters:
left- The left method mapping, nevernull.strictRight- The best-fit right method mapping which continues from the left mapping, can benullif not present.looseRight- The slightly worse-fit right method mapping which continues from the left mapping, can benullif not present. Can only be present if the method merge strategy is set toMethodMergeStrategy.LOOSE.target- The class mapping to create the new method mapping in, nevernull.context- TheMergeContextassociated with this merge operation, nevernull.- Returns:
- The new method mapping in a merge result. Pass
nullto theMergeResultif the mapping wasn't merged and should be removed. - See Also:
mergeDuplicateMethodMappings(MethodMapping, MethodMapping, MethodMapping, MethodMapping, MethodMapping, ClassMapping, MergeContext)- Implementation Note:
- The
looseRightparameter will only be checked for and included if the method mapping merge strategy is set toMethodMergeStrategy.LOOSE. This is set viaMergeConfig. If the merge strategy is notloosethenlooseRightwill always benull.
-
mergeDuplicateMethodMappings
default MergeResult<MethodMapping> mergeDuplicateMethodMappings(MethodMapping left, MethodMapping strictRightDuplicate, MethodMapping looseRightDuplicate, MethodMapping strictRightContinuation, MethodMapping looseRightContinuation, ClassMapping<?,?> target, MergeContext context)
Merge 2 or more existing method mappings together who all refer to the same obfuscated signature, creating the result in the
targetand returning it. This method should only map the name of the method, not any parameters.There are 2 possible ways a
rightmethod mapping can duplicate aleftmethod mapping:- The right method mapping's obfuscated signature matches the left method mapping's obfuscated signature. This is the standard case.
- The right method mapping's obfuscated name matches the left method mapping's obfuscated name, but the right method mapping's obfuscated descriptor matches the left mapping's deobfuscated descriptor.
The first case is considered most correct and, and thus is considered the
strictduplicate and is what maps to the parameter namedstrictRightDuplicate. The second case is found only by widening the search past a typical duplicate, so it's considered thelooseduplicate and is what maps to the parameter namedlooseRightDuplicate.There are 2 possible ways a
rightmethod mapping can continue aleftmethod mapping:- The right method mapping's obfuscated signature matches the left method mapping's deobfuscated signature. This is the standard case.
- The right method mapping's obfuscated name matches the left method mapping's deobfuscated name, but the right method mapping's obfuscated descriptor matches the left mapping's obfuscated descriptor.
The first case is considered most correct and, and thus is considered the
strictcontinuation and is what maps to the parameter namedstrictRightContinuation. The second case is found only by widening the search past a typical merge, so it's considered theloosemerge and is what maps to the parameter namedlooseRightContinuation.Note: At least one of the two parameters
strictRightDuplicateorlooseRightDuplicatemust be present for this method to be called. They both can be present together at the same time. The 2 continuation parameters,strictRightContinuationandlooseRightContinuationmay also be present, either together or separate, but are not guaranteed.For more information on continuation mappings, see the "Continuations and Duplicates" section in
MappingSetMergerHandler- Parameters:
left- The left method mapping, nevernull.strictRightDuplicate- The best-fit right method mapping which duplicates the left mapping, can benullif not present.looseRightDuplicate- The slightly worse-fit right method mapping which duplicates the left mapping, can benullif not present. Can only be present if the method merge strategy is set toMethodMergeStrategy.LOOSE.strictRightContinuation- The optional best-fit right method mapping which continues from the left mapping, can benullif not present.looseRightContinuation- The optional slightly worse-fit right method mapping which continues from the left mapping, can benullif not present. Can only be present if the method merge strategy is set toMethodMergeStrategy.LOOSE.target- The class mapping to create the new method mapping in, nevernull.context- TheMergeContextassociated with this merge operation, nevernull.- Returns:
- The new method mapping in a merge result. Pass
nullto theMergeResultif the mapping wasn't merged and should be removed. - See Also:
mergeMethodMappings(MethodMapping, MethodMapping, MethodMapping, ClassMapping, MergeContext)- Implementation Note:
The default implementation views the "right" mapping as the more up-to-date method, so this situation is treated by delegating to
addRightMethodMapping()whichever of the 2 duplicate parameters is present, checkingstrictRightDuplicatefirst as it is the preferred of the two.
The
looseRightDuplicateandlooseRightContinuationparameters will only be checked for and included if the method mapping merge strategy is set toMethodMergeStrategy.LOOSE. This is set viaMergeConfig. If the merge strategy is notloosethenlooseRightDuplicateandlooseRightContinuationwill always benull.
-
addLeftMethodMapping
default MergeResult<MethodMapping> addLeftMethodMapping(MethodMapping left, ClassMapping<?,?> target, MergeContext context)
Handle the case where only the left method mapping exists, creating the result in thetargetand returning it. This method should only map the name of the method, not any parameters- Parameters:
left- The left method mapping, nevernull.target- The class mapping to create the new method mapping in, nevernull.context- TheMergeContextassociated with this merge operation, nevernull.- Returns:
- The new method mapping in a merge result. Pass
nullto theMergeResultif the mapping wasn't merged and should be removed.
-
addRightMethodMapping
default MergeResult<MethodMapping> addRightMethodMapping(MethodMapping right, ClassMapping<?,?> target, MergeContext context)
Handle the case where only the right method mapping exists, creating the result in thetargetand returning it. This method should only map the name of the method, not any parameters.- Parameters:
right- The right method mapping, nevernull.target- The class mapping to create the new method mapping in, nevernull.context- TheMergeContextassociated with this merge operation, nevernull.- Returns:
- The new method mapping in a merge result. Pass
nullto theMergeResultif the mapping wasn't merged and should be removed.
-
mergeParameterMappings
default MethodParameterMapping mergeParameterMappings(MethodParameterMapping left, MethodParameterMapping right, MethodMapping target, MergeContext context)
Merge 2 existing parameter mappings together, creating the result in thetargetand returning it.- Parameters:
left- The left parameter mapping, nevernull.right- The right parameter mapping, nevernull.target- The method mapping to create the new parameter mapping in, nevernull.context- TheMergeContextassociated with this merge operation, nevernull.- Returns:
- The new parameter mapping. Return
nullif the mapping wasn't merged and should be removed. - API Note:
- Unlike all of the other classes of mapping merge handlers in this class, method parameters don't have a distinction between merging parameter mappings and merging duplicate parameter mappings. this is because all parameters are mapped solely by their index, so any time both mapping sets have parameters mappings for the same method they are always a kind of "duplicate" - this method handles both cases, since they are identical.
-
addLeftParameterMapping
default MethodParameterMapping addLeftParameterMapping(MethodParameterMapping left, MethodMapping target, MergeContext context)
Handle the case where only the left parameter mapping mapping exists, creating the result in thetargetand returning it.- Parameters:
left- The left parameter mapping, nevernull.target- The method mapping to create the new parameter mapping in, nevernull.context- TheMergeContextassociated with this merge operation, nevernull.- Returns:
- The new parameter mapping. Return
nullif the mapping wasn't merged and should be removed.
-
addRightParameterMapping
default MethodParameterMapping addRightParameterMapping(MethodParameterMapping right, MethodMapping target, MergeContext context)
Handle the case where only the right parameter mapping mapping exists, creating the result in thetargetand returning it.- Parameters:
right- The right parameter mapping, nevernull.target- The method mapping to create the new parameter mapping in, nevernull.context- TheMergeContextassociated with this merge operation, nevernull.- Returns:
- The new parameter mapping. Return
nullif the mapping wasn't merged and should be removed.
-
-