001
002package com.commercetools.api.models.associate_role;
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 AssociateRole.</p>
019 */
020@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
021public class AssociateRolePagedQueryResponseImpl implements AssociateRolePagedQueryResponse, 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.associate_role.AssociateRole> results;
032
033    /**
034     * create instance with all properties
035     */
036    @JsonCreator
037    AssociateRolePagedQueryResponseImpl(@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.associate_role.AssociateRole> 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 AssociateRolePagedQueryResponseImpl() {
052    }
053
054    /**
055     *  <p>Number of requested results.</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>AssociateRoles matching the query.</p>
088     */
089
090    public java.util.List<com.commercetools.api.models.associate_role.AssociateRole> 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.associate_role.AssociateRole... results) {
111        this.results = new ArrayList<>(Arrays.asList(results));
112    }
113
114    public void setResults(final java.util.List<com.commercetools.api.models.associate_role.AssociateRole> results) {
115        this.results = results;
116    }
117
118    @Override
119    public boolean equals(Object o) {
120        if (this == o)
121            return true;
122
123        if (o == null || getClass() != o.getClass())
124            return false;
125
126        AssociateRolePagedQueryResponseImpl that = (AssociateRolePagedQueryResponseImpl) o;
127
128        return new EqualsBuilder().append(limit, that.limit)
129                .append(offset, that.offset)
130                .append(count, that.count)
131                .append(total, that.total)
132                .append(results, that.results)
133                .append(limit, that.limit)
134                .append(offset, that.offset)
135                .append(count, that.count)
136                .append(total, that.total)
137                .append(results, that.results)
138                .isEquals();
139    }
140
141    @Override
142    public int hashCode() {
143        return new HashCodeBuilder(17, 37).append(limit)
144                .append(offset)
145                .append(count)
146                .append(total)
147                .append(results)
148                .toHashCode();
149    }
150
151}