Class BasicNamedQueryDataPopulator
java.lang.Object
de.hybris.platform.cmsfacades.media.populator.BasicNamedQueryDataPopulator
- All Implemented Interfaces:
Populator<NamedQueryData,NamedQuery>
public class BasicNamedQueryDataPopulator
extends Object
implements Populator<NamedQueryData,NamedQuery>
This populator will convert the the basic attributes of the
NamedQuery bean: - queryName - currentPage -
pageSize - sort params-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionconvertSort(String sort) Converts the String sort param into a list of objects.protected SortconvertSortBlock(String sortBlock) Convert A sort block, i.e.voidpopulate(NamedQueryData namedQueryData, NamedQuery namedQuery) Populate the target instance with values from the source instance.protected IntegertoOptionalInteger(String value) Convert the string to an integer.
-
Constructor Details
-
BasicNamedQueryDataPopulator
public BasicNamedQueryDataPopulator()
-
-
Method Details
-
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
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
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
Convert A sort block, i.e. {param}:{direction} into a Sort object.- Parameters:
sortBlock-- Returns:
-