Class ContentReplacer<RECEIVER>

  • All Implemented Interfaces:
    java.lang.Comparable<ContentReplacer<RECEIVER>>
    Direct Known Subclasses:
    ParamReplacer

    public abstract class ContentReplacer<RECEIVER>
    extends java.lang.Object
    implements java.lang.Comparable<ContentReplacer<RECEIVER>>
    • Field Detail

      • priority

        protected final int priority
      • pattern

        @NotNull
        protected @NotNull java.util.regex.Pattern pattern
    • Constructor Detail

      • ContentReplacer

        public ContentReplacer​(int priority,
                               @NotNull
                               @NotNull java.util.regex.Pattern pattern)
    • Method Detail

      • match

        public static <R> ContentReplacer.Builder<R> match​(@NotNull
                                                           @NotNull java.util.regex.Pattern pattern)
      • priority

        public int priority()
      • pattern

        public void pattern​(@NotNull
                            @NotNull java.util.regex.Pattern pattern)
      • matcher

        @NotNull
        public @NotNull java.util.regex.Matcher matcher​(@NotNull
                                                        @NotNull java.lang.String text)
      • replace

        public java.lang.String replace​(@NotNull
                                        @NotNull java.lang.String text,
                                        @Nullable
                                        RECEIVER receiver)
      • get

        @Nullable
        protected abstract @Nullable java.lang.String get​(@Nullable
                                                          RECEIVER receiver,
                                                          @NotNull
                                                          @NotNull java.util.regex.Matcher matcher)
      • compareTo

        public int compareTo​(@NotNull
                             @NotNull ContentReplacer<RECEIVER> o)
        Specified by:
        compareTo in interface java.lang.Comparable<RECEIVER>