public class DataHandlerRegistry extends Object implements AutoCloseable
Constructor and Description |
---|
DataHandlerRegistry()
Creates a new instance of this class.
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
<K,D extends DataHandler<K>> |
containsDataHandlerForUniqueKey(Class<D> type,
K uniqueKey)
Checks if there is a registered
DataHandler for the provided unique key. |
<K,D extends DataHandler<K>> |
getDataHandler(Class<D> type,
K uniqueKey)
Gets the
DataHandler for the provided unique key. |
<K,D extends DataHandler<K>> |
registerDataHandler(D dataHandler)
Registers a
DataHandler . |
void |
unregisterDataHandler(DataHandler<?> dataHandler)
Unregisters a
DataHandler . |
public DataHandlerRegistry()
public <K,D extends DataHandler<K>> D registerDataHandler(D dataHandler)
DataHandler
. K
- the type of the unique key of the data handlerD
- the type of the data handlerdataHandler
- the data handlerpublic void unregisterDataHandler(DataHandler<?> dataHandler)
DataHandler
.dataHandler
- the data handler to unregisterpublic <K,D extends DataHandler<K>> boolean containsDataHandlerForUniqueKey(Class<D> type, K uniqueKey)
DataHandler
for the provided unique key.K
- the type of the unique key of the data handlerD
- the type of the data handlertype
- the type of the data handleruniqueKey
- the unique key of the data handlerpublic <K,D extends DataHandler<K>> D getDataHandler(Class<D> type, K uniqueKey)
DataHandler
for the provided unique key.K
- the type of the unique key of the data handlerD
- the type of the data handlertype
- the type of the data handleruniqueKey
- the unique key of the data handlerpublic void close()
close
in interface AutoCloseable
Copyright © 2012–2019 Drombler. All rights reserved.