Class Product

java.lang.Object
Creational.Builder.Product

public class Product extends Object
Represents the complex product being built. The Product class includes parts `partA` and `partB`, representing different components of the product. It provides methods to set these parts and to retrieve a string representation of the constructed product.
  • Constructor Details

    • Product

      public Product()
      Default constructor for Product.
  • Method Details

    • setPartA

      public void setPartA(String partA)
      Sets Part A of the product.
      Parameters:
      partA - A string representing Part A.
    • setPartB

      public void setPartB(String partB)
      Sets Part B of the product.
      Parameters:
      partB - A string representing Part B.
    • toString

      public String toString()
      Provides a string representation of the product.
      Overrides:
      toString in class Object
      Returns:
      A string describing the product's parts.