Record Class BaseEventMetadata<L extends LocalizationSetting>

java.lang.Object
java.lang.Record
net.flectone.pulse.model.event.BaseEventMetadata<L>
All Implemented Interfaces:
EventMetadata<L>

public record BaseEventMetadata<L extends LocalizationSetting>(@NonNull UUID uuid, @NonNull FEntity sender, @NonNull Predicate<FPlayer> filter, @NonNull Map<MessageFlag, Boolean> flags, @NonNull BiFunction<FPlayer, L extends LocalizationSetting, String> format, @NonNull Destination destination, @NonNull Range range, @Nullable org.apache.commons.lang3.tuple.Pair<Sound, PermissionSetting> sound, @Nullable String message, @Nullable Function<FPlayer, net.kyori.adventure.text.minimessage.tag.resolver.TagResolver[]> tagResolvers, @Nullable ProxyDataConsumer<SafeDataOutputStream> proxy, @Nullable IntegrationMetadata integrationMetadata, @NonNull List<FPlayer> receivers) extends Record implements EventMetadata<L>
  • Constructor Details

    • BaseEventMetadata

      public BaseEventMetadata(@NonNull UUID uuid, @NonNull FEntity sender, @NonNull Predicate<FPlayer> filter, @NonNull Map<MessageFlag, Boolean> flags, @NonNull BiFunction<FPlayer,L,String> format, @NonNull Destination destination, @NonNull Range range, @Nullable org.apache.commons.lang3.tuple.Pair<Sound, PermissionSetting> sound, @Nullable String message, @Nullable Function<FPlayer, net.kyori.adventure.text.minimessage.tag.resolver.TagResolver[]> tagResolvers, @Nullable ProxyDataConsumer<SafeDataOutputStream> proxy, @Nullable IntegrationMetadata integrationMetadata, @NonNull List<FPlayer> receivers)
      Creates an instance of a BaseEventMetadata record class.
      Parameters:
      uuid - the value for the uuid record component
      sender - the value for the sender record component
      filter - the value for the filter record component
      flags - the value for the flags record component
      format - the value for the format record component
      destination - the value for the destination record component
      range - the value for the range record component
      sound - the value for the sound record component
      message - the value for the message record component
      tagResolvers - the value for the tagResolvers record component
      proxy - the value for the proxy record component
      integrationMetadata - the value for the integrationMetadata record component
      receivers - the value for the receivers record component
  • Method Details

    • base

      public BaseEventMetadata<L> base()
      Specified by:
      base in interface EventMetadata<L extends LocalizationSetting>
    • withBase

      public EventMetadata<L> withBase(BaseEventMetadata<L> baseEventMetadata)
      Specified by:
      withBase in interface EventMetadata<L extends LocalizationSetting>
    • resolveTags

      public @Nullable net.kyori.adventure.text.minimessage.tag.resolver.TagResolver[] resolveTags(FPlayer fPlayer)
      Specified by:
      resolveTags in interface EventMetadata<L extends LocalizationSetting>
    • resolveFormat

      public @NonNull String resolveFormat(FPlayer fPlayer, L localization)
      Specified by:
      resolveFormat in interface EventMetadata<L extends LocalizationSetting>
    • builder

      public static <L extends LocalizationSetting> BaseEventMetadata.BaseEventMetadataBuilder<L> builder()
    • withUuid

      public BaseEventMetadata<L> withUuid(@NonNull UUID uuid)
      Returns:
      a clone of this object, except with this updated property (returns this if an identical value is passed).
    • withSender

      public BaseEventMetadata<L> withSender(@NonNull FEntity sender)
      Returns:
      a clone of this object, except with this updated property (returns this if an identical value is passed).
    • withFilter

      public BaseEventMetadata<L> withFilter(@NonNull Predicate<FPlayer> filter)
      Returns:
      a clone of this object, except with this updated property (returns this if an identical value is passed).
    • withFlags

      public BaseEventMetadata<L> withFlags(@NonNull Map<MessageFlag, Boolean> flags)
      Returns:
      a clone of this object, except with this updated property (returns this if an identical value is passed).
    • withFormat

      public BaseEventMetadata<L> withFormat(@NonNull BiFunction<FPlayer,L,String> format)
      Returns:
      a clone of this object, except with this updated property (returns this if an identical value is passed).
    • withDestination

      public BaseEventMetadata<L> withDestination(@NonNull Destination destination)
      Returns:
      a clone of this object, except with this updated property (returns this if an identical value is passed).
    • withRange

      public BaseEventMetadata<L> withRange(@NonNull Range range)
      Returns:
      a clone of this object, except with this updated property (returns this if an identical value is passed).
    • withSound

      public BaseEventMetadata<L> withSound(@Nullable org.apache.commons.lang3.tuple.Pair<Sound, PermissionSetting> sound)
      Returns:
      a clone of this object, except with this updated property (returns this if an identical value is passed).
    • withMessage

      public BaseEventMetadata<L> withMessage(@Nullable String message)
      Returns:
      a clone of this object, except with this updated property (returns this if an identical value is passed).
    • withTagResolvers

      public BaseEventMetadata<L> withTagResolvers(@Nullable Function<FPlayer, net.kyori.adventure.text.minimessage.tag.resolver.TagResolver[]> tagResolvers)
      Returns:
      a clone of this object, except with this updated property (returns this if an identical value is passed).
    • withProxy

      public BaseEventMetadata<L> withProxy(@Nullable ProxyDataConsumer<SafeDataOutputStream> proxy)
      Returns:
      a clone of this object, except with this updated property (returns this if an identical value is passed).
    • withIntegrationMetadata

      public BaseEventMetadata<L> withIntegrationMetadata(@Nullable IntegrationMetadata integrationMetadata)
      Returns:
      a clone of this object, except with this updated property (returns this if an identical value is passed).
    • withReceivers

      public BaseEventMetadata<L> withReceivers(@NonNull List<FPlayer> receivers)
      Returns:
      a clone of this object, except with this updated property (returns this if an identical value is passed).
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • uuid

      public @NonNull UUID uuid()
      Returns the value of the uuid record component.
      Specified by:
      uuid in interface EventMetadata<L extends LocalizationSetting>
      Returns:
      the value of the uuid record component
    • sender

      public @NonNull FEntity sender()
      Returns the value of the sender record component.
      Specified by:
      sender in interface EventMetadata<L extends LocalizationSetting>
      Returns:
      the value of the sender record component
    • filter

      public @NonNull Predicate<FPlayer> filter()
      Returns the value of the filter record component.
      Specified by:
      filter in interface EventMetadata<L extends LocalizationSetting>
      Returns:
      the value of the filter record component
    • flags

      public @NonNull Map<MessageFlag, Boolean> flags()
      Returns the value of the flags record component.
      Specified by:
      flags in interface EventMetadata<L extends LocalizationSetting>
      Returns:
      the value of the flags record component
    • format

      public @NonNull BiFunction<FPlayer,L,String> format()
      Returns the value of the format record component.
      Specified by:
      format in interface EventMetadata<L extends LocalizationSetting>
      Returns:
      the value of the format record component
    • destination

      public @NonNull Destination destination()
      Returns the value of the destination record component.
      Specified by:
      destination in interface EventMetadata<L extends LocalizationSetting>
      Returns:
      the value of the destination record component
    • range

      public @NonNull Range range()
      Returns the value of the range record component.
      Specified by:
      range in interface EventMetadata<L extends LocalizationSetting>
      Returns:
      the value of the range record component
    • sound

      public @Nullable org.apache.commons.lang3.tuple.Pair<Sound, PermissionSetting> sound()
      Returns the value of the sound record component.
      Specified by:
      sound in interface EventMetadata<L extends LocalizationSetting>
      Returns:
      the value of the sound record component
    • message

      public @Nullable String message()
      Returns the value of the message record component.
      Specified by:
      message in interface EventMetadata<L extends LocalizationSetting>
      Returns:
      the value of the message record component
    • tagResolvers

      public @Nullable Function<FPlayer, net.kyori.adventure.text.minimessage.tag.resolver.TagResolver[]> tagResolvers()
      Returns the value of the tagResolvers record component.
      Specified by:
      tagResolvers in interface EventMetadata<L extends LocalizationSetting>
      Returns:
      the value of the tagResolvers record component
    • proxy

      public @Nullable ProxyDataConsumer<SafeDataOutputStream> proxy()
      Returns the value of the proxy record component.
      Specified by:
      proxy in interface EventMetadata<L extends LocalizationSetting>
      Returns:
      the value of the proxy record component
    • integrationMetadata

      public @Nullable IntegrationMetadata integrationMetadata()
      Returns the value of the integrationMetadata record component.
      Specified by:
      integrationMetadata in interface EventMetadata<L extends LocalizationSetting>
      Returns:
      the value of the integrationMetadata record component
    • receivers

      public @NonNull List<FPlayer> receivers()
      Returns the value of the receivers record component.
      Specified by:
      receivers in interface EventMetadata<L extends LocalizationSetting>
      Returns:
      the value of the receivers record component