Package dev.reuss.tmdb.core.config
Record Class TmdbClientConfig
java.lang.Object
java.lang.Record
dev.reuss.tmdb.core.config.TmdbClientConfig
- Record Components:
auth- the TMDB authentication configurationbaseUrl- the TMDB API base URL, usuallyhttps://api.themoviedb.org/3defaultLanguage- the default language used for localized requestsdefaultRegion- the optional default region used for regional requestsconnectTimeout- the HTTP connection timeoutrequestTimeout- the overall HTTP request timeoutmetricsRecorder- the metrics recorder used to observe TMDB HTTP requests
public record TmdbClientConfig(TmdbAuth auth, String baseUrl, Language defaultLanguage, Region defaultRegion, Duration connectTimeout, Duration requestTimeout, TmdbMetricsRecorder metricsRecorder)
extends Record
Configuration used to create and operate a TMDB client instance.
This record contains authentication, endpoint and default request settings shared by all services created by the client.
The defaultLanguage is used by services when no request-specific
language is provided. The defaultRegion is optional and may be
null, because not every TMDB endpoint or request requires a region.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionTmdbClientConfig(TmdbAuth auth, String baseUrl, Language defaultLanguage, Region defaultRegion, Duration connectTimeout, Duration requestTimeout, TmdbMetricsRecorder metricsRecorder) Creates a new TMDB client configuration. -
Method Summary
Modifier and TypeMethodDescriptionauth()Returns the value of theauthrecord component.baseUrl()Returns the value of thebaseUrlrecord component.Returns the value of theconnectTimeoutrecord component.Returns the value of thedefaultLanguagerecord component.Returns the value of thedefaultRegionrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of themetricsRecorderrecord component.Returns the value of therequestTimeoutrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
DEFAULT_BASE_URL
- See Also:
-
DEFAULT_LANGUAGE
- See Also:
-
DEFAULT_CONNECT_TIMEOUT
- See Also:
-
DEFAULT_REQUEST_TIMEOUT
- See Also:
-
DEFAULT_CONNECT_TIMEOUT_DURATION
-
DEFAULT_REQUEST_TIMEOUT_DURATION
-
-
Constructor Details
-
TmdbClientConfig
public TmdbClientConfig(TmdbAuth auth, String baseUrl, Language defaultLanguage, Region defaultRegion, Duration connectTimeout, Duration requestTimeout, TmdbMetricsRecorder metricsRecorder) Creates a new TMDB client configuration.- Throws:
NullPointerException- ifauth,defaultLanguage,connectTimeoutorrequestTimeoutisnullIllegalArgumentException- ifbaseUrlisnull, blank or empty, or if a timeout is zero or negative
-
-
Method Details
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
auth
Returns the value of theauthrecord component.- Returns:
- the value of the
authrecord component
-
baseUrl
Returns the value of thebaseUrlrecord component.- Returns:
- the value of the
baseUrlrecord component
-
defaultLanguage
Returns the value of thedefaultLanguagerecord component.- Returns:
- the value of the
defaultLanguagerecord component
-
defaultRegion
Returns the value of thedefaultRegionrecord component.- Returns:
- the value of the
defaultRegionrecord component
-
connectTimeout
Returns the value of theconnectTimeoutrecord component.- Returns:
- the value of the
connectTimeoutrecord component
-
requestTimeout
Returns the value of therequestTimeoutrecord component.- Returns:
- the value of the
requestTimeoutrecord component
-
metricsRecorder
Returns the value of themetricsRecorderrecord component.- Returns:
- the value of the
metricsRecorderrecord component
-