001 002package com.commercetools.api.models.shipping_method; 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 ShippingMethod.</p> 019 */ 020@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") 021public class ShippingMethodPagedQueryResponseImpl implements ShippingMethodPagedQueryResponse, 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.shipping_method.ShippingMethod> results; 032 033 /** 034 * create instance with all properties 035 */ 036 @JsonCreator 037 ShippingMethodPagedQueryResponseImpl(@JsonProperty("limit") final Long limit, 038 @JsonProperty("count") final Long count, @JsonProperty("total") final Long total, 039 @JsonProperty("offset") final Long offset, 040 @JsonProperty("results") final java.util.List<com.commercetools.api.models.shipping_method.ShippingMethod> results) { 041 this.limit = limit; 042 this.count = count; 043 this.total = total; 044 this.offset = offset; 045 this.results = results; 046 } 047 048 /** 049 * create empty instance 050 */ 051 public ShippingMethodPagedQueryResponseImpl() { 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>Actual number of results returned.</p> 064 */ 065 066 public Long getCount() { 067 return this.count; 068 } 069 070 /** 071 * <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> 072 */ 073 074 public Long getTotal() { 075 return this.total; 076 } 077 078 /** 079 * <p>Number of elements skipped.</p> 080 */ 081 082 public Long getOffset() { 083 return this.offset; 084 } 085 086 /** 087 * <p>Shipping Methods matching the query.</p> 088 */ 089 090 public java.util.List<com.commercetools.api.models.shipping_method.ShippingMethod> getResults() { 091 return this.results; 092 } 093 094 public void setLimit(final Long limit) { 095 this.limit = limit; 096 } 097 098 public void setCount(final Long count) { 099 this.count = count; 100 } 101 102 public void setTotal(final Long total) { 103 this.total = total; 104 } 105 106 public void setOffset(final Long offset) { 107 this.offset = offset; 108 } 109 110 public void setResults(final com.commercetools.api.models.shipping_method.ShippingMethod... results) { 111 this.results = new ArrayList<>(Arrays.asList(results)); 112 } 113 114 public void setResults(final java.util.List<com.commercetools.api.models.shipping_method.ShippingMethod> 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 ShippingMethodPagedQueryResponseImpl that = (ShippingMethodPagedQueryResponseImpl) o; 127 128 return new EqualsBuilder().append(limit, that.limit) 129 .append(count, that.count) 130 .append(total, that.total) 131 .append(offset, that.offset) 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(count) 140 .append(total) 141 .append(offset) 142 .append(results) 143 .toHashCode(); 144 } 145 146}