Package io.dropwizard.core
Class Configuration
java.lang.Object
io.dropwizard.core.Configuration
- Direct Known Subclasses:
HelloWorldConfiguration
An object representation of the YAML configuration file. Extend this with your own configuration
properties, and they'll be parsed from the YAML file as well.
For example, given a YAML file with this:
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
.- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionReturns the admin interface-specific section of the configuration file.Returns the health interface-specific section of the configuration file.Returns the logging-specific section of the configuration file.Returns the server-specific section of the configuration file.void
setAdminFactory
(AdminFactory admin) Sets the admin interface-specific section of the configuration file.void
setHealthFactory
(HealthFactory health) Sets the health interface-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.toString()
-
Constructor Details
-
Configuration
public Configuration()
-
-
Method Details
-
getServerFactory
Returns the server-specific section of the configuration file.- Returns:
- server-specific configuration parameters
-
setServerFactory
Sets the HTTP-specific section of the configuration file. -
getLoggingFactory
Returns the logging-specific section of the configuration file.- Returns:
- logging-specific configuration parameters
-
setLoggingFactory
Sets the logging-specific section of the configuration file. -
getMetricsFactory
-
setMetricsFactory
-
getAdminFactory
Returns the admin interface-specific section of the configuration file.- Returns:
- admin interface-specific configuration parameters
- Since:
- 2.0
-
setAdminFactory
Sets the admin interface-specific section of the configuration file.- Since:
- 2.0
-
getHealthFactory
Returns the health interface-specific section of the configuration file.- Returns:
- health interface-specific configuration parameters
- Since:
- 2.1
-
setHealthFactory
Sets the health interface-specific section of the configuration file.- Since:
- 2.1
-
toString
-