R - Resource type.public static class Try.ResourceHandler<R extends AutoCloseable> extends Object
| Modifier and Type | Method and Description |
|---|---|
<V> Try.Value<V> |
apply(Throwing.Function<R,V> fn)
Apply the resource and produces an output.
|
<V extends AutoCloseable> |
map(Throwing.Function<R,V> fn)
Map the resource to a new closeable resource.
|
Try |
run(Throwing.Consumer<R> fn)
Run an operation over the resource.
|
public <V extends AutoCloseable> Try.ResourceHandler<V> map(Throwing.Function<R,V> fn)
V - New resource type.fn - Mapper.public <V> Try.Value<V> apply(Throwing.Function<R,V> fn)
V - Output type.fn - Function to apply.public Try run(Throwing.Consumer<R> fn)
fn - Function to apply.Copyright © 2017. All rights reserved.