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.constraints.NotNull;
010
011import com.fasterxml.jackson.annotation.*;
012import com.fasterxml.jackson.databind.annotation.*;
013
014import io.vrap.rmf.base.client.utils.Generated;
015
016/**
017 * AttributeType
018 *
019 * <hr>
020 * Example to create an instance using the builder pattern
021 * <div class=code-example>
022 * <pre><code class='java'>
023 *     AttributeType attributeType = AttributeType.builder()
024 *             .name("{name}")
025 *             .build()
026 * </code></pre>
027 * </div>
028 */
029@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
030@JsonDeserialize(as = AttributeTypeImpl.class)
031public interface AttributeType {
032
033    /**
034     *
035     * @return name
036     */
037    @NotNull
038    @JsonProperty("name")
039    public String getName();
040
041    /**
042     * set name
043     * @param name value to be set
044     */
045
046    public void setName(final String name);
047
048    /**
049     * factory method
050     * @return instance of AttributeType
051     */
052    public static AttributeType of() {
053        return new AttributeTypeImpl();
054    }
055
056    /**
057     * factory method to create a shallow copy AttributeType
058     * @param template instance to be copied
059     * @return copy instance
060     */
061    public static AttributeType of(final AttributeType template) {
062        AttributeTypeImpl instance = new AttributeTypeImpl();
063        instance.setName(template.getName());
064        return instance;
065    }
066
067    /**
068     * factory method to create a deep copy of AttributeType
069     * @param template instance to be copied
070     * @return copy instance
071     */
072    @Nullable
073    public static AttributeType deepCopy(@Nullable final AttributeType template) {
074        if (template == null) {
075            return null;
076        }
077        AttributeTypeImpl instance = new AttributeTypeImpl();
078        instance.setName(template.getName());
079        return instance;
080    }
081
082    /**
083     * builder factory method for AttributeType
084     * @return builder
085     */
086    public static AttributeTypeBuilder builder() {
087        return AttributeTypeBuilder.of();
088    }
089
090    /**
091     * create builder for AttributeType instance
092     * @param template instance with prefilled values for the builder
093     * @return builder
094     */
095    public static AttributeTypeBuilder builder(final AttributeType template) {
096        return AttributeTypeBuilder.of(template);
097    }
098
099    /**
100     * accessor map function
101     * @param <T> mapped type
102     * @param helper function to map the object
103     * @return mapped value
104     */
105    default <T> T withAttributeType(Function<AttributeType, T> helper) {
106        return helper.apply(this);
107    }
108
109    /**
110     * gives a TypeReference for usage with Jackson DataBind
111     * @return TypeReference
112     */
113    public static com.fasterxml.jackson.core.type.TypeReference<AttributeType> typeReference() {
114        return new com.fasterxml.jackson.core.type.TypeReference<AttributeType>() {
115            @Override
116            public String toString() {
117                return "TypeReference<AttributeType>";
118            }
119        };
120    }
121}