Class DefaultDistanceHelper
- java.lang.Object
-
- de.hybris.platform.commerceservices.storefinder.helpers.impl.DefaultDistanceHelper
-
- All Implemented Interfaces:
DistanceHelper
public class DefaultDistanceHelper extends java.lang.Object implements DistanceHelper
-
-
Field Summary
Fields Modifier and Type Field Description static doubleIMPERIAL_DISTANCE_RATIO
-
Constructor Summary
Constructors Constructor Description DefaultDistanceHelper()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.DoublegetDistance(DistanceUnit distanceUnit, double distanceInKm)java.lang.StringgetDistanceStringForLocation(java.lang.String locationName, double distanceInKm)Gets the distance string for given distance value and the distance unit that is set in corresponding base store model.java.lang.StringgetDistanceStringForStore(BaseStoreModel baseStoreModel, double distanceInKm)Gets the distance string for given distance value and the distance unit that is set in the base store model.protected java.lang.StringgetDistanceUnit(DistanceUnit distanceUnit)protected EnumerationServicegetEnumerationService()protected PointOfServiceServicegetPointOfServiceService()voidsetEnumerationService(EnumerationService enumerationService)voidsetPointOfServiceService(PointOfServiceService pointOfServiceService)
-
-
-
Field Detail
-
IMPERIAL_DISTANCE_RATIO
public static final double IMPERIAL_DISTANCE_RATIO
- See Also:
- Constant Field Values
-
-
Method Detail
-
getDistanceUnit
protected java.lang.String getDistanceUnit(DistanceUnit distanceUnit)
-
getDistance
protected java.lang.Double getDistance(DistanceUnit distanceUnit, double distanceInKm)
-
getDistanceStringForStore
public java.lang.String getDistanceStringForStore(BaseStoreModel baseStoreModel, double distanceInKm)
Description copied from interface:DistanceHelperGets the distance string for given distance value and the distance unit that is set in the base store model. In no distance unit is set in the store model default 'km' is assumed.- Specified by:
getDistanceStringForStorein interfaceDistanceHelper- Parameters:
baseStoreModel- the base store model that provide distance unitdistanceInKm- the distance in km- Returns:
- the calculated distance string
-
getDistanceStringForLocation
public java.lang.String getDistanceStringForLocation(java.lang.String locationName, double distanceInKm)Description copied from interface:DistanceHelperGets the distance string for given distance value and the distance unit that is set in corresponding base store model. If no distance unit is set in the store model default 'km' is assumed.- Specified by:
getDistanceStringForLocationin interfaceDistanceHelper- Parameters:
locationName- the location namedistanceInKm- the distance in km- Returns:
- the calculated distance string
-
getPointOfServiceService
protected PointOfServiceService getPointOfServiceService()
-
setPointOfServiceService
public void setPointOfServiceService(PointOfServiceService pointOfServiceService)
-
getEnumerationService
protected EnumerationService getEnumerationService()
-
setEnumerationService
public void setEnumerationService(EnumerationService enumerationService)
-
-