public class WebhookMessage extends Object implements Comparable<WebhookMessage>
Modifier and Type | Class and Description |
---|---|
static class |
WebhookMessage.WebhookMessageType |
Modifier and Type | Field and Description |
---|---|
protected Player |
concerned |
protected long |
date |
protected WebhookMessage.WebhookMessageType |
messageType |
protected Object[] |
placeholders |
protected String |
sender |
Constructor and Description |
---|
WebhookMessage(WebhookMessage.WebhookMessageType messageType,
Player concerned,
String sender,
long date,
Object... placeholders) |
Modifier and Type | Method and Description |
---|---|
String |
applyPlaceHolders(String message)
Apply all placeholders available for this message
|
boolean |
canBeSend(@Nullable Configuration config) |
boolean |
canCombine()
Know if this type of webhook message can be combined.
|
@Nullable WebhookMessage |
combine(WebhookMessage msg)
Combine actual message instance with given one
|
int |
compareTo(WebhookMessage o) |
Player |
getConcerned()
The concerned player of the message
|
long |
getDate() |
WebhookMessage.WebhookMessageType |
getMessageType()
Get the message type which correspond to the source of it
|
Object[] |
getPlaceholders()
Get all messages placeholders
|
String |
getSender()
The sender of this message
|
protected final WebhookMessage.WebhookMessageType messageType
protected final String sender
protected final Player concerned
protected final Object[] placeholders
protected final long date
public WebhookMessage(WebhookMessage.WebhookMessageType messageType, Player concerned, String sender, long date, Object... placeholders)
public WebhookMessage.WebhookMessageType getMessageType()
public String getSender()
public Player getConcerned()
public Object[] getPlaceholders()
public long getDate()
public String applyPlaceHolders(String message)
message
- the raw messagepublic @Nullable WebhookMessage combine(WebhookMessage msg)
msg
- the message to addpublic boolean canCombine()
public boolean canBeSend(@Nullable Configuration config)
public int compareTo(WebhookMessage o)
compareTo
in interface Comparable<WebhookMessage>