From 40f6279f674b95685def38e9e096c47a1ed5c069 Mon Sep 17 00:00:00 2001 From: Gianluca Finocchiaro Date: Thu, 21 Sep 2017 15:34:36 +0200 Subject: [PATCH] Fix JavaDoc specification and improve code formatting. --- .../java/cool/mqtt/hooks/SimpleCoolHook.java | 53 +++++++++---------- 1 file changed, 24 insertions(+), 29 deletions(-) diff --git a/src/main/java/cool/mqtt/hooks/SimpleCoolHook.java b/src/main/java/cool/mqtt/hooks/SimpleCoolHook.java index af2638d..10bfd5a 100644 --- a/src/main/java/cool/mqtt/hooks/SimpleCoolHook.java +++ b/src/main/java/cool/mqtt/hooks/SimpleCoolHook.java @@ -4,12 +4,12 @@ import java.util.Map; /** - * Simple skeletal implementation of the {@code MQTTCoolHook} interface, meant - * as a base class to be extended in order to minimize the effort required to - * provide a full implementation of a custom Hook. - *

- * All methods provide a trivial implementation, therefore subclasses must - * override those methods for which a specific behaviour is really needed. + * Simple skeletal implementation of the {@code MQTTCoolHook} interface, meant as a base class to be + * extended in order to minimize the effort required to provide a full implementation of a custom + * Hook. + * + *

All methods provide a trivial implementation, therefore subclasses must override those methods + * for which a specific behavior is really needed. */ public class SimpleCoolHook implements MQTTCoolHook { @@ -22,7 +22,7 @@ public void init(File configDir) throws HookException { } /** - * This implementation always return {@code null} + * This implementation always returns {@code null}. */ @Override public MqttBrokerConfig resolveAlias(String alias) throws HookException { @@ -30,12 +30,12 @@ public MqttBrokerConfig resolveAlias(String alias) throws HookException { } /** - * This implementation always return {@code true} + * This implementation always returns {@code true}. */ @Override - public boolean canOpenSession(String sessionId, String user, - String password, @SuppressWarnings("rawtypes") Map clientContext, - String clientPrincipal) throws HookException { + public boolean canOpenSession(String sessionId, String user, String password, + @SuppressWarnings("rawtypes") Map clientContext, String clientPrincipal) + throws HookException { return true; } @@ -44,16 +44,14 @@ public boolean canOpenSession(String sessionId, String user, * This implementation is void. */ @Override - public void onSessionClose(String sessionId) { - } + public void onSessionClose(String sessionId) {} /** - * This implementation always return {@code true} + * This implementation always returns {@code true}. */ @Override - public boolean canConnect(String sessionId, String clientId, - String brokerAddress, - MqttConnectOptions connectOptions) throws HookException { + public boolean canConnect(String sessionId, String clientId, String brokerAddress, + MqttConnectOptions connectOptions) throws HookException { return true; } @@ -62,28 +60,26 @@ public boolean canConnect(String sessionId, String clientId, * This implementation is void. */ @Override - public void onDisconnection(String sessionId, String clientId, - String brokerAddress) { + public void onDisconnection(String sessionId, String clientId, String brokerAddress) { } /** - * This implementation always return {@code true} + * This implementation always returns {@code true}. */ @Override - public boolean canPublish(String sessionId, String clientId, - String brokerAddress, MqttMessage message) throws HookException { + public boolean canPublish(String sessionId, String clientId, String brokerAddress, + MqttMessage message) throws HookException { return true; } /** - * This implementation always return {@code true} + * This implementation always returns {@code true}. */ @Override - public boolean canSubscribe(String sessionId, String clientId, - String brokerAddress, - MqttSubscription subscription) throws HookException { + public boolean canSubscribe(String sessionId, String clientId, String brokerAddress, + MqttSubscription subscription) throws HookException { return true; } @@ -92,8 +88,7 @@ public boolean canSubscribe(String sessionId, String clientId, * This implementation is void. */ @Override - public void onUnsubscribe(String sessionId, String clientId, - String brokerAddress, String topicFilter) { - } + public void onUnsubscribe(String sessionId, String clientId, String brokerAddress, + String topicFilter) {} }