Package org.bytemechanics.commons.string
Class SimpleFormat
- java.lang.Object
-
- org.bytemechanics.commons.string.SimpleFormat
-
public final class SimpleFormat extends Object
Helper class for internal use only Please keep in mind that this class can be changed, renamed, deleted or extended without previous advice between fix releases, minor versions or major versions- Since:
- 0.0.1
- Version:
- 1.0.1
- Author:
- Albert Farré Figueras
-
-
Constructor Summary
Constructors Constructor Description SimpleFormat()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static String
format(String _message, Object... _args)
Formatter that replaces _message content '{}' by the giver _args per order.
The method to print the object is by calling object to string and in case the object is null is replaced by the string "null"static Supplier<String>
supplier(String _message, Object... _args)
Supplier that retrieve the message formatted that replaces _message content '{}' by the giver _args per order.
The method to print the object is by calling object to string and in case the object is null is replaced by the string "null"
-
-
-
Method Detail
-
format
public static final String format(String _message, Object... _args)
Formatter that replaces _message content '{}' by the giver _args per order.
The method to print the object is by calling object to string and in case the object is null is replaced by the string "null"- Parameters:
_message
- Message to be replaced_args
- Objects to us by replacement- Returns:
- the _message with the '{}' replaced by the given args or "null"
- Since:
- 0.0.1
-
supplier
public static final Supplier<String> supplier(String _message, Object... _args)
Supplier that retrieve the message formatted that replaces _message content '{}' by the giver _args per order.
The method to print the object is by calling object to string and in case the object is null is replaced by the string "null"- Parameters:
_message
- Message to be replaced_args
- Objects to us by replacement- Returns:
- a supplier that provides the _message with the '{}' replaced by the given args or "null"
- Since:
- 1.1.0
-
-