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 Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description @NotNull TagResolver
build()
Create a placeholder resolver based on the input.default @NotNull TagResolver.Builder
caching(TagResolver.WithoutArguments dynamic)
Add a resolver that dynamically queries and caches based on the provided function.@NotNull TagResolver.Builder
resolver(@NotNull TagResolver resolver)
Add a placeholder resolver to those queried by the result of this builder.@NotNull TagResolver.Builder
resolvers(@NotNull Iterable<? extends TagResolver> resolvers)
Add placeholder resolvers to those queried by the result of this builder.@NotNull TagResolver.Builder
resolvers(@NotNull TagResolver @NotNull ... resolvers)
Add placeholder resolvers to those queried by the result of this builder.default @NotNull TagResolver.Builder
tag(@NotNull String name, @NotNull BiFunction<ArgumentQueue,Context,Tag> handler)
Add a single dynamically created tag to this resolver.@NotNull TagResolver.Builder
tag(@NotNull String name, @NotNull Tag tag)
Add a single tag to this resolver.default @NotNull TagResolver.Builder
tag(@NotNull Set<String> names, @NotNull BiFunction<ArgumentQueue,Context,Tag> handler)
Add a single dynamically created tag to this resolver.
-
-
-
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 identifiertag
- 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 tohandler
- the tag handler, may throwParsingException
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 tohandler
- the tag handler, may throwParsingException
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
-
-