001
002package com.commercetools.api.models.review;
003
004import java.time.*;
005import java.util.*;
006
007import com.fasterxml.jackson.annotation.JsonCreator;
008import com.fasterxml.jackson.annotation.JsonProperty;
009import com.fasterxml.jackson.databind.annotation.*;
010
011import io.vrap.rmf.base.client.ModelBase;
012import io.vrap.rmf.base.client.utils.Generated;
013
014import org.apache.commons.lang3.builder.EqualsBuilder;
015import org.apache.commons.lang3.builder.HashCodeBuilder;
016
017/**
018 * ReviewPagedQueryResponse
019 */
020@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
021public class ReviewPagedQueryResponseImpl implements ReviewPagedQueryResponse, ModelBase {
022
023    private Long limit;
024
025    private Long count;
026
027    private Long total;
028
029    private Long offset;
030
031    private java.util.List<com.commercetools.api.models.review.Review> results;
032
033    /**
034     * create instance with all properties
035     */
036    @JsonCreator
037    ReviewPagedQueryResponseImpl(@JsonProperty("limit") final Long limit, @JsonProperty("count") final Long count,
038            @JsonProperty("total") final Long total, @JsonProperty("offset") final Long offset,
039            @JsonProperty("results") final java.util.List<com.commercetools.api.models.review.Review> results) {
040        this.limit = limit;
041        this.count = count;
042        this.total = total;
043        this.offset = offset;
044        this.results = results;
045    }
046
047    /**
048     * create empty instance
049     */
050    public ReviewPagedQueryResponseImpl() {
051    }
052
053    /**
054     *  <p>Number of results requested.</p>
055     */
056
057    public Long getLimit() {
058        return this.limit;
059    }
060
061    /**
062     *  <p>Actual number of results returned.</p>
063     */
064
065    public Long getCount() {
066        return this.count;
067    }
068
069    /**
070     *  <p>Total number of results matching the query. This number is an estimation that is not strongly consistent. This field is returned by default. For improved performance, calculating this field can be deactivated by using the query parameter <code>withTotal=false</code>. When the results are filtered with a Query Predicate, <code>total</code> is subject to a limit.</p>
071     */
072
073    public Long getTotal() {
074        return this.total;
075    }
076
077    /**
078     *  <p>Number of elements skipped.</p>
079     */
080
081    public Long getOffset() {
082        return this.offset;
083    }
084
085    /**
086     *  <p>Reviews matching the query.</p>
087     */
088
089    public java.util.List<com.commercetools.api.models.review.Review> getResults() {
090        return this.results;
091    }
092
093    public void setLimit(final Long limit) {
094        this.limit = limit;
095    }
096
097    public void setCount(final Long count) {
098        this.count = count;
099    }
100
101    public void setTotal(final Long total) {
102        this.total = total;
103    }
104
105    public void setOffset(final Long offset) {
106        this.offset = offset;
107    }
108
109    public void setResults(final com.commercetools.api.models.review.Review... results) {
110        this.results = new ArrayList<>(Arrays.asList(results));
111    }
112
113    public void setResults(final java.util.List<com.commercetools.api.models.review.Review> results) {
114        this.results = results;
115    }
116
117    @Override
118    public boolean equals(Object o) {
119        if (this == o)
120            return true;
121
122        if (o == null || getClass() != o.getClass())
123            return false;
124
125        ReviewPagedQueryResponseImpl that = (ReviewPagedQueryResponseImpl) o;
126
127        return new EqualsBuilder().append(limit, that.limit)
128                .append(count, that.count)
129                .append(total, that.total)
130                .append(offset, that.offset)
131                .append(results, that.results)
132                .append(limit, that.limit)
133                .append(count, that.count)
134                .append(total, that.total)
135                .append(offset, that.offset)
136                .append(results, that.results)
137                .isEquals();
138    }
139
140    @Override
141    public int hashCode() {
142        return new HashCodeBuilder(17, 37).append(limit)
143                .append(count)
144                .append(total)
145                .append(offset)
146                .append(results)
147                .toHashCode();
148    }
149
150}