Skip to content

Commit

Permalink
Fix remaining solvable JavaDoc warnings from style check.
Browse files Browse the repository at this point in the history
  • Loading branch information
alexdlaird committed Mar 6, 2024
1 parent e99fa97 commit ec6c31d
Show file tree
Hide file tree
Showing 14 changed files with 113 additions and 26 deletions.
2 changes: 1 addition & 1 deletion config/checkstyle/checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@
</module>
<module name="SingleLineJavadoc"/>
<module name="EmptyCatchBlock">
<property name="exceptionVariableName" value="expected"/>
<property name="exceptionVariableName" value="ignored"/>
</module>
<module name="CommentsIndentation">
<property name="tokens" value="SINGLE_LINE_COMMENT, BLOCK_COMMENT_BEGIN"/>
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/com/github/alexdlaird/ngrok/NgrokClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -519,6 +519,9 @@ public Builder withHttpClient(final HttpClient httpClient) {
return this;
}

/**
* Build the {@link NgrokClient}.
*/
public NgrokClient build() {
if (isNull(javaNgrokConfig)) {
javaNgrokConfig = new JavaNgrokConfig.Builder().build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,9 @@ public Builder withApiKey(final String apiKey) {
return this;
}

/**
* Build the {@link JavaNgrokConfig}.
*/
public JavaNgrokConfig build() {
if (isNull(ngrokPath)) {
ngrokPath = NgrokInstaller.DEFAULT_NGROK_PATH;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@

package com.github.alexdlaird.ngrok.installer;

/**
* An interface for getting <code>ngrok</code> download URLs.
*/
public interface NgrokCDNUrl {
String getUrl();
}
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ public class NgrokInstaller {

private final HttpClient httpClient;

/**
* Constructor that uses the {@link DefaultHttpClient}.
*/
public NgrokInstaller() {
this(new DefaultHttpClient.Builder()
.withTimeout(6000)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
package com.github.alexdlaird.ngrok.installer;

/**
* An enum that maps systems and architectures to their corresponding <code>ngrok</code> download URLs.
* An enum that maps systems and architectures to their corresponding <code>ngrok</code> V3 download URLs.
*/
public enum NgrokV3CDNUrl implements NgrokCDNUrl {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,9 @@ public ProcessMonitor getProcessMonitor() {
return processMonitor;
}

/**
* A Runnable that monitors the <code>ngrok</code> thread.
*/
public static class ProcessMonitor implements Runnable {

private final Process process;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ public Response getResponse() {
return response;
}

/**
* An object representing a nested Request from <code>ngrok</code>'s API.
*/
public static class Request {
private String method;
private String proto;
Expand Down Expand Up @@ -83,6 +86,9 @@ public String getRaw() {
}
}

/**
* An object representing a nested Response from <code>ngrok</code>'s API.
*/
public static class Response {
private String status;
private int statusCode;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -771,6 +771,9 @@ public Builder withTunnelDefinition(Map<String, Object> tunnelDefinition) {
return this;
}

/**
* Build the {@link CreateTunnel}.
*/
public CreateTunnel build() {
if (isNull(ngrokVersion)) {
ngrokVersion = NgrokVersion.V3;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@ public void setMetrics(final Map<String, Metrics> metrics) {
this.metrics = metrics;
}

/**
* An object representing a nested TunnelConfig from <code>ngrok</code>'s API.
*/
public static class TunnelConfig {
private String addr;
private boolean inspect;
Expand All @@ -118,6 +121,9 @@ public boolean isInspect() {
}
}

/**
* An object representing a nested Metrics from <code>ngrok</code>'s API.
*/
public static class Metrics {
private int count;
private int gauge;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,31 @@ public List<String> getRemove() {
return remove;
}

/**
* Builder for a {@link TunnelHeader}.
*/
public static class Builder {
private List<String> add;
private List<String> remove;

/**
* Default constructor for {@link TunnelHeader.Builder}.
*/
public Builder() {
}

public Builder(Map<String, Object> tunnelDefinitions) {
if (tunnelDefinitions.containsKey("add")) {
this.add = (List<String>) tunnelDefinitions.get("add");
/**
* Constructor for {@link TunnelHeader.Builder} to be built from <code>request_header</code> or
* <code>response_header</code> portion of a tunnel definition.
*
* @param tunnelHeaderDefinitions The map of Tunnel header attributes.
*/
public Builder(Map<String, Object> tunnelHeaderDefinitions) {
if (tunnelHeaderDefinitions.containsKey("add")) {
this.add = (List<String>) tunnelHeaderDefinitions.get("add");
}
if (tunnelDefinitions.containsKey("remove")) {
this.remove = (List<String>) tunnelDefinitions.get("remove");
if (tunnelHeaderDefinitions.containsKey("remove")) {
this.remove = (List<String>) tunnelHeaderDefinitions.get("remove");
}
}

Expand All @@ -68,6 +80,9 @@ public TunnelHeader.Builder withRemove(final List<String> remove) {
return this;
}

/**
* Build the {@link TunnelHeader}.
*/
public TunnelHeader build() {
return new TunnelHeader(this);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,31 @@ public List<String> getDenyCidrs() {
return denyCidrs;
}

/**
* Builder for a {@link TunnelIPRestrictions}.
*/
public static class Builder {
public List<String> allowCidrs;
public List<String> denyCidrs;

/**
* Default constructor for {@link TunnelIPRestrictions.Builder}.
*/
public Builder() {
}

public Builder(Map<String, Object> tunnelDefinitions) {
if (tunnelDefinitions.containsKey("allow_cidrs")) {
this.allowCidrs = (List<String>) tunnelDefinitions.get("allow_cidrs");
/**
* Constructor for {@link TunnelIPRestrictions.Builder} to be built from <code>ip_restrictions</code>
* portion of a tunnel definition.
*
* @param tunnelIPRestrictionsDefinitions The map of Tunnel IP restrictions attributes.
*/
public Builder(Map<String, Object> tunnelIPRestrictionsDefinitions) {
if (tunnelIPRestrictionsDefinitions.containsKey("allow_cidrs")) {
this.allowCidrs = (List<String>) tunnelIPRestrictionsDefinitions.get("allow_cidrs");
}
if (tunnelDefinitions.containsKey("deny_cidrs")) {
this.denyCidrs = (List<String>) tunnelDefinitions.get("deny_cidrs");
if (tunnelIPRestrictionsDefinitions.containsKey("deny_cidrs")) {
this.denyCidrs = (List<String>) tunnelIPRestrictionsDefinitions.get("deny_cidrs");
}
}

Expand All @@ -67,6 +79,9 @@ public TunnelIPRestrictions.Builder withDenyCidrs(final List<String> denyCidrs)
return this;
}

/**
* Build the {@link TunnelIPRestrictions}.
*/
public TunnelIPRestrictions build() {
return new TunnelIPRestrictions(this);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,21 +64,30 @@ public static class Builder {
private List<String> allowEmails;
private List<String> allowDomains;

/**
* Default constructor for {@link TunnelOAuth.Builder}.
*/
public Builder() {
}

public Builder(Map<String, Object> tunnelDefinitions) {
if (tunnelDefinitions.containsKey("provider")) {
this.provider = (String) tunnelDefinitions.get("provider");
/**
* Constructor for {@link TunnelOAuth.Builder} to be built from <code>oauth</code>
* portion of a tunnel definition.
*
* @param tunnelOAuthDefinitions The map of Tunnel OAuth attributes.
*/
public Builder(Map<String, Object> tunnelOAuthDefinitions) {
if (tunnelOAuthDefinitions.containsKey("provider")) {
this.provider = (String) tunnelOAuthDefinitions.get("provider");
}
if (tunnelDefinitions.containsKey("scopes")) {
this.scopes = (List<String>) tunnelDefinitions.get("scopes");
if (tunnelOAuthDefinitions.containsKey("scopes")) {
this.scopes = (List<String>) tunnelOAuthDefinitions.get("scopes");
}
if (tunnelDefinitions.containsKey("allow_emails")) {
this.allowEmails = (List<String>) tunnelDefinitions.get("allow_emails");
if (tunnelOAuthDefinitions.containsKey("allow_emails")) {
this.allowEmails = (List<String>) tunnelOAuthDefinitions.get("allow_emails");
}
if (tunnelDefinitions.containsKey("allow_domains")) {
this.allowDomains = (List<String>) tunnelDefinitions.get("allow_domains");
if (tunnelOAuthDefinitions.containsKey("allow_domains")) {
this.allowDomains = (List<String>) tunnelOAuthDefinitions.get("allow_domains");
}
}

Expand Down Expand Up @@ -115,6 +124,9 @@ public Builder withAllowDomains(final List<String> domains) {
return this;
}

/**
* Build the {@link TunnelOAuth}.
*/
public TunnelOAuth build() {
return new TunnelOAuth(this);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,31 @@ public String getSecret() {
return secret;
}

/**
* Builder for a {@link TunnelVerifyWebhook}.
*/
public static class Builder {
public String provider;
public String secret;

/**
* Default constructor for {@link TunnelVerifyWebhook.Builder}.
*/
public Builder() {
}

public Builder(Map<String, Object> tunnelDefinitions) {
if (tunnelDefinitions.containsKey("provider")) {
this.provider = (String) tunnelDefinitions.get("provider");
/**
* Constructor for {@link TunnelVerifyWebhook.Builder} to be built from <code>verify_webhook</code>
* portion of a tunnel definition.
*
* @param tunnelVerifyWebhookDefinitions The map of Tunnel OAuth attributes.
*/
public Builder(Map<String, Object> tunnelVerifyWebhookDefinitions) {
if (tunnelVerifyWebhookDefinitions.containsKey("provider")) {
this.provider = (String) tunnelVerifyWebhookDefinitions.get("provider");
}
if (tunnelDefinitions.containsKey("secret")) {
this.secret = (String) tunnelDefinitions.get("secret");
if (tunnelVerifyWebhookDefinitions.containsKey("secret")) {
this.secret = (String) tunnelVerifyWebhookDefinitions.get("secret");
}
}

Expand All @@ -67,6 +79,9 @@ public TunnelVerifyWebhook.Builder withSecret(final String secret) {
return this;
}

/**
* Build the {@link TunnelVerifyWebhook}.
*/
public TunnelVerifyWebhook build() {
return new TunnelVerifyWebhook(this);
}
Expand Down

0 comments on commit ec6c31d

Please sign in to comment.