Skip to content

Instantly share code, notes, and snippets.

@javaeeeee
Last active December 4, 2015 07:38
Show Gist options
  • Select an option

  • Save javaeeeee/df2f6a032232bb809ec7 to your computer and use it in GitHub Desktop.

Select an option

Save javaeeeee/df2f6a032232bb809ec7 to your computer and use it in GitHub Desktop.
Additions to Dropwizard Configuration file to configure Jersey client
public class DWGettingStartedConfiguration extends Configuration {
...
/**
* The URL to access exchange rate API.
*/
@NotEmpty
private String apiURL;
/**
* The key to access exchange rate API.
*/
@NotEmpty
private String apiKey;
/**
* Jersey client default configuration.
*/
@Valid
@NotNull
private JerseyClientConfiguration jerseyClientConfiguration
= new JerseyClientConfiguration();
/**
*
* @return Jersey Client
*/
@JsonProperty("jerseyClient")
public JerseyClientConfiguration getJerseyClientConfiguration() {
return jerseyClientConfiguration;
}
/**
* A getter for the URL of currency rates the API.
*
* @return the URL of currency rates the API.
*/
@JsonProperty
public String getApiURL() {
return apiURL;
}
/**
* A getter for the API key of currency rates the API.
*
* @return the API key of currency rates the API.
*/
@JsonProperty
public String getApiKey() {
return apiKey;
}
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment