Package net.ygbstudio.jbrave.core.model
Enum Class SearchOptions
- All Implemented Interfaces:
Serializable,Comparable<SearchOptions>,Constable,BraveAPIConstant,ClientProvidedOption,SearchOption
Enumeration of the search options available in the Brave API.
These options can be used to modify the behavior of the API requests.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescription -
Field Summary
Fields inherited from interface net.ygbstudio.jbrave.core.domain.BraveAPIConstant
SEARCH_API_BASE -
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull BraveSearchOption<Integer> count(int count) Create a new instance ofBraveSearchOptionwithCOUNTand the given value.static @NotNull BraveSearchOption<Boolean> enableRichCallback(boolean enableRichCallback) Creates a new instance ofBraveSearchOptionwithENABLE_RICH_CALLBACKand the given value.static @NotNull BraveSearchOption<Boolean> extraSnippets(boolean extraSnippets) Create a new instance ofBraveSearchOptionwithEXTRA_SNIPPETSand the given value.static @NotNull BraveSearchOption<String> Creates a new instance ofBraveSearchOptionwithGOGGLESand the given value.static @NotNull BraveSearchOption<Boolean> includeFetchMetadata(boolean includeFetchMetadata) Creates a new instance ofBraveSearchOptionwithINCLUDE_FETCH_METADATAand the given value.static @NotNull BraveSearchOption<Integer> offset(int offset) Create a new instance ofBraveSearchOptionwithOFFSETand the given value.static @NotNull BraveSearchOption<Boolean> operators(boolean operators) Create a new instance ofBraveSearchOptionwithOPERATORSand the given value.static @NotNull BraveSearchOption<Boolean> rich(boolean rich) Creates a new instance ofBraveSearchOptionwithRICHand the given value.static @NotNull BraveSearchOption<Boolean> spellCheck(boolean spellCheck) Create a new instance ofBraveSearchOptionwithSPELLCHECKand the given value.static @NotNull BraveSearchOption<Boolean> summary(boolean summary) Create a new instance ofBraveSearchOptionwithSUMMARYand the given value.static @NotNull BraveSearchOption<Boolean> textDecorations(boolean textDecorations) Create a new instance ofBraveSearchOptionwithTEXT_DECORATIONSand the given value.@NotNull StringurlParam()Returns the URL parameter associated with this constant.value()Returns the value of the constant.static SearchOptionsReturns the enum constant of this class with the specified name.static SearchOptions[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
COUNT
-
OFFSET
-
TEXT_DECORATIONS
-
SPELLCHECK
-
EXTRA_SNIPPETS
-
ENABLE_RICH_CALLBACK
-
SUMMARY
-
OPERATORS
-
GOGGLES
-
RICH
-
INCLUDE_FETCH_METADATA
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
value
Description copied from interface:BraveAPIConstantReturns the value of the constant. Must be implemented by the enum constants.- Specified by:
valuein interfaceBraveAPIConstant- Returns:
- the value of the constant
-
urlParam
Description copied from interface:BraveAPIConstantReturns the URL parameter associated with this constant. It can be implemented by default at the interface level with the value of the parameter.This method is used to generate the URL parameter for the API requests and represents a unit of
option/parameterName/parameterConstant + "=" + parameterValue.A
parameterValuemay be provided by the API or require that the client provides it. By default, all options/parameters names are provided by the API.- Specified by:
urlParamin interfaceBraveAPIConstant- Returns:
- the URL parameter associated with this constant
- See Also:
-
count
Create a new instance ofBraveSearchOptionwithCOUNTand the given value.- Parameters:
count- the value forCOUNT- Returns:
- a new instance of
BraveSearchOption - Throws:
IllegalArgumentException- if the specified count is less than one.
-
offset
Create a new instance ofBraveSearchOptionwithOFFSETand the given value.- Parameters:
offset- the value forOFFSET- Returns:
- a new instance of
BraveSearchOption - Throws:
IllegalArgumentException- if specified offset is less than zero.
-
textDecorations
@Contract("_ -> new") @NotNull public static @NotNull BraveSearchOption<Boolean> textDecorations(boolean textDecorations) Create a new instance ofBraveSearchOptionwithTEXT_DECORATIONSand the given value.- Parameters:
textDecorations- the value forTEXT_DECORATIONS- Returns:
- a new instance of
BraveSearchOption
-
spellCheck
@Contract("_ -> new") @NotNull public static @NotNull BraveSearchOption<Boolean> spellCheck(boolean spellCheck) Create a new instance ofBraveSearchOptionwithSPELLCHECKand the given value.- Parameters:
spellCheck- the value forSPELLCHECK- Returns:
- a new instance of
BraveSearchOption
-
extraSnippets
@Contract("_ -> new") @NotNull public static @NotNull BraveSearchOption<Boolean> extraSnippets(boolean extraSnippets) Create a new instance ofBraveSearchOptionwithEXTRA_SNIPPETSand the given value.- Parameters:
extraSnippets- the value forEXTRA_SNIPPETS- Returns:
- a new instance of
BraveSearchOption
-
summary
@Contract("_ -> new") @NotNull public static @NotNull BraveSearchOption<Boolean> summary(boolean summary) Create a new instance ofBraveSearchOptionwithSUMMARYand the given value.- Parameters:
summary- the value forSUMMARY- Returns:
- a new instance of
BraveSearchOption
-
operators
@Contract("_ -> new") @NotNull public static @NotNull BraveSearchOption<Boolean> operators(boolean operators) Create a new instance ofBraveSearchOptionwithOPERATORSand the given value.- Parameters:
operators- the value forOPERATORS- Returns:
- a new instance of
BraveSearchOption
-
enableRichCallback
@Contract("_ -> new") @NotNull public static @NotNull BraveSearchOption<Boolean> enableRichCallback(boolean enableRichCallback) Creates a new instance ofBraveSearchOptionwithENABLE_RICH_CALLBACKand the given value.- Parameters:
enableRichCallback- the value forENABLE_RICH_CALLBACK- Returns:
- a new instance of
BraveSearchOption
-
goggles
@Contract("_ -> new") @NotNull public static @NotNull BraveSearchOption<String> goggles(@NotNull @NotNull URI gogglesUri) Creates a new instance ofBraveSearchOptionwithGOGGLESand the given value.- Parameters:
gogglesUri- the value forGOGGLES, the URI must be a valid URL too- Returns:
- a new instance of
BraveSearchOption - Throws:
BraveGogglesIdentifierException- if the given gogglesUri is not a valid URL candidate
-
includeFetchMetadata
@Contract("_ -> new") @NotNull public static @NotNull BraveSearchOption<Boolean> includeFetchMetadata(boolean includeFetchMetadata) Creates a new instance ofBraveSearchOptionwithINCLUDE_FETCH_METADATAand the given value.- Parameters:
includeFetchMetadata- the value forINCLUDE_FETCH_METADATA- Returns:
- a new instance of
BraveSearchOption
-
rich
Creates a new instance ofBraveSearchOptionwithRICHand the given value.- Parameters:
rich- the value forRICH- Returns:
- a new instance of
BraveSearchOption
-