Record Class Recipe
java.lang.Object
java.lang.Record
net.ygbstudio.jbrave.core.domain.dto.web.Recipe
- Record Components:
title- The title of the recipe.description- A brief description or summary of the recipe.thumbnail- An image representing the finished dish.url- The URL where the full recipe can be found.domain- The domain name where the recipe is hosted.favicon- The URL of the website's favicon.time- The total time required to prepare and cook the recipe.prepTime- The preparation time required before cooking.cookTime- The cooking time required.ingredients- A formatted string containing the list of ingredients.instructions- Step-by-step instructions for preparing the recipe.servings- The number of servings the recipe yields.calories- The total number of calories per serving.rating- The average user rating of the recipe.recipeCategory- The category of the recipe (e.g., "Dinner", "Dessert").recipeCusine- The cuisine type of the recipe (e.g., "Italian", "Mexican").video- A video demonstrating how to prepare the recipe.
public record Recipe(String title, String description, Thumbnail thumbnail, String url, String domain, String favicon, String time, String prepTime, String cookTime, String ingredients, List<HowTo> instructions, Integer servings, Integer calories, Rating rating, String recipeCategory, String recipeCusine, VideoData video)
extends Record
Represents a recipe in search results. This is used in the Brave Search API to provide structured
data about cooking recipes, including ingredients, instructions, and nutritional information.
-
Constructor Summary
ConstructorsConstructorDescriptionRecipe(String title, String description, Thumbnail thumbnail, String url, String domain, String favicon, String time, String prepTime, String cookTime, String ingredients, List<HowTo> instructions, Integer servings, Integer calories, Rating rating, String recipeCategory, String recipeCusine, VideoData video) Creates an instance of aReciperecord class. -
Method Summary
Modifier and TypeMethodDescriptioncalories()Returns the value of thecaloriesrecord component.cookTime()Returns the value of thecookTimerecord component.Returns the value of thedescriptionrecord component.domain()Returns the value of thedomainrecord component.final booleanIndicates whether some other object is "equal to" this one.favicon()Returns the value of thefaviconrecord component.final inthashCode()Returns a hash code value for this object.Returns the value of theingredientsrecord component.Returns the value of theinstructionsrecord component.prepTime()Returns the value of theprepTimerecord component.rating()Returns the value of theratingrecord component.Returns the value of therecipeCategoryrecord component.Returns the value of therecipeCusinerecord component.servings()Returns the value of theservingsrecord component.Returns the value of thethumbnailrecord component.time()Returns the value of thetimerecord component.title()Returns the value of thetitlerecord component.final StringtoString()Returns a string representation of this record class.url()Returns the value of theurlrecord component.video()Returns the value of thevideorecord component.
-
Constructor Details
-
Recipe
public Recipe(String title, String description, Thumbnail thumbnail, String url, String domain, String favicon, String time, String prepTime, String cookTime, String ingredients, List<HowTo> instructions, Integer servings, Integer calories, Rating rating, String recipeCategory, String recipeCusine, VideoData video) Creates an instance of aReciperecord class.- Parameters:
title- the value for thetitlerecord componentdescription- the value for thedescriptionrecord componentthumbnail- the value for thethumbnailrecord componenturl- the value for theurlrecord componentdomain- the value for thedomainrecord componentfavicon- the value for thefaviconrecord componenttime- the value for thetimerecord componentprepTime- the value for theprepTimerecord componentcookTime- the value for thecookTimerecord componentingredients- the value for theingredientsrecord componentinstructions- the value for theinstructionsrecord componentservings- the value for theservingsrecord componentcalories- the value for thecaloriesrecord componentrating- the value for theratingrecord componentrecipeCategory- the value for therecipeCategoryrecord componentrecipeCusine- the value for therecipeCusinerecord componentvideo- the value for thevideorecord component
-
-
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). -
title
Returns the value of thetitlerecord component.- Returns:
- the value of the
titlerecord component
-
description
Returns the value of thedescriptionrecord component.- Returns:
- the value of the
descriptionrecord component
-
thumbnail
Returns the value of thethumbnailrecord component.- Returns:
- the value of the
thumbnailrecord component
-
url
Returns the value of theurlrecord component.- Returns:
- the value of the
urlrecord component
-
domain
Returns the value of thedomainrecord component.- Returns:
- the value of the
domainrecord component
-
favicon
Returns the value of thefaviconrecord component.- Returns:
- the value of the
faviconrecord component
-
time
Returns the value of thetimerecord component.- Returns:
- the value of the
timerecord component
-
prepTime
Returns the value of theprepTimerecord component.- Returns:
- the value of the
prepTimerecord component
-
cookTime
Returns the value of thecookTimerecord component.- Returns:
- the value of the
cookTimerecord component
-
ingredients
Returns the value of theingredientsrecord component.- Returns:
- the value of the
ingredientsrecord component
-
instructions
Returns the value of theinstructionsrecord component.- Returns:
- the value of the
instructionsrecord component
-
servings
Returns the value of theservingsrecord component.- Returns:
- the value of the
servingsrecord component
-
calories
Returns the value of thecaloriesrecord component.- Returns:
- the value of the
caloriesrecord component
-
rating
Returns the value of theratingrecord component.- Returns:
- the value of the
ratingrecord component
-
recipeCategory
Returns the value of therecipeCategoryrecord component.- Returns:
- the value of the
recipeCategoryrecord component
-
recipeCusine
Returns the value of therecipeCusinerecord component.- Returns:
- the value of the
recipeCusinerecord component
-
video
Returns the value of thevideorecord component.- Returns:
- the value of the
videorecord component
-