Class RecordPagedQueryResponseBuilder
java.lang.Object
com.commercetools.history.models.change_history.RecordPagedQueryResponseBuilder
- All Implemented Interfaces:
Builder<RecordPagedQueryResponse>
public class RecordPagedQueryResponseBuilder
extends Object
implements Builder<RecordPagedQueryResponse>
RecordPagedQueryResponseBuilder
Example to create an instance using the builder pattern
Example to create an instance using the builder pattern
RecordPagedQueryResponse recordPagedQueryResponse = RecordPagedQueryResponse.builder()
.limit(1)
.count(1)
.total(1)
.offset(1)
.plusResults(resultsBuilder -> resultsBuilder)
.build()
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddResults
(Function<RecordBuilder, Record> builder) Records matching the query.build()
builds RecordPagedQueryResponse with checking for non-null required valuesbuilds RecordPagedQueryResponse without checking for non-null required valuesActual number of results returned.getCount()
Actual number of results returned.getLimit()
Number of results requested.Number of elements skipped.Records matching the query.getTotal()
Total number of results matching the query.Number of results requested.of()
factory method for an instance of RecordPagedQueryResponseBuilderof
(RecordPagedQueryResponse template) create builder for RecordPagedQueryResponse instanceNumber of elements skipped.plusResults
(Record... results) Records matching the query.plusResults
(Function<RecordBuilder, RecordBuilder> builder) Records matching the query.Records matching the query.Records matching the query.setResults
(Function<RecordBuilder, Record> builder) Records matching the query.Total number of results matching the query.withResults
(Function<RecordBuilder, RecordBuilder> builder) Records matching the query.
-
Constructor Details
-
RecordPagedQueryResponseBuilder
public RecordPagedQueryResponseBuilder()
-
-
Method Details
-
limit
Number of results requested.
- Parameters:
limit
- value to be set- Returns:
- Builder
-
count
Actual number of results returned.
- Parameters:
count
- value to be set- Returns:
- Builder
-
total
Total number of results matching the query. This number is an estimation and not strongly consistent.
- Parameters:
total
- value to be set- Returns:
- Builder
-
offset
Number of elements skipped.
- Parameters:
offset
- value to be set- Returns:
- Builder
-
results
Records matching the query.
- Parameters:
results
- value to be set- Returns:
- Builder
-
results
Records matching the query.
- Parameters:
results
- value to be set- Returns:
- Builder
-
plusResults
Records matching the query.
- Parameters:
results
- value to be set- Returns:
- Builder
-
plusResults
Records matching the query.
- Parameters:
builder
- function to build the results value- Returns:
- Builder
-
withResults
Records matching the query.
- Parameters:
builder
- function to build the results value- Returns:
- Builder
-
addResults
Records matching the query.
- Parameters:
builder
- function to build the results value- Returns:
- Builder
-
setResults
Records matching the query.
- Parameters:
builder
- function to build the results value- Returns:
- Builder
-
getLimit
Number of results requested.
- Returns:
- limit
-
getCount
Actual number of results returned.
- Returns:
- count
-
getTotal
Total number of results matching the query. This number is an estimation and not strongly consistent.
- Returns:
- total
-
getOffset
Number of elements skipped.
- Returns:
- offset
-
getResults
Records matching the query.
- Returns:
- results
-
build
builds RecordPagedQueryResponse with checking for non-null required values- Specified by:
build
in interfaceBuilder<RecordPagedQueryResponse>
- Returns:
- RecordPagedQueryResponse
-
buildUnchecked
builds RecordPagedQueryResponse without checking for non-null required values- Returns:
- RecordPagedQueryResponse
-
of
factory method for an instance of RecordPagedQueryResponseBuilder- Returns:
- builder
-
of
create builder for RecordPagedQueryResponse instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-