Record Class VideoSearchApiResponse
java.lang.Object
java.lang.Record
net.ygbstudio.jbrave.api.response.VideoSearchApiResponse
- Record Components:
type- The type of the response.query- The original query submitted by the user.results- A list of video results provided by the API.extra- Additional information about the response.
- All Implemented Interfaces:
ApiResponse
public record VideoSearchApiResponse(String type, Query query, List<VideoResult> results, Extra extra)
extends Record
implements ApiResponse
Represents the response from the Brave Search API for video searches. This class contains the
original query, a list of video results, and extra information.
This response record contains methods to deserialise and serialise instances.
Factory methods are available for String, File, Reader, and HttpResponse inputs. You can also write the contents of a response object to the filesystem;
ApiResponse.write(File) can be useful for that purpose.
-
Constructor Summary
ConstructorsConstructorDescriptionVideoSearchApiResponse(String type, Query query, List<VideoResult> results, Extra extra) Creates an instance of aVideoSearchApiResponserecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.extra()Returns the value of theextrarecord component.static VideoSearchApiResponseDeserializes aVideoSearchApiResponsefrom a JSONFile.static VideoSearchApiResponseDeserializes aVideoSearchApiResponsefrom a JSONReader.static VideoSearchApiResponseDeserializes aVideoSearchApiResponsefrom a JSONString.static VideoSearchApiResponsefrom(@NotNull HttpResponse<String> dataResponse) Deserializes aVideoSearchApiResponsefrom the body of an HTTP response.final inthashCode()Returns a hash code value for this object.query()Returns the value of thequeryrecord component.results()Returns the value of theresultsrecord component.final StringtoString()Returns a string representation of this record class.type()Returns the value of thetyperecord component.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.ygbstudio.jbrave.api.response.ApiResponse
toJson, write
-
Constructor Details
-
Method Details
-
from
Deserializes aVideoSearchApiResponsefrom a JSONFile.- Parameters:
dataFile- the file containing the JSON response data- Returns:
- the deserialized response
-
from
Deserializes aVideoSearchApiResponsefrom a JSONString.- Parameters:
dataString- the string containing the JSON response data- Returns:
- the deserialized response
-
from
Deserializes aVideoSearchApiResponsefrom a JSONReader.- Parameters:
dataReader- the reader supplying the JSON response data- Returns:
- the deserialized response
-
from
Deserializes aVideoSearchApiResponsefrom the body of an HTTP response.- Parameters:
dataResponse- the HTTP response whose body contains the JSON response data- Returns:
- the deserialized response
-
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). -
type
Returns the value of thetyperecord component.- Returns:
- the value of the
typerecord component
-
query
Returns the value of thequeryrecord component.- Returns:
- the value of the
queryrecord component
-
results
Returns the value of theresultsrecord component.- Returns:
- the value of the
resultsrecord component
-
extra
Returns the value of theextrarecord component.- Returns:
- the value of the
extrarecord component
-