public class WatchFileJsonImplStub extends Object
ConfigurationJsonImpl.| Modifier and Type | Field and Description |
|---|---|
protected EventBus |
eventBus |
protected File |
file |
protected String |
sourceId |
| Modifier and Type | Method and Description |
|---|---|
<T> ConfigurationJsonImpl<T> |
mappedTo(Class<T> clazz)
Instructs the configuration object to map the contents of the JSON file to an object of the given type.
|
<C> ConfigurationJsonCollectionImpl<C> |
mappedTo(com.fasterxml.jackson.core.type.TypeReference<C> typeReference)
Instructs the configuration object to map the contents of the JSON file to an object of the given type reference.
|
protected final String sourceId
protected final File file
protected final EventBus eventBus
public <T> ConfigurationJsonImpl<T> mappedTo(Class<T> clazz) throws IOException
ConfigurationJsonImpl<User> config = Watch.json("/path/to/user.json").mappedTo(User.class);
User user = config.getValue();
clazz - Non-null typeIOException - On I/O parsing the JSON filepublic <C> ConfigurationJsonCollectionImpl<C> mappedTo(com.fasterxml.jackson.core.type.TypeReference<C> typeReference) throws IOException
ConfigurationJsonImpl<List<User>> config = Watch.json("/path/to/users.json").mappedTo(new TypeReference<List<User>>() {
});
List<User> users = config.getValue();
typeReference - Non-null type referenceIOException - On I/O parsing the JSON fileCopyright © 2016–2017. All rights reserved.