Class GetRecommendationsRequest.Builder
java.lang.Object
se.michaelthelin.spotify.requests.AbstractRequest.Builder<Recommendations,GetRecommendationsRequest.Builder>
se.michaelthelin.spotify.requests.data.AbstractDataRequest.Builder<Recommendations,GetRecommendationsRequest.Builder>
se.michaelthelin.spotify.requests.data.browse.GetRecommendationsRequest.Builder
- All Implemented Interfaces:
IRequest.Builder<Recommendations,
GetRecommendationsRequest.Builder>
- Enclosing class:
GetRecommendationsRequest
public static final class GetRecommendationsRequest.Builder
extends AbstractDataRequest.Builder<Recommendations,GetRecommendationsRequest.Builder>
Builder class for building a
GetRecommendationsRequest
.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
The request build method.The limit setter.market
(com.neovisionaries.i18n.CountryCode market) The country code setter.max_acousticness
(Float max_acousticness) The maximum acousticness setter.max_danceability
(Float max_danceability) The maximum danceability setter.max_duration_ms
(Integer max_duration_ms) The maximum duration setter.max_energy
(Float max_energy) The maximum energy setter.max_instrumentalness
(Float max_instrumentalness) The maximum instrumentalness setter.The maximum key setter.max_liveness
(Float max_liveness) The maximum liveness setter.max_loudness
(Float max_loudness) The maximum loudness setter.The maximum mode setter.max_popularity
(Integer max_popularity) The maximum popularity setter.max_speechiness
(Float max_speechiness) The maximum speechiness setter.The maximum tempo setter.max_time_signature
(Integer max_time_signature) The maximum time signature setter.max_valence
(Float max_valence) The maximum valence setter.min_acousticness
(Float min_acousticness) The minimum acousticness setter.min_danceability
(Float min_danceability) The minimum danceability setter.min_duration_ms
(Integer min_duration_ms) The minimum duration setter.min_energy
(Float min_energy) The minimum energy setter.min_instrumentalness
(Float min_instrumentalness) The minimum instrumentalness setter.The minimum key setter.min_liveness
(Float min_liveness) The minimum liveness setter.min_loudness
(Float min_loudness) The minimum loudness setter.The minimum mode setter.min_popularity
(Integer min_popularity) The minimum popularity setter.min_speechiness
(Float min_speechiness) The minimum speechiness setter.The minimum tempo setter.min_time_signature
(Integer min_time_signature) The minimum time signature setter.min_valence
(Float min_valence) The minimum valence setter.seed_artists
(String seed_artists) The seed artists setter.seed_genres
(String seed_genres) The seed genres setter.seed_tracks
(String seed_tracks) The seed tracks setter.protected GetRecommendationsRequest.Builder
self()
Return this instance to simulate a self-type.target_acousticness
(Float target_acousticness) The target acousticness setter.target_danceability
(Float target_danceability) The target danceability setter.target_duration_ms
(Integer target_duration_ms) The target duration setter.target_energy
(Float target_energy) The target energy setter.target_instrumentalness
(Float target_instrumentalness) The target instrumentalness setter.target_key
(Integer target_key) The target key setter.target_liveness
(Float target_liveness) The target liveness setter.target_loudness
(Float target_loudness) The target loudness setter.target_mode
(Integer target_mode) The target mode setter.target_popularity
(Integer target_popularity) The target popularity setter.target_speechiness
(Float target_speechiness) The target speechiness setter.target_tempo
(Float target_tempo) The target tempo setter.target_time_signature
(Integer target_time_signature) The target time signature setter.target_valence
(Float target_valence) The target valence setter.Methods inherited from class se.michaelthelin.spotify.requests.AbstractRequest.Builder
setBody, setBodyParameter, setContentType, setDefaults, setHeader, setHost, setHttpManager, setPath, setPathParameter, setPort, setQueryParameter, setScheme
-
Constructor Details
-
Builder
Create a newGetRecommendationsRequest.Builder
instance.- Parameters:
accessToken
- Required. A valid access token from the Spotify Accounts service.
-
-
Method Details
-
limit
The limit setter.- Parameters:
limit
- Optional. The target size of the list of recommended tracks. For seeds with unusually small pools or when highly restrictive filtering is applied, it may be impossible to generate the requested number of recommended tracks. Debugging information for such cases is available in the response. Default: 20. Minimum: 1. Maximum: 100.- Returns:
- A
GetRecommendationsRequest.Builder
.
-
market
The country code setter.- Parameters:
market
- Optional. An ISO 3166-1 alpha-2 country code. Provide this parameter if you want to apply Track Relinking. Becausemin_*
,max_*
andtarget_*
are applied to pools before relinking, the generated results may not precisely match the filters applied. Original, non-relinked tracks are available via thelinked_from
attribute of the relinked track response.- Returns:
- A
GetRecommendationsRequest.Builder
. - See Also:
-
max_acousticness
The maximum acousticness setter. Tracks with the attribute value above the maximum value will be omitted.- Parameters:
max_acousticness
- A confidence measure from 0.0 to 1.0 of whether the track is acoustic. 1.0 represents high confidence the track is acoustic.- Returns:
- A
GetRecommendationsRequest.Builder
.
-
max_danceability
The maximum danceability setter. Tracks with the attribute value above the maximum value will be omitted.- Parameters:
max_danceability
- Danceability describes how suitable a track is for dancing based on a combination of musical elements including tempo, rhythm stability, beat strength, and overall regularity. A value of 0.0 is least danceable and 1.0 is most danceable.- Returns:
- A
GetRecommendationsRequest.Builder
.
-
max_duration_ms
The maximum duration setter. Tracks with the attribute value above the maximum value will be omitted.- Parameters:
max_duration_ms
- The duration of the track in milliseconds.- Returns:
- A
GetRecommendationsRequest.Builder
.
-
max_energy
The maximum energy setter. Tracks with the attribute value above the maximum value will be omitted.- Parameters:
max_energy
- Energy is a measure from 0.0 to 1.0 and represents a perceptual measure of intensity and activity. Typically, energetic seed_tracks feel fast, loud, and noisy. For example, death metal has high energy, while a Bach prelude scores low on the scale. Perceptual features contributing to this attribute include dynamic range, perceived loudness, timbre, onset rate, and general entropy.- Returns:
- A
GetRecommendationsRequest.Builder
.
-
max_instrumentalness
The maximum instrumentalness setter. Tracks with the attribute value above the maximum value will be omitted.- Parameters:
max_instrumentalness
- Predicts whether a track contains no vocals. "Ooh" and "aah" sounds are treated as instrumental in this context. Rap or spoken word seed_tracks are clearly "vocal". The closer the instrumentalness value is to 1.0, the greater likelihood the track contains no vocal content. Values above 0.5 are intended to represent instrumental seed_tracks, but confidence is higher as the value approaches 1.0.- Returns:
- A
GetRecommendationsRequest.Builder
.
-
max_key
The maximum key setter. Tracks with the attribute value above the maximum value will be omitted.- Parameters:
max_key
- The key the track is in. Integers map to pitches using standard Pitch Class notation. E.g. 0 = C, 1 = C♯/D♭, 2 = D, and so on.- Returns:
- A
GetRecommendationsRequest.Builder
.
-
max_liveness
The maximum liveness setter. Tracks with the attribute value above the maximum value will be omitted.- Parameters:
max_liveness
- Detects the presence of an audience in the recording. Higher liveness values represent an increased probability that the track was performed live. A value above 0.8 provides strong likelihood that the track is live.- Returns:
- A
GetRecommendationsRequest.Builder
.
-
max_loudness
The maximum loudness setter. Tracks with the attribute value above the maximum value will be omitted.- Parameters:
max_loudness
- The overall loudness of a track in decibels (dB). Loudness values are averaged across the entire track and are useful for comparing relative loudness of seed_tracks. Loudness is the quality of a sound that is the primary psychological correlate of physical strength (amplitude). Values typical range between -60 and 0 db.- Returns:
- A
GetRecommendationsRequest.Builder
.
-
max_mode
The maximum mode setter. Tracks with the attribute value above the maximum value will be omitted.- Parameters:
max_mode
- Mode indicates the modality (major or minor) of a track, the type of scale from which its melodic content is derived. Major is represented by 1 and minor is 0.- Returns:
- A
GetRecommendationsRequest.Builder
.
-
max_popularity
The maximum popularity setter. Tracks with the attribute value above the maximum value will be omitted.- Parameters:
max_popularity
- The popularity of the track. The value will be between 0 and 100, with 100 being the most popular. The popularity is calculated by algorithm and is based, in the most part, on the total number of plays the track has had and how recent those plays are.- Returns:
- A
GetRecommendationsRequest.Builder
.
-
max_speechiness
The maximum speechiness setter. Tracks with the attribute value above the maximum value will be omitted.- Parameters:
max_speechiness
- Speechiness detects the presence of spoken words in a track. The more exclusively speech-like the recording (e.g. talk show, audio book, poetry), the closer to 1.0 the attribute value. Values above 0.66 describe seed_tracks that are probably made entirely of spoken words. Values between 0.33 and 0.66 describe seed_tracks that may contain both music and speech, either in sections or layered, including such cases as rap music. Values below 0.33 most likely represent music and other non-speech-like seed_tracks.- Returns:
- A
GetRecommendationsRequest.Builder
.
-
max_tempo
The maximum tempo setter. Tracks with the attribute value above the maximum value will be omitted.- Parameters:
max_tempo
- The overall estimated tempo of a track in beats per minute (BPM). In musical terminology, tempo is the speed or pace of a given piece and derives directly from the average beat duration.- Returns:
- A
GetRecommendationsRequest.Builder
.
-
max_time_signature
The maximum time signature setter. Tracks with the attribute value above the maximum value will be omitted.- Parameters:
max_time_signature
- An estimated overall time signature of a track. The time signature (meter) is a notational convention to specify how many beats are in each bar (or measure).- Returns:
- A
GetRecommendationsRequest.Builder
.
-
max_valence
The maximum valence setter. Tracks with the attribute value above the maximum value will be omitted.- Parameters:
max_valence
- A measure from 0.0 to 1.0 describing the musical positiveness conveyed by a track. Tracks with high valence sound more positive (e.g. happy, cheerful, euphoric), while seed_tracks with low valence sound more negative (e.g. sad, depressed, angry).- Returns:
- A
GetRecommendationsRequest.Builder
.
-
min_acousticness
The minimum acousticness setter. Tracks with the attribute value below the minimum value will be omitted.- Parameters:
min_acousticness
- A confidence measure from 0.0 to 1.0 of whether the track is acoustic. 1.0 represents high confidence the track is acoustic.- Returns:
- A
GetRecommendationsRequest.Builder
.
-
min_danceability
The minimum danceability setter. Tracks with the attribute value below the minimum value will be omitted.- Parameters:
min_danceability
- Danceability describes how suitable a track is for dancing based on a combination of musical elements including tempo, rhythm stability, beat strength, and overall regularity. A value of 0.0 is least danceable and 1.0 is most danceable.- Returns:
- A
GetRecommendationsRequest.Builder
.
-
min_duration_ms
The minimum duration setter. Tracks with the attribute value below the minimum value will be omitted.- Parameters:
min_duration_ms
- The duration of the track in milliseconds.- Returns:
- A
GetRecommendationsRequest.Builder
.
-
min_energy
The minimum energy setter. Tracks with the attribute value below the minimum value will be omitted.- Parameters:
min_energy
- Energy is a measure from 0.0 to 1.0 and represents a perceptual measure of intensity and activity. Typically, energetic seed_tracks feel fast, loud, and noisy. For example, death metal has high energy, while a Bach prelude scores low on the scale. Perceptual features contributing to this attribute include dynamic range, perceived loudness, timbre, onset rate, and general entropy.- Returns:
- A
GetRecommendationsRequest.Builder
.
-
min_instrumentalness
The minimum instrumentalness setter. Tracks with the attribute value below the minimum value will be omitted.- Parameters:
min_instrumentalness
- Predicts whether a track contains no vocals. "Ooh" and "aah" sounds are treated as instrumental in this context. Rap or spoken word seed_tracks are clearly "vocal". The closer the instrumentalness value is to 1.0, the greater likelihood the track contains no vocal content. Values above 0.5 are intended to represent instrumental seed_tracks, but confidence is higher as the value approaches 1.0.- Returns:
- A
GetRecommendationsRequest.Builder
.
-
min_key
The minimum key setter. Tracks with the attribute value below the minimum value will be omitted.- Parameters:
min_key
- The key the track is in. Integers map to pitches using standard Pitch Class notation. E.g. 0 = C, 1 = C♯/D♭, 2 = D, and so on.- Returns:
- A
GetRecommendationsRequest.Builder
.
-
min_liveness
The minimum liveness setter. Tracks with the attribute value below the minimum value will be omitted.- Parameters:
min_liveness
- Detects the presence of an audience in the recording. Higher liveness values represent an increased probability that the track was performed live. A value above 0.8 provides strong likelihood that the track is live.- Returns:
- A
GetRecommendationsRequest.Builder
.
-
min_loudness
The minimum loudness setter. Tracks with the attribute value below the minimum value will be omitted.- Parameters:
min_loudness
- The overall loudness of a track in decibels (dB). Loudness values are averaged across the entire track and are useful for comparing relative loudness of seed_tracks. Loudness is the quality of a sound that is the primary psychological correlate of physical strength (amplitude). Values typical range between -60 and 0 db.- Returns:
- A
GetRecommendationsRequest.Builder
.
-
min_mode
The minimum mode setter. Tracks with the attribute value below the minimum value will be omitted.- Parameters:
min_mode
- Mode indicates the modality (major or minor) of a track, the type of scale from which its melodic content is derived. Major is represented by 1 and minor is 0.- Returns:
- A
GetRecommendationsRequest.Builder
.
-
min_popularity
The minimum popularity setter. Tracks with the attribute value below the minimum value will be omitted.- Parameters:
min_popularity
- The popularity of the track. The value will be between 0 and 100, with 100 being the most popular. The popularity is calculated by algorithm and is based, in the most part, on the total number of plays the track has had and how recent those plays are.- Returns:
- A
GetRecommendationsRequest.Builder
.
-
min_speechiness
The minimum speechiness setter. Tracks with the attribute value below the minimum value will be omitted.- Parameters:
min_speechiness
- Speechiness detects the presence of spoken words in a track. The more exclusively speech-like the recording (e.g. talk show, audio book, poetry), the closer to 1.0 the attribute value. Values above 0.66 describe seed_tracks that are probably made entirely of spoken words. Values between 0.33 and 0.66 describe seed_tracks that may contain both music and speech, either in sections or layered, including such cases as rap music. Values below 0.33 most likely represent music and other non-speech-like seed_tracks.- Returns:
- A
GetRecommendationsRequest.Builder
.
-
min_tempo
The minimum tempo setter. Tracks with the attribute value below the minimum value will be omitted.- Parameters:
min_tempo
- The overall estimated tempo of a track in beats per minute (BPM). In musical terminology, tempo is the speed or pace of a given piece and derives directly from the average beat duration.- Returns:
- A
GetRecommendationsRequest.Builder
.
-
min_time_signature
The minimum time signature setter. Tracks with the attribute value below the minimum value will be omitted.- Parameters:
min_time_signature
- An estimated overall time signature of a track. The time signature (meter) is a notational convention to specify how many beats are in each bar (or measure).- Returns:
- A
GetRecommendationsRequest.Builder
.
-
min_valence
The minimum valence setter. Tracks with the attribute value below the minimum value will be omitted.- Parameters:
min_valence
- A measure from 0.0 to 1.0 describing the musical positiveness conveyed by a track. Tracks with high valence sound more positive (e.g. happy, cheerful, euphoric), while seed_tracks with low valence sound more negative (e.g. sad, depressed, angry).- Returns:
- A
GetRecommendationsRequest.Builder
.
-
seed_artists
The seed artists setter.- Parameters:
seed_artists
- A comma separated list of Spotify IDs for seed seed_artists. Up to 5 seed values may be provided in any combination of seed_artists, seed_tracks and seed_genres.- Returns:
- A
GetRecommendationsRequest.Builder
. - See Also:
-
seed_genres
The seed genres setter.- Parameters:
seed_genres
- A comma separated list of any seed_genres in the set of available genre seeds. Up to 5 seed values may be provided in any combination of seed_artists, seed_tracks and seed_genres.- Returns:
- A
GetRecommendationsRequest.Builder
. - See Also:
-
seed_tracks
The seed tracks setter.- Parameters:
seed_tracks
- A comma separated list of Spotify IDs for a seed track. Up to 5 seed values may be provided in any combination of seed_artists, seed_tracks and seed_genres.- Returns:
- A
GetRecommendationsRequest.Builder
. - See Also:
-
target_acousticness
The target acousticness setter. Tracks with the attribute value nearest to the target value will be preferred. All target values will be weighed equally in ranking results.- Parameters:
target_acousticness
- A confidence measure from 0.0 to 1.0 of whether the track is acoustic. 1.0 represents high confidence the track is acoustic.- Returns:
- A
GetRecommendationsRequest.Builder
.
-
target_danceability
The target danceability setter. Tracks with the attribute value nearest to the target value will be preferred. All target values will be weighed equally in ranking results.- Parameters:
target_danceability
- Danceability describes how suitable a track is for dancing based on a combination of musical elements including tempo, rhythm stability, beat strength, and overall regularity. A value of 0.0 is least danceable and 1.0 is most danceable.- Returns:
- A
GetRecommendationsRequest.Builder
.
-
target_duration_ms
The target duration setter. Tracks with the attribute value nearest to the target value will be preferred. All target values will be weighed equally in ranking results.- Parameters:
target_duration_ms
- The duration of the track in milliseconds.- Returns:
- A
GetRecommendationsRequest.Builder
.
-
target_energy
The target energy setter. Tracks with the attribute value nearest to the target value will be preferred. All target values will be weighed equally in ranking results.- Parameters:
target_energy
- Energy is a measure from 0.0 to 1.0 and represents a perceptual measure of intensity and activity. Typically, energetic seed_tracks feel fast, loud, and noisy. For example, death metal has high energy, while a Bach prelude scores low on the scale. Perceptual features contributing to this attribute include dynamic range, perceived loudness, timbre, onset rate, and general entropy.- Returns:
- A
GetRecommendationsRequest.Builder
.
-
target_instrumentalness
The target instrumentalness setter. Tracks with the attribute value nearest to the target value will be preferred. All target values will be weighed equally in ranking results.- Parameters:
target_instrumentalness
- Predicts whether a track contains no vocals. "Ooh" and "aah" sounds are treated as instrumental in this context. Rap or spoken word seed_tracks are clearly "vocal". The closer the instrumentalness value is to 1.0, the greater likelihood the track contains no vocal content. Values above 0.5 are intended to represent instrumental seed_tracks, but confidence is higher as the value approaches 1.0.- Returns:
- A
GetRecommendationsRequest.Builder
.
-
target_key
The target key setter. Tracks with the attribute value nearest to the target value will be preferred. All target values will be weighed equally in ranking results.- Parameters:
target_key
- The key the track is in. Integers map to pitches using standard Pitch Class notation. E.g. 0 = C, 1 = C♯/D♭, 2 = D, and so on.- Returns:
- A
GetRecommendationsRequest.Builder
.
-
target_liveness
The target liveness setter. Tracks with the attribute value nearest to the target value will be preferred. All target values will be weighed equally in ranking results.- Parameters:
target_liveness
- Detects the presence of an audience in the recording. Higher liveness values represent an increased probability that the track was performed live. A value above 0.8 provides strong likelihood that the track is live.- Returns:
- A
GetRecommendationsRequest.Builder
.
-
target_loudness
The target loudness setter. Tracks with the attribute value nearest to the target value will be preferred. All target values will be weighed equally in ranking results.- Parameters:
target_loudness
- The overall loudness of a track in decibels (dB). Loudness values are averaged across the entire track and are useful for comparing relative loudness of seed_tracks. Loudness is the quality of a sound that is the primary psychological correlate of physical strength (amplitude). Values typical range between -60 and 0 db.- Returns:
- A
GetRecommendationsRequest.Builder
.
-
target_mode
The target mode setter. Tracks with the attribute value nearest to the target value will be preferred. All target values will be weighed equally in ranking results.- Parameters:
target_mode
- Mode indicates the modality (major or minor) of a track, the type of scale from which its melodic content is derived. Major is represented by 1 and minor is 0.- Returns:
- A
GetRecommendationsRequest.Builder
.
-
target_popularity
The target popularity setter. Tracks with the attribute value nearest to the target value will be preferred. All target values will be weighed equally in ranking results.- Parameters:
target_popularity
- The value will be between 0 and 100, with 100 being the most popular. The popularity is calculated by algorithm and is based, in the most part, on the total number of plays the track has had and how recent those plays are.- Returns:
- A
GetRecommendationsRequest.Builder
.
-
target_speechiness
The target speechiness setter. Tracks with the attribute value nearest to the target value will be preferred. All target values will be weighed equally in ranking results.- Parameters:
target_speechiness
- Speechiness detects the presence of spoken words in a track. The more exclusively speech-like the recording (e.g. talk show, audio book, poetry), the closer to 1.0 the attribute value. Values above 0.66 describe seed_tracks that are probably made entirely of spoken words. Values between 0.33 and 0.66 describe seed_tracks that may contain both music and speech, either in sections or layered, including such cases as rap music. Values below 0.33 most likely represent music and other non-speech-like seed_tracks.- Returns:
- A
GetRecommendationsRequest.Builder
.
-
target_tempo
The target tempo setter. Tracks with the attribute value nearest to the target value will be preferred. All target values will be weighed equally in ranking results.- Parameters:
target_tempo
- The overall estimated tempo of a track in beats per minute (BPM). In musical terminology, tempo is the speed or pace of a given piece and derives directly from the average beat duration.- Returns:
- A
GetRecommendationsRequest.Builder
.
-
target_time_signature
The target time signature setter. Tracks with the attribute value nearest to the target value will be preferred. All target values will be weighed equally in ranking results.- Parameters:
target_time_signature
- An estimated overall time signature of a track. The time signature (meter) is a notational convention to specify how many beats are in each bar (or measure).- Returns:
- A
GetRecommendationsRequest.Builder
.
-
target_valence
The target valence setter. Tracks with the attribute value nearest to the target value will be preferred. All target values will be weighed equally in ranking results.- Parameters:
target_valence
- A measure from 0.0 to 1.0 describing the musical positiveness conveyed by a track. Tracks with high valence sound more positive (e.g. happy, cheerful, euphoric), while seed_tracks with low valence sound more negative (e.g. sad, depressed, angry).- Returns:
- A
GetRecommendationsRequest.Builder
.
-
build
The request build method.- Returns:
- A custom
GetRecommendationsRequest
.
-
self
Description copied from class:AbstractRequest.Builder
Return this instance to simulate a self-type.- Specified by:
self
in classAbstractRequest.Builder<Recommendations,
GetRecommendationsRequest.Builder> - Returns:
- This instance.
-