public interface MessengerFormatter
| Modifier and Type | Method and Description |
|---|---|
MessengerFormatter |
fork()
Clone formatter into a new instance
|
String |
format(String message,
Collection<Object> context)
Format message using registered placeholders and with provided data
|
Messenger |
getMessenger()
Get
Messenger |
<T> MessengerTypeFormatter<T> |
getTypeFormatter(Class<T> type)
Register group of placeholders associated with the specified type
|
<T> MessengerFormatter |
register(String placeholder,
@Nullable Class<T> requiredData,
FormatterFunction<?> replacementFunction)
Register a new placeholder
|
String format(String message, Collection<Object> context)
message - the message to formatcontext - the values to use as data for placeholders<T> MessengerFormatter register(String placeholder, @Nullable @Nullable Class<T> requiredData, FormatterFunction<?> replacementFunction)
T - type of required dataplaceholder - the name of the placeholderrequiredData - the required type of data to use that placeholder (if null, it means that placeholder does not require provided context)replacementFunction - the value to replace with<T> MessengerTypeFormatter<T> getTypeFormatter(Class<T> type)
T - typetype - the type of the groupMessengerFormatter fork()
Copyright © 2020. All rights reserved.