@Override public Iterable<T> children(T root) { return nodeToChildrenFunction.apply(root); } };
@Override public V2 transformEntry(K key, V1 value) { return function.apply(value); } };
@Override T transform(F from) { return function.apply(from); } };
@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; }
@Override T transform(F from) { return function.apply(from); } };
@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 protected X mapException(Exception e) { return mapper.apply(e); } }
@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 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; }
@Nullable @Override public Row apply(Row input) { Row preRow = preCompute.apply(input); if (preRow instanceof MapBasedRow) { MapBasedRow preMapRow = (MapBasedRow) preRow; Map<String, Object> event = new HashMap<>(preMapRow.getEvent()); for (String dim : optimizedDims) { final Object eventVal = event.get(dim); event.put(dim, extractionFnMap.get(dim).apply(eventVal)); } return new MapBasedRow(preMapRow.getTimestamp(), event); } else { return preRow; } } };
@Override protected B doForward(A a) { return forwardFunction.apply(a); }
@Override public boolean equals(@NullableDecl Object object) { if (object instanceof FunctionBasedConverter) { FunctionBasedConverter<?, ?> that = (FunctionBasedConverter<?, ?>) object; return this.forwardFunction.equals(that.forwardFunction) && this.backwardFunction.equals(that.backwardFunction); } return false; }
@Nullable @Override public Server pick() { final ServiceInstance instance; try { instance = serviceProvider.getInstance(); } catch (Exception e) { log.info(e, "Exception getting instance for [%s]", name); return null; } if (instance == null) { log.error("No server instance found for [%s]", name); return null; } return TO_SERVER.apply(instance); }