Skip to content

Commit

Permalink
Fix Javadoc in DropwizardConnectors (#467)
Browse files Browse the repository at this point in the history
* Change javadoc to say there must be exactly one application/admin
  port for the "getOnly" methods
  • Loading branch information
sleberknight authored Apr 27, 2024
1 parent da74f24 commit 95a348a
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -132,20 +132,20 @@ public static List<Port> getPorts(DefaultServerFactory serverFactory) {
}

/**
* Get the single application port. If there is more than one, throw an exception.
* Get the single application port. If there is not exactly one, throw an exception.
*
* @param <C> the type of the Dropwizard Configuration
* @param configuration the Dropwizard configuration
* @return the single application port
* @throws IllegalStateException if there is more than one application port
* @throws IllegalStateException if there is not exactly one application port
*/
public static <C extends Configuration> Port getOnlyApplicationPort(C configuration) {
var serverFactory = requireDefaultServerFactory(configuration);
return getOnlyApplicationPort(serverFactory);
}

/**
* Get the single application port. If there is more than one, throw an exception.
* Get the single application port. If there is not exactly one, throw an exception.
*
* @param serverFactory the {@link DefaultServerFactory} to get the single application port from
* @return the application port
Expand Down Expand Up @@ -180,24 +180,24 @@ public static List<Port> getApplicationPorts(DefaultServerFactory serverFactory)
}

/**
* Get the single admin port. If there is more than one, throw an exception.
* Get the single admin port. If there is not exactly one, throw an exception.
*
* @param <C> the type of the Dropwizard Configuration
* @param configuration the Dropwizard configuration
* @return the admin port
* @throws IllegalStateException if there is more than one admin port
* @throws IllegalStateException if there is not exactly one admin port
*/
public static <C extends Configuration> Port getOnlyAdminPort(C configuration) {
var serverFactory = requireDefaultServerFactory(configuration);
return getOnlyAdminPort(serverFactory);
}

/**
* Get the single admin port. If there is more than one, throw an exception.
* Get the single admin port. If there is not exactly one, throw an exception.
*
* @param serverFactory the {@link DefaultServerFactory} to get single admin port from
* @return the admin port
* @throws IllegalStateException if there is more than one admin port
* @throws IllegalStateException if there is not exactly one admin port
*/
public static Port getOnlyAdminPort(DefaultServerFactory serverFactory) {
var adminPorts = getAdminPorts(serverFactory);
Expand Down

0 comments on commit 95a348a

Please sign in to comment.