to be done in java
Your task is to finish the StockItem class so that it meets thefollowing criteria
• The StockItem class will have 4 attributes:
a stock number;
a name;
the price of the item;
the total number of items currently in stock
• The first three of the above characteristics will need to beset at the time a StockItem object is created, with the totalnumber of items set to 0 at this time. The stock number and namewill not need to be changed after an item is created.
• The following methods are also required:
o A method that allows the price to be re-set during theobject's lifetime
o a method that takes an integer argument and adds this to thetotal number of items in stock
o a method that returns the total value of items of this stocktype;
calculated by multiplying the price of the item by the number ofitems in stock (price * units)
Required Methods: StockItem(String, String, double) (classconstructor) setPrice(double) increaseTotalStock(int)getStockNumber(): String getName(): String getTotalStock(): intgetPrice(): double calculateTotalPrice(): double
Requested files StockItem.java
/** * A class representing an item in stock in some sort * ofinventory system */
public class StockItem {
//TODO: add fields for a: name, stockNumber, price, units.
//TODO: create a constructor that takes name, stockNumber andprice as arguments
// and sets units to 0.
//TODO: create accessor (\"getter\") methods for price, stocknumber and name.
//TODO: create a method increaseTotalStock that increases unitsby a given quantity.
//TODO:create a mutator (\"setter\") method setPrice that setsprice to a given amount.
//TODO: create a method calculateTotalPrice that returns thetotal price of the current inventory
// (Calculated as current price * number of units) }