| Package | Description |
|---|---|
| ch.awae.utils.functional |
A set of functional types and interfaces.
|
| ch.awae.utils.source | |
| ch.awae.utils.xml |
| Modifier and Type | Method and Description |
|---|---|
static <T> Result<T> |
Result.empty()
Returns an empty result
|
static <T> Result<T> |
Result.eval(FailableFunction0<T> supplier)
Evaluates a given expression and returns a result according to the
expression result.
|
abstract <E> Result<E> |
Result.flatMap(FailableFunction1<T,Result<E>> mapper)
Applies the mapping function to the value of the result and returns the
result returned by the mapping function.
|
abstract Result<T> |
Result.flatMapException(FailableFunction1<java.lang.Throwable,Result<T>> mapper)
Applies the mapping function to the exception and returns the result
returned by it.
|
abstract <E> Result<E> |
Result.map(FailableFunction1<T,E> mapper)
Applies the mapping function to the value of the result (if it exists).
|
abstract Result<T> |
Result.mapException(FailableFunction1<java.lang.Throwable,T> mapper)
Applies the mapping function to the exception.
|
static <T> Result<T> |
Result.of(T value)
Wraps a non-null value into a value result.
|
static <T> Result<T> |
Result.ofException(java.lang.Throwable e)
Wraps an exception into an error result.
|
static <T> Result<T> |
Result.ofNullable(T value)
Wraps a value into a value result.
|
| Modifier and Type | Method and Description |
|---|---|
abstract <E> Result<E> |
Result.flatMap(FailableFunction1<T,Result<E>> mapper)
Applies the mapping function to the value of the result and returns the
result returned by the mapping function.
|
abstract Result<T> |
Result.flatMapException(FailableFunction1<java.lang.Throwable,Result<T>> mapper)
Applies the mapping function to the exception and returns the result
returned by it.
|
| Modifier and Type | Method and Description |
|---|---|
abstract Result<java.io.InputStream> |
Source.mkStream()
Returns the Source as an input stream
|
Result<java.lang.String> |
Source.mkString()
reads the source into a string
|
Result<XML> |
Source.mkXML()
reads the source into an XML document
|
| Modifier and Type | Method and Description |
|---|---|
java.util.stream.Stream<Result<java.lang.String>> |
XPath.attribute(java.lang.String name)
Returns a stream containing the attribute value for a given attribute
name for each element
|
java.util.stream.Stream<Result<java.lang.String>> |
XPath.text()
Returns a stream containing the text of all current elements
|
Copyright © 2018. All Rights Reserved.