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