Java 推土机:如何转换通用字段
我是一个新的推土机用户。 当我将ProductInfo转换为ProductDto时,抛出一个异常。 错误消息是: 类没有字段 有一个通用字段:Java 推土机:如何转换通用字段,java,generics,converter,dozer,Java,Generics,Converter,Dozer,我是一个新的推土机用户。 当我将ProductInfo转换为ProductDto时,抛出一个异常。 错误消息是: 类没有字段 有一个通用字段:TrialInfoTrialInfo,是否有方法转换此产品型号 public class ProductInfo implements Serializable{ private PriceInfo priceInfo; public priceInfo getPriceInfo() { return priceInfo;
TrialInfo
TrialInfo,是否有方法转换此产品型号
public class ProductInfo implements Serializable{
private PriceInfo priceInfo;
public priceInfo getPriceInfo() {
return priceInfo;
}
public void setPriceInfo(PriceInfo priceInfo) {
this.priceInfo = priceInfo;
}
}
public class PriceInfo implements Serializable {
private TrialInfo<Amount> trialInfo;
public TrialInfo<Amount> getTrialInfo() {
return trialInfo;
}
public void setTrialInfo(TrialInfo<Amount> trialInfo) {
this.trialInfo = trialInfo;
}
}
public class TrialInfo<AmountT> implements Serializable {
private AmountT trialAmount;
public AmountT getTrialAmount() {
return trialAmount;
}
public void setTrialAmount(AmountT trialAmount) {
this.trialAmount = trialAmount;
}
}
public class Amount implements Serializable {
private int storage;
public int getStorage() {
return storage;
}
public void setStorage(int storage) {
this.storage = storage;
}
}
公共类ProductInfo实现可序列化{
PriceInfo PriceInfo;
public priceInfo getPriceInfo(){
返回价格信息;
}
public void setPriceInfo(PriceInfo PriceInfo){
this.priceInfo=priceInfo;
}
}
公共类PriceInfo实现可序列化{
私人TrialInfo TrialInfo;
公共TrialInfo getTrialInfo(){
返回trialInfo;
}
公共无效集合TrialInfo(TrialInfo TrialInfo){
this.trialInfo=trialInfo;
}
}
公共类TrialInfo实现了可序列化{
私人金额trialAmount;
公共金额getTrialAmount(){
返回trialAmount;
}
公共无效集合数量(集合数量){
this.trialAmount=trialAmount;
}
}
公共类金额实现可序列化{
私有int存储;
public int getStorage(){
返回存储;
}
公共存储(内部存储){
这个.存储=存储;
}
}