001
002package com.commercetools.api.models.product_discount;
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 *  <p>PagedQueryResult with results containing an array of ProductDiscount.</p>
019 */
020@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
021public class ProductDiscountPagedQueryResponseImpl implements ProductDiscountPagedQueryResponse, ModelBase {
022
023    private Long limit;
024
025    private Long offset;
026
027    private Long count;
028
029    private Long total;
030
031    private java.util.List<com.commercetools.api.models.product_discount.ProductDiscount> results;
032
033    /**
034     * create instance with all properties
035     */
036    @JsonCreator
037    ProductDiscountPagedQueryResponseImpl(@JsonProperty("limit") final Long limit,
038            @JsonProperty("offset") final Long offset, @JsonProperty("count") final Long count,
039            @JsonProperty("total") final Long total,
040            @JsonProperty("results") final java.util.List<com.commercetools.api.models.product_discount.ProductDiscount> results) {
041        this.limit = limit;
042        this.offset = offset;
043        this.count = count;
044        this.total = total;
045        this.results = results;
046    }
047
048    /**
049     * create empty instance
050     */
051    public ProductDiscountPagedQueryResponseImpl() {
052    }
053
054    /**
055     *  <p>Number of results requested.</p>
056     */
057
058    public Long getLimit() {
059        return this.limit;
060    }
061
062    /**
063     *  <p>Number of elements skipped.</p>
064     */
065
066    public Long getOffset() {
067        return this.offset;
068    }
069
070    /**
071     *  <p>Actual number of results returned.</p>
072     */
073
074    public Long getCount() {
075        return this.count;
076    }
077
078    /**
079     *  <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>
080     */
081
082    public Long getTotal() {
083        return this.total;
084    }
085
086    /**
087     *  <p>ProductDiscounts matching the query.</p>
088     */
089
090    public java.util.List<com.commercetools.api.models.product_discount.ProductDiscount> getResults() {
091        return this.results;
092    }
093
094    public void setLimit(final Long limit) {
095        this.limit = limit;
096    }
097
098    public void setOffset(final Long offset) {
099        this.offset = offset;
100    }
101
102    public void setCount(final Long count) {
103        this.count = count;
104    }
105
106    public void setTotal(final Long total) {
107        this.total = total;
108    }
109
110    public void setResults(final com.commercetools.api.models.product_discount.ProductDiscount... results) {
111        this.results = new ArrayList<>(Arrays.asList(results));
112    }
113
114    public void setResults(
115            final java.util.List<com.commercetools.api.models.product_discount.ProductDiscount> results) {
116        this.results = results;
117    }
118
119    @Override
120    public boolean equals(Object o) {
121        if (this == o)
122            return true;
123
124        if (o == null || getClass() != o.getClass())
125            return false;
126
127        ProductDiscountPagedQueryResponseImpl that = (ProductDiscountPagedQueryResponseImpl) o;
128
129        return new EqualsBuilder().append(limit, that.limit)
130                .append(offset, that.offset)
131                .append(count, that.count)
132                .append(total, that.total)
133                .append(results, that.results)
134                .isEquals();
135    }
136
137    @Override
138    public int hashCode() {
139        return new HashCodeBuilder(17, 37).append(limit)
140                .append(offset)
141                .append(count)
142                .append(total)
143                .append(results)
144                .toHashCode();
145    }
146
147}