Skip to content

Commit

Permalink
Merge pull request aol#227 from aol/javadoc-rx
Browse files Browse the repository at this point in the history
Javadoc rx
  • Loading branch information
johnmcclean authored Oct 21, 2016
2 parents 7f503a4 + ad7951c commit 6449b84
Show file tree
Hide file tree
Showing 15 changed files with 355 additions and 152 deletions.
3 changes: 2 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ test {
}



subprojects {
apply plugin: 'eclipse'

Expand All @@ -32,7 +33,7 @@ subprojects {
}
}
}


}
21 changes: 20 additions & 1 deletion cyclops-reactor/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,29 @@ jar {
}
}




if (JavaVersion.current().isJava8Compatible()) {
allprojects {
tasks.withType(Javadoc) {
options.addStringOption('Xdoclint:none', '-quiet')
}
}
}

repositories {
mavenCentral()

}
configurations {
provided
doc {
transitive false
}
}
dependencies {
doc 'com.aol.simplereact:cyclops-react:'+cyclopsReactVersion+':sources'
compile 'io.projectreactor:reactor-core:'+reactorVersion
compile group: 'com.aol.simplereact', name:'cyclops-react', version:cyclopsReactVersion
provided group: 'org.projectlombok', name: 'lombok', version:lombokVersion
Expand All @@ -51,7 +66,11 @@ eclipse.classpath.plusConfigurations += [configurations.provided] // Eclipse us
test {
systemProperties 'property': 'value'
}

javadoc {
source configurations.doc.collect { zipTree(it) }
include '**/*.java'
options.addStringOption('Xdoclint:none', '-quiet')
}


modifyPom {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -253,8 +253,7 @@ public static <T1, T2, R1, R2, R> Flux<R> forEach3(Flux<? extends T1> value1,
* @param yieldingFunction Generates a result per combination
* @return
*/
public static <T, R1, R> Flux<R> forEach(Flux<? extends T> value1,
Function<? super T, Flux<R1>> value2,
public static <T, R1, R> Flux<R> forEach(Flux<? extends T> value1, Function<? super T, Flux<R1>> value2,
BiFunction<? super T, ? super R1, ? extends R> yieldingFunction) {

return AnyM.ofSeq(For.anyM(anyM(value1))
Expand Down Expand Up @@ -1144,7 +1143,7 @@ public T next() {

});
}

/**
* Apply the identity function / combiner from left to right accumulating partial results in the resulting Flux
*
Expand All @@ -1165,7 +1164,7 @@ public T next() {
*/
public static <T, U> Flux<U> scanRight(Flux<T> flux, U identity,
BiFunction<? super T, ? super U, ? extends U> combiner) {

return Flux.fromIterable(() -> new Iterator<U>() {

Iterator<U> it;
Expand Down Expand Up @@ -1331,6 +1330,7 @@ public T next() {

});
}

/**
* Create a sliding view over this Sequence
*
Expand Down Expand Up @@ -1379,7 +1379,7 @@ public ListX<T> next() {

});
}

/**
* Group elements in a Flux
* <pre>
Expand Down Expand Up @@ -1515,7 +1515,7 @@ public static <T> Flux<Tuple2<T, Long>> zipWithIndex(Flux<T> stream) {
return stream.zipWith(ReactiveSeq.rangeLong(0, Long.MAX_VALUE), Tuple::tuple);
}

/**
/**
* Delete elements between given indexes in a Flux
* <pre>
* {@code
Expand Down Expand Up @@ -1563,7 +1563,6 @@ public static final <T> Flux<T> insertAt(final Flux<T> stream, final int pos, fi

}


/**
* Create Flux of ListX where
* each ListX is populated while the supplied bipredicate holds. The
Expand All @@ -1584,7 +1583,7 @@ public static final <T> Flux<T> insertAt(final Flux<T> stream, final int pos, fi
*/
public final static <T> Flux<ListX<T>> groupedStatefullyUntil(final Flux<T> flux,
final BiPredicate<ListX<? super T>, ? super T> predicate) {

return Flux.fromIterable(() -> new Iterator<ListX<T>>() {

Iterator<ListX<T>> it;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public Class getTargetClass() {
}

@Override
public FluxTValue fromIterator(Iterator o) {
public FluxTValue fromIterator(Iterator o) {
Mono<Flux<Object>> mono = Mono.just(Flux.fromIterable(() -> o));
return FluxT.fromMono(mono);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -265,8 +265,6 @@ public static <A> FluxTSeq<A> fromIterable(Iterable<Flux<A>> iterableOfFluxs) {
return FluxTSeq.of(AnyM.fromIterable(iterableOfFluxs));
}



/**
* Create a FluxTSeq from a Publisher that contains nested Fluxes
*
Expand Down Expand Up @@ -324,6 +322,7 @@ public static <A> FluxTValue<A> fromOptional(Optional<Flux<A>> optional) {
public static <A> FluxTValue<A> fromFuture(CompletableFuture<Flux<A>> future) {
return FluxTValue.of(AnyM.fromCompletableFuture(future));
}

/**
* Create a FluxTValue from a Reactor Mono type that contains nested Fluxes
* <pre>
Expand Down Expand Up @@ -352,7 +351,7 @@ public static <A> FluxTValue<A> fromMono(Mono<Flux<A>> mono) {
public static <A> FluxTValue<A> fromIterableValue(Iterable<Flux<A>> iterableOfFluxs) {
return FluxTValue.of(AnyM.fromIterableValue(iterableOfFluxs));
}

/**
* @return An empty FluxValue (wraps an Empty Optional)
*/
Expand Down Expand Up @@ -1123,5 +1122,4 @@ default <U extends Comparable<? super U>> FluxT<T> sorted(Function<? super T, ?
return (FluxT) FoldableTransformerSeq.super.sorted(function);
}


}
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,11 @@ public FluxTSeq<T> filter(Predicate<? super T> test) {
*
* <pre>
* {@code
* FluxT.of(AnyM.fromStream(Arrays.asStream(Flux.just(10)))
* FluxT.of(AnyM.fromStream(Stream.of(Flux.just(10)))
* .map(t->t=t+1);
*
*
* //FluxT<AnyM<Stream<Stream[11]>>>
* //FluxT<11>>
* }
* </pre>
*
Expand Down Expand Up @@ -180,10 +180,10 @@ public static <A> FluxTSeq<A> fromAnyM(AnyMSeq<A> anyM) {
}

/**
* Create a FluxT from an AnyM that wraps a monad containing a Stream
* Create a FluxT from an AnyM that wraps a monad containing a Flux
*
* @param monads
* @return
* @param monads AnyM that wraps a Flux containing monad
* @return FluxTSeq
*/
public static <A> FluxTSeq<A> of(AnyMSeq<? extends Flux<A>> monads) {
return new FluxTSeq<>(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,6 @@ public static <A> MonoTSeq<A> fromStream(Stream<Mono<A>> streamOfMonos) {
return MonoTSeq.of(AnyM.fromStream(streamOfMonos));
}


/**
* Construct a MonoTSeq from a Publisher containing Monos
*
Expand Down Expand Up @@ -294,6 +293,7 @@ public static <A> MonoTValue<A> fromOptional(Optional<Mono<A>> optional) {
public static <A> MonoTValue<A> fromFuture(CompletableFuture<Mono<A>> future) {
return MonoTValue.of(AnyM.fromCompletableFuture(future));
}

/**
* Construct a MonoTValue from a Mono containing a Mono
* <pre>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,6 @@ public boolean isSeqPresent() {
return !run.isEmpty();
}


/*
* (non-Javadoc)
*
Expand Down
30 changes: 18 additions & 12 deletions cyclops-rx/src/main/java/com/aol/cyclops/rx/ObservableTs.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
*/
@UtilityClass
public class ObservableTs {

/**
* Construct an AnyM type from an Observable Transformer. This allows the Observable Transformer to be manipulated according to a standard interface
* along with a vast array of other Java Monad implementations
Expand All @@ -46,6 +46,7 @@ public class ObservableTs {
public static <T> AnyMSeq<T> anyM(ObservableT<T> obs) {
return AnyM.ofSeq(obs);
}

/**
* Construct an ObservableT from a Publisher containing nested Observables
*
Expand All @@ -55,6 +56,7 @@ public static <T> AnyMSeq<T> anyM(ObservableT<T> obs) {
public static <T> ObservableTSeq<T> observableT(Publisher<Observable<T>> nested) {
return ObservableT.fromPublisher(nested);
}

/**
* Construct an ObservableT from an Observable containing nested Observables
*
Expand Down Expand Up @@ -106,13 +108,14 @@ public static <T1, T2, T3, R1, R2, R3, R> ObservableT<R> forEach4(ObservableT<?

return AnyM.ofSeq(For.anyM(anyM(value1))
.anyM(a -> AnyM.fromPublisher(value2.apply(a)))
.anyM(a -> b -> AnyM.fromPublisher(value3.apply(a, b)))
.anyM(a -> b -> c -> AnyM.fromPublisher(value4.apply(a, b, c)))
.anyM(a -> b -> AnyM.fromPublisher(value3.apply(a, b)))
.anyM(a -> b -> c -> AnyM.fromPublisher(value4.apply(a, b, c)))
.yield4(yieldingFunction)
.unwrap())
.unwrap();

}

/**
* Perform a For Comprehension over an ObservableT, accepting 3 generating functions.
* This results in a four level nested internal iteration over the provided Publishers.
Expand Down Expand Up @@ -153,15 +156,16 @@ public static <T1, T2, T3, R1, R2, R3, R> ObservableT<R> forEach4(ObservableT<?
QuadFunction<? super T1, ? super R1, ? super R2, ? super R3, ? extends R> yieldingFunction) {

return AnyM.ofSeq(For.anyM(anyM(value1))
.anyM(a -> AnyM.fromPublisher(value2.apply(a)))
.anyM(a -> b -> AnyM.fromPublisher(value3.apply(a, b)))
.anyM(a -> b -> c -> AnyM.fromPublisher(value4.apply(a, b, c)))
.anyM(a -> AnyM.fromPublisher(value2.apply(a)))
.anyM(a -> b -> AnyM.fromPublisher(value3.apply(a, b)))
.anyM(a -> b -> c -> AnyM.fromPublisher(value4.apply(a, b, c)))
.filter(a -> b -> c -> d -> filterFunction.apply(a, b, c, d))
.yield4(yieldingFunction)
.unwrap())
.unwrap();

}

/**
* Perform a For Comprehension over a ObservableT, accepting 2 generating functions.
* This results in a three level nested internal iteration over the provided Publishers.
Expand Down Expand Up @@ -196,8 +200,8 @@ public static <T1, T2, R1, R2, R> ObservableT<R> forEach3(ObservableT<? extends
TriFunction<? super T1, ? super R1, ? super R2, ? extends R> yieldingFunction) {

return AnyM.ofSeq(For.anyM(anyM(value1))
.anyM(a -> AnyM.fromPublisher(value2.apply(a)))
.anyM(a -> b -> AnyM.fromPublisher(value3.apply(a, b)))
.anyM(a -> AnyM.fromPublisher(value2.apply(a)))
.anyM(a -> b -> AnyM.fromPublisher(value3.apply(a, b)))
.yield3(yieldingFunction)
.unwrap())
.unwrap();
Expand Down Expand Up @@ -239,14 +243,15 @@ public static <T1, T2, R1, R2, R> ObservableT<R> forEach3(ObservableT<? extends
TriFunction<? super T1, ? super R1, ? super R2, ? extends R> yieldingFunction) {

return AnyM.ofSeq(For.anyM(anyM(value1))
.anyM(a -> AnyM.fromPublisher(value2.apply(a)))
.anyM(a -> b -> AnyM.fromPublisher(value3.apply(a, b)))
.anyM(a -> AnyM.fromPublisher(value2.apply(a)))
.anyM(a -> b -> AnyM.fromPublisher(value3.apply(a, b)))
.filter(a -> b -> c -> filterFunction.apply(a, b, c))
.yield3(yieldingFunction)
.unwrap())
.unwrap();

}

/**
* Perform a For Comprehension over a ObservableT, accepting a generating function.
* This results in a two level nested internal iteration over the provided Publishers.
Expand Down Expand Up @@ -278,12 +283,13 @@ public static <T, R1, R> ObservableT<R> forEach(ObservableT<? extends T> value1,
BiFunction<? super T, ? super R1, ? extends R> yieldingFunction) {

return AnyM.ofSeq(For.anyM(anyM(value1))
.anyM(a -> AnyM.fromPublisher(value2.apply(a)))
.anyM(a -> AnyM.fromPublisher(value2.apply(a)))
.yield2(yieldingFunction)
.unwrap())
.unwrap();

}

/**
* Perform a For Comprehension over an ObservableT, accepting a generating function.
* This results in a two level nested internal iteration over the provided Publishers.
Expand Down Expand Up @@ -317,7 +323,7 @@ public static <T, R1, R> ObservableT<R> forEach(ObservableT<? extends T> value1,
BiFunction<? super T, ? super R1, ? extends R> yieldingFunction) {

return AnyM.ofSeq(For.anyM(anyM(value1))
.anyM(a -> AnyM.fromPublisher(value2.apply(a)))
.anyM(a -> AnyM.fromPublisher(value2.apply(a)))
.filter(a -> b -> filterFunction.apply(a, b))
.yield2(yieldingFunction)
.unwrap())
Expand Down
Loading

0 comments on commit 6449b84

Please sign in to comment.