Class BusinessProduct
java.lang.Object
us.teaminceptus.novaconomy.api.util.Product
us.teaminceptus.novaconomy.api.util.BusinessProduct
- All Implemented Interfaces:
Comparable<Product>,ConfigurationSerializable
Represents a Product owned by a Business
-
Constructor Summary
ConstructorsConstructorDescriptionBusinessProduct(@NotNull ItemStack item, @NotNull Economy econ, double amount, @NotNull Business business) Constructs a Business Product.BusinessProduct(@NotNull ItemStack item, @NotNull Price price, @NotNull Business business) Constructs a Business Product.BusinessProduct(@NotNull Product pr, @NotNull Business business) Constructs a Business Product from a Product and Business. -
Method Summary
Modifier and TypeMethodDescriptionstatic @Nullable BusinessProductdeserialize(@Nullable Map<String, Object> serial) Deserializes a Map into a BusinessProduct.@NotNull BusinessFetches the BusinessProduct's Business.voidsetBusiness(@NotNull Business business) Sets the BusinessProduct's Business.Sets the Product's Selling Item.Sets the Proudct's selling price.toString()
-
Constructor Details
-
BusinessProduct
public BusinessProduct(@NotNull @NotNull ItemStack item, @NotNull @NotNull Price price, @NotNull @NotNull Business business) throws IllegalArgumentException Constructs a Business Product.- Parameters:
item- Item to useprice- Price to usebusiness- Business to use- Throws:
IllegalArgumentException- if item, price, or business is null
-
BusinessProduct
public BusinessProduct(@NotNull @NotNull ItemStack item, @NotNull @NotNull Economy econ, double amount, @NotNull @NotNull Business business) throws IllegalArgumentException Constructs a Business Product.- Parameters:
item- Item to useecon- Economy Price is usingamount- Amount Price is selling atbusiness- Business to use- Throws:
IllegalArgumentException- if item, price, or economy is null / amount is less than or greater than 0
-
BusinessProduct
public BusinessProduct(@NotNull @NotNull Product pr, @NotNull @NotNull Business business) throws IllegalArgumentException Constructs a Business Product from a Product and Business.- Parameters:
pr- Product to usebusiness- Business to use- Throws:
IllegalArgumentException- if product or business is null
-
-
Method Details
-
getBusiness
Fetches the BusinessProduct's Business.- Returns:
- Business that owns this BusinessProduct
-
setBusiness
Sets the BusinessProduct's Business.- Parameters:
business- Business to set
-
setPrice
Description copied from class:ProductSets the Proudct's selling price.- Overrides:
setPricein classProduct- Parameters:
price- Price Selling at- Returns:
- this Product, for chaining
- Throws:
IllegalArgumentException- if Price is null
-
setItem
Description copied from class:ProductSets the Product's Selling Item.- Overrides:
setItemin classProduct- Parameters:
item- Item to sell- Returns:
- this Product, for chaining
- Throws:
IllegalArgumentException- if item is null
-
toString
-
serialize
- Specified by:
serializein interfaceConfigurationSerializable- Overrides:
serializein classProduct
-
deserialize
@Nullable public static @Nullable BusinessProduct deserialize(@Nullable @Nullable Map<String, Object> serial) throws IllegalArgumentExceptionDeserializes a Map into a BusinessProduct.- Parameters:
serial- Serialization fromserialize()- Returns:
- Deserialized BusinessProduct
- Throws:
IllegalArgumentException- if a argument is missing or
-