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 * SearchKeywords 019 * 020 * <hr> 021 * Example to create an instance using the builder pattern 022 * <div class=code-example> 023 * <pre><code class='java'> 024 * SearchKeywords searchKeywords = SearchKeywords.builder() 025 * .plus/^[a-z]{2}(-[A-Z]{2})?$/(/^[a-z]{2}(-[A-Z]{2})?$/Builder -> /^[a-z]{2}(-[A-Z]{2})?$/Builder) 026 * .build() 027 * </code></pre> 028 * </div> 029 */ 030@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") 031@JsonDeserialize(as = SearchKeywordsImpl.class) 032public interface SearchKeywords { 033 034 /** 035 * 036 * @return map of the pattern property values 037 */ 038 @NotNull 039 @Valid 040 @JsonAnyGetter 041 public Map<String, List<SearchKeyword>> values(); 042 043 /** 044 * set pattern property 045 * @param key property name 046 * @param value property value 047 */ 048 049 @JsonAnySetter 050 public void setValue(String key, List<SearchKeyword> value); 051 052 /** 053 * factory method 054 * @return instance of SearchKeywords 055 */ 056 public static SearchKeywords of() { 057 return new SearchKeywordsImpl(); 058 } 059 060 /** 061 * factory method to create a shallow copy SearchKeywords 062 * @param template instance to be copied 063 * @return copy instance 064 */ 065 public static SearchKeywords of(final SearchKeywords template) { 066 SearchKeywordsImpl instance = new SearchKeywordsImpl(); 067 Optional.ofNullable(template.values()).ifPresent(t -> t.forEach(instance::setValue)); 068 return instance; 069 } 070 071 /** 072 * factory method to create a deep copy of SearchKeywords 073 * @param template instance to be copied 074 * @return copy instance 075 */ 076 @Nullable 077 public static SearchKeywords deepCopy(@Nullable final SearchKeywords template) { 078 if (template == null) { 079 return null; 080 } 081 SearchKeywordsImpl instance = new SearchKeywordsImpl(); 082 Optional.ofNullable(template.values()).ifPresent(t -> t.forEach(instance::setValue)); 083 return instance; 084 } 085 086 /** 087 * builder factory method for SearchKeywords 088 * @return builder 089 */ 090 public static SearchKeywordsBuilder builder() { 091 return SearchKeywordsBuilder.of(); 092 } 093 094 /** 095 * create builder for SearchKeywords instance 096 * @param template instance with prefilled values for the builder 097 * @return builder 098 */ 099 public static SearchKeywordsBuilder builder(final SearchKeywords template) { 100 return SearchKeywordsBuilder.of(template); 101 } 102 103 /** 104 * accessor map function 105 * @param <T> mapped type 106 * @param helper function to map the object 107 * @return mapped value 108 */ 109 default <T> T withSearchKeywords(Function<SearchKeywords, T> helper) { 110 return helper.apply(this); 111 } 112 113 /** 114 * gives a TypeReference for usage with Jackson DataBind 115 * @return TypeReference 116 */ 117 public static com.fasterxml.jackson.core.type.TypeReference<SearchKeywords> typeReference() { 118 return new com.fasterxml.jackson.core.type.TypeReference<SearchKeywords>() { 119 @Override 120 public String toString() { 121 return "TypeReference<SearchKeywords>"; 122 } 123 }; 124 } 125}