Package com.demonwav.hypo.core
Class HypoContext.Builder
java.lang.Object
com.demonwav.hypo.core.HypoContext.Builder
- Enclosing class:
- HypoContext
Builder class for creating new instances of
HypoContext. Create new instances of this builder with
HypoContext.builder().
This class is structured as the write-only version of HypoContext, which is read-only.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Use the current values of this builder to create a new instance ofHypoContextand return it.Clear the current set of contextproviders.Clear the current set of coreproviders.withConfig(@NotNull HypoConfig config)Set theconfigfor the context to be built.withContextProvider(@NotNull ClassDataProvider provider)Add the givenprovideras a context provider.withContextProviders(@NotNull ClassDataProvider @NotNull ... providers)Add multipleprovidersas context providers.withContextProviders(@NotNull Collection<@NotNull ? extends ClassDataProvider> providers)Add acollectionofprovideras context providers.withProvider(@NotNull ClassDataProvider provider)Add the givenprovideras a core provider to analyze.withProviders(@NotNull ClassDataProvider @NotNull ... providers)Add multipleprovidersas core providers to analyze.withProviders(@NotNull Collection<@NotNull ? extends ClassDataProvider> providers)Add acollectionofprovideras core providers to analyze.
-
Constructor Details
-
Builder
Builder()Constructor forHypoContext.Builder. UseHypoContext.builder()instead.
-
-
Method Details
-
withProvider
@CanIgnoreReturnValue @Contract(value="_ -> this", mutates="this") @NotNull public HypoContext.Builder withProvider(@NotNull @NotNull ClassDataProvider provider)Add the givenprovideras a core provider to analyze.- Parameters:
provider- The provider to add to the set of core providers.- Returns:
thisfor chaining.
-
withProviders
@CanIgnoreReturnValue @Contract(value="_ -> this", mutates="this") @NotNull public HypoContext.Builder withProviders(@NotNull @NotNull ClassDataProvider @NotNull ... providers)Add multipleprovidersas core providers to analyze.- Parameters:
providers- The providers to add to the set of core providers.- Returns:
thisfor chaining.
-
withProviders
@CanIgnoreReturnValue @Contract(value="_ -> this", mutates="this") @NotNull public HypoContext.Builder withProviders(@NotNull @NotNull Collection<@NotNull ? extends ClassDataProvider> providers)Add acollectionofprovideras core providers to analyze.- Parameters:
providers- The providers to add to the set of core providers.- Returns:
thisfor chaining.
-
clearProviders
@CanIgnoreReturnValue @Contract(value="-> this", mutates="this") @NotNull public HypoContext.Builder clearProviders()Clear the current set of coreproviders.- Returns:
thisfor chaining.
-
withContextProvider
@CanIgnoreReturnValue @Contract(value="_ -> this", mutates="this") @NotNull public HypoContext.Builder withContextProvider(@NotNull @NotNull ClassDataProvider provider)Add the givenprovideras a context provider.- Parameters:
provider- The provider to add to the set of context providers.- Returns:
thisfor chaining.
-
withContextProviders
@CanIgnoreReturnValue @Contract(value="_ -> this", mutates="this") @NotNull public HypoContext.Builder withContextProviders(@NotNull @NotNull ClassDataProvider @NotNull ... providers)Add multipleprovidersas context providers.- Parameters:
providers- The providers to add to the set of context providers.- Returns:
thisfor chaining.
-
withContextProviders
@CanIgnoreReturnValue @Contract(value="_ -> this", mutates="this") @NotNull public HypoContext.Builder withContextProviders(@NotNull @NotNull Collection<@NotNull ? extends ClassDataProvider> providers)Add acollectionofprovideras context providers.- Parameters:
providers- The providers to add to the set of context providers.- Returns:
thisfor chaining.
-
clearContextProviders
@CanIgnoreReturnValue @Contract(value="-> this", mutates="this") @NotNull public HypoContext.Builder clearContextProviders()Clear the current set of contextproviders.- Returns:
thisfor chaining.
-
withConfig
@CanIgnoreReturnValue @Contract(value="_ -> this", mutates="this") @NotNull public HypoContext.Builder withConfig(@NotNull @NotNull HypoConfig config)- Parameters:
config- Theconfigto set.- Returns:
thisfor chaining.
-
build
Use the current values of this builder to create a new instance ofHypoContextand return it.- Returns:
- The new instance of
HypoContextusing the values set in this builder.
-