Class Pager.Builder

  • Enclosing class:
    Pager

    public static class Pager.Builder
    extends Object
    An inner static Builder class used for building the Pager object with various criteria. This uses the builder fluent API pattern. All of the attributes in this Builder class correspond to the attributes in the containing Pager class.
    • Constructor Detail

      • Builder

        public Builder​(String resourceName)
        Assigns the given resourceName to the resourceName of this Builder.
        Parameters:
        resourceName - the name of the Ethos resource.
    • Method Detail

      • forVersion

        public Pager.Builder forVersion​(String version)
        Assigns the specified version and returns this builder for fluent API functionality.
        Parameters:
        version - The version of the Ethos resource (A.K.A media type).
        Returns:
        This Builder with the version assigned.
      • withCriteriaFilter

        public Pager.Builder withCriteriaFilter​(String criteriaFilter)
        Assigns the specified request URL criteria filter and returns this builder for fluent API functionality. Nulls out the namedQueryFilter, filterMap, and qapiRequestBody because there can only be one filter approach used at a time.
        Parameters:
        criteriaFilter - The request URL criteria-based filter which can also be used when paging.
        Returns:
        The Builder with the criteria filter assigned.
      • withNamedQueryFilter

        public Pager.Builder withNamedQueryFilter​(String namedQueryFilter)
        Assigns the specified request URL named query filter and returns this builder for fluent API functionality. Nulls out the criteriaFilter, filterMap, and qapiRequestBody because there can only be one filter approach used at a time.
        Parameters:
        namedQueryFilter - The request URL named query filter which can also be used when paging.
        Returns:
        The Builder with the named query filter assigned.
      • withFilterMap

        public Pager.Builder withFilterMap​(String filterMap)
        Assigns the specified request URL filter map and returns this builder for fluent API functionality. Nulls out the criteriaFilter, namedQueryFilter, and qapiRequestBody because there can only be one filter approach used at a time.
        Parameters:
        filterMap - The request URL filter map which can also be used when paging.
        Returns:
        The Builder with the filter map assigned.
      • withQAPIRequestBodyFilter

        public Pager.Builder withQAPIRequestBodyFilter​(String qapiRequestBody)
        Assigns the specified QAPI request request body and returns this builder for fluent API functionality. Nulls out the criteriaFilter, namedQueryFilter, and filterMap because there can only be one filter approach used at a time.
        Parameters:
        qapiRequestBody - The QAPI request body which can also be used when paging.
        Returns:
        The Builder with the QAPI request body assigned.
      • withPageSize

        public Pager.Builder withPageSize​(int pageSize)
        Assigns the specified pageSize and returns this builder for fluent API functionality.
        Parameters:
        pageSize - The pageSize (number of rows in each response) to page with.
        Returns:
        This Builder with the pageSize assigned.
      • forNumPages

        public Pager.Builder forNumPages​(int numPages)
        Assigns the specified numPages and returns this builder for fluent API functionality.
        Parameters:
        numPages - The number of pages to page for.
        Returns:
        This Builder with the numPages assigned.
      • forNumRows

        public Pager.Builder forNumRows​(int numRows)
        Assigns the specified numRows and returns this builder for fluent API functionality.
        Parameters:
        numRows - The number of rows to page for. Data is returned in pages up to the specified number of rows.
        Returns:
        This Builder with the numRows assigned.
      • fromOffset

        public Pager.Builder fromOffset​(int offset)
        Assigns the specified offset and returns this builder for fluent API functionality.
        Parameters:
        offset - The offset (row number) to start paging from.
        Returns:
        This Builder with the offset assigned.
      • withTotalCount

        public Pager.Builder withTotalCount​(int totalCount)
        Assigns the specified totalCount and returns this builder for fluent API functionality.
        Parameters:
        totalCount - The total count of rows for the given resource.
        Returns:
        This Builder with the totalCount assigned.
      • forPagingType

        public Pager.Builder forPagingType​(Pager.PagingType pagingType)
        Assigns the specified PagingType for how to page and returns this builder for fluent API functionality.
        Parameters:
        pagingType - Must be of the PagingType enumeration defined in the Pager class, and used to determine how to page.
        Returns:
        This Builder with the pagingType assigned.
      • withShouldDoPaging

        public Pager.Builder withShouldDoPaging​(boolean shouldDoPaging)
        Assigns the specified shouldDoPaging indicator and returns this builder for fluent API functionality.
        Parameters:
        shouldDoPaging - Determines whether paging should be done, or not.
        Returns:
        This Builder with the shouldDoPaging indicator assigned.
      • withEthosResponse

        public Pager.Builder withEthosResponse​(EthosResponse ethosResponse)
        Assigns the specified EthosResponse and returns this builder for fluent API functionality.
        Parameters:
        ethosResponse - The ethosResponse obtained from the initial GET request made to determine whether paging is needed or not.
        Returns:
        This Builder with the ethosResponse assigned.
      • build

        public Pager build()
        Builds the Pager object with whatever attributes are specified from the various methods above.
        Returns:
        A new Pager object containing whatever attributes are assigned. Note that not all attributes may have been assigned.