From f1cf6e13aa66d8cfa180d2347269dbd218e511dc Mon Sep 17 00:00:00 2001 From: mattbradburyr3 Date: Sun, 29 Jan 2023 17:13:28 +0000 Subject: [PATCH] tidy up --- .../utilities/CorDappHelpers.java | 30 +++++++++---------- .../workflows/FinalizeChatSubFlow.java | 4 +-- .../utxoexample/workflows/UpdateChatFlow.java | 1 - 3 files changed, 17 insertions(+), 18 deletions(-) diff --git a/workflows/src/main/java/com/r3/developers/csdetemplate/utilities/CorDappHelpers.java b/workflows/src/main/java/com/r3/developers/csdetemplate/utilities/CorDappHelpers.java index e66299c..b392a00 100644 --- a/workflows/src/main/java/com/r3/developers/csdetemplate/utilities/CorDappHelpers.java +++ b/workflows/src/main/java/com/r3/developers/csdetemplate/utilities/CorDappHelpers.java @@ -6,18 +6,18 @@ import java.util.List; import java.util.concurrent.Callable; import java.util.function.Predicate; import java.util.stream.Collectors; - -public final class CorDappHelpers { - public static T findAndExpectExactlyOne(Collection collection, Predicate filterFn, String exceptionMsg) - { - Collection results = collection.stream().filter(filterFn).collect(Collectors.toList()); - if(results.size() != 1){ - throw new RuntimeException(exceptionMsg); - } - return results.iterator().next(); - } - - public static T findAndExpectExactlyOne(Collection collection, String exceptionMsg) { - return findAndExpectExactlyOne(collection, e -> true, exceptionMsg); - } -} +// +//public final class CorDappHelpers { +// public static T findAndExpectExactlyOne(Collection collection, Predicate filterFn, String exceptionMsg) +// { +// Collection results = collection.stream().filter(filterFn).collect(Collectors.toList()); +// if(results.size() != 1){ +// throw new RuntimeException(exceptionMsg); +// } +// return results.iterator().next(); +// } +// +// public static T findAndExpectExactlyOne(Collection collection, String exceptionMsg) { +// return findAndExpectExactlyOne(collection, e -> true, exceptionMsg); +// } +//} diff --git a/workflows/src/main/java/com/r3/developers/csdetemplate/utxoexample/workflows/FinalizeChatSubFlow.java b/workflows/src/main/java/com/r3/developers/csdetemplate/utxoexample/workflows/FinalizeChatSubFlow.java index e6891cf..95ec536 100644 --- a/workflows/src/main/java/com/r3/developers/csdetemplate/utxoexample/workflows/FinalizeChatSubFlow.java +++ b/workflows/src/main/java/com/r3/developers/csdetemplate/utxoexample/workflows/FinalizeChatSubFlow.java @@ -33,8 +33,8 @@ public class FinalizeChatSubFlow implements SubFlow { @Suspendable public String call() { - log.info("AppendChatFlow.call() called"); - log.info("otherMember = " + otherMember); +// log.info("AppendChatFlow.call() called"); +// log.info("otherMember = " + otherMember); FlowSession session = flowMessaging.initiateFlow(otherMember); String retVal; diff --git a/workflows/src/main/java/com/r3/developers/csdetemplate/utxoexample/workflows/UpdateChatFlow.java b/workflows/src/main/java/com/r3/developers/csdetemplate/utxoexample/workflows/UpdateChatFlow.java index 831275d..069fd67 100644 --- a/workflows/src/main/java/com/r3/developers/csdetemplate/utxoexample/workflows/UpdateChatFlow.java +++ b/workflows/src/main/java/com/r3/developers/csdetemplate/utxoexample/workflows/UpdateChatFlow.java @@ -26,7 +26,6 @@ import java.time.Instant; import java.util.List; import java.util.stream.Collectors; -import static com.r3.developers.csdetemplate.utilities.CorDappHelpers.findAndExpectExactlyOne; import static java.util.Objects.*; import static java.util.stream.Collectors.toList;