MCPcopy Create free account
hub / github.com/traneio/future / let

Method let

future-java/src/main/java/io/trane/future/Local.java:182–190  ·  view source on GitHub ↗

Executes the supplier with the provided value and then rolls back to the previous local value. @param value value to be set. @param s supplier to be executed with the provided value. @return the result of the supplier.

(final T value, final Supplier<U> s)

Source from the content-addressed store, hash-verified

180 * @return the result of the supplier.
181 */
182 public final <U> U let(final T value, final Supplier<U> s) {
183 final Optional<T> saved = get();
184 set(Optional.of(value));
185 try {
186 return s.get();
187 } finally {
188 set(saved);
189 }
190 }
191}

Callers 2

letSuccessMethod · 0.80
letFailureMethod · 0.80

Calls 3

getMethod · 0.95
setMethod · 0.95
getMethod · 0.65

Tested by 2

letSuccessMethod · 0.64
letFailureMethod · 0.64