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

Method get

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

Gets the current value of the local. @return the local value

()

Source from the content-addressed store, hash-verified

159 * @return the local value
160 */
161 @SuppressWarnings("unchecked")
162 public final Optional<T> get() {
163 final Optional<?>[] ctx = threadLocal.get();
164 if (ctx == null || ctx.length <= position)
165 return Optional.empty();
166
167 final Optional<?> v = ctx[position];
168 if (v == null)
169 return Optional.empty();
170 else
171 return (Optional<T>) v;
172 }
173
174 /**
175 * Executes the supplier with the provided value and then rolls back to the

Callers 1

letMethod · 0.95

Calls 1

getMethod · 0.65

Tested by

no test coverage detected