Class StringUtils
java.lang.Object
com.thanlinardos.spring_enterprise_library.objects.utils.StringUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringformatErrorMessageWithArgs(ErrorCode errorCode, String message, Object[] args) Formats an error message by including the error code and name, along with the provided message and arguments.static StringformatMessageWithArgs(String message, Object... args) Formats a message with the provided arguments if the message contains placeholders.
-
Constructor Details
-
StringUtils
public StringUtils()
-
-
Method Details
-
formatMessageWithArgs
Formats a message with the provided arguments if the message contains placeholders.- Parameters:
message- the message to format.args- the arguments to insert into the message.- Returns:
- the formatted message if placeholders are present and args are provided; otherwise, the original message.
-
formatErrorMessageWithArgs
Formats an error message by including the error code and name, along with the provided message and arguments.- Parameters:
errorCode- the error code to include in the message.message- the base message to format.args- the arguments to insert into the base message.- Returns:
- the formatted error message including the error code, name, and formatted base message.
-