Package xyz.geik.farmer.model.inventory
Class FarmerItem
java.lang.Object
xyz.geik.farmer.model.inventory.FarmerItem
Farmer item which contains item name, price, amount and material.
Farmer item is an item which farmer can store in his inventory.
- Author:
- Geik
-
Constructor Summary
ConstructorDescriptionFarmerItem
(String name, double price, long amount) Constructor of FarmerItem -
Method Summary
Modifier and TypeMethodDescriptionclone()
Clones FarmerItemstatic List<FarmerItem>
deserializeItems
(String items) Deserialize FarmerItem from flat string to a listvoid
negateAmount
(long negate) Negating x from amountstatic String
serializeItems
(@NotNull List<FarmerItem> items) Serializing FarmerItem set to flat string Because it should save to databasevoid
sumAmount
(long sum) Summing x to amount
-
Constructor Details
-
FarmerItem
Constructor of FarmerItem- Parameters:
name
- of itemprice
- of itemamount
- of item
-
-
Method Details
-
clone
Clones FarmerItem -
sumAmount
public void sumAmount(long sum) Summing x to amount- Parameters:
sum
- sum amount
-
negateAmount
public void negateAmount(long negate) Negating x from amount- Parameters:
negate
- negate amount
-
serializeItems
Serializing FarmerItem set to flat string Because it should save to database- Parameters:
items
- list of item- Returns:
- serialized string
-
deserializeItems
Deserialize FarmerItem from flat string to a list- Parameters:
items
- serialized item list- Returns:
- List deserialized item list
-