public class Streams extends Object
| Modifier and Type | Field and Description |
|---|---|
static FaultHandler |
IGNORE_POLICY
A
IgnoreHandler for failure handling. |
static NoOpGenerator<String> |
no_serialiser
|
static FaultHandler |
RETHROW_POLICY
A
RethrowHandler for failure handling. |
static FaultHandler |
RETHROW_UNRECOVERABLE_POLICY
A
RethrowUnrecoverableHandler for failure handling. |
static FaultHandler |
STOPFAST_POLICY
A
StopFastHandler for failure handling. |
| Constructor and Description |
|---|
Streams() |
| Modifier and Type | Method and Description |
|---|---|
static <E> ConsumeWithClause<E> |
consume(Stream<E> stream)
Starts a sentence to consume a
Stream |
static <E> Stream<E> |
convert(E... elements)
Converts one or more elements into a
Stream. |
static <E> Stream<E> |
convert(Iterable<E> iterable)
|
static <E> Stream<E> |
convert(Iterator<E> itarator)
|
static <E> IteratorStream<E> |
convert(IteratorAdapter<E> adapter)
Converts a custom
IteratorAdapter to a Stream. |
static RsOfClause<gr.uoa.di.madgik.grs.record.Record> |
convert(URI locator)
Starts a sentence to convert a resultset into a
Stream. |
static <E> Stream<E> |
convertWithFaults(Class<E> clazz,
List<? extends Object> elements)
Converts a mixture of exceptions and elements of a given type to a
Stream of a that type. |
static <E> Stream<E> |
convertWithFaults(Class<E> clazz,
Object... elements)
Converts a mixture of exceptions and elements of a given type to a
Stream of a that type. |
static <E> InClause<E> |
fold(Stream<E> stream)
|
static <E> GuardWithClause<E> |
guard(Stream<E> stream)
|
static <E> Stream<E> |
log(Stream<E> stream)
|
static <E> MonitorWithClause<E> |
monitor(Stream<E> stream)
|
static <E> NoOpGenerator<E> |
no_op(Stream<E> stream)
Returns a
NoOpGenerator. |
static <E> PipeThroughClause<E> |
pipe(Stream<E> stream)
|
static <E> PublishRsUsingClause<E> |
publish(Stream<E> stream)
Starts a sentence to publish a
Stream as a resultset. |
static PublishRsWithClause<String> |
publishStringsIn(Stream<String> stream)
Starts a sentence to publish a
Stream as a resultset. |
static Stream<String> |
stringsIn(URI locator)
Returns a
Stream of strings extracted from a resultset of RsStringRecordFactory.STRING_RECORDs. |
static Stream<String> |
stringsIn(URI locator,
int timeout,
TimeUnit timeUnit)
Returns a
Stream of strings extracted from a resultset of RsStringRecordFactory.STRING_RECORDs. |
static <E> UnfoldThroughClause<E> |
unfold(Stream<E> stream)
|
public static NoOpGenerator<String> no_serialiser
public static FaultHandler RETHROW_POLICY
RethrowHandler for failure handling.public static FaultHandler RETHROW_UNRECOVERABLE_POLICY
RethrowUnrecoverableHandler for failure handling.public static FaultHandler STOPFAST_POLICY
StopFastHandler for failure handling.public static FaultHandler IGNORE_POLICY
IgnoreHandler for failure handling.public static <E> ConsumeWithClause<E> consume(Stream<E> stream)
Streamstream - the streampublic static <E> Stream<E> convert(Iterator<E> itarator)
itarator - the iteratorpublic static <E> IteratorStream<E> convert(IteratorAdapter<E> adapter)
IteratorAdapter to a Stream.adapter - the adapterpublic static <E> Stream<E> convert(Iterable<E> iterable)
iterable - the iterablepublic static <E> Stream<E> convert(E... elements)
Stream.elements - the elementspublic static <E> Stream<E> convertWithFaults(Class<E> clazz, Object... elements)
Stream of a that type.
It's the client's responsibility to ensure that the elements that are not exceptions are homogeneously typed as the type indicated in input.clazz - the stream typeelements - the elementspublic static <E> Stream<E> convertWithFaults(Class<E> clazz, List<? extends Object> elements)
Stream of a that type.
It's the client's responsibility to ensure that the elements that are not exceptions are homogeneously typed as the type indicated in input.clazz - the stream typeelements - the elementspublic static RsOfClause<gr.uoa.di.madgik.grs.record.Record> convert(URI locator)
Stream.locator - the locator of the resultsetpublic static Stream<String> stringsIn(URI locator)
Stream of strings extracted from a resultset of RsStringRecordFactory.STRING_RECORDs.locator - the locator of the resultsetpublic static Stream<String> stringsIn(URI locator, int timeout, TimeUnit timeUnit)
Stream of strings extracted from a resultset of RsStringRecordFactory.STRING_RECORDs.locator - the locator of the resultsetpublic static <E> PipeThroughClause<E> pipe(Stream<E> stream)
stream - the input stream.public static <E> InClause<E> fold(Stream<E> stream)
stream - the input stream.public static <E> UnfoldThroughClause<E> unfold(Stream<E> stream)
stream - the input stream.public static <E> GuardWithClause<E> guard(Stream<E> stream)
stream - the input stream.public static <E> MonitorWithClause<E> monitor(Stream<E> stream)
stream - the input stream.public static <E> PublishRsUsingClause<E> publish(Stream<E> stream)
Stream as a resultset.stream - the streampublic static PublishRsWithClause<String> publishStringsIn(Stream<String> stream)
Stream as a resultset.stream - the streampublic static <E> Stream<E> log(Stream<E> stream)
stream - the input streampublic static <E> NoOpGenerator<E> no_op(Stream<E> stream)
NoOpGenerator.Copyright © 2019. All Rights Reserved.