Package ai.preferred.venom.fetcher
Class StorageFetcher.Builder
- java.lang.Object
-
- ai.preferred.venom.fetcher.StorageFetcher.Builder
-
- Enclosing class:
- StorageFetcher
public static final class StorageFetcher.Builder extends java.lang.ObjectA builder for StorageFetcher class.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StorageFetcherbuild()Builds the fetcher with the options specified.StorageFetcher.BuildersetHeaders(@NotNull java.util.Map<java.lang.String,java.lang.String> headers)Sets the headers to be used when fetching items.StorageFetcher.BuildersetValidator(@NotNull Validator validator)Sets the Validator to be used.StorageFetcher.BuildersetValidator(@NotNull Validator... validators)Sets the multiple validators to be used.
-
-
-
Method Detail
-
setHeaders
public StorageFetcher.Builder setHeaders(@NotNull @NotNull java.util.Map<java.lang.String,java.lang.String> headers)
Sets the headers to be used when fetching items. Defaults to none.- Parameters:
headers- a map to headers to be used.- Returns:
- this
-
setValidator
public StorageFetcher.Builder setValidator(@NotNull @NotNull Validator validator)
Sets the Validator to be used. Defaults to StatusOkValidator and EmptyContentValidator.This will validate the fetched page and retry if page is not consistent with the specification set by the validator.
- Parameters:
validator- validator to be used.- Returns:
- this
-
setValidator
public StorageFetcher.Builder setValidator(@NotNull @NotNull Validator... validators)
Sets the multiple validators to be used. Defaults to StatusOkValidator and EmptyContentValidator.This will validate the fetched page and retry if page is not consistent with the specification set by the validator.
- Parameters:
validators- validator to be used.- Returns:
- this
-
build
public StorageFetcher build()
Builds the fetcher with the options specified.- Returns:
- an instance of Fetcher.
-
-