public static class PathPaymentOperation.Builder
extends java.lang.Object
PathPaymentOperation
Constructor and Description |
---|
Builder(Asset sendAsset,
java.lang.String sendMax,
KeyPair destination,
Asset destAsset,
java.lang.String destAmount)
Creates a new PathPaymentOperation builder.
|
Modifier and Type | Method and Description |
---|---|
PathPaymentOperation |
build()
Builds an operation
|
PathPaymentOperation.Builder |
setPath(Asset[] path)
Sets path for this operation
|
PathPaymentOperation.Builder |
setSourceAccount(KeyPair sourceAccount)
Sets the source account for this operation.
|
public Builder(Asset sendAsset, java.lang.String sendMax, KeyPair destination, Asset destAsset, java.lang.String destAmount)
sendAsset
- The asset deducted from the sender's account.sendMax
- The asset deducted from the sender's account.destination
- Payment destinationdestAsset
- The asset the destination account receives.destAmount
- The amount of destination asset the destination account receives.java.lang.ArithmeticException
- when sendMax or destAmount has more than 7 decimal places.public PathPaymentOperation.Builder setPath(Asset[] path)
path
- The assets (other than send asset and destination asset) involved in the offers the path takes. For example, if you can only find a path from USD to EUR through XLM and BTC, the path would be USD -» XLM -» BTC -» EUR and the path field would contain XLM and BTC.public PathPaymentOperation.Builder setSourceAccount(KeyPair sourceAccount)
sourceAccount
- The operation's source account.public PathPaymentOperation build()