public static class

ArticleListRequest.Builder

extends KnowledgeRequest.KnowledgeRequestBuilder<T extends KnowledgeRequestBuilder<T>>
java.lang.Object
   ↳ com.salesforce.android.service.common.fetchsave.requests.FetchSaveRequest.FetchSaveRequestBuilder<T extends com.salesforce.android.service.common.fetchsave.requests.FetchSaveRequest.FetchSaveRequestBuilder<T>>
     ↳ com.salesforce.android.knowledge.core.requests.KnowledgeRequest.KnowledgeRequestBuilder<T extends com.salesforce.android.knowledge.core.requests.KnowledgeRequest.KnowledgeRequestBuilder<T>>
       ↳ com.salesforce.android.knowledge.core.requests.ArticleListRequest.Builder

Class Overview

Builder class for the ArticleListRequest type.

Summary

Constants
int DEFAULT_PAGE_NUMBER The default page number used if not specified.
int DEFAULT_PAGE_SIZE The default page size used if not specified.
int DEFAULT_QUERY_METHOD The default query method used if not specified.
int DEFAULT_SORT_BY The default sorting type used if not specified.
int DEFAULT_SORT_ORDER The default sort order used if not specified.
Public Methods
ArticleListRequest build()
Builds the ArticleListRequest without submitting to to a KnowledgeClient.
ArticleListRequest.Builder dataCategory(String group, String category)
Return only articles that exist in the given data category, as determined by the queryMethod(int).
ArticleListRequest.Builder pageNumber(int pageNumber)
Set which page of articles to retrieve in the request.
ArticleListRequest.Builder pageSize(int pageSize)
Sets the number of articles to retrieve.
ArticleListRequest.Builder queryMethod(int queryMethod)
Sets the query method to use when fetching articles.
ArticleListRequest.Builder searchTerm(CharSequence searchTerm)
The search term to use to filter the returned articles.
ArticleListRequest.Builder sortBy(int sortBy)
Which field to use for sorting the returned results.
ArticleListRequest.Builder sortOrder(int sortOrder)
The sort order to use for the returned results.
Async<ArticleList> submit(KnowledgeClient client)
Builds an ArticleListRequest and submits it directly to the given KnowledgeClient.
Protected Methods
ArticleListRequest.Builder getThis()
[Expand]
Inherited Methods
From class com.salesforce.android.service.common.fetchsave.requests.FetchSaveRequest.FetchSaveRequestBuilder
From class java.lang.Object

Constants

public static final int DEFAULT_PAGE_NUMBER

The default page number used if not specified.

Constant Value: 1 (0x00000001)

public static final int DEFAULT_PAGE_SIZE

The default page size used if not specified.

Constant Value: 3 (0x00000003)

public static final int DEFAULT_QUERY_METHOD

The default query method used if not specified.

Constant Value: 1 (0x00000001)

public static final int DEFAULT_SORT_BY

The default sorting type used if not specified.

Constant Value: 1 (0x00000001)

public static final int DEFAULT_SORT_ORDER

The default sort order used if not specified.

Constant Value: 2 (0x00000002)

Public Methods

public ArticleListRequest build ()

Builds the ArticleListRequest without submitting to to a KnowledgeClient.

Returns

public ArticleListRequest.Builder dataCategory (String group, String category)

Return only articles that exist in the given data category, as determined by the queryMethod(int). If not specified then articles will not be filtered by category.

Parameters
group The data category group containing the category to search.
category The data category from which to retrieve the articles.
Returns
  • This instance for fluent API calls.

public ArticleListRequest.Builder pageNumber (int pageNumber)

Set which page of articles to retrieve in the request. Page numbers are one-indexed. The default value is 1 (the first page).

Parameters
pageNumber The page to retrieve.
Returns
  • This instance for fluent API calls.
Throws
IllegalArgumentException if pageNumber is less than one.

public ArticleListRequest.Builder pageSize (int pageSize)

Sets the number of articles to retrieve. Default is three.

Parameters
pageSize The number of articles to retrieve.
Returns
  • This instance for fluent API calls.
Throws
IllegalArgumentException if pageSize is less than one.

public ArticleListRequest.Builder queryMethod (int queryMethod)

Sets the query method to use when fetching articles. Default is QUERY_BELOW.

Parameters
queryMethod The query method to use.
Returns
  • This instance for fluent API calls.

public ArticleListRequest.Builder searchTerm (CharSequence searchTerm)

The search term to use to filter the returned articles. If not specified then no search term will be used to filter articles.

The behaviour of the search term varies for offline and online searching, so you may receive slightly different results when searching with the device online vs the device offline.

Parameters
searchTerm The term to use for filtering.
Returns
  • This instance for fluent API calls.

public ArticleListRequest.Builder sortBy (int sortBy)

Which field to use for sorting the returned results. The actual sorting algorithm used will be appropriate for the chosen field. Default is SORT_BY_LAST_PUBLISHED_DATE.

Parameters
sortBy The field to use when sorting the results.
Returns
  • This instance for fluent API calls.

public ArticleListRequest.Builder sortOrder (int sortOrder)

The sort order to use for the returned results. Default is SORT_DESC.

Parameters
sortOrder The order to use when sorting the results.
Returns
  • This instance for fluent API calls.

public Async<ArticleList> submit (KnowledgeClient client)

Builds an ArticleListRequest and submits it directly to the given KnowledgeClient. This is a convenience method for client.submit(builder.build());

Parameters
client The KnowledgeClient to which to submit the request.
Returns
  • The Async return value representing the result of the request.

Protected Methods

protected ArticleListRequest.Builder getThis ()