package tay;

import io.dropwizard.Configuration;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.hibernate.validator.constraints.*;
import javax.validation.constraints.*;

public class tayConfiguration extends Configuration {
    // TODO: implement service configuration

    @NotEmpty
    private String dateFormat;

    public String getDateFormat() {
        return dateFormat;
    }
}

package tay;

import io.dropwizard.Configuration;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.dropwizard.db.DataSourceFactory;
import org.hibernate.validator.constraints.*;

import javax.validation.Valid;
import javax.validation.constraints.*;

public class tayConfiguration extends Configuration {

    @NotEmpty
    private String dateFormat;

    @NotNull
    @Valid
    private DataSourceFactory dataSourceFactory = new DataSourceFactory();

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

    public String getDateFormat() {
        return dateFormat;
    }
}

change config file