package com.example.helloworld;

import com.bazaarvoice.dropwizard.assets.AssetsBundleConfiguration;
import com.bazaarvoice.dropwizard.assets.AssetsConfiguration;
import com.example.helloworld.core.Template;
import com.fasterxml.jackson.annotation.JsonProperty;

import io.dropwizard.Configuration;
import io.dropwizard.client.JerseyClientConfiguration;
import io.dropwizard.db.DataSourceFactory;

import org.hibernate.validator.constraints.NotEmpty;

import javax.validation.Valid;
import javax.validation.constraints.NotNull;

public class HelloWorldConfiguration extends Configuration implements AssetsBundleConfiguration {
    @NotEmpty
    private String template;

    @NotEmpty
    private String defaultName = "Stranger";

    @Valid
    @NotNull
    private DataSourceFactory database = new DataSourceFactory();
    
    @Valid
    @NotNull
    @JsonProperty
    private final AssetsConfiguration assets = new AssetsConfiguration();

    @Valid
    @NotNull
    @JsonProperty
    private JerseyClientConfiguration httpClient = new JerseyClientConfiguration();
    
    @JsonProperty
    public String getTemplate() {
        return template;
    }

    @JsonProperty
    public void setTemplate(String template) {
        this.template = template;
    }

    @JsonProperty
    public String getDefaultName() {
        return defaultName;
    }

    @JsonProperty
    public void setDefaultName(String defaultName) {
        this.defaultName = defaultName;
    }

    public Template buildTemplate() {
        return new Template(template, defaultName);
    }

    @JsonProperty("database")
    public DataSourceFactory getDataSourceFactory() {
        return database;
    }

    @JsonProperty("database")
    public void setDataSourceFactory(DataSourceFactory dataSourceFactory) {
        this.database = dataSourceFactory;
    }

	@Override
	public AssetsConfiguration getAssetsConfiguration() {
		return assets;
	}
	
	public JerseyClientConfiguration getJerseyClientConfiguration() {
        return httpClient;
    }
}

@@ -30,138 +30,8 @@
 d;%0A%0A
-import com.bazaarvoice.dropwizard.assets.AssetsBundleConfiguration;%0Aimport com.bazaarvoice.dropwizard.assets.AssetsConfiguration;%0A
 impo
@@ -71,16 +71,16 @@
 mplate;%0A
+
 import c
@@ -455,45 +455,8 @@
 ion 
-implements AssetsBundleConfiguration 
 %7B%0A  
@@ -650,129 +650,8 @@
 y();
-%0A    %0A    @Valid%0A    @NotNull%0A    @JsonProperty%0A    private final AssetsConfiguration assets = new AssetsConfiguration();
 %0A%0A  
@@ -1550,96 +1550,8 @@
  %7D%0A%0A
-%09@Override%0A%09public AssetsConfiguration getAssetsConfiguration() %7B%0A%09%09return assets;%0A%09%7D%0A%09%0A
 %09pub

Clean up configuration