Class MergeContext


  • public class MergeContext
    extends java.lang.Object

    This class represents the current context for a remapping operation for a MappingSetMergerHandler. This allows implementers of MappingSetMergerHandlers access to each of the 4 combinations of mappings for a merge:

    • The left mapping set
    • The right mapping set
    • The reverse of the left mapping set
    • The reverse of the right mapping set

    This class represents a performance advantage for retrieving the reverse of the mappings as well, as it only computes the value of the reverse mapping set when requested, and only computes the value once per merge session.

    This class is thread safe and all methods are reentrant.

    Since:
    0.5.4
    • Constructor Detail

      • MergeContext

        public MergeContext​(MappingSet left,
                            MappingSet right)
        Create a new MappingSet merge context. Provide the left and right mapping sets for the merge, neither may be null.
        Parameters:
        left - The left mapping set, must not be null.
        right - The right mapping set, must not be null.
    • Method Detail

      • getLeft

        public MappingSet getLeft()
        Returns:
        The left MappingSet for the merge operation, not null.
      • getRight

        public MappingSet getRight()
        Returns:
        The right MappingSet for the merge operation, not null.
      • getLeftReversed

        public MappingSet getLeftReversed()
        Returns:
        The right MappingSet for the merge operation, but reversed. Never null. This method computes the value on first query and caches the result, making it more efficient than calling MappingSet.reverse() yourself.
      • getRightReversed

        public MappingSet getRightReversed()
        Returns:
        The right MappingSet for the merge operation, but reversed. Never null. This method computes the value on first query and caches the result, making it more efficient than calling MappingSet.reverse() yourself.