Package dev.reuss.tmdb.query
Record Class AppendToResponse<T extends AppendableResponse>
java.lang.Object
java.lang.Record
dev.reuss.tmdb.query.AppendToResponse<T>
- Type Parameters:
T- appendable response type- Record Components:
values- appendable responses to request
- All Implemented Interfaces:
Serializable
public record AppendToResponse<T extends AppendableResponse>(List<T extends AppendableResponse> values)
extends Record
implements Serializable
Models TMDB's
append_to_response query parameter.
Use this value with endpoints that support appended responses. Values are serialized as a comma-separated list, duplicate append values are removed while preserving their first occurrence, and at most 20 unique values are allowed.
AppendToResponse<MovieAppend> append =
AppendToResponse.of(MovieAppend.CREDITS, MovieAppend.VIDEOS);
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionAppendToResponse(List<T> values) Creates an instance of aAppendToResponserecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.static <T extends AppendableResponse>
AppendToResponse<T>of(T... values) Creates an append-to-response value from one or more appendable responses.toString()Returns a string representation of this record class.values()Returns the value of thevaluesrecord component.
-
Constructor Details
-
AppendToResponse
Creates an instance of aAppendToResponserecord class.- Parameters:
values- the value for thevaluesrecord component
-
-
Method Details
-
of
Creates an append-to-response value from one or more appendable responses.- Type Parameters:
T- appendable response type- Parameters:
values- appendable responses to request- Returns:
- append-to-response query value
- Throws:
IllegalArgumentException- ifvaluesisnull, empty, containsnull, or contains more than 20 unique append values
-
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). -
values
Returns the value of thevaluesrecord component.- Returns:
- the value of the
valuesrecord component
-