Tabnine Logo
com.oath.cyclops.types.functor
Code IndexAdd Tabnine to your IDE (free)

How to use com.oath.cyclops.types.functor

Best Java code snippets using com.oath.cyclops.types.functor (Showing top 20 results out of 315)

origin: aol/cyclops

@Override
default <R> IO<R> retry(Function<? super T, ? extends R> fn) {
  return (IO<R>)ReactiveTransformable.super.retry(fn);
}
default <R> IO<R> checkedRetry(CheckedFunction<? super T,? extends R> checkedFunction, int retries, long delay, TimeUnit timeUnit){
origin: aol/cyclops

@Override
default LazyEither3<LT1, LT2, RT> bipeek(final Consumer<? super LT2> c1, final Consumer<? super RT> c2) {
  return (LazyEither3<LT1, LT2, RT>) BiTransformable.super.bipeek(c1, c2);
}
origin: aol/cyclops

@Override
default LazyEither3<LT1, LT2, RT> peek(final Consumer<? super RT> c) {
  return (LazyEither3<LT1, LT2, RT>) Transformable.super.peek(c);
}
origin: aol/cyclops

/**
 * Peek at the current value of this Transformable, without transforming it
 *
 * <pre>
 * {@code
 *
 *
 *    of(1,2,3).map(System.out::println)
 *
 *    1
 *    2
 *    3
 *
 * }
 * </pre>
 * @param c Consumer that recieves each element from this Transformable
 * @return Transformable that will peek at each value
 */
default Transformable<T> peek(final Consumer<? super T> c) {
  return map(input -> {
    c.accept(input);
    return input;
  });
}
origin: aol/cyclops

@Override
default Traversable<T> filterNot(final Predicate<? super T> predicate) {
  return (Traversable<T>)FilterableTransformable.super.filterNot(predicate);
}
origin: aol/cyclops

/**
 * Peek at two data types simulatanously (typically to perform a side-effect with each data point)
 *
 * <pre>
 * {@code
 *     MapX<String,Integer> map = MapXs.of("hello",2);
 *     map.bipeek(s->System.out.pritnln("key = " + s),System.out::println);
 * }
 * </pre>
 *
 * @param c1 consumer for the first type
 * @param c2 consumer for the second type
 * @return New BiTransformable with the same data
 */
default BiTransformable<T1, T2> bipeek(final Consumer<? super T1> c1, final Consumer<? super T2> c2) {
  return bimap(input -> {
    c1.accept(input);
    return input;
  } , input -> {
    c2.accept(input);
    return input;
  });
}
origin: aol/cyclops

@Override
default Either<LT, RT> bipeek(Consumer<? super LT> c1, Consumer<? super RT> c2) {
  return (Either<LT, RT>)BiTransformable.super.bipeek(c1, c2);
}
origin: aol/cyclops

@Override
default LazyEither5<LT1, LT2, LT3,LT4, RT> peek(final Consumer<? super RT> c) {
  return (LazyEither5<LT1, LT2, LT3, LT4, RT>) Transformable.super.peek(c);
}
origin: aol/cyclops

/**
 * Retry a transformation if it fails. Default settings are to retry up to 7
 * times, with an doubling backoff period starting @ 2 seconds delay before
 * retry.
 *
 *
 * @param fn
 *            Function to retry if fails
 *
 */
default <R> Transformable<R> retry(final Function<? super T, ? extends R> fn) {
  return retry(fn, 7, 2, TimeUnit.SECONDS);
}
origin: aol/cyclops

public static <T> Unrestricted<T> liftF(final Transformable<T> functor){
  return new Suspend<T>(functor.map(Unrestricted::done));
}
origin: aol/cyclops

@Override
default ImmutableMap<K, V> bipeek(Consumer<? super K> c1, Consumer<? super V> c2) {
  return (ImmutableMap<K,V>)BiTransformable.super.bipeek(c1,c2);
}
origin: aol/cyclops

@Override
default ImmutableMap<K,V> peek(Consumer<? super V> c) {
  return (ImmutableMap<K,V>)Transformable.super.peek(c);
}
origin: aol/cyclops

@Override
default <R> IO<R> retry(Function<? super T, ? extends R> fn, int retries, long delay, TimeUnit timeUnit) {
  return (IO<R>)ReactiveTransformable.super.retry(fn,retries,delay,timeUnit);
}
origin: aol/cyclops

@Override
default LazyEither4<LT1, LT2, LT3, RT> bipeek(final Consumer<? super LT3> c1, final Consumer<? super RT> c2) {
  return (LazyEither4<LT1, LT2, LT3, RT>) BiTransformable.super.bipeek(c1, c2);
}
origin: aol/cyclops

@Override
public Tuple1<T> peek(Consumer<? super T> c) {
  return (Tuple1<T>)Transformable.super.peek(c);
}
origin: aol/cyclops

/**
 * Retry a transformation if it fails. Retries up to <b>retries</b>
 * times, with an doubling backoff period starting @ <b>delay</b> TimeUnits delay before
 * retry.
 *
 * <pre>
 * {@code
 *
 *
 *
 *         String result = ReactiveSeq.of( 1,  2, 3)
 *                 .retry(this::makeIOCall, 7, 2, TimeUnit.SECONDS)
 *                 .firstValue();
 *
 *         //result = [service call result]
 * }
 * </pre>
 *
 * @param fn
 *            Function to retry if fails
 * @param retries
 *            Number of retries
 * @param delay
 *            Delay in TimeUnits
 * @param timeUnit
 *            TimeUnit to use for delay
 */
default <R> ReactiveSeq<R> retry(final Function<? super T, ? extends R> fn, final int retries, final long delay, final TimeUnit timeUnit) {
  return (ReactiveSeq) ReactiveTransformable.super.retry(fn, retries, delay, timeUnit);
}
origin: aol/cyclops

@Override
default LazyEither5<LT1, LT2, LT3, LT4, RT> bipeek(final Consumer<? super LT4> c1, final Consumer<? super RT> c2) {
  return (LazyEither5<LT1, LT2, LT3,LT4, RT>) BiTransformable.super.bipeek(c1, c2);
}
origin: aol/cyclops

@Override
default LazyEither4<LT1, LT2, LT3, RT> peek(final Consumer<? super RT> c) {
  return (LazyEither4<LT1, LT2, LT3, RT>) Transformable.super.peek(c);
}
origin: aol/cyclops

@Override
default Ior<LT, RT> bipeek(final Consumer<? super LT> c1, final Consumer<? super RT> c2) {
  return (Ior<LT, RT>) BiTransformable.super.bipeek(c1, c2);
}
origin: aol/cyclops

@Override
public LazyImmutable<T> peek(final Consumer<? super T> c) {
  return (LazyImmutable<T>) Transformable.super.peek(c);
}
com.oath.cyclops.types.functor

Most used classes

  • BiTransformable
  • FilterableTransformable
    Represents a Transformable that is also Filters (e.g. a Stream or Optional type)
  • ReactiveTransformable
  • Transformable
    An interface that represents a type that can transform a value from one type to another
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now