001 002package com.commercetools.api.models.custom_object; 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 <code>results</code> containing an array of CustomObject.</p> 019 */ 020@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") 021public class CustomObjectPagedQueryResponseImpl implements CustomObjectPagedQueryResponse, 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.custom_object.CustomObject> results; 032 033 /** 034 * create instance with all properties 035 */ 036 @JsonCreator 037 CustomObjectPagedQueryResponseImpl(@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.custom_object.CustomObject> 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 CustomObjectPagedQueryResponseImpl() { 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>The 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>CustomObjects matching the query.</p> 088 */ 089 090 public java.util.List<com.commercetools.api.models.custom_object.CustomObject> 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.custom_object.CustomObject... results) { 111 this.results = new ArrayList<>(Arrays.asList(results)); 112 } 113 114 public void setResults(final java.util.List<com.commercetools.api.models.custom_object.CustomObject> 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 CustomObjectPagedQueryResponseImpl that = (CustomObjectPagedQueryResponseImpl) 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 .isEquals(); 134 } 135 136 @Override 137 public int hashCode() { 138 return new HashCodeBuilder(17, 37).append(limit) 139 .append(offset) 140 .append(count) 141 .append(total) 142 .append(results) 143 .toHashCode(); 144 } 145 146}