Class Commission
- java.lang.Object
-
- edu.cnm.deepdive.albuquirky.model.entity.Commission
-
@Entity public class Commission extends Object
This is theCommissionentity class, which declares the attributes needed for each commission which includes, the commission ID, the commission request, waitlist position, the seller ID, a timestamp, theCommissionID and theProductID. Both seller ID and commissioner ID are annotated by @ManyToOne coming fromProfile. Commissions accepted by the commissioner becomeProduct.
-
-
Constructor Summary
Constructors Constructor Description Commission()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ProfilegetCommissioner()Gets the commissioningProfile.StringgetCommissionRequest()Returns the commission request for theCommission.LonggetId()Gets the ID of theCommission.ProductgetProduct()Gets theProductassociated with the commission.ProfilegetSeller()Returns theProfileid of the seller.DategetTimestamp()Gets the commission creation timestamp.intgetWaitlistPosition()Gets the waitlist position for the commission.voidsetCommissioner(Profile commissioner)Setter of the commissionervoidsetCommissionRequest(String commissionRequest)Sets the commission request for theCommission.voidsetProduct(Product product)Sets theProductassociated with the commission.voidsetSeller(Profile seller)SetsProfileseller idvoidsetWaitlistPosition(int waitlistPosition)Sets thewaitlistPosition
-
-
-
Method Detail
-
getId
public Long getId()
Gets the ID of theCommission.- Returns:
- The
Commission.
-
getCommissionRequest
@NonNull public String getCommissionRequest()
Returns the commission request for theCommission.- Returns:
- The commission request for the
Commission.
-
setCommissionRequest
public void setCommissionRequest(@NonNull String commissionRequest)Sets the commission request for theCommission.- Parameters:
commissionRequest- The commission request content.
-
getWaitlistPosition
public int getWaitlistPosition()
Gets the waitlist position for the commission.- Returns:
- The current waitlist position.
-
setWaitlistPosition
public void setWaitlistPosition(int waitlistPosition)
Sets thewaitlistPosition- Parameters:
waitlistPosition- - int
-
setSeller
public void setSeller(Profile seller)
SetsProfileseller id- Parameters:
seller- - Profile
-
getTimestamp
@NonNull public Date getTimestamp()
Gets the commission creation timestamp.- Returns:
- The timestamp from when the commission was created.
-
getCommissioner
@NonNull public Profile getCommissioner()
Gets the commissioningProfile.- Returns:
- The
Profilewho created the commission.
-
setCommissioner
public void setCommissioner(@NonNull Profile commissioner)Setter of the commissioner- Parameters:
commissioner-Profile
-
getProduct
public Product getProduct()
Gets theProductassociated with the commission.- Returns:
- product- Product
-
-