D - public interface DataProvider<D>
| Modifier and Type | Method and Description |
|---|---|
void |
addDataObserver(Observer<D> observer)
This method allows the registration of data observers to get informed about data updates.
|
D |
getData()
Method returns the data object of this instance.
|
Class<D> |
getDataClass()
Method returns the class of the data object.
|
CompletableFuture<D> |
getDataFuture()
Returns a future of the data object.
|
boolean |
isDataAvailable()
Check if the data object is already available.
|
void |
removeDataObserver(Observer<D> observer)
This method removes already registered data observers.
|
void |
waitForData()
Method blocks until an initial data is available.
|
void |
waitForData(long timeout,
TimeUnit timeUnit)
Method blocks until an initial data is available or the given timeout is reached.
|
boolean isDataAvailable()
Class<D> getDataClass()
D getData() throws NotAvailableException
NotAvailableException - is thrown in case the data is not available.CompletableFuture<D> getDataFuture()
void addDataObserver(Observer<D> observer)
observer - the observer addedvoid removeDataObserver(Observer<D> observer)
observer - the observer removedvoid waitForData()
throws CouldNotPerformException,
InterruptedException
CouldNotPerformException - is thrown if any error occurs.InterruptedException - is thrown in case the thread is externally interrupted.void waitForData(long timeout,
TimeUnit timeUnit)
throws CouldNotPerformException,
InterruptedException
timeout - maximal time to wait for the data. After the timeout is reached a NotAvailableException is thrown which is caused by a TimeoutException.timeUnit - the time unit of the timeout.NotAvailableException - is thrown in case the any error occurs, or if the given timeout is reached. In this case a TimeoutException is thrown.InterruptedException - is thrown in case the thread is externally interrupted.CouldNotPerformExceptionCopyright © 2015–2018 openbase.org. All rights reserved.