/** Runs all handlers registered for this Hook, with the given argument. */ public void run(Object arg) { for (Function<Object, Object> handler : handlers) { handler.apply(arg); } }
@Override public boolean equals(@Nullable Object object) { if (object instanceof FunctionBasedConverter) { FunctionBasedConverter<?, ?> that = (FunctionBasedConverter<?, ?>) object; return this.forwardFunction.equals(that.forwardFunction) && this.backwardFunction.equals(that.backwardFunction); } return false; }
public <T> T withConnection(Function<Connection, T> function) throws Exception { try (Connection connection = adapter.createConnection()) { return function.apply(connection); } } }
@Override public boolean equals(@Nullable Object obj) { if (obj instanceof SupplierComposition) { SupplierComposition<?, ?> that = (SupplierComposition<?, ?>) obj; return function.equals(that.function) && supplier.equals(that.supplier); } return false; }
@Override public V2 transformEntry(K key, V1 value) { return function.apply(value); } };
@Override public boolean equals(@Nullable Object object) { if (object == this) { return true; } if (object instanceof ByFunctionOrdering) { ByFunctionOrdering<?, ?> that = (ByFunctionOrdering<?, ?>) object; return this.function.equals(that.function) && this.ordering.equals(that.ordering); } return false; }
@Override T transform(F from) { return function.apply(from); } };
@Override public boolean equals(@Nullable Object obj) { if (obj == this) { return true; } if (obj instanceof FunctionalEquivalence) { FunctionalEquivalence<?, ?> that = (FunctionalEquivalence<?, ?>) obj; return function.equals(that.function) && resultEquivalence.equals(that.resultEquivalence); } return false; }
@Override protected X mapException(Exception e) { return mapper.apply(e); } }
@Override public boolean equals(@Nullable Object obj) { if (obj instanceof CompositionPredicate) { CompositionPredicate<?, ?> that = (CompositionPredicate<?, ?>) obj; return f.equals(that.f) && p.equals(that.p); } return false; }
@Override T transform(F from) { return function.apply(from); } };
@Override T transform(F from) { return function.apply(from); } };
@Override public Iterable<T> children(T root) { return nodeToChildrenFunction.apply(root); } };
@Override protected A doBackward(B b) { return backwardFunction.apply(b); }
@Override protected B doForward(A a) { return forwardFunction.apply(a); }
@Override public T get(int index) { return function.apply(fromList.get(index)); }
@Override @Nullable V doFallback(Function<? super X, ? extends V> fallback, X cause) throws Exception { return fallback.apply(cause); }
private O applyTransformation(I input) throws ExecutionException { try { return function.apply(input); } catch (Throwable t) { throw new ExecutionException(t); } } };