public class Sources extends Registry<DataSource>
Constructor and Description |
---|
Sources() |
Modifier and Type | Method and Description |
---|---|
<T> DataSource<T> |
computeIfAbsent(java.lang.String uri,
java.util.function.Supplier<DataSource<T>> sourceSupplier) |
java.util.List<DataSource> |
forType(SourceType type)
Gets a list of all the known data sources.
|
<T> java.util.Optional<DataSource<T>> |
get(java.lang.String id) |
static Sources |
getDefault() |
java.util.stream.Stream<DataSource<?>> |
hierarchy(DataSource<?> source) |
void |
register(DataSource source)
Registers an item with this registry.
|
void |
unregister(DataSource source)
Unregisters an item from this registry.
|
addItem, getItems, isRegistered, registerAll, registerAll, registerIfAbsent, removeItem, unregisterAll, unregisterAll
public static Sources getDefault()
public void register(DataSource source)
Registry
unregistered
.register
in class Registry<DataSource>
source
- the item to registerpublic void unregister(DataSource source)
Registry
unregister
in class Registry<DataSource>
source
- the item to unregisterpublic java.util.List<DataSource> forType(SourceType type)
type
- the source type to get the sources forpublic <T> java.util.Optional<DataSource<T>> get(java.lang.String id)
public <T> DataSource<T> computeIfAbsent(java.lang.String uri, java.util.function.Supplier<DataSource<T>> sourceSupplier)
public java.util.stream.Stream<DataSource<?>> hierarchy(DataSource<?> source)