001 002package com.commercetools.history.models.common; 003 004import java.util.*; 005 006import io.vrap.rmf.base.client.Builder; 007import io.vrap.rmf.base.client.utils.Generated; 008 009/** 010 * SearchKeywordsBuilder 011 * <hr> 012 * Example to create an instance using the builder pattern 013 * <div class=code-example> 014 * <pre><code class='java'> 015 * SearchKeywords searchKeywords = SearchKeywords.builder() 016 * .plus/^[a-z]{2}(-[A-Z]{2})?$/(/^[a-z]{2}(-[A-Z]{2})?$/Builder -> /^[a-z]{2}(-[A-Z]{2})?$/Builder) 017 * .build() 018 * </code></pre> 019 * </div> 020 */ 021@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") 022public class SearchKeywordsBuilder implements Builder<SearchKeywords> { 023 024 private Map<String, java.util.List<com.commercetools.history.models.common.SearchKeyword>> values = new HashMap<>(); 025 026 /** 027 * assign pattern properties to the builder 028 * @param values properties to be set 029 * @return Builder 030 */ 031 032 public SearchKeywordsBuilder values( 033 final Map<String, java.util.List<com.commercetools.history.models.common.SearchKeyword>> values) { 034 this.values = values; 035 return this; 036 } 037 038 /** 039 * assign a pattern property to the builder 040 * @param key property name 041 * @param value property value 042 * @return Builder 043 */ 044 045 public SearchKeywordsBuilder addValue(final String key, 046 final java.util.List<com.commercetools.history.models.common.SearchKeyword> value) { 047 if (this.values == null) { 048 values = new HashMap<>(); 049 } 050 values.put(key, value); 051 return this; 052 } 053 054 /** 055 * values of pattern properties 056 * @return pattern properties 057 */ 058 059 public Map<String, java.util.List<com.commercetools.history.models.common.SearchKeyword>> getValues() { 060 return this.values; 061 } 062 063 /** 064 * builds SearchKeywords with checking for non-null required values 065 * @return SearchKeywords 066 */ 067 public SearchKeywords build() { 068 return new SearchKeywordsImpl(values); 069 } 070 071 /** 072 * builds SearchKeywords without checking for non-null required values 073 * @return SearchKeywords 074 */ 075 public SearchKeywords buildUnchecked() { 076 return new SearchKeywordsImpl(values); 077 } 078 079 /** 080 * factory method for an instance of SearchKeywordsBuilder 081 * @return builder 082 */ 083 public static SearchKeywordsBuilder of() { 084 return new SearchKeywordsBuilder(); 085 } 086 087 /** 088 * create builder for SearchKeywords instance 089 * @param template instance with prefilled values for the builder 090 * @return builder 091 */ 092 public static SearchKeywordsBuilder of(final SearchKeywords template) { 093 SearchKeywordsBuilder builder = new SearchKeywordsBuilder(); 094 builder.values = template.values(); 095 return builder; 096 } 097 098}