Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package com.yammer.dropwizard.config;
 
 
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;

     public String getName() {
         return name;
     }

     public int getAge() {
         return age;
     }
 }
 
Dropwizard will parse the given YAML file and provide an ExampleConfiguration instance to your service whose getName() method will return "Random Person" and whose getAge() method will return 43.

See also:
YAML Cookbook
@SuppressWarnings("UnusedDeclaration")
public class Configuration {
    @Valid
    @NotNull
    private HttpConfiguration http = new HttpConfiguration();
    @Valid
    @NotNull
    private LoggingConfiguration logging = new LoggingConfiguration();

    
Returns the HTTP-specific section of the configuration file.

Returns:
HTTP-specific configuration parameters
        return ;
    }

    
Sets the HTTP-specific section of the configuration file.
    public void setHttpConfiguration(HttpConfiguration config) {
        this. = config;
    }

    
Returns the logging-specific section of the configuration file.

Returns:
logging-specific configuration parameters
        return ;
    }

    
Sets the logging-specific section of the configuration file.
    public void setLoggingConfiguration(LoggingConfiguration config) {
        this. = config;
    }
    @Override
    public String toString() {
        return Objects.toStringHelper(this)
                      .add("http")
                      .add("logging")
                      .toString();
    }
New to GrepCode? Check out our FAQ X