use of com.salesmanager.shop.model.system.ReadableOptin in project shopizer by shopizer-ecommerce.
the class OptinFacadeImpl method create.
@Override
public ReadableOptin create(PersistableOptin persistableOptin, MerchantStore merchantStore, Language language) {
Optin optinEntity = persistableOptinConverter.convert(persistableOptin, merchantStore, language);
Optin savedOptinEntity = createOptin(optinEntity);
return readableOptinConverter.convert(savedOptinEntity, merchantStore, language);
}
use of com.salesmanager.shop.model.system.ReadableOptin in project shopizer by shopizer-ecommerce.
the class ReadableOptinMapper method convert.
@Override
public ReadableOptin convert(Optin source, MerchantStore store, Language language) {
ReadableOptin optinEntity = new ReadableOptin();
optinEntity.setCode(source.getCode());
optinEntity.setDescription(source.getDescription());
optinEntity.setOptinType(source.getOptinType().name());
return optinEntity;
}
use of com.salesmanager.shop.model.system.ReadableOptin in project shopizer by shopizer-ecommerce.
the class ReadableOptinPopulator method populate.
@Override
public ReadableOptin populate(Optin source, ReadableOptin target, MerchantStore store, Language language) throws ConversionException {
Validate.notNull(store, "MerchantStore cannot be null");
Validate.notNull(source, "Optin cannot be null");
if (target == null) {
target = new ReadableOptin();
}
target.setCode(source.getCode());
target.setDescription(source.getDescription());
target.setEndDate(source.getEndDate());
target.setId(source.getId());
target.setOptinType(source.getOptinType().name());
target.setStartDate(source.getStartDate());
target.setStore(store.getCode());
return target;
}
Aggregations