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 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 a Recipe record class.
      Parameters:
      title - the value for the title record component
      description - the value for the description record component
      thumbnail - the value for the thumbnail record component
      url - the value for the url record component
      domain - the value for the domain record component
      favicon - the value for the favicon record component
      time - the value for the time record component
      prepTime - the value for the prepTime record component
      cookTime - the value for the cookTime record component
      ingredients - the value for the ingredients record component
      instructions - the value for the instructions record component
      servings - the value for the servings record component
      calories - the value for the calories record component
      rating - the value for the rating record component
      recipeCategory - the value for the recipeCategory record component
      recipeCusine - the value for the recipeCusine record component
      video - the value for the video record component
  • Method Details

    • 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.
    • title

      public String title()
      Returns the value of the title record component.
      Returns:
      the value of the title record component
    • description

      public String description()
      Returns the value of the description record component.
      Returns:
      the value of the description record component
    • thumbnail

      public Thumbnail thumbnail()
      Returns the value of the thumbnail record component.
      Returns:
      the value of the thumbnail record component
    • url

      public String url()
      Returns the value of the url record component.
      Returns:
      the value of the url record component
    • domain

      public String domain()
      Returns the value of the domain record component.
      Returns:
      the value of the domain record component
    • favicon

      public String favicon()
      Returns the value of the favicon record component.
      Returns:
      the value of the favicon record component
    • time

      public String time()
      Returns the value of the time record component.
      Returns:
      the value of the time record component
    • prepTime

      public String prepTime()
      Returns the value of the prepTime record component.
      Returns:
      the value of the prepTime record component
    • cookTime

      public String cookTime()
      Returns the value of the cookTime record component.
      Returns:
      the value of the cookTime record component
    • ingredients

      public String ingredients()
      Returns the value of the ingredients record component.
      Returns:
      the value of the ingredients record component
    • instructions

      public List<HowTo> instructions()
      Returns the value of the instructions record component.
      Returns:
      the value of the instructions record component
    • servings

      public Integer servings()
      Returns the value of the servings record component.
      Returns:
      the value of the servings record component
    • calories

      public Integer calories()
      Returns the value of the calories record component.
      Returns:
      the value of the calories record component
    • rating

      public Rating rating()
      Returns the value of the rating record component.
      Returns:
      the value of the rating record component
    • recipeCategory

      public String recipeCategory()
      Returns the value of the recipeCategory record component.
      Returns:
      the value of the recipeCategory record component
    • recipeCusine

      public String recipeCusine()
      Returns the value of the recipeCusine record component.
      Returns:
      the value of the recipeCusine record component
    • video

      public VideoData video()
      Returns the value of the video record component.
      Returns:
      the value of the video record component