Various code simplification/fixes and a lot of typo/grammar fixes (may brake some stuff)

This commit is contained in:
2023-06-20 00:15:46 +02:00
parent c984b63cee
commit 5edd8cdfec
151 changed files with 909 additions and 983 deletions

View File

@@ -123,7 +123,7 @@ public interface AbstractWS {
* {@link PayloadRegistry#arbitraryToString(String, Object, boolean)}.
* @param type the type.
* @param obj the object to Jsonify.
* @param serializeNulls if null propreties must be included in the json object.
* @param serializeNulls if null properties must be included in the json object.
* @throws IOException if an IO error occurs when sending the data.
* @throws JsonParseException if the json is invalid.
* @see PayloadRegistry#arbitraryToString(String, Object, boolean)
@@ -137,7 +137,7 @@ public interface AbstractWS {
* {@link PayloadRegistry#arbitraryToString(String, Object, boolean)}.
* @param type the type.
* @param obj the object to Jsonify.
* @param serializeNulls if null propreties must be included in the json object.
* @param serializeNulls if null properties must be included in the json object.
* @return true if the data is sent successfully, false if an IO error occurs.
* @see PayloadRegistry#arbitraryToString(String, Object, boolean)
*/
@@ -225,7 +225,7 @@ public interface AbstractWS {
* Utility method to wrap sending operation into a try-catch.
* @param run the sending operation that may throw an {@link IOException}.
* @param errorMessage the error message to log if the runnable throws an {@link IOException}.
* @return true if the data if the runnable is executed successfully, false if an IO error occurs.
* @return true if the runnable is executed successfully, false if an IO error occurs.
*/
default boolean trySend(RunnableException<IOException> run, String errorMessage) {
try {
@@ -244,7 +244,7 @@ public interface AbstractWS {
*/
/**
* Logs the provided message with logger level {@link Level#INFO}, prefixed with infos avout this web-socket.
* Logs the provided message with logger level {@link Level#INFO}, prefixed with infos about this web-socket.
* @param message the message to log.
*/
default void log(String message) {
@@ -252,7 +252,7 @@ public interface AbstractWS {
}
/**
* Logs the provided message with logger level {@link Level#SEVERE}, prefixed with infos avout this web-socket.
* Logs the provided message with logger level {@link Level#SEVERE}, prefixed with infos about this web-socket.
* @param message the message to log.
*/
default void logError(String message) {
@@ -260,7 +260,7 @@ public interface AbstractWS {
}
/**
* Logs the provided message and {@link Throwable} with logger level {@link Level#SEVERE}, prefixed with infos avout this web-socket.
* Logs the provided message and {@link Throwable} with logger level {@link Level#SEVERE}, prefixed with infos about this web-socket.
* @param message the message to log.
* @param t the throwable to log.
*/
@@ -269,7 +269,8 @@ public interface AbstractWS {
}
/**
* Gets an identifier for this web-socket, used for logging. May be the remote IP:port or URI.
* Gets an identifier for this web-socket, used for logging.
* It may be the remote IP:port or URI.
* @return an identifier for this web-socket.
*/
String getRemoteIdentifier();

View File

@@ -83,7 +83,7 @@ public class PayloadRegistry {
* to a Json string.
* @param type the type
* @param obj the object to Jsonify
* @param serializeNulls if null propreties must be included in the json object.
* @param serializeNulls if null properties must be included in the json object.
* @return the String to send through the websocket
* @throws JsonParseException if the json is invalid.
*/

View File

@@ -1,7 +1,7 @@
package fr.pandacube.lib.ws.payloads;
/**
* Payload used by the client to login to key-protected websocket endpoint.
* Payload used by the client to log in to key-protected websocket endpoint.
*/
public class LoginPayload extends Payload {
/**

View File

@@ -1,7 +1,7 @@
package fr.pandacube.lib.ws.payloads;
/**
* Payload used by the server in inform the client the login was successfull.
* Payload used by the server in inform the client the login was successful.
*/
public class LoginSucceedPayload extends Payload {
}

View File

@@ -10,7 +10,7 @@ public class MessagePayload extends Payload {
public String message;
/**
* Initialite a new MessagePayload with the provided message.
* Initialize a new MessagePayload with the provided message.
* @param message the message.
*/
public MessagePayload(String message) {