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    @JsonCreator
032    ImageSearchResponseImpl(@JsonProperty("count") final Integer count, @JsonProperty("offset") final Double offset,
033            @JsonProperty("total") final Integer total,
034            @JsonProperty("results") final java.util.List<com.commercetools.ml.models.image_search.ResultItem> results) {
035        this.count = count;
036        this.offset = offset;
037        this.total = total;
038        this.results = results;
039    }
040
041    public ImageSearchResponseImpl() {
042    }
043
044    /**
045     *  <p>The maximum number of results to return from a query.</p>
046     */
047
048    public Integer getCount() {
049        return this.count;
050    }
051
052    /**
053     *  <p>Number of elements skipped.</p>
054     */
055
056    public Double getOffset() {
057        return this.offset;
058    }
059
060    /**
061     *  <p>The total number of product images that were have been analyzed.</p>
062     */
063
064    public Integer getTotal() {
065        return this.total;
066    }
067
068    /**
069     *  <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>
070     */
071
072    public java.util.List<com.commercetools.ml.models.image_search.ResultItem> getResults() {
073        return this.results;
074    }
075
076    public void setCount(final Integer count) {
077        this.count = count;
078    }
079
080    public void setOffset(final Double offset) {
081        this.offset = offset;
082    }
083
084    public void setTotal(final Integer total) {
085        this.total = total;
086    }
087
088    public void setResults(final com.commercetools.ml.models.image_search.ResultItem... results) {
089        this.results = new ArrayList<>(Arrays.asList(results));
090    }
091
092    public void setResults(final java.util.List<com.commercetools.ml.models.image_search.ResultItem> results) {
093        this.results = results;
094    }
095
096    @Override
097    public boolean equals(Object o) {
098        if (this == o)
099            return true;
100
101        if (o == null || getClass() != o.getClass())
102            return false;
103
104        ImageSearchResponseImpl that = (ImageSearchResponseImpl) o;
105
106        return new EqualsBuilder().append(count, that.count)
107                .append(offset, that.offset)
108                .append(total, that.total)
109                .append(results, that.results)
110                .isEquals();
111    }
112
113    @Override
114    public int hashCode() {
115        return new HashCodeBuilder(17, 37).append(count).append(offset).append(total).append(results).toHashCode();
116    }
117
118}