001
002package com.commercetools.history.models.common;
003
004import java.time.*;
005import java.util.*;
006import java.util.function.Function;
007
008import javax.annotation.Nullable;
009import javax.validation.Valid;
010import javax.validation.constraints.NotNull;
011
012import com.fasterxml.jackson.annotation.*;
013import com.fasterxml.jackson.databind.annotation.*;
014
015import io.vrap.rmf.base.client.utils.Generated;
016
017/**
018 * AssetSource
019 *
020 * <hr>
021 * Example to create an instance using the builder pattern
022 * <div class=code-example>
023 * <pre><code class='java'>
024 *     AssetSource assetSource = AssetSource.builder()
025 *             .uri("{uri}")
026 *             .key("{key}")
027 *             .dimensions(dimensionsBuilder -> dimensionsBuilder)
028 *             .contentType("{contentType}")
029 *             .build()
030 * </code></pre>
031 * </div>
032 */
033@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
034@JsonDeserialize(as = AssetSourceImpl.class)
035public interface AssetSource {
036
037    /**
038     *
039     * @return uri
040     */
041    @NotNull
042    @JsonProperty("uri")
043    public String getUri();
044
045    /**
046     *
047     * @return key
048     */
049    @NotNull
050    @JsonProperty("key")
051    public String getKey();
052
053    /**
054     *
055     * @return dimensions
056     */
057    @NotNull
058    @Valid
059    @JsonProperty("dimensions")
060    public AssetDimensions getDimensions();
061
062    /**
063     *
064     * @return contentType
065     */
066    @NotNull
067    @JsonProperty("contentType")
068    public String getContentType();
069
070    /**
071     * set uri
072     * @param uri value to be set
073     */
074
075    public void setUri(final String uri);
076
077    /**
078     * set key
079     * @param key value to be set
080     */
081
082    public void setKey(final String key);
083
084    /**
085     * set dimensions
086     * @param dimensions value to be set
087     */
088
089    public void setDimensions(final AssetDimensions dimensions);
090
091    /**
092     * set contentType
093     * @param contentType value to be set
094     */
095
096    public void setContentType(final String contentType);
097
098    /**
099     * factory method
100     * @return instance of AssetSource
101     */
102    public static AssetSource of() {
103        return new AssetSourceImpl();
104    }
105
106    /**
107     * factory method to create a shallow copy AssetSource
108     * @param template instance to be copied
109     * @return copy instance
110     */
111    public static AssetSource of(final AssetSource template) {
112        AssetSourceImpl instance = new AssetSourceImpl();
113        instance.setUri(template.getUri());
114        instance.setKey(template.getKey());
115        instance.setDimensions(template.getDimensions());
116        instance.setContentType(template.getContentType());
117        return instance;
118    }
119
120    /**
121     * factory method to create a deep copy of AssetSource
122     * @param template instance to be copied
123     * @return copy instance
124     */
125    @Nullable
126    public static AssetSource deepCopy(@Nullable final AssetSource template) {
127        if (template == null) {
128            return null;
129        }
130        AssetSourceImpl instance = new AssetSourceImpl();
131        instance.setUri(template.getUri());
132        instance.setKey(template.getKey());
133        instance.setDimensions(
134            com.commercetools.history.models.common.AssetDimensions.deepCopy(template.getDimensions()));
135        instance.setContentType(template.getContentType());
136        return instance;
137    }
138
139    /**
140     * builder factory method for AssetSource
141     * @return builder
142     */
143    public static AssetSourceBuilder builder() {
144        return AssetSourceBuilder.of();
145    }
146
147    /**
148     * create builder for AssetSource instance
149     * @param template instance with prefilled values for the builder
150     * @return builder
151     */
152    public static AssetSourceBuilder builder(final AssetSource template) {
153        return AssetSourceBuilder.of(template);
154    }
155
156    /**
157     * accessor map function
158     * @param <T> mapped type
159     * @param helper function to map the object
160     * @return mapped value
161     */
162    default <T> T withAssetSource(Function<AssetSource, T> helper) {
163        return helper.apply(this);
164    }
165
166    /**
167     * gives a TypeReference for usage with Jackson DataBind
168     * @return TypeReference
169     */
170    public static com.fasterxml.jackson.core.type.TypeReference<AssetSource> typeReference() {
171        return new com.fasterxml.jackson.core.type.TypeReference<AssetSource>() {
172            @Override
173            public String toString() {
174                return "TypeReference<AssetSource>";
175            }
176        };
177    }
178}