Interface TagResolver.Builder

  • Enclosing interface:
    TagResolver

    public static interface TagResolver.Builder
    A builder to gradually construct tag resolvers.

    Entries added later will take priority over entries added earlier.

    Since:
    4.10.0
    • Method Detail

      • tag

        @NotNull
        @NotNull TagResolver.Builder tag​(@NotNull
                                         @NotNull String name,
                                         @NotNull
                                         @NotNull Tag tag)
        Add a single tag to this resolver.
        Parameters:
        name - the tag identifier
        tag - the tag logic
        Returns:
        this builder
        Since:
        4.10.0
      • tag

        @NotNull
        default @NotNull TagResolver.Builder tag​(@NotNull
                                                 @NotNull String name,
                                                 @NotNull
                                                 @NotNull BiFunction<ArgumentQueue,​Context,​Tag> handler)
        Add a single dynamically created tag to this resolver.
        Parameters:
        name - the name to respond to
        handler - the tag handler, may throw ParsingException if provided arguments are in an invalid format
        Returns:
        this builder
        Since:
        4.10.0
      • tag

        @NotNull
        default @NotNull TagResolver.Builder tag​(@NotNull
                                                 @NotNull Set<String> names,
                                                 @NotNull
                                                 @NotNull BiFunction<ArgumentQueue,​Context,​Tag> handler)
        Add a single dynamically created tag to this resolver.
        Parameters:
        names - the names to respond to
        handler - the tag handler, may throw ParsingException if provided arguments are in an invalid format
        Returns:
        this builder
        Since:
        4.10.0
      • resolver

        @NotNull
        @NotNull TagResolver.Builder resolver​(@NotNull
                                              @NotNull TagResolver resolver)
        Add a placeholder resolver to those queried by the result of this builder.
        Parameters:
        resolver - the resolver to add
        Returns:
        this builder
        Since:
        4.10.0
      • resolvers

        @NotNull
        @NotNull TagResolver.Builder resolvers​(@NotNull
                                               @NotNull TagResolver @NotNull ... resolvers)
        Add placeholder resolvers to those queried by the result of this builder.
        Parameters:
        resolvers - the resolvers to add
        Returns:
        this builder
        Since:
        4.10.0
      • resolvers

        @NotNull
        @NotNull TagResolver.Builder resolvers​(@NotNull
                                               @NotNull Iterable<? extends TagResolver> resolvers)
        Add placeholder resolvers to those queried by the result of this builder.
        Parameters:
        resolvers - the resolvers to add
        Returns:
        this builder
        Since:
        4.10.0
      • caching

        @NotNull
        default @NotNull TagResolver.Builder caching​(@NotNull
                                                     TagResolver.WithoutArguments dynamic)
        Add a resolver that dynamically queries and caches based on the provided function.
        Parameters:
        dynamic - the function to query for replacements
        Returns:
        this builder
        Since:
        4.10.0
      • build

        @NotNull
        @NotNull TagResolver build()
        Create a placeholder resolver based on the input.

        If no elements are added, this may return an empty resolver.

        Returns:
        the resolver
        Since:
        4.10.0