Simplified via Lombok notation
This commit is contained in:
@@ -1,120 +1,44 @@
|
||||
package de.rwu.easydrop.api.dto;
|
||||
|
||||
import de.rwu.easydrop.util.FormattingUtil;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* Product data transfer object.
|
||||
*
|
||||
* @since 0.1.0
|
||||
*/
|
||||
@Data
|
||||
public class ProductDTO {
|
||||
/**
|
||||
* Data source platform, like "Amazon".
|
||||
*/
|
||||
private String dataOrigin;
|
||||
|
||||
/**
|
||||
* @return the dataOrigin
|
||||
*/
|
||||
public String getDataOrigin() {
|
||||
return dataOrigin;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param newDataOrigin the dataOrigin to set
|
||||
*/
|
||||
public void setDataOrigin(final String newDataOrigin) {
|
||||
this.dataOrigin = newDataOrigin;
|
||||
}
|
||||
|
||||
/**
|
||||
* Platform internal product identifier.
|
||||
*/
|
||||
private String productId;
|
||||
|
||||
/**
|
||||
* @return the productId
|
||||
*/
|
||||
public String getProductId() {
|
||||
return productId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Current product price per piece in Euro.
|
||||
*/
|
||||
private double currentPrice;
|
||||
|
||||
/**
|
||||
* @return the currentPrice
|
||||
*/
|
||||
public double getCurrentPrice() {
|
||||
return currentPrice;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param newCurrentPrice the currentPrice to set
|
||||
*/
|
||||
public void setCurrentPrice(final double newCurrentPrice) {
|
||||
this.currentPrice = newCurrentPrice;
|
||||
}
|
||||
|
||||
/**
|
||||
* Name of mercant offering the product on the platform.
|
||||
*/
|
||||
private String merchant;
|
||||
|
||||
/**
|
||||
* @return the merchant
|
||||
*/
|
||||
public String getMerchant() {
|
||||
return merchant;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param newMerchant the merchant to set
|
||||
*/
|
||||
public void setMerchant(final String newMerchant) {
|
||||
this.merchant = newMerchant;
|
||||
}
|
||||
|
||||
/**
|
||||
* Additional Cost for delivery in Euro.
|
||||
*/
|
||||
private double deliveryPrice;
|
||||
|
||||
/**
|
||||
* @return the deliveryPrice
|
||||
*/
|
||||
public double getDeliveryPrice() {
|
||||
return deliveryPrice;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param newDeliveryPrice the deliveryPrice to set
|
||||
*/
|
||||
public void setDeliveryPrice(final double newDeliveryPrice) {
|
||||
this.deliveryPrice = newDeliveryPrice;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether the product can be purchased at this point.
|
||||
*/
|
||||
private boolean available;
|
||||
|
||||
/**
|
||||
* @return the available
|
||||
*/
|
||||
public boolean isAvailable() {
|
||||
return available;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param newAvailable the available to set
|
||||
*/
|
||||
public void setAvailable(final boolean newAvailable) {
|
||||
this.available = newAvailable;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates ProductDTO instance.
|
||||
*
|
||||
@@ -125,15 +49,4 @@ public class ProductDTO {
|
||||
this.productId = newProductId;
|
||||
this.dataOrigin = newDataOrigin;
|
||||
}
|
||||
|
||||
@Override
|
||||
public final String toString() {
|
||||
return "ProductDTO{"
|
||||
+ productId + " from "
|
||||
+ merchant + " ("
|
||||
+ dataOrigin + ")"
|
||||
+ " at "
|
||||
+ FormattingUtil.formatEuro(currentPrice) + " (available: "
|
||||
+ (available ? "yes" : "no") + ")}";
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user