Class CategoryTravelRestrictionPopulator
java.lang.Object
de.hybris.platform.travelfacades.ancillary.search.converters.populator.CategoryTravelRestrictionPopulator
- All Implemented Interfaces:
de.hybris.platform.converters.Populator<CategoryModel,OfferGroupData>
public class CategoryTravelRestrictionPopulator
extends Object
implements de.hybris.platform.converters.Populator<CategoryModel,OfferGroupData>
Populator class to populate TravelRestriction for Category
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected StringgetAddToCartCriteria(OfferGroupRestrictionModel offerGroupRestrictionModel) Returns the addToCartCriteria code of the given offerGroupRestrictionModel.protected de.hybris.platform.servicelayer.dto.converter.Converter<TravelRestrictionModel,TravelRestrictionData> voidpopulate(CategoryModel source, OfferGroupData target) protected TravelRestrictionDatasetDefaultTravelRestrictionValues(TravelRestrictionData travelRestrictionData) Method to get the travelRestrictionData with the default values: effectiveDate = empty, expireDate = empty, travellerMinOfferQty = 0, travellerMaxOfferQty = -1, tripMinOfferQty = 0, tripMaxOfferQty = -1, addToCartCriteria = PER_LEG_PER_PAX.voidsetTravelRestrictionConverter(de.hybris.platform.servicelayer.dto.converter.Converter<TravelRestrictionModel, TravelRestrictionData> travelRestrictionConverter)
-
Constructor Details
-
CategoryTravelRestrictionPopulator
public CategoryTravelRestrictionPopulator()
-
-
Method Details
-
populate
public void populate(CategoryModel source, OfferGroupData target) throws de.hybris.platform.servicelayer.dto.converter.ConversionException - Specified by:
populatein interfacede.hybris.platform.converters.Populator<CategoryModel,OfferGroupData> - Throws:
de.hybris.platform.servicelayer.dto.converter.ConversionException
-
getAddToCartCriteria
Returns the addToCartCriteria code of the given offerGroupRestrictionModel. If the offerGroupRestrictionModel or the addToCartCriteria attribute are null, the default addToCartCriteria code is returned.- Parameters:
offerGroupRestrictionModel-- Returns:
- the addToCartCriteria code
-
setDefaultTravelRestrictionValues
protected TravelRestrictionData setDefaultTravelRestrictionValues(TravelRestrictionData travelRestrictionData) Method to get the travelRestrictionData with the default values: effectiveDate = empty, expireDate = empty, travellerMinOfferQty = 0, travellerMaxOfferQty = -1, tripMinOfferQty = 0, tripMaxOfferQty = -1, addToCartCriteria = PER_LEG_PER_PAX. The constant -1 is the value to represent no restriction on number- Parameters:
travelRestrictionData- the travelRestrictionData to populate with the default values- Returns:
- the travelRestrictionData with the default values
-
getTravelRestrictionConverter
protected de.hybris.platform.servicelayer.dto.converter.Converter<TravelRestrictionModel,TravelRestrictionData> getTravelRestrictionConverter()- Returns:
- travelRestrictionConverter
-
setTravelRestrictionConverter
public void setTravelRestrictionConverter(de.hybris.platform.servicelayer.dto.converter.Converter<TravelRestrictionModel, TravelRestrictionData> travelRestrictionConverter) - Parameters:
travelRestrictionConverter- as the travelRestrictionConverter to set
-