Class Resource
-
- All Implemented Interfaces:
-
java.lang.AutoCloseable
public abstract class Resource implements AutoCloseable
Abstract representation of a resource. This is used to lazily load resources.
- Since:
0.21.1
-
-
Field Summary
Fields Modifier and Type Field Description private final Booleaninitprivate final Booleanerroredprivate final Booleanresettableprivate final InputStreamstreamprivate final StringresourcePath
-
Method Summary
Modifier and Type Method Description final BooleangetInit()final BooleangetErrored()final BooleangetResettable()final InputStreamgetStream()final StringgetResourcePath()final InputStreamget()final Unitreset()Unitclose()final UnitgetAsync(Function1<Throwable, Unit> exceptionHandler, Function1<InputStream, Unit> callback)final UnitgetAsyncNullable(Function1<Throwable, Unit> exceptionHandler, Function1<InputStream, Unit> callback)final UnitaddCompletionCallback(Function1<Resource, Unit> callback)StringtoString()IntegerhashCode()Booleanequals(Object other)-
-
Constructor Detail
-
Resource
Resource(String resourcePath)
-
-
Method Detail
-
getErrored
final Boolean getErrored()
-
getResettable
final Boolean getResettable()
-
getStream
final InputStream getStream()
-
getResourcePath
final String getResourcePath()
-
get
final InputStream get()
-
getAsync
@ApiStatus.Experimental() final Unit getAsync(Function1<Throwable, Unit> exceptionHandler, Function1<InputStream, Unit> callback)
-
getAsyncNullable
@ApiStatus.Experimental() final Unit getAsyncNullable(Function1<Throwable, Unit> exceptionHandler, Function1<InputStream, Unit> callback)
-
addCompletionCallback
final Unit addCompletionCallback(Function1<Resource, Unit> callback)
-
-
-
-