Interface FpmlPartySelector

  • Functional Interface:
    This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

    @FunctionalInterface
    public interface FpmlPartySelector
    Finds the party representing "us" in FpML.

    The FpML data structure is neutral as to the direction of a trade, choosing to represent the two parties throughout the structure. The Strata data model takes the opposite view, with each trade stored with Pay/Receive or Buy/Sell concepts expressed from "our" point of view. This selector is used to bridge the gap, picking the party that represents "us" in the FpML data.

    • Method Detail

      • any

        static FpmlPartySelector any()
        Returns a selector that will choose any party from the trade.

        The party chosen varies by trade type and will be consistent for a given input file. For example, in a FRA the 'Buy' party will be chosen, whereas in a swap the 'Pay' party of the first leg will be chosen. In general, it is not recommended to rely on this implementation.

        Returns:
        the selector that will choose the party from the first leg
      • matching

        static FpmlPartySelector matching​(String partyId)
        Returns a selector that matches the specified party ID.

        This examines the party IDs included in the FpML document and returns the href ID for the party that exactly matches the specified party ID.

        Parameters:
        partyId - the party ID to match
        Returns:
        the selector that will choose the party based on the specified party ID
      • matchingRegex

        static FpmlPartySelector matchingRegex​(Pattern partyIdRegex)
        Returns a selector that matches the specified party ID regular expression.

        This examines the party IDs included in the FpML document and returns the href ID for the party that matches the specified party ID regular expression.

        Parameters:
        partyIdRegex - the party ID regular expression to match
        Returns:
        the selector that will choose the party based on the specified party ID
      • selectParties

        List<String> selectParties​(ListMultimap<String,​String> allParties)
        Given a map of all parties in the FpML document, extract those that represent "our" side of the trade.
        Parameters:
        allParties - the multimap of party href id to associated partyId
        Returns:
        the party href ids to use, empty if unable to find "our" party