Class ConfiguredText<MSG,​RECEIVER>

  • Type Parameters:
    MSG - The type of the message
    RECEIVER - The type of the receiver

    public class ConfiguredText<MSG,​RECEIVER>
    extends ConfiguredValue<TextContents>
    • Field Detail

      • parser

        @NotNull
        protected final @NotNull java.util.function.BiFunction<RECEIVER,​java.lang.String,​java.lang.String> parser
      • compiler

        @NotNull
        protected final @NotNull java.util.function.BiFunction<RECEIVER,​java.lang.String,​MSG> compiler
      • dispatcher

        @NotNull
        protected final @NotNull java.util.function.BiConsumer<RECEIVER,​java.util.List<MSG>> dispatcher
      • params

        @NotNull
        protected final @NotNull java.lang.String[] params
    • Constructor Detail

      • ConfiguredText

        public ConfiguredText​(@NotNull
                              @NotNull ValueManifest<TextContents,​TextContents> manifest,
                              @NotNull
                              @NotNull java.util.function.BiFunction<RECEIVER,​java.lang.String,​java.lang.String> parser,
                              @NotNull
                              @NotNull java.util.function.BiFunction<RECEIVER,​java.lang.String,​MSG> compiler,
                              @NotNull
                              @NotNull java.util.function.BiConsumer<RECEIVER,​java.util.List<MSG>> dispatcher,
                              @NotNull
                              @NotNull java.lang.String[] params)
    • Method Detail

      • parse

        public java.util.List<java.lang.String> parse​(@Nullable
                                                      RECEIVER receiver,
                                                      @NotNull
                                                      @NotNull java.lang.Object... values)
        Parse the message for the receiver.
        Parameters:
        receiver - The receiver of the message.
        values - The values to replace the params.
        Returns:
        The parsed message.
      • parseLine

        public java.lang.String parseLine​(@Nullable
                                          RECEIVER receiver,
                                          @NotNull
                                          @NotNull java.lang.Object... values)
        Parse the message for the receiver and send it.
        Parameters:
        receiver - The receiver of the message.
        values - The values to replace the params.
        Returns:
        The parsed message.
      • compile

        public java.util.List<MSG> compile​(@Nullable
                                           RECEIVER receiver,
                                           @NotNull
                                           @NotNull java.lang.Object... values)
        Compile the message for the receiver.
        Parameters:
        receiver - The receiver of the message.
        values - The values to replace the params.
        Returns:
        The compiled message.
      • compileLine

        public MSG compileLine​(@Nullable
                               RECEIVER receiver,
                               @NotNull
                               @NotNull java.lang.Object... values)
        Compile the message for the receiver and send it.
        Parameters:
        receiver - The receiver of the message.
        values - The values to replace the params.
        Returns:
        The compiled message.
      • sendTo

        public void sendTo​(@NotNull
                           RECEIVER receiver,
                           @NotNull
                           @NotNull java.lang.Object... values)
        Send the message to the receiver.
        Parameters:
        receiver - The receiver of the message.
        values - The values to replace the params.
      • sendToAll

        public void sendToAll​(@NotNull
                              @NotNull java.lang.Iterable<? extends RECEIVER> receivers,
                              @NotNull
                              @NotNull java.lang.Object... values)
        Send the message to the multiple receivers.
        Parameters:
        receivers - The receivers of the message.
        values - The values to replace the params.