Record Class ImageQuery

java.lang.Object
java.lang.Record
dev.reuss.tmdb.query.ImageQuery
Record Components:
language - optional language filter
includeImageLanguage - optional comma-separated image language filter
All Implemented Interfaces:
TmdbQuery, Serializable

public record ImageQuery(Language language, String includeImageLanguage) extends Record implements TmdbQuery
Query parameters for TMDB image requests.

Both filters are optional. A blank includeImageLanguage value is rejected. Values are serialized as language and include_image_language query parameters.

See Also:
  • Constructor Details

    • ImageQuery

      public ImageQuery(Language language, String includeImageLanguage)
      Creates an instance of a ImageQuery record class.
      Parameters:
      language - the value for the language record component
      includeImageLanguage - the value for the includeImageLanguage record component
  • Method Details

    • none

      public static ImageQuery none()
      Creates an image query without filters.
      Returns:
      empty image query
    • language

      public static ImageQuery language(Language language)
      Creates an image query for a single response language.
      Parameters:
      language - response language
      Returns:
      image query
      Throws:
      NullPointerException - if language is null
    • includeImageLanguage

      public static ImageQuery includeImageLanguage(String includeImageLanguage)
      Creates an image query using TMDB's image-language filter.
      Parameters:
      includeImageLanguage - comma-separated image language filter
      Returns:
      image query
      Throws:
      IllegalArgumentException - if includeImageLanguage is blank
    • toQueryParams

      public QueryParams toQueryParams()
      Converts this query to TMDB query parameters.
      Specified by:
      toQueryParams in interface TmdbQuery
      Returns:
      query parameters
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • language

      public Language language()
      Returns the value of the language record component.
      Returns:
      the value of the language record component
    • includeImageLanguage

      public String includeImageLanguage()
      Returns the value of the includeImageLanguage record component.
      Returns:
      the value of the includeImageLanguage record component