Class Product
java.lang.Object
org.salespointframework.core.AbstractEntity<Product.ProductIdentifier>
org.salespointframework.core.AbstractAggregateRoot<Product.ProductIdentifier>
org.salespointframework.catalog.Product
- All Implemented Interfaces:
Comparable<Product>, Persistable<Product.ProductIdentifier>
@Entity
public class Product
extends AbstractAggregateRoot<Product.ProductIdentifier>
implements Comparable<Product>
A product.
- Author:
- Paul Henke, Oliver Gierke
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class{link ProductIdentifier} serves as an identifier type forProductobjects. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanaddCategory(String category) Adds theProductto the given category.intcreateQuantity(double amount) createQuantity(long amount) Returns the categories theProductis assigned to.getId()Returns the unique id of thisProduct.@NonNull StringgetName()@NonNull javax.money.MonetaryAmountgetPrice()final booleanremoveCategory(String category) setPrice(@NonNull javax.money.MonetaryAmount price) booleantoString()voidMethods inherited from class AbstractAggregateRoot
registerEventMethods inherited from class AbstractEntity
equals, hashCode, hasId, isNew
-
Constructor Details
-
Method Details
-
getId
Returns the unique id of thisProduct.- Specified by:
getIdin interfacePersistable<Product.ProductIdentifier>- Returns:
- will never be null
-
getCategories
Returns the categories theProductis assigned to.- Returns:
- will never be null.
-
addCategory
-
removeCategory
-
supports
-
verify
-
createQuantity
-
createQuantity
-
compareTo
- Specified by:
compareToin interfaceComparable<Product>
-
toString
-
getName
-
setName
-
getPrice
@NonNull public @NonNull javax.money.MonetaryAmount getPrice() -
setPrice
- Returns:
this.
-