Class Vendor
- java.lang.Object
-
- Vendor
-
public class Vendor extends java.lang.ObjectThis 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 intgetBiggestVendorId()Returns the biggest vendor ID currently in the system.java.util.ArrayList<Product>getProducts()Returns the list of products associated with the vendor.booleangetVendorActive()Returns a boolean indicating whether the vendor is active or not.intgetVendorId()Returns the vendor's ID.java.lang.StringgetVendorName()Returns the vendor's name.java.time.LocalDategetVendorRegDate()Returns the vendor's registration date.voidsetProducts(java.util.ArrayList<Product> products)Sets the list of products associated with the vendor.voidsetVendorActive(boolean vendorActive)Sets whether the vendor is active or not.voidsetVendorId(int vendorId)Sets the vendor's ID.voidsetVendorName(java.lang.String vendorName)Sets the vendor's name.java.lang.StringtoString()Returns a string representation of the vendor object, including the vendor's name, ID, registration date, and status.
-
-
-
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:
toStringin classjava.lang.Object- Returns:
- a string representation of the vendor object
-
-