public class Configuration extends Object
name: "Random Person" age: 43 # ... etc ...And a configuration like this:
public class ExampleConfiguration extends Configuration {
\@NotNull
private String name;
\@Min(1)
\@Max(120)
private int age;
\@JsonProperty
public String getName() {
return name;
}
\@JsonProperty
public void setName(String name) {
this.name = name;
}
\@JsonProperty
public int getAge() {
return age;
}
\@JsonProperty
public void setAge(int age) {
this.age = age;
}
}
Dropwizard will parse the given YAML file and provide an ExampleConfiguration instance
to your application whose getName() method will return "Random Person" and whose
getAge() method will return 43.| Constructor and Description |
|---|
Configuration() |
| Modifier and Type | Method and Description |
|---|---|
LoggingFactory |
getLoggingFactory()
Returns the logging-specific section of the configuration file.
|
MetricsFactory |
getMetricsFactory() |
ServerFactory |
getServerFactory()
Returns the server-specific section of the configuration file.
|
void |
setLoggingFactory(LoggingFactory factory)
Sets the logging-specific section of the configuration file.
|
void |
setMetricsFactory(MetricsFactory metrics) |
void |
setServerFactory(ServerFactory factory)
Sets the HTTP-specific section of the configuration file.
|
String |
toString() |
public ServerFactory getServerFactory()
public void setServerFactory(ServerFactory factory)
public LoggingFactory getLoggingFactory()
public void setLoggingFactory(LoggingFactory factory)
public MetricsFactory getMetricsFactory()
public void setMetricsFactory(MetricsFactory metrics)
Copyright © 2016. All rights reserved.