001
002package com.commercetools.ml.models.image_search;
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>Response format from image search endpoint.</p>
019 */
020@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
021public class ImageSearchResponseImpl implements ImageSearchResponse, ModelBase {
022
023    private Integer count;
024
025    private Double offset;
026
027    private Integer total;
028
029    private java.util.List<com.commercetools.ml.models.image_search.ResultItem> results;
030
031    /**
032     * create instance with all properties
033     */
034    @JsonCreator
035    ImageSearchResponseImpl(@JsonProperty("count") final Integer count, @JsonProperty("offset") final Double offset,
036            @JsonProperty("total") final Integer total,
037            @JsonProperty("results") final java.util.List<com.commercetools.ml.models.image_search.ResultItem> results) {
038        this.count = count;
039        this.offset = offset;
040        this.total = total;
041        this.results = results;
042    }
043
044    /**
045     * create empty instance
046     */
047    public ImageSearchResponseImpl() {
048    }
049
050    /**
051     *  <p>The maximum number of results to return from a query.</p>
052     */
053
054    public Integer getCount() {
055        return this.count;
056    }
057
058    /**
059     *  <p>Number of elements skipped.</p>
060     */
061
062    public Double getOffset() {
063        return this.offset;
064    }
065
066    /**
067     *  <p>The total number of product images that were have been analyzed.</p>
068     */
069
070    public Integer getTotal() {
071        return this.total;
072    }
073
074    /**
075     *  <p>An array of image URLs of images that are similar to the query image. If no matching images are found, results is empty.</p>
076     */
077
078    public java.util.List<com.commercetools.ml.models.image_search.ResultItem> getResults() {
079        return this.results;
080    }
081
082    public void setCount(final Integer count) {
083        this.count = count;
084    }
085
086    public void setOffset(final Double offset) {
087        this.offset = offset;
088    }
089
090    public void setTotal(final Integer total) {
091        this.total = total;
092    }
093
094    public void setResults(final com.commercetools.ml.models.image_search.ResultItem... results) {
095        this.results = new ArrayList<>(Arrays.asList(results));
096    }
097
098    public void setResults(final java.util.List<com.commercetools.ml.models.image_search.ResultItem> results) {
099        this.results = results;
100    }
101
102    @Override
103    public boolean equals(Object o) {
104        if (this == o)
105            return true;
106
107        if (o == null || getClass() != o.getClass())
108            return false;
109
110        ImageSearchResponseImpl that = (ImageSearchResponseImpl) o;
111
112        return new EqualsBuilder().append(count, that.count)
113                .append(offset, that.offset)
114                .append(total, that.total)
115                .append(results, that.results)
116                .append(count, that.count)
117                .append(offset, that.offset)
118                .append(total, that.total)
119                .append(results, that.results)
120                .isEquals();
121    }
122
123    @Override
124    public int hashCode() {
125        return new HashCodeBuilder(17, 37).append(count).append(offset).append(total).append(results).toHashCode();
126    }
127
128}