Class EventMetadata.Builder
java.lang.Object
net.flectone.pulse.model.event.EventMetadata.Builder
- Enclosing interface:
EventMetadata
Collects the metadata pieces. Receiver filters stack, so each call narrows the audience further.
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds the metadata.destination(Destination destination) Sets where the message is drawn.filter(Collection<FPlayer> fReceivers) Narrows delivery to the given players.Narrows delivery further.Narrows delivery to a single player.Mirrors the message to the chat integrations using the default format.integration(Supplier<IntegrationMessageFormat> integration) Mirrors the message to the chat integrations using the supplied format.messageContext(Function<FPlayer, MessageContext> messageContext) Sets how the message context is built for each receiver.proxy()Sends the message across the proxy with no extra payload.proxy(ProxyDataConsumer<DataOutputStream> proxy) Sends the message across the proxy, writing the given extra payload.Sets the range.range(@NonNull Range.Type type) Sets the range to one of the named scopes.sound(Pair<Sound, PermissionSetting> sound) Sets the sound played with the message and the permission needed to hear it.
-
Method Details
-
messageContext
Sets how the message context is built for each receiver. Required.- Parameters:
messageContext- builds the context for a given receiver- Returns:
- this builder
-
filter
Narrows delivery to a single player.- Parameters:
fReceiver- the only receiver- Returns:
- this builder
-
filter
Narrows delivery to the given players.- Parameters:
fReceivers- the receivers- Returns:
- this builder
-
filter
Narrows delivery further. The new condition is combined with the existing one.- Parameters:
filter- the extra condition a receiver must satisfy- Returns:
- this builder
-
destination
Sets where the message is drawn. Defaults to chat.- Parameters:
destination- the destination- Returns:
- this builder
-
range
Sets the range to one of the named scopes.- Parameters:
type- the scope- Returns:
- this builder
-
range
Sets the range. Defaults to the sender only.- Parameters:
range- the range- Returns:
- this builder
-
sound
Sets the sound played with the message and the permission needed to hear it.- Parameters:
sound- the sound and its permission- Returns:
- this builder
-
proxy
Sends the message across the proxy, writing the given extra payload.- Parameters:
proxy- writes the extra payload- Returns:
- this builder
-
proxy
Sends the message across the proxy with no extra payload.- Returns:
- this builder
-
integration
Mirrors the message to the chat integrations using the supplied format.- Parameters:
integration- supplies the format- Returns:
- this builder
-
integration
Mirrors the message to the chat integrations using the default format.- Returns:
- this builder
-
build
Builds the metadata.- Returns:
- the built metadata
- Throws:
NullPointerException- if no message context was set
-