public class Metadata extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
Metadata.Builder
The Builder class creates a new Metadata instance from a metadata.json file.
|
| Modifier | Constructor and Description |
|---|---|
|
Metadata() |
protected |
Metadata(Map<String,Resource> resources,
Map<String,String> environment,
Map<String,RuntimeProperty> runtimeProperties)
This constructor is used by the Builder subclass to create a new Metadata instance
|
| Modifier and Type | Method and Description |
|---|---|
Map<String,String> |
getEnvironment() |
String |
getEnvironmentVariable(String variableName) |
<R extends Resource> |
getResource(String resourceName) |
Resource |
getResourceByType(String type) |
Map<String,Resource> |
getResources() |
<R extends Resource> |
getResources(Class<R> type) |
<R extends Resource> |
getResourcesByType(String type) |
String |
getRuntimeParameter(String section,
String name) |
String |
getRuntimeParameter(String section,
String name,
String defaultValue) |
RuntimeProperty |
getRuntimeProperty(String section) |
boolean |
hasSection(String section) |
void |
setRuntimeParameter(String parameter,
String value) |
void |
setRuntimeParameter(String section,
String name,
String value) |
protected Metadata(Map<String,Resource> resources, Map<String,String> environment, Map<String,RuntimeProperty> runtimeProperties)
resources - A map of the GenApp resourcesenvironment - A map of the environment variablesruntimeProperties - A map of RuntimePropertiespublic Metadata()
@Nonnull public Map<String,Resource> getResources()
Resource@Nonnull public <R extends Resource> Collection<R> getResources(@Nullable Class<R> type)
@Nonnull public <R extends Resource> Collection<R> getResourcesByType(@Nullable String type)
@Nullable public Resource getResourceByType(@Nullable String type) throws IllegalStateException
type - IllegalStateException - more than 1 Resource matching given @Nullable public RuntimeProperty getRuntimeProperty(String section)
NullPointerException - if section does not exist@Nullable public String getRuntimeParameter(@Nullable String section, @Nullable String name)
section - name - null if the section does not exist or if the parameter does not exist@Nullable public String getRuntimeParameter(@Nullable String section, @Nullable String name, @Nullable String defaultValue)
section - name - defaultValue - null if the section does not exist or if the parameter does not exist and the defaultValue is nullpublic void setRuntimeParameter(@Nonnull String parameter, @Nonnull String value)
parameter - format section + '.' + parameterNamevalue - Copyright © 2013–2014. All rights reserved.