From 96a5af859fca5adf3fd2fb44f1ef50acb303969a Mon Sep 17 00:00:00 2001 From: parisyup <66366646+parisyup@users.noreply.github.com> Date: Thu, 2 May 2024 15:47:08 +0400 Subject: [PATCH] update deprecated method --- .../negotiation/workflows/modify/ModifyFlowRequest.java | 2 +- .../samples/negotiation/workflows/util/ListProposal.java | 2 +- .../samples/negotiation/workflows/util/ListTrade.java | 2 +- .../samples/obligation/workflows/IOUSettleFlow.java | 2 +- .../samples/obligation/workflows/IOUTransferFlow.java | 2 +- .../developers/samples/obligation/workflows/ListIOUFlow.java | 2 +- .../samples/encumbrance/workflows/GetAssetFlow.java | 2 +- .../developers/samples/encumbrance/workflows/GetLoanFlow.java | 2 +- .../samples/encumbrance/workflows/RequestLoanFlow.java | 2 +- .../samples/encumbrance/workflows/SettleLoanFlow.java | 4 ++-- .../samples/encumbrance/workflows/TransferAssetFlow.java | 2 +- .../samples/persistence/workflows/InsuranceClaimFlow.java | 2 +- .../samples/referencestate/workflows/GetIOUFlow.java | 2 +- .../samples/referencestate/workflows/GetSanctionListFlow.java | 2 +- .../samples/referencestate/workflows/IOUIssueFlow.java | 2 +- .../referencestate/workflows/UpdateSanctionListFlow.java | 2 +- .../developers/samples/tokens/workflows/ListGoldTokens.java | 2 +- 17 files changed, 18 insertions(+), 18 deletions(-) diff --git a/java-samples/corda5-negotiation-cordapp/workflows/src/main/java/com/r3/developers/samples/negotiation/workflows/modify/ModifyFlowRequest.java b/java-samples/corda5-negotiation-cordapp/workflows/src/main/java/com/r3/developers/samples/negotiation/workflows/modify/ModifyFlowRequest.java index 00fbe11..5e126fd 100644 --- a/java-samples/corda5-negotiation-cordapp/workflows/src/main/java/com/r3/developers/samples/negotiation/workflows/modify/ModifyFlowRequest.java +++ b/java-samples/corda5-negotiation-cordapp/workflows/src/main/java/com/r3/developers/samples/negotiation/workflows/modify/ModifyFlowRequest.java @@ -59,7 +59,7 @@ public String call(@NotNull ClientRequestBody requestBody) { UUID proposalID = request.getProposalID(); // Getting the old Proposal State as an input state - List> proposalStatAndRef = utxoLedgerService.findUnconsumedStatesByExactType (Proposal.class,100, Instant.now()).getResults(); + List> proposalStatAndRef = utxoLedgerService.findUnconsumedStatesByExactType(Proposal.class,100, Instant.now()).getResults(); List> proposalStatAndRefWithId = proposalStatAndRef.stream(). filter(it -> it.getState().getContractState().getProposalID().equals(proposalID)).collect(Collectors.toList()); diff --git a/java-samples/corda5-negotiation-cordapp/workflows/src/main/java/com/r3/developers/samples/negotiation/workflows/util/ListProposal.java b/java-samples/corda5-negotiation-cordapp/workflows/src/main/java/com/r3/developers/samples/negotiation/workflows/util/ListProposal.java index e2a98db..384b2d4 100644 --- a/java-samples/corda5-negotiation-cordapp/workflows/src/main/java/com/r3/developers/samples/negotiation/workflows/util/ListProposal.java +++ b/java-samples/corda5-negotiation-cordapp/workflows/src/main/java/com/r3/developers/samples/negotiation/workflows/util/ListProposal.java @@ -27,7 +27,7 @@ public class ListProposal implements ClientStartableFlow { @Override public String call(@NotNull ClientRequestBody requestBody) { // Queries the VNode's vault for unconsumed states and converts the result to a serializable DTO. - List> states = utxoLedgerService.findUnconsumedStatesByExactType (Proposal.class, 100, Instant.now()).getResults(); + List> states = utxoLedgerService.findUnconsumedStatesByExactType(Proposal.class, 100, Instant.now()).getResults(); List results = states.stream().map(stateAndRef -> new ListProposalArgs( stateAndRef.getState().getContractState().getProposalID(), diff --git a/java-samples/corda5-negotiation-cordapp/workflows/src/main/java/com/r3/developers/samples/negotiation/workflows/util/ListTrade.java b/java-samples/corda5-negotiation-cordapp/workflows/src/main/java/com/r3/developers/samples/negotiation/workflows/util/ListTrade.java index d9ae108..233df2b 100644 --- a/java-samples/corda5-negotiation-cordapp/workflows/src/main/java/com/r3/developers/samples/negotiation/workflows/util/ListTrade.java +++ b/java-samples/corda5-negotiation-cordapp/workflows/src/main/java/com/r3/developers/samples/negotiation/workflows/util/ListTrade.java @@ -27,7 +27,7 @@ public class ListTrade implements ClientStartableFlow { @Override public String call(@NotNull ClientRequestBody requestBody) { // Queries the VNode's vault for unconsumed states and converts the result to a serializable DTO. - List> states = utxoLedgerService.findUnconsumedStatesByExactType (Trade.class, 100, Instant.now()).getResults(); + List> states = utxoLedgerService.findUnconsumedStatesByExactType(Trade.class, 100, Instant.now()).getResults(); List results = states.stream().map(stateAndRef -> new ListTradeArgs( stateAndRef.getState().getContractState().getProposalID(), diff --git a/java-samples/corda5-obligation-cordapp/workflows/src/main/java/com/r3/developers/samples/obligation/workflows/IOUSettleFlow.java b/java-samples/corda5-obligation-cordapp/workflows/src/main/java/com/r3/developers/samples/obligation/workflows/IOUSettleFlow.java index 9170915..0e18e85 100644 --- a/java-samples/corda5-obligation-cordapp/workflows/src/main/java/com/r3/developers/samples/obligation/workflows/IOUSettleFlow.java +++ b/java-samples/corda5-obligation-cordapp/workflows/src/main/java/com/r3/developers/samples/obligation/workflows/IOUSettleFlow.java @@ -64,7 +64,7 @@ public String call(ClientRequestBody requestBody) { int amountSettle = Integer.parseInt(flowArgs.getAmountSettle()); //query the IOU input - List> iouStateAndRefs = ledgerService.findUnconsumedStatesByExactType (IOUState.class,100, Instant.now()).getResults(); + List> iouStateAndRefs = ledgerService.findUnconsumedStatesByExactType(IOUState.class,100, Instant.now()).getResults(); List> iouStateAndRefsWithId = iouStateAndRefs.stream() .filter(sar -> sar.getState().getContractState().getLinearId().equals(iouID)).collect(toList()); diff --git a/java-samples/corda5-obligation-cordapp/workflows/src/main/java/com/r3/developers/samples/obligation/workflows/IOUTransferFlow.java b/java-samples/corda5-obligation-cordapp/workflows/src/main/java/com/r3/developers/samples/obligation/workflows/IOUTransferFlow.java index f964992..939bba9 100644 --- a/java-samples/corda5-obligation-cordapp/workflows/src/main/java/com/r3/developers/samples/obligation/workflows/IOUTransferFlow.java +++ b/java-samples/corda5-obligation-cordapp/workflows/src/main/java/com/r3/developers/samples/obligation/workflows/IOUTransferFlow.java @@ -62,7 +62,7 @@ public String call(ClientRequestBody requestBody) { UUID iouID = flowArgs.getIouID(); //query the IOU input - List> iouStateAndRefs = ledgerService.findUnconsumedStatesByExactType (IOUState.class,100, Instant.now()).getResults(); + List> iouStateAndRefs = ledgerService.findUnconsumedStatesByExactType(IOUState.class,100, Instant.now()).getResults(); List> iouStateAndRefsWithId = iouStateAndRefs.stream() .filter(sar -> sar.getState().getContractState().getLinearId().equals(iouID)).collect(toList()); if (iouStateAndRefsWithId.size() != 1) throw new CordaRuntimeException("Multiple or zero IOU states with id " + iouID + " found"); diff --git a/java-samples/corda5-obligation-cordapp/workflows/src/main/java/com/r3/developers/samples/obligation/workflows/ListIOUFlow.java b/java-samples/corda5-obligation-cordapp/workflows/src/main/java/com/r3/developers/samples/obligation/workflows/ListIOUFlow.java index ba5dcef..f7498bd 100644 --- a/java-samples/corda5-obligation-cordapp/workflows/src/main/java/com/r3/developers/samples/obligation/workflows/ListIOUFlow.java +++ b/java-samples/corda5-obligation-cordapp/workflows/src/main/java/com/r3/developers/samples/obligation/workflows/ListIOUFlow.java @@ -34,7 +34,7 @@ public String call(ClientRequestBody requestBody) { log.info("ListIOUFlow.call() called"); // Queries the VNode's vault for unconsumed states and converts the result to a serializable DTO. - List> states = utxoLedgerService.findUnconsumedStatesByExactType (IOUState.class,100, Instant.now()).getResults(); + List> states = utxoLedgerService.findUnconsumedStatesByExactType(IOUState.class,100, Instant.now()).getResults(); List results = states.stream().map(stateAndRef -> new ListIOUFlowResults( stateAndRef.getState().getContractState().getLinearId(), diff --git a/java-samples/encumbrance-pawn-shop/workflows/src/main/java/com/r3/developers/samples/encumbrance/workflows/GetAssetFlow.java b/java-samples/encumbrance-pawn-shop/workflows/src/main/java/com/r3/developers/samples/encumbrance/workflows/GetAssetFlow.java index e2d7a41..456d4fb 100644 --- a/java-samples/encumbrance-pawn-shop/workflows/src/main/java/com/r3/developers/samples/encumbrance/workflows/GetAssetFlow.java +++ b/java-samples/encumbrance-pawn-shop/workflows/src/main/java/com/r3/developers/samples/encumbrance/workflows/GetAssetFlow.java @@ -26,7 +26,7 @@ public class GetAssetFlow implements ClientStartableFlow { @Suspendable public String call(@NotNull ClientRequestBody requestBody) { List assetList = - ledgerService.findUnconsumedStatesByExactType (Asset.class,100, Instant.now()).getResults().stream().map( + ledgerService.findUnconsumedStatesByExactType(Asset.class,100, Instant.now()).getResults().stream().map( it -> new AssetDetail( it.getState().getContractState().getOwner().getName(), it.getState().getContractState().getAssetId(), diff --git a/java-samples/encumbrance-pawn-shop/workflows/src/main/java/com/r3/developers/samples/encumbrance/workflows/GetLoanFlow.java b/java-samples/encumbrance-pawn-shop/workflows/src/main/java/com/r3/developers/samples/encumbrance/workflows/GetLoanFlow.java index 218a98c..fabdbd2 100644 --- a/java-samples/encumbrance-pawn-shop/workflows/src/main/java/com/r3/developers/samples/encumbrance/workflows/GetLoanFlow.java +++ b/java-samples/encumbrance-pawn-shop/workflows/src/main/java/com/r3/developers/samples/encumbrance/workflows/GetLoanFlow.java @@ -27,7 +27,7 @@ public class GetLoanFlow implements ClientStartableFlow { @Suspendable public String call(@NotNull ClientRequestBody requestBody) { List loanList = - ledgerService.findUnconsumedStatesByExactType (Loan.class,100, Instant.now()).getResults().stream().map( + ledgerService.findUnconsumedStatesByExactType(Loan.class,100, Instant.now()).getResults().stream().map( it -> new LoanDetail( it.getState().getContractState().getLoanId(), it.getState().getContractState().getLender().getName(), diff --git a/java-samples/encumbrance-pawn-shop/workflows/src/main/java/com/r3/developers/samples/encumbrance/workflows/RequestLoanFlow.java b/java-samples/encumbrance-pawn-shop/workflows/src/main/java/com/r3/developers/samples/encumbrance/workflows/RequestLoanFlow.java index bb50ba2..48e46d0 100644 --- a/java-samples/encumbrance-pawn-shop/workflows/src/main/java/com/r3/developers/samples/encumbrance/workflows/RequestLoanFlow.java +++ b/java-samples/encumbrance-pawn-shop/workflows/src/main/java/com/r3/developers/samples/encumbrance/workflows/RequestLoanFlow.java @@ -61,7 +61,7 @@ public String call(@NotNull ClientRequestBody requestBody) { Member lender = new Member(memberInfo.getName(), memberInfo.getLedgerKeys().get(0)); List> filteredAssetStateAndRefs = - ledgerService.findUnconsumedStatesByExactType (Asset.class,100, Instant.now()).getResults().stream().filter( + ledgerService.findUnconsumedStatesByExactType(Asset.class,100, Instant.now()).getResults().stream().filter( it -> it.getState().getContractState().getAssetId().equals(flowArgs.getCollateral()) ).collect(Collectors.toList()); if (filteredAssetStateAndRefs.size() != 1) { diff --git a/java-samples/encumbrance-pawn-shop/workflows/src/main/java/com/r3/developers/samples/encumbrance/workflows/SettleLoanFlow.java b/java-samples/encumbrance-pawn-shop/workflows/src/main/java/com/r3/developers/samples/encumbrance/workflows/SettleLoanFlow.java index 30d0a57..c370602 100644 --- a/java-samples/encumbrance-pawn-shop/workflows/src/main/java/com/r3/developers/samples/encumbrance/workflows/SettleLoanFlow.java +++ b/java-samples/encumbrance-pawn-shop/workflows/src/main/java/com/r3/developers/samples/encumbrance/workflows/SettleLoanFlow.java @@ -51,7 +51,7 @@ public String call(@NotNull ClientRequestBody requestBody) { SettleLoanFlowArgs flowArgs = requestBody.getRequestBodyAs(jsonMarshallingService, SettleLoanFlowArgs.class); List> filteredLoanStateAndRefs = - ledgerService.findUnconsumedStatesByExactType (Loan.class,100, Instant.now()).getResults().stream().filter( + ledgerService.findUnconsumedStatesByExactType(Loan.class,100, Instant.now()).getResults().stream().filter( it -> it.getState().getContractState().getLoanId().equals(flowArgs.getLoanId()) ).collect(Collectors.toList()); @@ -63,7 +63,7 @@ public String call(@NotNull ClientRequestBody requestBody) { StateAndRef loanStateAndRef = filteredLoanStateAndRefs.get(0); List> filteredAssetStateAndRefs = - ledgerService.findUnconsumedStatesByExactType (Asset.class,100, Instant.now()).getResults().stream().filter( + ledgerService.findUnconsumedStatesByExactType(Asset.class,100, Instant.now()).getResults().stream().filter( it -> it.getState().getContractState().getAssetId().equals( loanStateAndRef.getState().getContractState().getCollateral() ) diff --git a/java-samples/encumbrance-pawn-shop/workflows/src/main/java/com/r3/developers/samples/encumbrance/workflows/TransferAssetFlow.java b/java-samples/encumbrance-pawn-shop/workflows/src/main/java/com/r3/developers/samples/encumbrance/workflows/TransferAssetFlow.java index 37c4463..8561209 100644 --- a/java-samples/encumbrance-pawn-shop/workflows/src/main/java/com/r3/developers/samples/encumbrance/workflows/TransferAssetFlow.java +++ b/java-samples/encumbrance-pawn-shop/workflows/src/main/java/com/r3/developers/samples/encumbrance/workflows/TransferAssetFlow.java @@ -56,7 +56,7 @@ public String call(@NotNull ClientRequestBody requestBody) { Member buyer = new Member(memberInfo.getName(), memberInfo.getLedgerKeys().get(0)); List> filteredAssetStateAndRefs = - ledgerService.findUnconsumedStatesByExactType (Asset.class,100, Instant.now()).getResults().stream().filter( + ledgerService.findUnconsumedStatesByExactType(Asset.class,100, Instant.now()).getResults().stream().filter( it -> it.getState().getContractState().getAssetId().equals(flowArgs.getAssetId()) ).collect(Collectors.toList()); diff --git a/java-samples/persistence-carinsurance/workflows/src/main/java/com/r3/developers/samples/persistence/workflows/InsuranceClaimFlow.java b/java-samples/persistence-carinsurance/workflows/src/main/java/com/r3/developers/samples/persistence/workflows/InsuranceClaimFlow.java index 939049b..08e3266 100644 --- a/java-samples/persistence-carinsurance/workflows/src/main/java/com/r3/developers/samples/persistence/workflows/InsuranceClaimFlow.java +++ b/java-samples/persistence-carinsurance/workflows/src/main/java/com/r3/developers/samples/persistence/workflows/InsuranceClaimFlow.java @@ -62,7 +62,7 @@ public String call(@NotNull ClientRequestBody requestBody) { // to fetch the desired Insurance state from the vault. This filtered state would be used as input to the // transaction. List> filteredInsuranceStateAndRefs = - ledgerService.findUnconsumedStatesByExactType (InsuranceState.class,100, Instant.now()).getResults().stream().filter( + ledgerService.findUnconsumedStatesByExactType(InsuranceState.class,100, Instant.now()).getResults().stream().filter( it -> it.getState().getContractState().getPolicyNumber().equals(flowArgs.getPolicyNumber()) ).collect(Collectors.toList()); if (filteredInsuranceStateAndRefs.size() != 1) { diff --git a/java-samples/referencestates-sanctionsbody/workflows/src/main/java/com/r3/developers/samples/referencestate/workflows/GetIOUFlow.java b/java-samples/referencestates-sanctionsbody/workflows/src/main/java/com/r3/developers/samples/referencestate/workflows/GetIOUFlow.java index ac8cf9d..12fc062 100644 --- a/java-samples/referencestates-sanctionsbody/workflows/src/main/java/com/r3/developers/samples/referencestate/workflows/GetIOUFlow.java +++ b/java-samples/referencestates-sanctionsbody/workflows/src/main/java/com/r3/developers/samples/referencestate/workflows/GetIOUFlow.java @@ -28,7 +28,7 @@ public class GetIOUFlow implements ClientStartableFlow { public String call(@NotNull ClientRequestBody requestBody) { List iouList = - ledgerService.findUnconsumedStatesByExactType (SanctionableIOUState.class,100, Instant.now()).getResults().stream().map( + ledgerService.findUnconsumedStatesByExactType(SanctionableIOUState.class,100, Instant.now()).getResults().stream().map( it -> new IOU( it.getState().getContractState().getValue(), it.getState().getContractState().getLender().getName(), diff --git a/java-samples/referencestates-sanctionsbody/workflows/src/main/java/com/r3/developers/samples/referencestate/workflows/GetSanctionListFlow.java b/java-samples/referencestates-sanctionsbody/workflows/src/main/java/com/r3/developers/samples/referencestate/workflows/GetSanctionListFlow.java index 9fde42b..aa82553 100644 --- a/java-samples/referencestates-sanctionsbody/workflows/src/main/java/com/r3/developers/samples/referencestate/workflows/GetSanctionListFlow.java +++ b/java-samples/referencestates-sanctionsbody/workflows/src/main/java/com/r3/developers/samples/referencestate/workflows/GetSanctionListFlow.java @@ -31,7 +31,7 @@ public class GetSanctionListFlow implements ClientStartableFlow { public String call(@NotNull ClientRequestBody requestBody) { List sanctionList = - ledgerService.findUnconsumedStatesByExactType (SanctionList.class,100, Instant.now()).getResults().stream().map( + ledgerService.findUnconsumedStatesByExactType(SanctionList.class,100, Instant.now()).getResults().stream().map( it-> new SanctionListDetail( it.getState().getContractState().getBadPeople().stream().map(Member::getName) .collect(Collectors.toList()), diff --git a/java-samples/referencestates-sanctionsbody/workflows/src/main/java/com/r3/developers/samples/referencestate/workflows/IOUIssueFlow.java b/java-samples/referencestates-sanctionsbody/workflows/src/main/java/com/r3/developers/samples/referencestate/workflows/IOUIssueFlow.java index 51ea791..09c377d 100644 --- a/java-samples/referencestates-sanctionsbody/workflows/src/main/java/com/r3/developers/samples/referencestate/workflows/IOUIssueFlow.java +++ b/java-samples/referencestates-sanctionsbody/workflows/src/main/java/com/r3/developers/samples/referencestate/workflows/IOUIssueFlow.java @@ -90,7 +90,7 @@ public String call(@NotNull ClientRequestBody requestBody) { @Suspendable public StateAndRef getSanctionsList(MemberX500Name sanctionsBody) { List> sanctionLists = - ledgerService.findUnconsumedStatesByExactType (SanctionList.class,100, Instant.now()).getResults().stream().filter( + ledgerService.findUnconsumedStatesByExactType(SanctionList.class,100, Instant.now()).getResults().stream().filter( it -> it.getState().getContractState().getIssuer().getName().equals(sanctionsBody) ).collect(Collectors.toList()); if(sanctionLists.isEmpty()){ diff --git a/java-samples/referencestates-sanctionsbody/workflows/src/main/java/com/r3/developers/samples/referencestate/workflows/UpdateSanctionListFlow.java b/java-samples/referencestates-sanctionsbody/workflows/src/main/java/com/r3/developers/samples/referencestate/workflows/UpdateSanctionListFlow.java index cc6ca3d..61db9db 100644 --- a/java-samples/referencestates-sanctionsbody/workflows/src/main/java/com/r3/developers/samples/referencestate/workflows/UpdateSanctionListFlow.java +++ b/java-samples/referencestates-sanctionsbody/workflows/src/main/java/com/r3/developers/samples/referencestate/workflows/UpdateSanctionListFlow.java @@ -59,7 +59,7 @@ public String call(@NotNull ClientRequestBody requestBody) { requestBody.getRequestBodyAs(jsonMarshallingService, UpdateSanctionListFlowArgs.class); List> oldList = - ledgerService.findUnconsumedStatesByExactType (SanctionList.class,100, Instant.now()).getResults(); + ledgerService.findUnconsumedStatesByExactType(SanctionList.class,100, Instant.now()).getResults(); if(oldList.isEmpty()){ throw new CordaRuntimeException("Sanction List not found."); diff --git a/java-samples/shinny-tokens/workflows/src/main/java/com/r3/developers/samples/tokens/workflows/ListGoldTokens.java b/java-samples/shinny-tokens/workflows/src/main/java/com/r3/developers/samples/tokens/workflows/ListGoldTokens.java index 2fb1213..b73a04e 100644 --- a/java-samples/shinny-tokens/workflows/src/main/java/com/r3/developers/samples/tokens/workflows/ListGoldTokens.java +++ b/java-samples/shinny-tokens/workflows/src/main/java/com/r3/developers/samples/tokens/workflows/ListGoldTokens.java @@ -31,7 +31,7 @@ public class ListGoldTokens implements ClientStartableFlow { @Suspendable @Override public String call(ClientRequestBody requestBody) { - List> states = utxoLedgerService.findUnconsumedStatesByExactType (GoldState.class,100, Instant.now()).getResults(); + List> states = utxoLedgerService.findUnconsumedStatesByExactType(GoldState.class,100, Instant.now()).getResults(); List results = states.stream().map(stateAndRef -> new GoldStateList(