Amount Transfer
Properties
is the Party, CompositeKey, or other identifier of the token sink if quantityDelta is positive, or the token source if quantityDelta is negative. The type P should support value equality.
is a signed Long value representing the exchanged number of tokens. If positive then it represents the movement of Math.abs(quantityDelta) tokens away from source and receipt of Math.abs(quantityDelta) at the destination. If the quantityDelta is negative then the source will receive Math.abs(quantityDelta) tokens and the destination will lose Math.abs(quantityDelta) tokens. Where possible the source and destination should be coded to ensure a positive quantityDelta, but in various scenarios it may be more consistent to allow positive and negative values. For example it is common for a bank to code asset flows as gains and losses from its perspective i.e. always the destination.
is the Party, CompositeKey, or other identifier of the token source if quantityDelta is positive, or the token sink if quantityDelta is negative. The type P should support value equality.
Functions
Applies this AmountTransfer to a list of SourceAndAmount objects representing balances. The list can be heterogeneous in terms of token types and parties, so long as there is sufficient balance of the correct token type held with the party paying for the transfer.
Returns a list of two new AmountTransfers each between one of the original parties and the centralParty. The net total exchange is the same as in the original input. Novation is a common financial operation in which a bilateral exchange is modified so that the same relative asset exchange happens, but with each party exchanging versus a central counterparty, or clearing house.
Add together two AmountTransfer objects to produce the single equivalent net flow. The addition only applies to AmountTransfer objects with the same token type. Also the pair of parties must be aligned, although source destination may be swapped in the second item.
Convert the quantityDelta to a displayable format BigDecimal value. The conversion ratio is the same as for Amount of the same token type.