Class Vendor


  • public class Vendor
    extends java.lang.Object
    This class represents a Vendor that provides products to the store. The vendor has a unique identifier, name, registration date, activity status, and a list of products they provide to the store.
    • Constructor Summary

      Constructors 
      Constructor Description
      Vendor​(java.lang.String vendorName, boolean vendorActive)
      Constructor for the Vendor class.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int getBiggestVendorId()
      Returns the biggest vendor ID currently in the system.
      java.util.ArrayList<Product> getProducts()
      Returns the list of products associated with the vendor.
      boolean getVendorActive()
      Returns a boolean indicating whether the vendor is active or not.
      int getVendorId()
      Returns the vendor's ID.
      java.lang.String getVendorName()
      Returns the vendor's name.
      java.time.LocalDate getVendorRegDate()
      Returns the vendor's registration date.
      void setProducts​(java.util.ArrayList<Product> products)
      Sets the list of products associated with the vendor.
      void setVendorActive​(boolean vendorActive)
      Sets whether the vendor is active or not.
      void setVendorId​(int vendorId)
      Sets the vendor's ID.
      void setVendorName​(java.lang.String vendorName)
      Sets the vendor's name.
      java.lang.String toString()
      Returns a string representation of the vendor object, including the vendor's name, ID, registration date, and status.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • Vendor

        public Vendor​(java.lang.String vendorName,
                      boolean vendorActive)
        Constructor for the Vendor class. Initializes a new vendor with a unique identifier, name, registration date, and activity status.
        Parameters:
        vendorName - A string representing the name of the vendor.
        vendorActive - A boolean value indicating whether the vendor is currently active.
    • Method Detail

      • getVendorId

        public int getVendorId()
        Returns the vendor's ID.
        Returns:
        an integer representing the vendor's ID.
      • setVendorId

        public void setVendorId​(int vendorId)
        Sets the vendor's ID.
        Parameters:
        vendorId - an integer representing the new vendor ID.
      • getVendorName

        public java.lang.String getVendorName()
        Returns the vendor's name.
        Returns:
        a String representing the vendor's name.
      • setVendorName

        public void setVendorName​(java.lang.String vendorName)
        Sets the vendor's name.
        Parameters:
        vendorName - a String representing the new vendor name.
      • getVendorRegDate

        public java.time.LocalDate getVendorRegDate()
        Returns the vendor's registration date.
        Returns:
        a LocalDate object representing the vendor's registration date.
      • getVendorActive

        public boolean getVendorActive()
        Returns a boolean indicating whether the vendor is active or not.
        Returns:
        a boolean indicating whether the vendor is active or not.
      • setVendorActive

        public void setVendorActive​(boolean vendorActive)
        Sets whether the vendor is active or not.
        Parameters:
        vendorActive - a boolean indicating whether the vendor is active or not.
      • getProducts

        public java.util.ArrayList<Product> getProducts()
        Returns the list of products associated with the vendor.
        Returns:
        an ArrayList of Product objects associated with the vendor.
      • setProducts

        public void setProducts​(java.util.ArrayList<Product> products)
        Sets the list of products associated with the vendor.
        Parameters:
        products - an ArrayList of Product objects to associate with the vendor.
      • getBiggestVendorId

        public int getBiggestVendorId()
        Returns the biggest vendor ID currently in the system.
        Returns:
        an integer representing the biggest vendor ID in the system.
      • toString

        public java.lang.String toString()
        Returns a string representation of the vendor object, including the vendor's name, ID, registration date, and status. The string is formatted with decorative characters for better visualization.
        Overrides:
        toString in class java.lang.Object
        Returns:
        a string representation of the vendor object