Class DataListBuilder

  • All Implemented Interfaces:
    org.springframework.beans.factory.Aware, org.springframework.context.ApplicationContextAware

    public class DataListBuilder
    extends ServiceConfig
    DataList Builder

    Builder class to generate DataLists

    Author:
    Pablo GARCIA - 20/MAR/2017
    • Constructor Detail

      • DataListBuilder

        public DataListBuilder()
    • Method Detail

      • setEnumQueryResult

        public DataListBuilder setEnumQueryResult​(List<Global> enumQueryResult)
        Adds a EnumQueryResult
        Parameters:
        enumQueryResult - Enumerated query output
        Returns:
        DataListBuilder
      • setServiceQueryResult

        public DataListBuilder setServiceQueryResult​(String[] serviceQueryResult)
        Adds a ServiceQueryResult
        Parameters:
        serviceQueryResult - Service query output
        Returns:
        DataListBuilder
      • setFieldList

        public DataListBuilder setFieldList​(List<SqlField> fieldList)
        Adds the list of Field needed for the service query result
        Parameters:
        fieldList - Field list
        Returns:
        DataListBuilder
      • setQueryResult

        public DataListBuilder setQueryResult​(List<com.querydsl.core.Tuple> queryResult)
        Adds a QueryResult
        Parameters:
        queryResult - Query result
        Returns:
        DataListBuilder
      • setQueryProjection

        public DataListBuilder setQueryProjection​(com.querydsl.core.types.Expression<?> projection)
        Adds the query projection containing information about the columns returned
        Parameters:
        projection - Query projection
        Returns:
        DataListBuilder
      • setDataList

        public DataListBuilder setDataList​(DataList dataList)
        Set the response as a datalist
        Parameters:
        dataList - DataList
        Returns:
        DataListBuilder
      • addDataList

        public DataListBuilder addDataList​(DataList dataList)
        Add a datalist
        Parameters:
        dataList - DataList
        Returns:
        DataListBuilder
      • addTransform

        public DataListBuilder addTransform​(TransformCellProcessor transform)
        Add a transform processor
        Parameters:
        transform - Transform processor
        Returns:
        DataListBuilder
      • addTranslate

        public DataListBuilder addTranslate​(TranslateCellProcessor translate)
        Add a translate processor
        Parameters:
        translate - Translate processor
        Returns:
        DataListBuilder
      • addNoPrint

        public DataListBuilder addNoPrint​(String noPrint)
        Add a no print field
        Parameters:
        noPrint - No print field alias
        Returns:
        DataListBuilder
      • addColumn

        public DataListBuilder addColumn​(String columnId,
                                         List<?> data,
                                         String type)
        Add a column to datalist
        Parameters:
        columnId - Column id
        data - Column data
        type - Column data type
        Returns:
        DataListBuilder
      • paginate

        public DataListBuilder paginate​(boolean paginate)
        Manage pagination or not
        Parameters:
        paginate - Paginate
        Returns:
        DataListBuilder
      • setPage

        public DataListBuilder setPage​(Long page)
        Set datalist page
        Parameters:
        page - Page number
        Returns:
        DataListBuilder
      • setMax

        public DataListBuilder setMax​(Long max)
        Set datalist max records per page
        Parameters:
        max - Max elements per page
        Returns:
        DataListBuilder
      • setRecords

        public DataListBuilder setRecords​(Long records)
        Set datalist records
        Parameters:
        records - Total records
        Returns:
        DataListBuilder
      • sort

        public DataListBuilder sort​(List<SortColumn> sortList)
        Set datalist max records per page
        Parameters:
        sortList - Sort field list
        Returns:
        DataListBuilder
      • filter

        public DataListBuilder filter​(String column,
                                      String value)
        Filter datalist
        Parameters:
        column - Column name
        value - filter value
        Returns:
        DataListBuilder
      • distinct

        public DataListBuilder distinct​(List<SortColumn> distinctList)
        Set datalist max records per page
        Parameters:
        distinctList - Sort field list
        Returns:
        DataListBuilder
      • generateIdentifiers

        public DataListBuilder generateIdentifiers()
        Generate identifiers
        Returns:
        DataListBuilder