001
002package com.commercetools.api.models.common;
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>Representation of an Asset in a specific format, for example a video in a certain encoding, or an image in a certain resolution.</p>
019 */
020@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
021public class AssetSourceImpl implements AssetSource, ModelBase {
022
023    private String uri;
024
025    private String key;
026
027    private com.commercetools.api.models.common.AssetDimensions dimensions;
028
029    private String contentType;
030
031    /**
032     * create instance with all properties
033     */
034    @JsonCreator
035    AssetSourceImpl(@JsonProperty("uri") final String uri, @JsonProperty("key") final String key,
036            @JsonProperty("dimensions") final com.commercetools.api.models.common.AssetDimensions dimensions,
037            @JsonProperty("contentType") final String contentType) {
038        this.uri = uri;
039        this.key = key;
040        this.dimensions = dimensions;
041        this.contentType = contentType;
042    }
043
044    /**
045     * create empty instance
046     */
047    public AssetSourceImpl() {
048    }
049
050    /**
051     *  <p>URI of the AssetSource.</p>
052     */
053
054    public String getUri() {
055        return this.uri;
056    }
057
058    /**
059     *  <p>User-defined unique identifier of the AssetSource.</p>
060     */
061
062    public String getKey() {
063        return this.key;
064    }
065
066    /**
067     *  <p>Width and height of the AssetSource.</p>
068     */
069
070    public com.commercetools.api.models.common.AssetDimensions getDimensions() {
071        return this.dimensions;
072    }
073
074    /**
075     *  <p>Indicates the type of content, for example <code>application/pdf</code>.</p>
076     */
077
078    public String getContentType() {
079        return this.contentType;
080    }
081
082    public void setUri(final String uri) {
083        this.uri = uri;
084    }
085
086    public void setKey(final String key) {
087        this.key = key;
088    }
089
090    public void setDimensions(final com.commercetools.api.models.common.AssetDimensions dimensions) {
091        this.dimensions = dimensions;
092    }
093
094    public void setContentType(final String contentType) {
095        this.contentType = contentType;
096    }
097
098    @Override
099    public boolean equals(Object o) {
100        if (this == o)
101            return true;
102
103        if (o == null || getClass() != o.getClass())
104            return false;
105
106        AssetSourceImpl that = (AssetSourceImpl) o;
107
108        return new EqualsBuilder().append(uri, that.uri)
109                .append(key, that.key)
110                .append(dimensions, that.dimensions)
111                .append(contentType, that.contentType)
112                .isEquals();
113    }
114
115    @Override
116    public int hashCode() {
117        return new HashCodeBuilder(17, 37).append(uri).append(key).append(dimensions).append(contentType).toHashCode();
118    }
119
120}