Class BasicNamedQueryDataPopulator
- java.lang.Object
-
- de.hybris.platform.cmsfacades.media.populator.BasicNamedQueryDataPopulator
-
- All Implemented Interfaces:
Populator<NamedQueryData,NamedQuery>
public class BasicNamedQueryDataPopulator extends java.lang.Object implements Populator<NamedQueryData,NamedQuery>
This populator will convert the the basic attributes of theNamedQuerybean: - queryName - currentPage - pageSize - sort params
-
-
Constructor Summary
Constructors Constructor Description BasicNamedQueryDataPopulator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.util.List<Sort>convertSort(java.lang.String sort)Converts the String sort param into a list of objects.protected SortconvertSortBlock(java.lang.String sortBlock)Convert A sort block, i.e.voidpopulate(NamedQueryData namedQueryData, NamedQuery namedQuery)Populate the target instance with values from the source instance.protected java.lang.IntegertoOptionalInteger(java.lang.String value)Convert the string to an integer.
-
-
-
Method Detail
-
populate
public void populate(NamedQueryData namedQueryData, NamedQuery namedQuery) throws ConversionException
Description copied from interface:PopulatorPopulate the target instance with values from the source instance.- Specified by:
populatein interfacePopulator<NamedQueryData,NamedQuery>- Parameters:
namedQueryData- the source objectnamedQuery- the target to fill- Throws:
ConversionException- if an error occurs
-
toOptionalInteger
protected java.lang.Integer toOptionalInteger(java.lang.String value)
Convert the string to an integer. If the value is null, then return null. This method assumes that a validation has already taken place, and a NumberFormatException is not expected at this point.- Parameters:
value- - the value to be converted- Returns:
- the Integer value
-
convertSort
protected java.util.List<Sort> convertSort(java.lang.String sort)
Converts the String sort param into a list of objects. The input, if not empty, should be already validated with the following format: {param}:{direction} Multiple sort parameters are allowed if the blocks are separated by comma.- Parameters:
sort- - the sort parameter received from the request- Returns:
- a list of Sort objects
-
convertSortBlock
protected Sort convertSortBlock(java.lang.String sortBlock)
Convert A sort block, i.e. {param}:{direction} into a Sort object.- Parameters:
sortBlock-- Returns:
-
-