Record Class EventMetadataImpl
java.lang.Object
java.lang.Record
net.flectone.pulse.model.event.EventMetadataImpl
- Record Components:
filter- decides which players receive the messagedestination- where the message is drawnrange- how far it travelssound- the sound and the permission to hear it, or nullmessageContext- builds the context for a given receiverproxy- writes the extra proxy payload, or nullintegration- supplies the mirroring format, or null
- All Implemented Interfaces:
EventMetadata
public record EventMetadataImpl(@NonNull Predicate<FPlayer> filter, @NonNull Destination destination, @NonNull Range range, @Nullable Pair<Sound, PermissionSetting> sound, @NonNull Function<FPlayer, MessageContext> messageContext, @Nullable ProxyDataConsumer<DataOutputStream> proxy, @Nullable Supplier<IntegrationMessageFormat> integration)
extends Record
implements EventMetadata
The plain event metadata every builder produces.
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface EventMetadata
EventMetadata.Builder -
Constructor Summary
ConstructorsConstructorDescriptionEventMetadataImpl(@NonNull Predicate<FPlayer> filter, @NonNull Destination destination, @NonNull Range range, @Nullable Pair<Sound, PermissionSetting> sound, @NonNull Function<FPlayer, MessageContext> messageContext, @Nullable ProxyDataConsumer<DataOutputStream> proxy, @Nullable Supplier<IntegrationMessageFormat> integration) Creates an instance of aEventMetadataImplrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbase()The underlying metadata this instance delegates to.builder()@NonNull DestinationReturns the value of thedestinationrecord component.final booleanIndicates whether some other object is "equal to" this one.filter()Returns the value of thefilterrecord component.final inthashCode()Returns a hash code value for this object.@Nullable Supplier<IntegrationMessageFormat> Returns the value of theintegrationrecord component.@NonNull Function<FPlayer, MessageContext> Returns the value of themessageContextrecord component.@Nullable ProxyDataConsumer<DataOutputStream> proxy()Returns the value of theproxyrecord component.@NonNull Rangerange()Returns the value of therangerecord component.@NonNull MessageContextresolveMessageContext(FPlayer fPlayer) Builds the message context for one receiver, so each player can get their own wording.@Nullable Pair<Sound, PermissionSetting> sound()Returns the value of thesoundrecord component.final StringtoString()Returns a string representation of this record class.withDestination(@NonNull Destination destination) withFilter(@NonNull Predicate<FPlayer> filter) withIntegration(@Nullable Supplier<IntegrationMessageFormat> integration) withMessageContext(@NonNull Function<FPlayer, MessageContext> messageContext) withProxy(@Nullable ProxyDataConsumer<DataOutputStream> proxy) withSound(@Nullable Pair<Sound, PermissionSetting> sound) Methods inherited from interface EventMetadata
resolveIntegrationMessageFormat
-
Constructor Details
-
EventMetadataImpl
public EventMetadataImpl(@NonNull Predicate<FPlayer> filter, @NonNull Destination destination, @NonNull Range range, @Nullable Pair<Sound, PermissionSetting> sound, @NonNull Function<FPlayer, MessageContext> messageContext, @Nullable ProxyDataConsumer<DataOutputStream> proxy, @Nullable Supplier<IntegrationMessageFormat> integration) Creates an instance of aEventMetadataImplrecord class.- Parameters:
filter- the value for thefilterrecord componentdestination- the value for thedestinationrecord componentrange- the value for therangerecord componentsound- the value for thesoundrecord componentmessageContext- the value for themessageContextrecord componentproxy- the value for theproxyrecord componentintegration- the value for theintegrationrecord component
-
-
Method Details
-
base
Description copied from interface:EventMetadataThe underlying metadata this instance delegates to.- Specified by:
basein interfaceEventMetadata- Returns:
- the base metadata
-
resolveMessageContext
Description copied from interface:EventMetadataBuilds the message context for one receiver, so each player can get their own wording.- Specified by:
resolveMessageContextin interfaceEventMetadata- Parameters:
fPlayer- the receiving player- Returns:
- the context for that player
-
builder
-
withFilter
- Returns:
- a clone of this object, except with this updated property (returns
thisif an identical value is passed).
-
withDestination
- Returns:
- a clone of this object, except with this updated property (returns
thisif an identical value is passed).
-
withRange
- Returns:
- a clone of this object, except with this updated property (returns
thisif an identical value is passed).
-
withSound
- Returns:
- a clone of this object, except with this updated property (returns
thisif an identical value is passed).
-
withMessageContext
public EventMetadataImpl withMessageContext(@NonNull Function<FPlayer, MessageContext> messageContext) - Returns:
- a clone of this object, except with this updated property (returns
thisif an identical value is passed).
-
withProxy
- Returns:
- a clone of this object, except with this updated property (returns
thisif an identical value is passed).
-
withIntegration
- Returns:
- a clone of this object, except with this updated property (returns
thisif an identical value is passed).
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
filter
-
destination
Returns the value of thedestinationrecord component.- Specified by:
destinationin interfaceEventMetadata- Returns:
- the value of the
destinationrecord component
-
range
Returns the value of therangerecord component.- Specified by:
rangein interfaceEventMetadata- Returns:
- the value of the
rangerecord component
-
sound
Returns the value of thesoundrecord component.- Specified by:
soundin interfaceEventMetadata- Returns:
- the value of the
soundrecord component
-
messageContext
Returns the value of themessageContextrecord component.- Returns:
- the value of the
messageContextrecord component
-
proxy
Returns the value of theproxyrecord component.- Specified by:
proxyin interfaceEventMetadata- Returns:
- the value of the
proxyrecord component
-
integration
Returns the value of theintegrationrecord component.- Specified by:
integrationin interfaceEventMetadata- Returns:
- the value of the
integrationrecord component
-