Interface UrlGenerationContext.Builder
- Enclosing interface:
- UrlGenerationContext
@NonExtendable
public static interface UrlGenerationContext.Builder
Builder for an
UrlGenerationContext.- Since:
- 5.2.200303
-
Method Summary
Modifier and TypeMethodDescription@NotNull UrlGenerationContext.BuilderConfigures an attribute to be available in the generation context.@NotNull UrlGenerationContextcreate()Creates a newUrlGenerationContextinstance based on the given configuration.@NotNull UrlGenerationContext.Builderfrom(@NotNull GenerationContext context) TheGenerationContextto extract the context information from, which consists of: TheUrlCreatorconfigured in the given generation context TheUrlCreatorProvideravailable in the given generation context The contextualLanguageWhether or not the release version is used@NotNull UrlGenerationContext.Builderfrom(@NotNull JsonGenerationContext context) TheJsonGenerationContextto extract the context information from, which consists of: TheUrlCreatorconfigured in the generation context TheUrlCreatorProvideravailable in the generation context The contextualLanguageWhether or not the release version is used The current attributes available in the given JSON generation context@NotNull UrlGenerationContext.BuilderConfigures the contextualLanguagewhen requesting the URL.@NotNull UrlGenerationContext.Builderrelease(boolean release) Indicates whether or not the URL is requested in the context of a release version.@NotNull UrlGenerationContext.BuilderurlCreator(@Nullable UrlCreator urlCreator) Configures the url creator to be used in the current generation context.@NotNull UrlGenerationContext.BuilderurlCreatorProvider(@Nullable UrlCreatorProvider urlCreatorProvider) Configures the provider of url creators in the current generation context.
-
Method Details
-
from
TheGenerationContextto extract the context information from, which consists of:- The
UrlCreatorconfigured in the given generation context - The
UrlCreatorProvideravailable in the given generation context - The contextual
Language - Whether or not the release version is used
- Parameters:
context- TheGenerationContextin which the URLs will be requested.- Returns:
- This builder instance.
- Since:
- 5.2.200303
- The
-
from
@NotNull @NotNull UrlGenerationContext.Builder from(@NotNull @NotNull JsonGenerationContext context) TheJsonGenerationContextto extract the context information from, which consists of:- The
UrlCreatorconfigured in the generation context - The
UrlCreatorProvideravailable in the generation context - The contextual
Language - Whether or not the release version is used
- The current attributes available in the given JSON generation context
- Parameters:
context- TheJsonGenerationContextin which the URLs will be requested.- Returns:
- This builder instance.
- Since:
- 5.2.200303
- The
-
urlCreator
@NotNull @NotNull UrlGenerationContext.Builder urlCreator(@Nullable @Nullable UrlCreator urlCreator) Configures the url creator to be used in the current generation context.- Parameters:
urlCreator- The url creator to be used.- Returns:
- This builder instance.
- Since:
- 5.2.200303
- See Also:
-
urlCreatorProvider
@NotNull @NotNull UrlGenerationContext.Builder urlCreatorProvider(@Nullable @Nullable UrlCreatorProvider urlCreatorProvider) Configures the provider of url creators in the current generation context. The givenUrlCreatorProviderwill also be used to provider theUrlCreatorand release version flag if necessary.- Parameters:
urlCreatorProvider- The url creator provider to be used.- Returns:
- This builder instance.
- Since:
- 5.2.200303
- See Also:
-
attribute
@NotNull @NotNull UrlGenerationContext.Builder attribute(@NotNull @NotNull String name, @Nullable @Nullable Object value) Configures an attribute to be available in the generation context.- Parameters:
name- the name of the attribute.value- the value of the attribute.- Returns:
- This builder instance.
- Since:
- 5.2.200303
- See Also:
-
release
Indicates whether or not the URL is requested in the context of a release version.- Parameters:
release-truethis context is based on a release version- Returns:
- This builder instance.
- Since:
- 5.2.200303
- See Also:
-
language
Configures the contextualLanguagewhen requesting the URL.- Parameters:
language- The contextualLanguage.- Returns:
- This builder instance.
- Since:
- 5.2.200303
- See Also:
-
create
Creates a newUrlGenerationContextinstance based on the given configuration.- Returns:
- The new context instance.
- Since:
- 5.2.200303
-