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 Object
A builder for StorageFetcher class.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StorageFetcher
build()
Builds the fetcher with the options specified.StorageFetcher.Builder
setHeaders(@NotNull Map<String,String> headers)
Sets the headers to be used when fetching items.StorageFetcher.Builder
setValidator(@NotNull Validator validator)
Sets the Validator to be used.StorageFetcher.Builder
setValidator(@NotNull Validator... validators)
Sets the multiple validators to be used.
-
-
-
Method Detail
-
setHeaders
public StorageFetcher.Builder setHeaders(@NotNull @NotNull Map<String,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.
-
-